From 498385c852e90222e73e0d6501dfe8d75d645acd Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Tue, 16 Dec 2025 18:02:36 +0000 Subject: [PATCH 1/5] WIP task 45. Added packages tree --- gresource.xml | 1 + groups-list.csv | 4 +- source/CMakeLists.txt | 3 +- source/ubinstall-gtk-packages.c | 97 ++++++++++++++++++++---------- source/ubinstall-gtk-page-switch.c | 6 +- source/ubinstall-gtk.c | 5 ++ source/ubinstall-gtk.h | 5 +- ubinstall-gtk.glade | 39 +++++++++++- 8 files changed, 121 insertions(+), 39 deletions(-) diff --git a/gresource.xml b/gresource.xml index cfb8b35..758b5dc 100644 --- a/gresource.xml +++ b/gresource.xml @@ -60,6 +60,7 @@ services-list.csv network-list.csv filesystems-format-list.csv + groups-list.csv vfs-list.csv \ No newline at end of file diff --git a/groups-list.csv b/groups-list.csv index e683605..1c0afbd 100644 --- a/groups-list.csv +++ b/groups-list.csv @@ -1,6 +1,6 @@ GROUP_NAME;SUBGROUP_NAME;PACKAGES;DESCRIPTION -Containerization;ubm-docker;Docker and webmanager and utils -Containerization;ubm-podman;Podman and webmanager and utils +Containerization;;ubm-docker;Docker and webmanager and utils +Containerization;;ubm-podman;Podman and webmanager and utils Drivers;Printer;ubm-drv-brother;Brother printer drivers Drivers;Printer;ubm-drv-canon-capt;Canon CAPT Printer Driver Drivers;Printer;ubm-drv-canon-ufrii;Canon UFR II LIPSLX CARPS2 printer driver diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 91569dc..b775731 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -82,6 +82,7 @@ set(DEPENDFILES ../services-list.csv ../network-list.csv ../filesystems-format-list.csv + ../groups-list.csv ../vfs-list.csv ../icons-builtin/install_type_custom_normal.png ../icons-builtin/install_type_data_only_normal.png @@ -143,7 +144,7 @@ set(SOURCE_FILES ubinstall-gtk-configuration-mode.c ubinstall-gtk-decorations.c ubinstall-gtk-log.c - # ubinstall-gtk-password.c + ubinstall-gtk-packages.c ubinstall-gtk-saving.c ubinstall-gtk-standard.c ubinstall-gtk-install-start.c diff --git a/source/ubinstall-gtk-packages.c b/source/ubinstall-gtk-packages.c index 5390f1a..7026b25 100644 --- a/source/ubinstall-gtk-packages.c +++ b/source/ubinstall-gtk-packages.c @@ -1,11 +1,12 @@ #include "ubinstall-gtk.h" +GtkTreeIter *yon_category_check(GtkTreeStore *target,char *category); GtkTreeIter *yon_category_check(GtkTreeStore *target,char *category){ GtkTreeIter iter; GtkTreeIter *ret_iter = NULL; for_iter(target,&iter){ char *cur_category; - gtk_tree_model_get(GTK_TREE_MODEL(target),&iter,0,&cur_category,-1); + gtk_tree_model_get(GTK_TREE_MODEL(target),&iter,1,&cur_category,-1); if (!strcmp(cur_category,category)){ ret_iter = gtk_tree_iter_copy(&iter); } @@ -13,14 +14,15 @@ GtkTreeIter *yon_category_check(GtkTreeStore *target,char *category){ return ret_iter; } +GtkTreeIter *yon_subcategory_check(GtkTreeStore *target, GtkTreeIter *parent_iter, char *category); GtkTreeIter *yon_subcategory_check(GtkTreeStore *target, GtkTreeIter *parent_iter, char *category){ GtkTreeIter iter; GtkTreeIter *ret_iter = NULL; - gtk_tree_model_iter_children(GTK_TREE_MODEL(target),&iter,parent_iter); - for(int valid = 1; valid; valid = gtk_tree_model_iter_next(GTK_TREE_MODEL(target),&iter)){ + int valid = gtk_tree_model_iter_children(GTK_TREE_MODEL(target),&iter,parent_iter); + for(; valid; valid = gtk_tree_model_iter_next(GTK_TREE_MODEL(target),&iter)){ char *cur_category; - gtk_tree_model_get(GTK_TREE_MODEL(target),&iter,0,&cur_category,-1); - if (!strcmp(cur_category,category)){ + gtk_tree_model_get(GTK_TREE_MODEL(target),&iter,1,&cur_category,-1); + if ((yon_char_is_empty(cur_category)&&yon_char_is_empty(category))||!strcmp(cur_category,category)){ ret_iter = gtk_tree_iter_copy(&iter); } } @@ -28,44 +30,75 @@ GtkTreeIter *yon_subcategory_check(GtkTreeStore *target, GtkTreeIter *parent_ite } void yon_packages_tab_init(main_window *widgets){ - GHashTable *category = g_hash_table_new(g_str_hash,g_str_equal); - GHashTable *subcategory = g_hash_table_new(g_str_hash,g_str_equal); + // GHashTable *category = g_hash_table_new(g_str_hash,g_str_equal); + // GHashTable *subcategory = g_hash_table_new(g_str_hash,g_str_equal); int size; config_str packages = yon_resource_open_file(groups_list_path,&size); - for (int i=0;iPackagesList,parsed[0]); if (category_iter){ - GtkTreeIter *subcategory_iter = yon_subcategory_check(widgets->PackagesList,category_iter,parsed[0]); - if (subcategory_iter){ - GtkTreeIter package_iter; - gtk_tree_store_append(widgets->PackagesList,&package_iter,subcategory_iter); - gtk_tree_store_set(widgets->PackagesList,&package_iter,0,packages[2],1,packages[3],-1); - gtk_tree_iter_free(subcategory_iter); + if (!yon_char_is_empty(parsed[1])){ + GtkTreeIter *subcategory_iter = yon_subcategory_check(widgets->PackagesList,category_iter,parsed[1]); + if (subcategory_iter){ + GtkTreeIter package_iter; + gtk_tree_store_append(widgets->PackagesList,&package_iter,subcategory_iter); + gtk_tree_store_set(widgets->PackagesList,&package_iter,0,0,1,parsed[2],2,parsed[3],3,1,-1); + gtk_tree_iter_free(subcategory_iter); + } else { + GtkTreeIter subcatiter; + GtkTreeIter package_iter; + gtk_tree_store_append(widgets->PackagesList,&subcatiter,category_iter); + gtk_tree_store_set(widgets->PackagesList,&subcatiter,1,parsed[1],2,parsed[3],3,0,-1); + gtk_tree_store_append(widgets->PackagesList,&package_iter,&subcatiter); + gtk_tree_store_set(widgets->PackagesList,&package_iter,0,0,1,parsed[2],2,parsed[3],3,1,-1); + } + } else { + GtkTreeIter package_iter; + gtk_tree_store_append(widgets->PackagesList,&package_iter,category_iter); + gtk_tree_store_set(widgets->PackagesList,&package_iter,0,0,1,parsed[2],2,parsed[3],3,1,-1); } gtk_tree_iter_free(category_iter); + } else { + if (!yon_char_is_empty(parsed[1])){ + GtkTreeIter subcategory_iter; + GtkTreeIter catiter; + GtkTreeIter package_iter; + gtk_tree_store_append(widgets->PackagesList,&catiter,NULL); + gtk_tree_store_set(widgets->PackagesList,&catiter,1,parsed[0],2,parsed[3],3,0,-1); + gtk_tree_store_append(widgets->PackagesList,&subcategory_iter,&catiter); + gtk_tree_store_set(widgets->PackagesList,&subcategory_iter,1,parsed[1],2,parsed[3],3,0,-1); + gtk_tree_store_append(widgets->PackagesList,&package_iter,&subcategory_iter); + gtk_tree_store_set(widgets->PackagesList,&package_iter,1,parsed[2],2,parsed[3],3,1,-1); + } else { + GtkTreeIter package_iter; + GtkTreeIter catiter; + gtk_tree_store_append(widgets->PackagesList,&catiter,NULL); + gtk_tree_store_set(widgets->PackagesList,&catiter,1,parsed[0],2,parsed[3],3,0,-1); + gtk_tree_store_append(widgets->PackagesList,&package_iter,&catiter); + gtk_tree_store_set(widgets->PackagesList,&package_iter,0,0,1,parsed[2],2,parsed[3],3,1,-1); + } } } + gtk_tree_view_expand_all(GTK_TREE_VIEW(widgets->PackagesTree)); } -void yon_on_packages_chosen(GtkTreeStore *, char *path, main_window *widgets){ - GtkTreeIter iter, chiter; - gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(widgets->PackagesList),&iter,path); - GtkTreePath *cur_path = gtk_tree_model_get_path(GTK_TREE_MODEL(widgets->PackagesList),&iter); - int depth = gtk_tree_path_get_depth(cur_path); - if (depth<2){ - GtkTreeIter *cur_parent, *cur_iter; - cur_parent = gtk_tree_iter_copy(&iter); - cur_iter = gtk_tree_iter_copy(&chiter); - switch(depth){ - case 0: - gtk_tree_model_iter_children(GTK_TREE_MODEL(widgets->PackagesList),cur_iter,&iter); - __attribute__((fallthrough)); - case 1: - gtk_tree_model_iter_children(GTK_TREE_MODEL(widgets->PackagesList),cur_iter,cur_parent); - - } - +void yon_on_packages_chosen(GtkWidget *, main_window *widgets){ + GtkTreeIter iter; + GtkTreeModel *model; + gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->PackagesTree)),&model,&iter); + GtkTreeIter cur_parent, cur_iter; + int status; + gtk_tree_model_get(model,&iter,3,&status,-1); + if (status) + return; + gtk_tree_model_iter_children(model,&cur_parent,&iter); + gtk_tree_model_get(model,&cur_parent,3,&status,-1); + if (status){ + gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->PackagesTree)),&cur_parent); + return; } + gtk_tree_model_iter_children(model,&cur_iter,&cur_parent); + gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->PackagesTree)),&cur_iter); } \ No newline at end of file diff --git a/source/ubinstall-gtk-page-switch.c b/source/ubinstall-gtk-page-switch.c index bedf2a1..83a8a7f 100644 --- a/source/ubinstall-gtk-page-switch.c +++ b/source/ubinstall-gtk-page-switch.c @@ -20,7 +20,7 @@ enum YON_PAGES yon_page_get_next(main_window *widgets, enum YON_PAGES page){ case YON_PAGE_USERS: return YON_PAGE_STARTUP; break; case YON_PAGE_STARTUP: return YON_PAGE_BOOTLOADER; break; case YON_PAGE_BOOTLOADER: return YON_PAGE_NETWORK; break; - case YON_PAGE_NETWORK: return YON_PAGE_KERNEL; break; + case YON_PAGE_NETWORK: return YON_PAGE_PACKAGES_HUB; break; case YON_PAGE_PACKAGES_HUB: return main_config.configure_mode? YON_PAGE_CONFIGURE_END : YON_PAGE_INSTALLATION; case YON_PAGE_INSTALL_COMMON: return YON_PAGE_OS_COMPONENTS; break; case YON_PAGE_INSTALL_SEPARATE: return YON_PAGE_OS_COMPONENTS; break; @@ -63,6 +63,7 @@ enum YON_PAGES yon_page_get_prev(enum YON_PAGES page){ case YON_PAGE_STARTUP: return YON_PAGE_USERS; break; case YON_PAGE_BOOTLOADER: return YON_PAGE_STARTUP; break; case YON_PAGE_NETWORK: return YON_PAGE_BOOTLOADER; break; + case YON_PAGE_PACKAGES_HUB: return YON_PAGE_NETWORK; case YON_PAGE_INSTALLATION: return YON_PAGE_INSTALLATION; break; case YON_PAGE_CONFIGURE_END: return YON_PAGE_CONFIGURE_END; break; case YON_PAGE_INSTALL_COMMON: return YON_PAGE_SECTIONS; break; @@ -384,6 +385,9 @@ void yon_page_init(main_window *widgets, enum YON_PAGES page){ case YON_PAGE_NETWORK: yon_network_init(widgets); break; + case YON_PAGE_PACKAGES_HUB: + yon_packages_tab_init(widgets); + break; case YON_PAGE_INSTALL_ADVANCED: yon_install_advanced_init(widgets); __attribute__((fallthrough)); diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index b0bd584..a4d05c2 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -1082,6 +1082,10 @@ void yon_main_window_create(main_window *widgets){ widgets->HostnameSensitiveSwitch = yon_gtk_builder_get_widget(builder,"HostnameSensitiveSwitch"); widgets->AutoHostnameCheck=yon_gtk_builder_get_widget(builder,"AutoHostnameCheck"); widgets->AdvancedVirtualDeviceLabel = yon_gtk_builder_get_widget(builder,"AdvancedVirtualDeviceLabel"); + + widgets->PackagesTree = yon_gtk_builder_get_widget(builder,"PackagesTree"); + widgets->PackagesList = GTK_TREE_STORE(gtk_builder_get_object(builder,"Packages")); + widgets->network_connections = NULL; widgets->pacmanchosen = g_hash_table_new_full(g_str_hash,g_str_equal,free,NULL); @@ -1211,6 +1215,7 @@ void yon_main_window_create(main_window *widgets){ g_signal_connect(G_OBJECT(widgets->AdvancedAddButton),"clicked",G_CALLBACK(on_advanced_partition_create),widgets); g_signal_connect(G_OBJECT(widgets->AdvancedPartChosenCell),"toggled",G_CALLBACK(on_install_advanced_partition_chosen),widgets); g_signal_connect(G_OBJECT(widgets->AdvancedVirtualDeviceCombo),"changed",G_CALLBACK(on_advanced_virtual_device_changed),widgets); + g_signal_connect(G_OBJECT(widgets->PackagesTree),"cursor-changed",G_CALLBACK(yon_on_packages_chosen),widgets); g_signal_connect(G_OBJECT(widgets->AboutMenuItem),"activate",G_CALLBACK(on_about),widgets); g_signal_connect(G_OBJECT(widgets->DocumentationMenuItem),"activate",G_CALLBACK(on_open_documentation_confirmation),WIKI_LINK); diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index a464ab1..1f393b6 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -728,6 +728,7 @@ typedef struct { GSequence *advanced_partition_order; GtkTreeStore *PackagesList; + GtkWidget *PackagesTree; GFile *install_progress_file; @@ -1340,4 +1341,6 @@ void on_layout_default_toggled(GtkWidget *, int status, main_window *widgets); void on_layout_selection_changed(GtkTreeView *self,main_window *widgets); void on_num_lock_changed(GtkComboBox *self, main_window *); void on_model_changed(GtkComboBoxText *self, main_window *widgets); -void on_options_save(GtkWidget *,main_window *widgets); \ No newline at end of file +void on_options_save(GtkWidget *,main_window *widgets); +void yon_packages_tab_init(main_window *widgets); +void yon_on_packages_chosen(GtkWidget *, main_window *widgets); \ No newline at end of file diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index 33e8e88..818bb51 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -153,7 +153,18 @@ True False - + + + + + + + + + + + + @@ -6342,13 +6353,37 @@ agreement True True - + True True Packages + False + + + column + + + + 3 + 0 + + + + + + + column + + + + 1 + + + + -- 2.35.1 From 68d2a24bb72bfdd9a012bd5233ceefb691b6e953 Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Wed, 17 Dec 2025 18:03:56 +0000 Subject: [PATCH 2/5] WIP configuration hub slide --- locale/ubinstall-gtk.pot | 12 + locale/ubinstall-gtk_ru.po | 14 +- source/CMakeLists.txt | 1 + source/ubinstall-gtk-config-hub.c | 124 ++++++++++ source/ubinstall-gtk-packages.c | 24 +- source/ubinstall-gtk-page-switch.c | 87 ++++--- source/ubinstall-gtk.c | 30 ++- source/ubinstall-gtk.h | 38 ++- source/ubl-strings.h | 19 +- ubinstall-gtk.glade | 361 ++++++++++++++++++++++++----- 10 files changed, 609 insertions(+), 101 deletions(-) create mode 100644 source/ubinstall-gtk-config-hub.c diff --git a/locale/ubinstall-gtk.pot b/locale/ubinstall-gtk.pot index cb0e8ea..c0dc747 100644 --- a/locale/ubinstall-gtk.pot +++ b/locale/ubinstall-gtk.pot @@ -1310,4 +1310,16 @@ msgstr "" #: source/ubl-strings.h:20 msgid "Attention! The selected partition will be reduced and the next new partition will be created. The data will be saved in the selected partition. The new partition will be formatted." +msgstr "" + +msgid "Personal" +msgstr "" + +msgid "Hardware" +msgstr "" + +msgid "System" +msgstr "" + +msgid "Packages" msgstr "" \ No newline at end of file diff --git a/locale/ubinstall-gtk_ru.po b/locale/ubinstall-gtk_ru.po index d7393e2..48042d9 100644 --- a/locale/ubinstall-gtk_ru.po +++ b/locale/ubinstall-gtk_ru.po @@ -3152,4 +3152,16 @@ msgstr "Новый раздел:" #: source/ubl-strings.h:20 msgid "Attention! The selected partition will be reduced and the next new partition will be created. The data will be saved in the selected partition. The new partition will be formatted." -msgstr "Внимание! Выбранный раздел будет уменьшен и будет создан следующий новый раздел. На выбранном разделе данные будут сохранены. Новый раздел будет отформатирован." \ No newline at end of file +msgstr "Внимание! Выбранный раздел будет уменьшен и будет создан следующий новый раздел. На выбранном разделе данные будут сохранены. Новый раздел будет отформатирован." + +msgid "Personal" +msgstr "Личные" + +msgid "Hardware" +msgstr "Оборудование" + +msgid "System" +msgstr "Система" + +msgid "Packages" +msgstr "Пакеты" \ No newline at end of file diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index b775731..8065fc9 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -151,6 +151,7 @@ set(SOURCE_FILES ubinstall-gtk-startup-services.c ubinstall-gtk-kernel.c ubinstall-gtk-language.c + ubinstall-gtk-config-hub.c ubinstall-gtk.h ubl-strings.h ) diff --git a/source/ubinstall-gtk-config-hub.c b/source/ubinstall-gtk-config-hub.c new file mode 100644 index 0000000..22b322a --- /dev/null +++ b/source/ubinstall-gtk-config-hub.c @@ -0,0 +1,124 @@ +#include "ubinstall-gtk.h" + + +void on_configuration_hub_selected(GtkWidget* self, main_window *widgets){ + GList *list = NULL; + list = g_list_prepend(list,widgets->HubPackagesListBox); + list = g_list_prepend(list,widgets->HubSystemListBox); + list = g_list_prepend(list,widgets->HubHardwareListBox); + list = g_list_prepend(list,widgets->HubPersonalListBox); + list = g_list_reverse(list); + GList *iter; + for (iter=list;iter;iter=iter->next){ + if (iter->data!=self){ + g_signal_handlers_block_by_func(G_OBJECT(iter->data),G_CALLBACK(on_configuration_hub_selected),widgets); + GList *flowlist = gtk_flow_box_get_selected_children(GTK_FLOW_BOX(iter->data)); + if (flowlist){ + gtk_flow_box_unselect_child(GTK_FLOW_BOX(iter->data),GTK_FLOW_BOX_CHILD(flowlist->data)); + g_list_free(flowlist); + } + g_signal_handlers_unblock_by_func(G_OBJECT(iter->data),G_CALLBACK(on_configuration_hub_selected),widgets); + } + } +} + +void yon_configuration_hub_section_get_max_size(GtkFlowBox *target, int *ret_width, int *ret_height){ + GList *list = gtk_container_get_children(GTK_CONTAINER(target)); + GList *iter; + for (iter=list;iter;iter=iter->next){ + config_hub_icon *section = g_object_get_data(G_OBJECT(iter->data),"config_hub_icon"); + gtk_widget_realize(GTK_WIDGET(iter->data)); + gtk_widget_realize(GTK_WIDGET(section->Label)); + int width; + int height; + + gtk_widget_get_preferred_width(section->Label,NULL,&width); + gtk_widget_get_preferred_height(section->Label,NULL,&height); + if ((*ret_width)next){ + config_hub_icon *section = g_object_get_data(G_OBJECT(iter->data),"config_hub_icon"); + gtk_widget_set_size_request(section->Label,width,height); + + } +} + +void yon_configuration_hub_resize(main_window *widgets){ + int max_width=0; + int max_height=0; + yon_configuration_hub_section_get_max_size(GTK_FLOW_BOX(widgets->HubPersonalListBox),&max_width,&max_height); + yon_configuration_hub_section_get_max_size(GTK_FLOW_BOX(widgets->HubHardwareListBox),&max_width,&max_height); + yon_configuration_hub_section_get_max_size(GTK_FLOW_BOX(widgets->HubSystemListBox),&max_width,&max_height); + yon_configuration_hub_section_get_max_size(GTK_FLOW_BOX(widgets->HubPackagesListBox),&max_width,&max_height); + yon_configuration_hub_section_set_max_size(GTK_FLOW_BOX(widgets->HubPersonalListBox),max_width,max_height); + yon_configuration_hub_section_set_max_size(GTK_FLOW_BOX(widgets->HubHardwareListBox),max_width,max_height); + yon_configuration_hub_section_set_max_size(GTK_FLOW_BOX(widgets->HubSystemListBox),max_width,max_height); + yon_configuration_hub_section_set_max_size(GTK_FLOW_BOX(widgets->HubPackagesListBox),max_width,max_height); +} + +void on_configuration_hub_open(GtkFlowBox *,GtkFlowBoxChild *child, main_window *widgets){ + config_hub_icon *cur_icon = g_object_get_data(G_OBJECT(child),"config_hub_icon"); + + gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),cur_icon->page); + yon_page_init(widgets,cur_icon->page); + yon_page_update(widgets); +} + +void yon_configuration_hub_add(GtkFlowBox *target, char *name, char *icon, enum YON_PAGES page){ + g_return_if_fail(GTK_IS_FLOW_BOX(target)); + config_hub_icon *cur_icon = malloc(sizeof(config_hub_icon)); + memset(cur_icon,0,sizeof(config_hub_icon)); + + GtkIconInfo *info = gtk_icon_theme_lookup_icon_for_scale(gtk_icon_theme_get_default(),icon,54,1,GTK_ICON_LOOKUP_FORCE_SIZE); + + char *name_wrapped = yon_char_wrap_to_length_str(name,10); + cur_icon->MainBox = gtk_box_new(GTK_ORIENTATION_VERTICAL,5); + cur_icon->Label = gtk_label_new(name_wrapped); + cur_icon->Image = gtk_image_new_from_pixbuf(gtk_icon_info_load_icon(info,NULL)); + cur_icon->page = page; + GtkWidget *flow = gtk_flow_box_child_new(); + + // gtk_label_set_line_wrap(GTK_LABEL(cur_icon->Label),1); + // gtk_label_set_line_wrap_mode(GTK_LABEL(cur_icon->Label),PANGO_WRAP_WORD); + g_object_set_data(G_OBJECT(flow),"config_hub_icon",cur_icon); + gtk_container_add(GTK_CONTAINER(flow),cur_icon->MainBox); + gtk_box_pack_start(GTK_BOX(cur_icon->MainBox),cur_icon->Image,0,0,0); + gtk_box_pack_start(GTK_BOX(cur_icon->MainBox),cur_icon->Label,0,0,0); + gtk_flow_box_insert(target,flow,-1); + gtk_widget_show_all(flow); + free(name_wrapped); +} + +void yon_flow_box_clear(GtkFlowBox *target){ + GList *list = gtk_container_get_children(GTK_CONTAINER(target)); + GList *iter; + for (iter=list;iter;iter=iter->next){ + gtk_widget_destroy(GTK_WIDGET(iter->data)); + } +} + +void yon_configuration_hub_init(main_window *widgets){ + yon_flow_box_clear(GTK_FLOW_BOX(widgets->HubPersonalListBox)); + yon_flow_box_clear(GTK_FLOW_BOX(widgets->HubSystemListBox)); + yon_flow_box_clear(GTK_FLOW_BOX(widgets->HubHardwareListBox)); + yon_flow_box_clear(GTK_FLOW_BOX(widgets->HubPackagesListBox)); + yon_configuration_hub_add(GTK_FLOW_BOX(widgets->HubPackagesListBox),KERNEL_LABEL,kernel_icon_path,YON_PAGE_KERNEL); + yon_configuration_hub_add(GTK_FLOW_BOX(widgets->HubPackagesListBox),KERNEL_ADDON_LABEL,kernel_icon_path,YON_PAGE_KERNEL_ADDON); + yon_configuration_hub_add(GTK_FLOW_BOX(widgets->HubPackagesListBox),SOFTWARE_LABEL,icon_path,YON_PAGE_SOFTWARE); + yon_configuration_hub_add(GTK_FLOW_BOX(widgets->HubPackagesListBox),PACMAN_SOFTWARE_LABEL,icon_path,YON_PAGE_PACMAN_SOFTWARE); + yon_configuration_hub_add(GTK_FLOW_BOX(widgets->HubPackagesListBox),KERNEL_ADDON_LABEL,icon_path,YON_PAGE_KERNEL_ADDON); + yon_configuration_hub_add(GTK_FLOW_BOX(widgets->HubPersonalListBox),REGION_ICON_LABEL,icon_path,YON_PAGE_REGION); + yon_configuration_hub_add(GTK_FLOW_BOX(widgets->HubPersonalListBox),LOCALE_LANGUAGE_LABEL,icon_path,YON_PAGE_LANGUAGE); + yon_configuration_hub_add(GTK_FLOW_BOX(widgets->HubPersonalListBox),KEYBOARD_TAB_LABEL,icon_path,YON_PAGE_KEYBOARD); + yon_configuration_hub_add(GTK_FLOW_BOX(widgets->HubSystemListBox),USERS_TAB_LABEL,icon_path,YON_PAGE_USERS); + yon_configuration_hub_add(GTK_FLOW_BOX(widgets->HubSystemListBox),STARTUP_LABEL,icon_path,YON_PAGE_STARTUP); + yon_configuration_hub_add(GTK_FLOW_BOX(widgets->HubSystemListBox),BOOTLOADER_LABEL,icon_path,YON_PAGE_BOOTLOADER); + yon_configuration_hub_add(GTK_FLOW_BOX(widgets->HubSystemListBox),NETWORK_LABEL,network_icon_path,YON_PAGE_NETWORK); + yon_configuration_hub_resize(widgets); +} \ No newline at end of file diff --git a/source/ubinstall-gtk-packages.c b/source/ubinstall-gtk-packages.c index 7026b25..375dcb7 100644 --- a/source/ubinstall-gtk-packages.c +++ b/source/ubinstall-gtk-packages.c @@ -84,7 +84,7 @@ void yon_packages_tab_init(main_window *widgets){ gtk_tree_view_expand_all(GTK_TREE_VIEW(widgets->PackagesTree)); } -void yon_on_packages_chosen(GtkWidget *, main_window *widgets){ +void yon_on_packages_selected(GtkWidget *, main_window *widgets){ GtkTreeIter iter; GtkTreeModel *model; gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->PackagesTree)),&model,&iter); @@ -96,9 +96,31 @@ void yon_on_packages_chosen(GtkWidget *, main_window *widgets){ gtk_tree_model_iter_children(model,&cur_parent,&iter); gtk_tree_model_get(model,&cur_parent,3,&status,-1); if (status){ + GtkTreePath *path = gtk_tree_model_get_path(model,&cur_parent); + gtk_tree_view_expand_to_path(GTK_TREE_VIEW(widgets->PackagesTree),path); + gtk_tree_path_free(path); gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->PackagesTree)),&cur_parent); return; } gtk_tree_model_iter_children(model,&cur_iter,&cur_parent); + GtkTreePath *path = gtk_tree_model_get_path(model,&cur_iter); + gtk_tree_view_expand_to_path(GTK_TREE_VIEW(widgets->PackagesTree),path); + gtk_tree_path_free(path); gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->PackagesTree)),&cur_iter); +} + +void yon_on_packages_chosen(GtkWidget *, char *path, main_window *widgets){ + GtkTreeIter iter; + gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(widgets->PackagesList),&iter,path); + int status; + gtk_tree_model_get(GTK_TREE_MODEL(widgets->PackagesList),&iter,0,&status,-1); + gtk_tree_store_set(widgets->PackagesList,&iter,0,!status,-1); +} + +void yon_on_packages_activated(GtkWidget *, GtkTreePath* path, GtkTreeViewColumn* , main_window *widgets){ + GtkTreeIter iter; + gtk_tree_model_get_iter(GTK_TREE_MODEL(widgets->PackagesList),&iter,path); + int status; + gtk_tree_model_get(GTK_TREE_MODEL(widgets->PackagesList),&iter,0,&status,-1); + gtk_tree_store_set(widgets->PackagesList,&iter,0,!status,-1); } \ No newline at end of file diff --git a/source/ubinstall-gtk-page-switch.c b/source/ubinstall-gtk-page-switch.c index 83a8a7f..9a42691 100644 --- a/source/ubinstall-gtk-page-switch.c +++ b/source/ubinstall-gtk-page-switch.c @@ -8,20 +8,21 @@ enum YON_PAGES yon_page_get_next(main_window *widgets, enum YON_PAGES page){ case YON_PAGE_WELCOME: return YON_PAGE_LICENCE; break; case YON_PAGE_LICENCE: return YON_PAGE_SECTIONS; break; case YON_PAGE_SECTIONS: return yon_sections_get_next_page(widgets); break; - case YON_PAGE_OS_COMPONENTS: return YON_PAGE_SOFTWARE; break; - case YON_PAGE_SOFTWARE: return main_config.configure_mode? YON_PAGE_REGION : YON_PAGE_INSTALLATION_BEGIN; break; - case YON_PAGE_INSTALLATION_BEGIN: return YON_PAGE_REGION; break; - case YON_PAGE_KERNEL: return YON_PAGE_PACKAGES_HUB; break; - case YON_PAGE_KERNEL_ADDON: return YON_PAGE_PACKAGES_HUB; break; - case YON_PAGE_PACMAN_SOFTWARE: return YON_PAGE_PACKAGES_HUB; break; - case YON_PAGE_REGION: return YON_PAGE_LANGUAGE; break; - case YON_PAGE_LANGUAGE: return YON_PAGE_KEYBOARD; break; - case YON_PAGE_KEYBOARD: return YON_PAGE_USERS; break; - case YON_PAGE_USERS: return YON_PAGE_STARTUP; break; - case YON_PAGE_STARTUP: return YON_PAGE_BOOTLOADER; break; - case YON_PAGE_BOOTLOADER: return YON_PAGE_NETWORK; break; - case YON_PAGE_NETWORK: return YON_PAGE_PACKAGES_HUB; break; - case YON_PAGE_PACKAGES_HUB: return main_config.configure_mode? YON_PAGE_CONFIGURE_END : YON_PAGE_INSTALLATION; + case YON_PAGE_OS_COMPONENTS: return YON_PAGE_INSTALLATION_BEGIN; break; + case YON_PAGE_SOFTWARE: return YON_PAGE_INSTALLATION_BEGIN; break; + case YON_PAGE_INSTALLATION_BEGIN: return YON_PAGE_CONFIG_HUB; break; + case YON_PAGE_CONFIG_HUB: return YON_PAGE_CONFIG_HUB; break; + case YON_PAGE_KERNEL: return YON_PAGE_CONFIG_HUB; break; + case YON_PAGE_KERNEL_ADDON: return YON_PAGE_CONFIG_HUB; break; + case YON_PAGE_PACMAN_SOFTWARE: return YON_PAGE_CONFIG_HUB; break; + case YON_PAGE_REGION: return YON_PAGE_CONFIG_HUB; break; + case YON_PAGE_LANGUAGE: return YON_PAGE_CONFIG_HUB; break; + case YON_PAGE_KEYBOARD: return YON_PAGE_CONFIG_HUB; break; + case YON_PAGE_USERS: return YON_PAGE_CONFIG_HUB; break; + case YON_PAGE_STARTUP: return YON_PAGE_CONFIG_HUB; break; + case YON_PAGE_BOOTLOADER: return YON_PAGE_CONFIG_HUB; break; + case YON_PAGE_NETWORK: return YON_PAGE_CONFIG_HUB; break; + case YON_PAGE_PACKAGES_HUB: return YON_PAGE_CONFIG_HUB; case YON_PAGE_INSTALL_COMMON: return YON_PAGE_OS_COMPONENTS; break; case YON_PAGE_INSTALL_SEPARATE: return YON_PAGE_OS_COMPONENTS; break; case YON_PAGE_INSTALL_SAME_PARTITION: return YON_PAGE_OS_COMPONENTS; break; @@ -52,17 +53,18 @@ enum YON_PAGES yon_page_get_prev(enum YON_PAGES page){ case YON_PAGE_LICENCE: return YON_PAGE_WELCOME; break; case YON_PAGE_SECTIONS: return YON_PAGE_LICENCE; break; case YON_PAGE_OS_COMPONENTS: return YON_PAGE_SECTIONS; break; - case YON_PAGE_SOFTWARE: return YON_PAGE_OS_COMPONENTS; break; - case YON_PAGE_INSTALLATION_BEGIN: return YON_PAGE_SOFTWARE; break; - case YON_PAGE_KERNEL: return YON_PAGE_NETWORK; break; - case YON_PAGE_KERNEL_ADDON: return YON_PAGE_KERNEL; break; - case YON_PAGE_PACMAN_SOFTWARE: return YON_PAGE_KERNEL_ADDON; break; - case YON_PAGE_REGION: return YON_PAGE_SECTIONS; break; - case YON_PAGE_KEYBOARD: return YON_PAGE_REGION; break; - case YON_PAGE_USERS: return YON_PAGE_KEYBOARD; break; - case YON_PAGE_STARTUP: return YON_PAGE_USERS; break; - case YON_PAGE_BOOTLOADER: return YON_PAGE_STARTUP; break; - case YON_PAGE_NETWORK: return YON_PAGE_BOOTLOADER; break; + case YON_PAGE_SOFTWARE: return YON_PAGE_CONFIG_HUB; break; + case YON_PAGE_INSTALLATION_BEGIN: return YON_PAGE_CONFIG_HUB; break; + case YON_PAGE_CONFIG_HUB: return YON_PAGE_CONFIG_HUB; break; + case YON_PAGE_KERNEL: return YON_PAGE_CONFIG_HUB; break; + case YON_PAGE_KERNEL_ADDON: return YON_PAGE_CONFIG_HUB; break; + case YON_PAGE_PACMAN_SOFTWARE: return YON_PAGE_CONFIG_HUB; break; + case YON_PAGE_REGION: return YON_PAGE_CONFIG_HUB; break; + case YON_PAGE_KEYBOARD: return YON_PAGE_CONFIG_HUB; break; + case YON_PAGE_USERS: return YON_PAGE_CONFIG_HUB; break; + case YON_PAGE_STARTUP: return YON_PAGE_CONFIG_HUB; break; + case YON_PAGE_BOOTLOADER: return YON_PAGE_CONFIG_HUB; break; + case YON_PAGE_NETWORK: return YON_PAGE_CONFIG_HUB; break; case YON_PAGE_PACKAGES_HUB: return YON_PAGE_NETWORK; case YON_PAGE_INSTALLATION: return YON_PAGE_INSTALLATION; break; case YON_PAGE_CONFIGURE_END: return YON_PAGE_CONFIGURE_END; break; @@ -121,9 +123,6 @@ void yon_navigation_buttons_set_sensetiveness(main_window *widgets){ gtk_widget_set_sensitive(widgets->BackButton,0); gtk_widget_hide(widgets->SkipInstallationButton); break; - case YON_PAGE_KERNEL: - gtk_widget_set_sensitive(widgets->BackButton,0); - break; case YON_PAGE_CONFIGURE_END: gtk_button_set_label(GTK_BUTTON(widgets->NextButton),SAVE_AND_EXIT_LABEL); gtk_button_set_label(GTK_BUTTON(widgets->CancelInstallButton),EXIT_LABEL); @@ -252,6 +251,7 @@ void yon_switch_page_render(main_window *widgets){ case YON_PAGE_INSTALL_ADVANCED: case YON_PAGE_INSTALL_RECOVERY: case YON_PAGE_INSTALLATION_BEGIN: + case YON_PAGE_CONFIG_HUB: case YON_PAGE_KERNEL: case YON_PAGE_KERNEL_ADDON: case YON_PAGE_SOFTWARE: @@ -349,6 +349,9 @@ enum YON_PAGES yon_recovery_get_next(main_window *widgets){ void yon_page_init(main_window *widgets, enum YON_PAGES page){ switch(page){ + case YON_PAGE_CONFIG_HUB: + yon_configuration_hub_init(widgets); + break; case YON_PAGE_OS_COMPONENTS: yon_os_components_init(widgets); break; @@ -432,7 +435,7 @@ void on_page_prev_clicked(GtkWidget *, main_window *widgets){ if ((int)page!=-1){ gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),page); } - yon_page_update(widgets); + yon_page_update(widgets); } void on_page_cancel_clicked(GtkWidget *, main_window *widgets){ @@ -483,4 +486,28 @@ void on_system_setup_pass(GtkWidget *, main_window *widgets){ } } yon_page_update(widgets); -} \ No newline at end of file +} + +void on_additional_page_clicked(GtkWidget *, main_window *widgets){ + gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_SOFTWARE); + yon_page_init(widgets,YON_PAGE_SOFTWARE); + yon_page_update(widgets); +} + +void on_kernel_components_page_clicked(GtkWidget *, main_window *widgets){ + gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_KERNEL_ADDON); + yon_page_init(widgets,YON_PAGE_KERNEL_ADDON); + yon_page_update(widgets); +} + +void on_kernel_page_clicked(GtkWidget *, main_window *widgets){ + gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_KERNEL); + yon_page_init(widgets,YON_PAGE_KERNEL); + yon_page_update(widgets); +} + +void on_additional_packages_page_clicked(GtkWidget *, main_window *widgets){ + gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_PACMAN_SOFTWARE); + yon_page_init(widgets,YON_PAGE_PACMAN_SOFTWARE); + yon_page_update(widgets); +} diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index a4d05c2..584366d 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -1084,8 +1084,19 @@ void yon_main_window_create(main_window *widgets){ widgets->AdvancedVirtualDeviceLabel = yon_gtk_builder_get_widget(builder,"AdvancedVirtualDeviceLabel"); widgets->PackagesTree = yon_gtk_builder_get_widget(builder,"PackagesTree"); + widgets->PackagesChosenCell = GTK_CELL_RENDERER(gtk_builder_get_object(builder,"PackagesChosenCell")); widgets->PackagesList = GTK_TREE_STORE(gtk_builder_get_object(builder,"Packages")); + widgets->AdditionalPageButton = yon_gtk_builder_get_widget(builder,"AdditionalPageButton"); + widgets->KernelComponentsPageButton = yon_gtk_builder_get_widget(builder,"KernelComponentsPageButton"); + widgets->KernelPageButton = yon_gtk_builder_get_widget(builder,"KernelPageButton"); + widgets->AdditionalPackagesPageButton = yon_gtk_builder_get_widget(builder,"AdditionalPackagesPageButton"); + + widgets->HubPersonalListBox = yon_gtk_builder_get_widget(builder,"HubPersonalListBox"); + widgets->HubHardwareListBox = yon_gtk_builder_get_widget(builder,"HubHardwareListBox"); + widgets->HubSystemListBox = yon_gtk_builder_get_widget(builder,"HubSystemListBox"); + widgets->HubPackagesListBox = yon_gtk_builder_get_widget(builder,"HubPackagesListBox"); + widgets->network_connections = NULL; widgets->pacmanchosen = g_hash_table_new_full(g_str_hash,g_str_equal,free,NULL); @@ -1215,7 +1226,24 @@ void yon_main_window_create(main_window *widgets){ g_signal_connect(G_OBJECT(widgets->AdvancedAddButton),"clicked",G_CALLBACK(on_advanced_partition_create),widgets); g_signal_connect(G_OBJECT(widgets->AdvancedPartChosenCell),"toggled",G_CALLBACK(on_install_advanced_partition_chosen),widgets); g_signal_connect(G_OBJECT(widgets->AdvancedVirtualDeviceCombo),"changed",G_CALLBACK(on_advanced_virtual_device_changed),widgets); - g_signal_connect(G_OBJECT(widgets->PackagesTree),"cursor-changed",G_CALLBACK(yon_on_packages_chosen),widgets); + g_signal_connect(G_OBJECT(widgets->PackagesTree),"cursor-changed",G_CALLBACK(yon_on_packages_selected),widgets); + g_signal_connect(G_OBJECT(widgets->PackagesTree),"row-activated",G_CALLBACK(yon_on_packages_activated),widgets); + g_signal_connect(G_OBJECT(widgets->PackagesChosenCell),"toggled",G_CALLBACK(yon_on_packages_chosen),widgets); + + g_signal_connect(G_OBJECT(widgets->AdditionalPageButton),"clicked",G_CALLBACK(on_additional_page_clicked),widgets); + g_signal_connect(G_OBJECT(widgets->KernelComponentsPageButton),"clicked",G_CALLBACK(on_kernel_components_page_clicked),widgets); + g_signal_connect(G_OBJECT(widgets->KernelPageButton),"clicked",G_CALLBACK(on_kernel_page_clicked),widgets); + g_signal_connect(G_OBJECT(widgets->AdditionalPackagesPageButton),"clicked",G_CALLBACK(on_additional_packages_page_clicked),widgets); + + g_signal_connect(G_OBJECT(widgets->HubPersonalListBox),"child-activated",G_CALLBACK(on_configuration_hub_open),widgets); + g_signal_connect(G_OBJECT(widgets->HubHardwareListBox),"child-activated",G_CALLBACK(on_configuration_hub_open),widgets); + g_signal_connect(G_OBJECT(widgets->HubSystemListBox),"child-activated",G_CALLBACK(on_configuration_hub_open),widgets); + g_signal_connect(G_OBJECT(widgets->HubPackagesListBox),"child-activated",G_CALLBACK(on_configuration_hub_open),widgets); + g_signal_connect(G_OBJECT(widgets->HubPersonalListBox),"selected-children-changed",G_CALLBACK(on_configuration_hub_selected),widgets); + g_signal_connect(G_OBJECT(widgets->HubHardwareListBox),"selected-children-changed",G_CALLBACK(on_configuration_hub_selected),widgets); + g_signal_connect(G_OBJECT(widgets->HubSystemListBox),"selected-children-changed",G_CALLBACK(on_configuration_hub_selected),widgets); + g_signal_connect(G_OBJECT(widgets->HubPackagesListBox),"selected-children-changed",G_CALLBACK(on_configuration_hub_selected),widgets); + g_signal_connect(G_OBJECT(widgets->AboutMenuItem),"activate",G_CALLBACK(on_about),widgets); g_signal_connect(G_OBJECT(widgets->DocumentationMenuItem),"activate",G_CALLBACK(on_open_documentation_confirmation),WIKI_LINK); diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index 1f393b6..19cd813 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -44,6 +44,7 @@ #define CssPath "/com/ublinux/css/ubinstall-gtk.css" #define config_path yon_char_unite(yon_ubl_user_get_home_directory(),"/.config/",LocaleName,"/",LocaleName,".conf",NULL) #define icon_path "com.ublinux.ubinstall-gtk" +#define kernel_icon_path "com.ublinux.ubl-settings-kernel" #define LocalePath "/usr/share/locale" #define LocaleName "ubinstall-gtk" @@ -356,6 +357,7 @@ enum YON_PAGES { YON_PAGE_SECTIONS, YON_PAGE_OS_COMPONENTS, YON_PAGE_INSTALLATION_BEGIN, + YON_PAGE_CONFIG_HUB, YON_PAGE_KERNEL, YON_PAGE_KERNEL_ADDON, YON_PAGE_SOFTWARE, @@ -728,8 +730,21 @@ typedef struct { GSequence *advanced_partition_order; GtkTreeStore *PackagesList; + GtkCellRenderer *PackagesChosenCell; GtkWidget *PackagesTree; + GtkWidget *AdditionalPageButton; + GtkWidget *KernelComponentsPageButton; + GtkWidget *KernelPageButton; + GtkWidget *AdditionalPackagesPageButton; + + // Configuration hub slide section + GtkWidget *HubPersonalListBox; + GtkWidget *HubHardwareListBox; + GtkWidget *HubSystemListBox; + GtkWidget *HubPackagesListBox; + + // Misc section GFile *install_progress_file; GFileMonitor *install_progress_monitor; @@ -1072,6 +1087,13 @@ typedef struct { char *parameters; } layouts_window; +typedef struct { + GtkWidget *MainBox; + GtkWidget *Image; + GtkWidget *Label; + enum YON_PAGES page; +} config_hub_icon; + void config_init(); main_window *yon_main_window_complete(); ubinstall_language_window *yon_ubinstall_language_new(); @@ -1343,4 +1365,18 @@ void on_num_lock_changed(GtkComboBox *self, main_window *); void on_model_changed(GtkComboBoxText *self, main_window *widgets); void on_options_save(GtkWidget *,main_window *widgets); void yon_packages_tab_init(main_window *widgets); -void yon_on_packages_chosen(GtkWidget *, main_window *widgets); \ No newline at end of file +void yon_on_packages_selected(GtkWidget *, main_window *widgets); +void yon_on_packages_chosen(GtkWidget *, char *path, main_window *widgets); +void yon_on_packages_activated(GtkWidget *, GtkTreePath* path, GtkTreeViewColumn* , main_window *widgets); +void on_additional_page_clicked(GtkWidget *, main_window *widgets); +void on_kernel_components_page_clicked(GtkWidget *, main_window *widgets); +void on_kernel_page_clicked(GtkWidget *, main_window *widgets); +void on_additional_packages_page_clicked(GtkWidget *, main_window *widgets); +void on_configuration_hub_open(GtkFlowBox *,GtkFlowBoxChild *child, main_window *widgets); +void yon_configuration_hub_add(GtkFlowBox *target, char *name, char *icon, enum YON_PAGES page); +void yon_configuration_hub_init(main_window *widgets); +void yon_flow_box_clear(GtkFlowBox *target); +void yon_configuration_hub_section_get_max_size(GtkFlowBox *target, int *ret_width, int *ret_height); +void yon_configuration_hub_section_set_max_size(GtkFlowBox *target, int width, int height); +void yon_configuration_hub_resize(main_window *widgets); +void on_configuration_hub_selected(GtkWidget* self, main_window *widgets); \ No newline at end of file diff --git a/source/ubl-strings.h b/source/ubl-strings.h index 24c2978..52bf414 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -269,6 +269,18 @@ NULL) #define LANGUAGE_TITLE_INFO_LABEL _("Specify your preferred system languages") #define REMOVE_LOCALE_TOOLTIP_LABEL _("Remove locale") #define NEW_PARTITION_LABEL _("New partition:") +#define PERSONAL_SECTION_LABEL _("Personal") +#define HARDWARE_SECTION_LABEL _("Hardware") +#define SYSTEM_SECTION_LABEL _("System") +#define PACKAGES_SECTION_LABEL _("Packages") +#define KERNEL_LABEL _("Kernel") +#define KERNEL_ADDON_LABEL _("Kernel addons") +#define SOFTWARE_LABEL _("Choose additional components") +#define PACMAN_SOFTWARE_LABEL _("Choose additional components") +#define REGION_ICON_LABEL _("Region") +#define STARTUP_LABEL _("Startup services") +#define BOOTLOADER_LABEL _("Boot load") +#define NETWORK_LABEL _("Network") // #define _LABEL _("Package:") // #define _LABEL _("Module:") @@ -338,18 +350,13 @@ NULL) // #define _LABEL _("Tags") // #define _LABEL _("Modules") // #define _LABEL _("Selecting additional software to install from the repository via the Internet") -// #define _LABEL _("Kernel") -// #define _LABEL _("Kernel addons") -// #define _LABEL _("Choose additional components") // #define _LABEL _("Type") // #define _LABEL _("Additional components") // #define _LABEL _("Package name:") // #define _LABEL _("Accessed") // #define _LABEL _("Repository status:") // #define _LABEL _("Pacman software") -// #define _LABEL _("Region") // #define _LABEL _("Administrator password (root):") -// #define _LABEL _("Startup services") // #define _LABEL _("Add") // #define _LABEL _("Edit") // #define _LABEL _("Remove") @@ -357,7 +364,6 @@ NULL) // #define _LABEL _("Unit") // #define _LABEL _("Service") // #define _LABEL _("Startup configuration") -// #define _LABEL _("Boot load") // #define _LABEL _("Boot selection menu timer:") // #define _LABEL _("seconds") // #define _LABEL _("Default OS:") @@ -366,7 +372,6 @@ NULL) // #define _LABEL _("Password") // #define _LABEL _("Bootloader menu users") // #define _LABEL _("Bootloader") -// #define _LABEL _("Network") // #define _LABEL _("Domain name:") // #define _LABEL _("Domain administrator:") // #define _LABEL _("NTP Server:") diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index 818bb51..71603f6 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -43,6 +43,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2011,6 +2051,212 @@ agreement False + + + True + False + vertical + 5 + + + True + False + vertical + 5 + + + True + False + Personal + 0 + + + + + + + False + True + 0 + + + + + True + False + True + 150 + False + + + False + True + 1 + + + + + False + True + 0 + + + + + True + False + vertical + 5 + + + True + False + Hardware + 0 + + + + + + + False + True + 0 + + + + + True + False + True + 150 + False + + + False + True + 1 + + + + + False + True + 1 + + + + + True + False + vertical + 5 + + + True + False + System + 0 + + + + + + + False + True + 0 + + + + + True + False + True + 150 + False + + + False + True + 1 + + + + + False + True + 2 + + + + + True + False + vertical + 5 + + + True + False + Packages + 0 + + + + + + + False + True + 0 + + + + + True + False + True + 150 + False + + + False + True + 1 + + + + + False + True + 3 + + + + + 5 + + + + + True + False + Configuration hub + + + 5 + False + + True @@ -2347,7 +2593,7 @@ agreement - 5 + 6 @@ -2357,7 +2603,7 @@ agreement Kernel - 5 + 6 False @@ -2541,7 +2787,7 @@ agreement - 6 + 7 @@ -2551,7 +2797,7 @@ agreement Kernel addons - 6 + 7 False @@ -2756,7 +3002,7 @@ agreement - 7 + 8 @@ -2766,7 +3012,7 @@ agreement Additional components - 7 + 8 False @@ -3180,7 +3426,7 @@ agreement - 8 + 9 @@ -3190,7 +3436,7 @@ agreement Pacman software - 8 + 9 False @@ -3536,7 +3782,7 @@ agreement - 9 + 10 @@ -3546,7 +3792,7 @@ agreement Region - 9 + 10 False @@ -3841,7 +4087,7 @@ agreement - 10 + 11 @@ -3851,7 +4097,7 @@ agreement Language - 10 + 11 False @@ -4438,7 +4684,7 @@ agreement - 11 + 12 @@ -4448,7 +4694,7 @@ agreement Keyboard - 11 + 12 False @@ -4856,7 +5102,7 @@ agreement - 12 + 13 @@ -4866,7 +5112,7 @@ agreement Users - 12 + 13 False @@ -5112,7 +5358,7 @@ agreement - 13 + 14 @@ -5122,7 +5368,7 @@ agreement Startup configuration - 13 + 14 False @@ -5536,7 +5782,7 @@ agreement - 14 + 15 @@ -5546,7 +5792,7 @@ agreement Bootloader - 14 + 15 False @@ -5992,7 +6238,7 @@ agreement - 15 + 16 @@ -6002,7 +6248,7 @@ agreement Network - 15 + 16 False @@ -6365,17 +6611,12 @@ agreement column - + 3 0 - - - - - column @@ -6395,7 +6636,7 @@ agreement - 16 + 17 @@ -6405,7 +6646,7 @@ agreement Packages - 16 + 17 False @@ -6549,7 +6790,7 @@ agreement - 17 + 18 @@ -6559,7 +6800,7 @@ agreement Installation process - 17 + 18 False @@ -6740,7 +6981,7 @@ or continue working in the environment, booted from the Live image. - 18 + 19 @@ -6750,7 +6991,7 @@ or continue working in the environment, booted from the Live image. Completion - 18 + 19 False @@ -6911,7 +7152,7 @@ or continue working in the environment, booted from the Live image. - 19 + 20 @@ -6921,7 +7162,7 @@ or continue working in the environment, booted from the Live image. Completed - 19 + 20 False @@ -7082,7 +7323,7 @@ or continue working in the environment, booted from the Live image. - 20 + 21 @@ -7092,7 +7333,7 @@ or continue working in the environment, booted from the Live image. Configuration error - 20 + 21 False @@ -7253,7 +7494,7 @@ or continue working in the environment, booted from the Live image. - 21 + 22 @@ -7263,7 +7504,7 @@ or continue working in the environment, booted from the Live image. Configuration end - 21 + 22 False @@ -7424,7 +7665,7 @@ or continue working in the environment, booted from the Live image. - 22 + 23 @@ -7434,7 +7675,7 @@ or continue working in the environment, booted from the Live image. Configuration saved - 22 + 23 False @@ -7888,7 +8129,7 @@ or continue working in the environment, booted from the Live image. - 23 + 24 @@ -7898,7 +8139,7 @@ or continue working in the environment, booted from the Live image. Common Installation - 23 + 24 False @@ -8565,7 +8806,7 @@ or continue working in the environment, booted from the Live image. - 24 + 25 @@ -8575,7 +8816,7 @@ or continue working in the environment, booted from the Live image. Installation next to system - 24 + 25 False @@ -9194,7 +9435,7 @@ or continue working in the environment, booted from the Live image. - 25 + 26 @@ -9204,7 +9445,7 @@ or continue working in the environment, booted from the Live image. Installation on same partition - 25 + 26 False @@ -10250,7 +10491,7 @@ separately into the selected partition. - 26 + 27 @@ -10260,7 +10501,7 @@ separately into the selected partition. Advanced section - 26 + 27 False @@ -10735,7 +10976,7 @@ separately into the selected partition. - 27 + 28 @@ -10745,7 +10986,7 @@ separately into the selected partition. Recovery section - 27 + 28 False @@ -11137,7 +11378,7 @@ separately into the selected partition. - 28 + 29 @@ -11147,7 +11388,7 @@ separately into the selected partition. GRUB install - 28 + 29 False @@ -11526,7 +11767,7 @@ separately into the selected partition. - 29 + 30 @@ -11536,7 +11777,7 @@ separately into the selected partition. GRUB update - 29 + 30 False @@ -12262,7 +12503,7 @@ separately into the selected partition. - 30 + 31 @@ -12272,7 +12513,7 @@ separately into the selected partition. OS only - 30 + 31 False @@ -13002,7 +13243,7 @@ separately into the selected partition. - 31 + 32 @@ -13012,7 +13253,7 @@ separately into the selected partition. User data only - 31 + 32 False -- 2.35.1 From 1752f7dc465d61a0676e605ad8a1d5d840a25d36 Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Thu, 18 Dec 2025 18:28:01 +0000 Subject: [PATCH 3/5] Additional components slide loading fix; Configuration menu parameters saving --- source/ubinstall-gtk-bootloader.c | 16 - source/ubinstall-gtk-components.c | 136 +-- source/ubinstall-gtk-config-hub.c | 96 ++- source/ubinstall-gtk-grub.c | 22 - source/ubinstall-gtk-network.c | 16 - source/ubinstall-gtk-packages.c | 25 +- source/ubinstall-gtk-page-switch.c | 45 +- source/ubinstall-gtk-region.c | 11 - source/ubinstall-gtk-startup-services.c | 11 - source/ubinstall-gtk-users.c | 16 - source/ubinstall-gtk.c | 14 +- source/ubinstall-gtk.h | 18 +- ubinstall-gtk-slider.glade | 34 + ubinstall-gtk.glade | 1043 ++++++++--------------- 14 files changed, 604 insertions(+), 899 deletions(-) create mode 100644 ubinstall-gtk-slider.glade diff --git a/source/ubinstall-gtk-bootloader.c b/source/ubinstall-gtk-bootloader.c index 1dc3111..4456896 100644 --- a/source/ubinstall-gtk-bootloader.c +++ b/source/ubinstall-gtk-bootloader.c @@ -42,22 +42,6 @@ int yon_bootloader_save(main_window *widgets){ yon_config_remove_by_key(GRUB_SUPERUSERS_parameter); } - if (!main_config.configure_mode){ - int size, users_size, final_size, save_size; - config_str grub_users = yon_config_find_keys(GRUB_PASSWORD_parameter_search,&users_size); - config_str save_parameters = yon_char_parsed_new(&size,GRUB_TIMEOUT_parameter,GRUB_DEFAULT_parameter,AUTOLOGINUSER_parameter,GRUB_SUPERUSERS_parameter,NULL); - config_str final = yon_char_parsed_merge(save_parameters,size,grub_users,users_size,&final_size); - config_str parameters = yon_config_get_save_parameters_by_list(&save_size,final,final_size); - if (parameters){ - char *command_parameters = yon_char_parsed_to_string(parameters,save_size," -- "); - char *command = yon_char_unite(ubconfig_dull_command,"--target system ",command_parameters,NULL); - if (!system(yon_debug_output("%s\n",command))){} - free(command); - yon_char_parsed_free(parameters,save_size); - } - if (grub_users) yon_char_parsed_free(grub_users,users_size); - if (save_parameters) yon_char_parsed_free(save_parameters,size); - } yon_bootloader_interface_update(widgets); return 1; diff --git a/source/ubinstall-gtk-components.c b/source/ubinstall-gtk-components.c index 1af6ded..4781405 100644 --- a/source/ubinstall-gtk-components.c +++ b/source/ubinstall-gtk-components.c @@ -3,14 +3,17 @@ int yon_kernel_save(main_window *widgets){ GList *list = gtk_container_get_children(GTK_CONTAINER(widgets->KernelListBox)); - char *install_modules = ""; + char *config_val = config(modules_extra_parameter); + if (yon_char_is_empty(config_val)) yon_config_register(modules_extra_parameter,modules_extra_parameter_command,""); char *enabled_module = NULL; + int overall_size = 0; + int active_size = 0; for(GList *iter = list;iter;iter = iter->next){ + overall_size++; kernel_row *row = g_object_get_data(G_OBJECT(iter->data),"kernel_row"); if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(row->InstallCheck))){ - char *temp = yon_char_unite(install_modules,!yon_char_is_empty(install_modules)?" ":"",row->modules,NULL); - if (!yon_char_is_empty(install_modules)) free(install_modules); - install_modules = temp; + yon_config_append_element(modules_extra_parameter,row->package,","); + active_size++; if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(row->EnableRadio))){ enabled_module = row->package; } @@ -18,28 +21,12 @@ int yon_kernel_save(main_window *widgets){ } if (yon_char_is_empty(enabled_module)){ - yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),ENABLED_KERNEL_MISSING_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); - return 0; - } - - if (!yon_char_is_empty(install_modules)){ - yon_config_register(modules_extra_parameter,modules_extra_parameter_command,install_modules); + yon_config_register(KERNEL_BOOT_parameter,KERNEL_BOOT_parameter_command,enabled_module); } else { - yon_config_remove_by_key(modules_extra_parameter); - } - yon_config_register(KERNEL_BOOT_parameter,KERNEL_BOOT_parameter_command,enabled_module); - if (!main_config.configure_mode){ - int size; - config_str parameters = yon_config_get_save_parameters_by_key(&size,modules_extra_parameter,KERNEL_BOOT_parameter,NULL); - if (parameters){ - char *command_parameters = yon_char_parsed_to_string(parameters,size," -- "); - char *command = yon_char_unite(ubconfig_dull_command,"--target system ",command_parameters,NULL); - if (!system(yon_debug_output("%s\n",command))){} - free(command); - yon_char_parsed_free(parameters,size); - } + yon_config_remove_by_key(KERNEL_BOOT_parameter); } + return 1; } @@ -61,17 +48,6 @@ int yon_kernel_addon_save(main_window *widgets){ yon_config_register(modules_extra_parameter,modules_extra_parameter_command,install_modules); free(install_modules); } - if (!main_config.configure_mode){ - int size; - config_str parameters = yon_config_get_save_parameters_by_key(&size,modules_extra_parameter,NULL); - if (parameters){ - char *command_parameters = yon_char_parsed_to_string(parameters,size," -- "); - char *command = yon_char_unite(ubconfig_dull_command,"--target system ",command_parameters,NULL); - if (!system(yon_debug_output("%s\n",command))){} - free(command); - yon_char_parsed_free(parameters,size); - } - } return 1; } @@ -99,17 +75,6 @@ int yon_os_components_save(main_window *widgets){ } else { yon_config_remove_by_key(modules_parameter); } - if (!main_config.configure_mode){ - int parameters_size; - config_str parameters = yon_config_get_save_parameters_by_key(¶meters_size,modules_parameter,NULL); - if (parameters){ - char *command_parameters = yon_char_parsed_to_string(parameters,parameters_size," -- "); - char *command = yon_char_unite(ubconfig_dull_command,"--target system ",command_parameters,NULL); - if (!system(yon_debug_output("%s\n",command))){} - free(command); - yon_char_parsed_free(parameters,parameters_size); - } - } return 1; } @@ -126,8 +91,6 @@ os_row *yon_os_row_new(){ row->modules=NULL; row->version=NULL; - g_signal_connect(G_OBJECT(row->InstallCheck),"toggled",G_CALLBACK(on_kernel_install_enabled),row); - row->row = gtk_list_box_row_new(); gtk_container_add(GTK_CONTAINER(row->row),row->RowBox); gtk_widget_show(row->row); @@ -235,43 +198,45 @@ void yon_os_components_init(main_window *widgets){ } } -int yon_software_save(main_window *){ - // GtkTreeIter iter; - // GtkTreeModel *model = GTK_TREE_MODEL(widgets->AdditionalSoftwareList); - // int size = 0; - // config_str modules = NULL; - // for_iter(model,&iter){ - // char *target; - // int status; - // gtk_tree_model_get(model,&iter,0,&status,1,&target,-1); - // if (status){ - // yon_char_parsed_add_or_create_if_exists(modules,&size,target); - // } - // } - // if (size){ - // char *final = yon_char_parsed_to_string(modules,size,","); - // char *parameter = config(modules_extra_parameter); - // char *parameter_new = yon_char_unite(!yon_char_is_empty(parameter)?parameter:"",!yon_char_is_empty(parameter)?",":"",final,NULL); - // yon_config_register(modules_extra_parameter,modules_extra_parameter_command,parameter_new); - // free(parameter_new); - // } - // if (!main_config.configure_mode){ - // int size; - // config_str parameters = yon_config_get_save_parameters_by_key(&size,modules_extra_parameter,NULL); - // if (parameters){ - // char *command_parameters = yon_char_parsed_to_string(parameters,size," -- "); - // char *command = yon_char_unite(ubconfig_dull_command,"--target system ",command_parameters,NULL); - // if (!system(yon_debug_output("%s\n",command))){} - // free(command); - // yon_char_parsed_free(parameters,size); - // } - // } +int yon_software_save(main_window *widgets){ + GList *list = gtk_container_get_children(GTK_CONTAINER(widgets->AdditionalComponentsList)); + GList *iter; + char *config_val = config(modules_extra_parameter); + for(iter = list;iter;iter=iter->next){ + os_row *row = g_object_get_data(iter->data,"kernel_row"); + char *target = row->name; + int status = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(row->InstallCheck)); + if (status){ + if (!yon_char_check_element(config_val,target,",")){ + yon_config_append_element(modules_extra_parameter,target,","); + } + } + } + g_list_free(list); return 1; } +gboolean yon_software_insert(struct row_data *row_input){ + os_row *row = yon_os_row_new(); + + main_window *widgets = row_input->widgets; + gtk_list_box_insert(GTK_LIST_BOX(widgets->AdditionalComponentsList),row->row,-1); + yon_os_row_setup(row,row_input->name,row_input->version,row_input->tags,row_input->description); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(row->InstallCheck),0); + return G_SOURCE_REMOVE; +} + void yon_software_init(main_window *widgets){ + + GList *list = gtk_container_get_children(GTK_CONTAINER(widgets->AdditionalComponentsList)); + GList *iter; + for (iter=list;iter;iter=iter->next){ + os_row *row = g_object_get_data(iter->data,"kernel_row"); + free(row); + gtk_widget_destroy(GTK_WIDGET(iter->data)); + } int base_size; - config_str base = yon_config_load(get_modules_command,&base_size); + config_str base = yon_config_load(get_available_modules_command,&base_size); for (int i=0;itags = yon_char_replace(parsed[2]," ",", "); row->description = parsed[3]; row->widgets=widgets; - g_idle_add((GSourceFunc)yon_os_component_insert,row); + g_idle_add((GSourceFunc)yon_software_insert,row); } g_idle_add((GSourceFunc)yon_spinner_switch_off,widgets->OSSpinner); yon_char_parsed_free(base,base_size); @@ -306,17 +271,6 @@ int yon_pacman_software_save(main_window *widgets){ } else { yon_config_remove_by_key(packages_parameter); } - if (!main_config.configure_mode){ - int size; - config_str parameters = yon_config_get_save_parameters_by_key(&size,packages_parameter,NULL); - if (parameters){ - char *command_parameters = yon_char_parsed_to_string(parameters,size," -- "); - char *command = yon_char_unite(ubconfig_dull_command,"--target system ",command_parameters,NULL); - if (!system(yon_debug_output("%s\n",command))){} - free(command); - yon_char_parsed_free(parameters,size); - } - } return 1; } diff --git a/source/ubinstall-gtk-config-hub.c b/source/ubinstall-gtk-config-hub.c index 22b322a..5830fc3 100644 --- a/source/ubinstall-gtk-config-hub.c +++ b/source/ubinstall-gtk-config-hub.c @@ -1,5 +1,70 @@ #include "ubinstall-gtk.h" +int yon_configuration_hub_save(main_window *){ + + if (!main_config.configure_mode){ + int size; + config_str parameters = yon_config_get_save_parameters_by_key(&size,modules_parameter, + modules_extra_parameter, + root_password_parameter, + autologin_parameter, + xkbmodel_parameter, + xkblayout_parameter, + xkbvariant_parameter, + xkboptions_parameter, + hostname_parameter, + zone_parameter, + lang_parameter, + locale_parameter, + num_lock_boot_parameter, + swap_parameter, + swap_size_parameter, + boot_parameter, + packages_parameter, + device_typevfs_parameter, + NTPSERVERS_parameter, + DOMAIN_parameter, + DOMAIN_admanger_parameter, + KERNEL_BOOT_parameter, + SERVICES_ENABLE_parameter, + GRUB_SUPERUSERS_parameter, + GRUB_TIMEOUT_parameter, + GRUB_DEFAULT_parameter, + AUTOLOGINUSER_parameter, + NULL); + if (parameters){ + char *command_parameters = yon_char_parsed_to_string(parameters,size," -- "); + char *command = yon_char_unite(ubconfig_dull_command,"--target system ",command_parameters,NULL); + if (!system(yon_debug_output("%s\n",command))){} + free(command); + yon_char_parsed_free(parameters,size); + } + + int users_size, save_size; + config_str users = yon_config_find_keys(NETWORK_parameter_search,&users_size); + parameters = yon_config_get_save_parameters_by_list(&save_size,users,users_size); + if (parameters){ + char *command_parameters = yon_char_parsed_to_string(parameters,save_size," -- "); + char *command = yon_char_unite(ubconfig_dull_command,"--target system ",command_parameters,NULL); + if (!system(yon_debug_output("%s\n",command))){} + free(command); + yon_char_parsed_free(parameters,save_size); + } + if (users)yon_char_parsed_free(users,users_size); + + users = yon_config_find_keys(USERADD_parameter_search,&users_size); + parameters = yon_config_get_save_parameters_by_list(&save_size,users,users_size); + if (parameters){ + char *command_parameters = yon_char_parsed_to_string(parameters,size," -- "); + char *command = yon_char_unite(ubconfig_dull_command,"--target system ",command_parameters,NULL); + if (!system(yon_debug_output("%s\n",command))){} + free(command); + yon_char_parsed_free(parameters,save_size); + } + if (users)yon_char_parsed_free(users,users_size); + } + return 1; +} void on_configuration_hub_selected(GtkWidget* self, main_window *widgets){ GList *list = NULL; @@ -78,18 +143,22 @@ void yon_configuration_hub_add(GtkFlowBox *target, char *name, char *icon, enum GtkIconInfo *info = gtk_icon_theme_lookup_icon_for_scale(gtk_icon_theme_get_default(),icon,54,1,GTK_ICON_LOOKUP_FORCE_SIZE); char *name_wrapped = yon_char_wrap_to_length_str(name,10); - cur_icon->MainBox = gtk_box_new(GTK_ORIENTATION_VERTICAL,5); + cur_icon->MainBox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,5); cur_icon->Label = gtk_label_new(name_wrapped); cur_icon->Image = gtk_image_new_from_pixbuf(gtk_icon_info_load_icon(info,NULL)); cur_icon->page = page; GtkWidget *flow = gtk_flow_box_child_new(); + gtk_style_context_add_class(gtk_widget_get_style_context(flow),"bggrey"); - // gtk_label_set_line_wrap(GTK_LABEL(cur_icon->Label),1); - // gtk_label_set_line_wrap_mode(GTK_LABEL(cur_icon->Label),PANGO_WRAP_WORD); + gtk_label_set_xalign(GTK_LABEL(cur_icon->Label),0); g_object_set_data(G_OBJECT(flow),"config_hub_icon",cur_icon); gtk_container_add(GTK_CONTAINER(flow),cur_icon->MainBox); gtk_box_pack_start(GTK_BOX(cur_icon->MainBox),cur_icon->Image,0,0,0); gtk_box_pack_start(GTK_BOX(cur_icon->MainBox),cur_icon->Label,0,0,0); + gtk_widget_set_margin_bottom(cur_icon->MainBox,5); + gtk_widget_set_margin_top(cur_icon->MainBox,5); + gtk_widget_set_margin_start(cur_icon->MainBox,5); + gtk_widget_set_margin_end(cur_icon->MainBox,5); gtk_flow_box_insert(target,flow,-1); gtk_widget_show_all(flow); free(name_wrapped); @@ -110,15 +179,16 @@ void yon_configuration_hub_init(main_window *widgets){ yon_flow_box_clear(GTK_FLOW_BOX(widgets->HubPackagesListBox)); yon_configuration_hub_add(GTK_FLOW_BOX(widgets->HubPackagesListBox),KERNEL_LABEL,kernel_icon_path,YON_PAGE_KERNEL); yon_configuration_hub_add(GTK_FLOW_BOX(widgets->HubPackagesListBox),KERNEL_ADDON_LABEL,kernel_icon_path,YON_PAGE_KERNEL_ADDON); - yon_configuration_hub_add(GTK_FLOW_BOX(widgets->HubPackagesListBox),SOFTWARE_LABEL,icon_path,YON_PAGE_SOFTWARE); - yon_configuration_hub_add(GTK_FLOW_BOX(widgets->HubPackagesListBox),PACMAN_SOFTWARE_LABEL,icon_path,YON_PAGE_PACMAN_SOFTWARE); - yon_configuration_hub_add(GTK_FLOW_BOX(widgets->HubPackagesListBox),KERNEL_ADDON_LABEL,icon_path,YON_PAGE_KERNEL_ADDON); - yon_configuration_hub_add(GTK_FLOW_BOX(widgets->HubPersonalListBox),REGION_ICON_LABEL,icon_path,YON_PAGE_REGION); - yon_configuration_hub_add(GTK_FLOW_BOX(widgets->HubPersonalListBox),LOCALE_LANGUAGE_LABEL,icon_path,YON_PAGE_LANGUAGE); - yon_configuration_hub_add(GTK_FLOW_BOX(widgets->HubPersonalListBox),KEYBOARD_TAB_LABEL,icon_path,YON_PAGE_KEYBOARD); - yon_configuration_hub_add(GTK_FLOW_BOX(widgets->HubSystemListBox),USERS_TAB_LABEL,icon_path,YON_PAGE_USERS); - yon_configuration_hub_add(GTK_FLOW_BOX(widgets->HubSystemListBox),STARTUP_LABEL,icon_path,YON_PAGE_STARTUP); - yon_configuration_hub_add(GTK_FLOW_BOX(widgets->HubSystemListBox),BOOTLOADER_LABEL,icon_path,YON_PAGE_BOOTLOADER); - yon_configuration_hub_add(GTK_FLOW_BOX(widgets->HubSystemListBox),NETWORK_LABEL,network_icon_path,YON_PAGE_NETWORK); + yon_configuration_hub_add(GTK_FLOW_BOX(widgets->HubPackagesListBox),SOFTWARE_LABEL,"com.ublinux.ubl-settings-update",YON_PAGE_SOFTWARE); + yon_configuration_hub_add(GTK_FLOW_BOX(widgets->HubPackagesListBox),PACMAN_SOFTWARE_LABEL,"com.ublinux.ubl-settings-repomanager",YON_PAGE_PACMAN_SOFTWARE); + yon_configuration_hub_add(GTK_FLOW_BOX(widgets->HubPackagesListBox),PACKAGES_SECTION_LABEL,"com.ublinux.ubl-settings-repomanager",YON_PAGE_PACKAGES); + // yon_configuration_hub_add(GTK_FLOW_BOX(widgets->HubPackagesListBox),KERNEL_ADDON_LABEL,icon_path,YON_PAGE_KERNEL_ADDON); + yon_configuration_hub_add(GTK_FLOW_BOX(widgets->HubPersonalListBox),REGION_ICON_LABEL,"com.ublinux.ubl-settings-system",YON_PAGE_REGION); + yon_configuration_hub_add(GTK_FLOW_BOX(widgets->HubPersonalListBox),LOCALE_LANGUAGE_LABEL,"com.ublinux.ubl-settings-system",YON_PAGE_LANGUAGE); + yon_configuration_hub_add(GTK_FLOW_BOX(widgets->HubPersonalListBox),KEYBOARD_TAB_LABEL,"com.ublinux.ubl-settings-keyboard",YON_PAGE_KEYBOARD); + yon_configuration_hub_add(GTK_FLOW_BOX(widgets->HubSystemListBox),USERS_TAB_LABEL,"com.ublinux.ubl-settings-usergroups",YON_PAGE_USERS); + yon_configuration_hub_add(GTK_FLOW_BOX(widgets->HubSystemListBox),STARTUP_LABEL,"com.ublinux.ubl-settings-info",YON_PAGE_STARTUP); + yon_configuration_hub_add(GTK_FLOW_BOX(widgets->HubSystemListBox),BOOTLOADER_LABEL,"com.ublinux.ubl-settings-bootloader",YON_PAGE_BOOTLOADER); + yon_configuration_hub_add(GTK_FLOW_BOX(widgets->HubSystemListBox),NETWORK_LABEL,"com.ublinux.ubl-settings-multiseat",YON_PAGE_NETWORK); yon_configuration_hub_resize(widgets); } \ No newline at end of file diff --git a/source/ubinstall-gtk-grub.c b/source/ubinstall-gtk-grub.c index 4b70364..0137b2e 100644 --- a/source/ubinstall-gtk-grub.c +++ b/source/ubinstall-gtk-grub.c @@ -20,17 +20,6 @@ int yon_grub_install_save(main_window *widgets){ yon_config_register(AUTOINSTALL_DEVICE,AUTOINSTALL_DEVICE_command,cur_device); yon_config_register(part_parameter,part_parameter_command,partition); yon_config_register(AUTOINSTALL_TYPE_INSTALL,AUTOINSTALL_TYPE_INSTALL_command,"grub_install"); - if (!main_config.configure_mode){ - int size; - config_str parameters = yon_config_get_save_parameters_by_key(&size,AUTOINSTALL_DEVICE,part_parameter,AUTOINSTALL_TYPE_INSTALL,NULL); - if (parameters){ - char *command_parameters = yon_char_parsed_to_string(parameters,size," -- "); - char *command = yon_char_unite(ubconfig_dull_command,"--target system ",command_parameters,NULL); - if (!system(yon_debug_output("%s\n",command))){} - free(command); - yon_char_parsed_free(parameters,size); - } - } return 1; } @@ -54,16 +43,5 @@ int yon_grub_update_save(main_window *widgets){ yon_config_register(AUTOINSTALL_DEVICE,AUTOINSTALL_DEVICE_command,cur_device); yon_config_register(part_parameter,part_parameter_command,partition); yon_config_register(AUTOINSTALL_TYPE_INSTALL,AUTOINSTALL_TYPE_INSTALL_command,"grub_update"); - if (!main_config.configure_mode){ - int size; - config_str parameters = yon_config_get_save_parameters_by_key(&size,AUTOINSTALL_DEVICE,part_parameter,AUTOINSTALL_TYPE_INSTALL,NULL); - if (parameters){ - char *command_parameters = yon_char_parsed_to_string(parameters,size," -- "); - char *command = yon_char_unite(ubconfig_dull_command,"--target system ",command_parameters,NULL); - if (!system(yon_debug_output("%s\n",command))){} - free(command); - yon_char_parsed_free(parameters,size); - } - } return 1; } \ No newline at end of file diff --git a/source/ubinstall-gtk-network.c b/source/ubinstall-gtk-network.c index 81f85f8..e57eeda 100644 --- a/source/ubinstall-gtk-network.c +++ b/source/ubinstall-gtk-network.c @@ -282,22 +282,6 @@ int yon_network_save(main_window *widgets){ } } - if (!main_config.configure_mode){ - int size, users_size, final_size, save_size; - config_str users = yon_config_find_keys(NETWORK_parameter_search,&users_size); - config_str save_parameters = yon_char_parsed_new(&size,DOMAIN_parameter,DOMAIN_admanger_parameter,NTPSERVERS_parameter,hostname_parameter,NULL); - config_str final = yon_char_parsed_merge(save_parameters,size,users,users_size,&final_size); - config_str parameters = yon_config_get_save_parameters_by_list(&save_size,final,final_size); - if (parameters){ - char *command_parameters = yon_char_parsed_to_string(parameters,save_size," -- "); - char *command = yon_char_unite(ubconfig_dull_command,"--target system ",command_parameters,NULL); - if (!system(yon_debug_output("%s\n",command))){} - free(command); - yon_char_parsed_free(parameters,save_size); - } - if (users)yon_char_parsed_free(users,users_size); - if (save_parameters)yon_char_parsed_free(save_parameters,size); - } return 1; } diff --git a/source/ubinstall-gtk-packages.c b/source/ubinstall-gtk-packages.c index 375dcb7..16f81f5 100644 --- a/source/ubinstall-gtk-packages.c +++ b/source/ubinstall-gtk-packages.c @@ -1,5 +1,28 @@ #include "ubinstall-gtk.h" +int yon_packages_tab_save(main_window *widgets){ + GtkTreeIter parentiter, subiter,packiter; + if (yon_char_is_empty(config(modules_extra_parameter))){ + yon_config_register(modules_extra_parameter,modules_extra_parameter_command,NULL); + } + for_iter(widgets->PackagesList,&parentiter){ + for (int valid2 = gtk_tree_model_iter_children(GTK_TREE_MODEL(widgets->PackagesList),&subiter,&parentiter);valid2;valid2 = gtk_tree_model_iter_next(GTK_TREE_MODEL(widgets->PackagesList),&subiter)){ + int selectable, status; + char *package; + gtk_tree_model_get(GTK_TREE_MODEL(widgets->PackagesList),&subiter,0,&status,1,&package,3,&selectable,-1); + if (selectable&&status){ + yon_config_append_element(modules_extra_parameter,package,","); + } else { + for (int valid3 = gtk_tree_model_iter_children(GTK_TREE_MODEL(widgets->PackagesList),&packiter,&subiter);valid3;valid3 = gtk_tree_model_iter_next(GTK_TREE_MODEL(widgets->PackagesList),&packiter)){ + gtk_tree_model_get(GTK_TREE_MODEL(widgets->PackagesList),&packiter,0,&status,1,&package,3,&selectable,-1); + yon_config_append_element(modules_extra_parameter,package,","); + } + } + } + } + return 1; +} + GtkTreeIter *yon_category_check(GtkTreeStore *target,char *category); GtkTreeIter *yon_category_check(GtkTreeStore *target,char *category){ GtkTreeIter iter; @@ -30,8 +53,6 @@ GtkTreeIter *yon_subcategory_check(GtkTreeStore *target, GtkTreeIter *parent_ite } void yon_packages_tab_init(main_window *widgets){ - // GHashTable *category = g_hash_table_new(g_str_hash,g_str_equal); - // GHashTable *subcategory = g_hash_table_new(g_str_hash,g_str_equal); int size; config_str packages = yon_resource_open_file(groups_list_path,&size); for (int i=1;iCancelInstallButton,0); gtk_widget_hide(widgets->BackButton); gtk_widget_hide(widgets->SourceButton); - gtk_widget_hide(widgets->SkipInstallationButton); gtk_widget_show(widgets->NextButton); if (!yon_char_is_empty(config(AUTOINSTALL_TYPE_INSTALL))){ gtk_widget_show(widgets->StartScenarioButton); @@ -121,7 +120,6 @@ void yon_navigation_buttons_set_sensetiveness(main_window *widgets){ case YON_PAGE_INSTALLATION: gtk_widget_set_sensitive(widgets->NextButton,0); gtk_widget_set_sensitive(widgets->BackButton,0); - gtk_widget_hide(widgets->SkipInstallationButton); break; case YON_PAGE_CONFIGURE_END: gtk_button_set_label(GTK_BUTTON(widgets->NextButton),SAVE_AND_EXIT_LABEL); @@ -147,23 +145,38 @@ void yon_navigation_buttons_set_sensetiveness(main_window *widgets){ } switch(page){ case YON_PAGE_KERNEL: + case YON_PAGE_SOFTWARE: case YON_PAGE_KERNEL_ADDON: case YON_PAGE_PACMAN_SOFTWARE: case YON_PAGE_REGION: case YON_PAGE_KEYBOARD: case YON_PAGE_USERS: case YON_PAGE_STARTUP: + case YON_PAGE_LANGUAGE: case YON_PAGE_BOOTLOADER: - case YON_PAGE_NETWORK: - gtk_widget_show(widgets->SkipInstallationButton); - break; - default: - gtk_widget_hide(widgets->SkipInstallationButton); + case YON_PAGE_PACKAGES: + case YON_PAGE_NETWORK:{ + gtk_widget_show(widgets->NextButton); + gtk_widget_hide(widgets->BackButton); + gtk_button_set_label(GTK_BUTTON(widgets->NextButton),BACK_LABEL); + GtkWidget *image = gtk_button_get_image(GTK_BUTTON(widgets->NextButton)); + gtk_image_set_from_icon_name(GTK_IMAGE(image),arrow_left_icon_path,GTK_ICON_SIZE_BUTTON); + } break; + case YON_PAGE_CONFIG_HUB:{ + gtk_widget_show(widgets->NextButton); + gtk_widget_show(widgets->BackButton); + gtk_button_set_label(GTK_BUTTON(widgets->NextButton),NEXT_LABEL); + GtkWidget *image = gtk_button_get_image(GTK_BUTTON(widgets->NextButton)); + gtk_image_set_from_icon_name(GTK_IMAGE(image),arrow_right_icon_path,GTK_ICON_SIZE_BUTTON); + } break; + default: break; } } int yon_page_save(main_window *widgets, enum YON_PAGES page){ switch (page){ + case YON_PAGE_CONFIG_HUB: + return yon_configuration_hub_save(widgets); case YON_PAGE_OS_COMPONENTS: return yon_os_components_save(widgets); break; @@ -200,6 +213,9 @@ int yon_page_save(main_window *widgets, enum YON_PAGES page){ case YON_PAGE_NETWORK: return yon_network_save(widgets); break; + case YON_PAGE_PACKAGES: + return yon_packages_tab_save(widgets); + break; case YON_PAGE_INSTALL_COMMON: return yon_install_common_save(widgets); break; @@ -275,7 +291,7 @@ void yon_switch_page_render(main_window *widgets){ case YON_PAGE_BOOTLOADER: case YON_PAGE_STARTUP: case YON_PAGE_NETWORK: - case YON_PAGE_PACKAGES_HUB: + case YON_PAGE_PACKAGES: page = 6; break; case YON_PAGE_INSTALLATION: @@ -388,7 +404,7 @@ void yon_page_init(main_window *widgets, enum YON_PAGES page){ case YON_PAGE_NETWORK: yon_network_init(widgets); break; - case YON_PAGE_PACKAGES_HUB: + case YON_PAGE_PACKAGES: yon_packages_tab_init(widgets); break; case YON_PAGE_INSTALL_ADVANCED: @@ -441,7 +457,6 @@ void on_page_prev_clicked(GtkWidget *, main_window *widgets){ void on_page_cancel_clicked(GtkWidget *, main_window *widgets){ gtk_widget_hide(widgets->BackButton); gtk_widget_hide(widgets->SourceButton); - gtk_widget_hide(widgets->SkipInstallationButton); gtk_widget_show(widgets->NextButton); gtk_widget_show(widgets->StartScenarioButton); gtk_widget_set_sensitive(widgets->CancelInstallButton,0); diff --git a/source/ubinstall-gtk-region.c b/source/ubinstall-gtk-region.c index 22a8af0..8b2df71 100644 --- a/source/ubinstall-gtk-region.c +++ b/source/ubinstall-gtk-region.c @@ -39,17 +39,6 @@ int yon_region_save(main_window *widgets){ } else { yon_config_remove_by_key(zone_parameter); } - if (!main_config.configure_mode){ - int size; - config_str parameters = yon_config_get_save_parameters_by_key(&size,locale_parameter,lang_parameter,zone_parameter,NULL); - if (parameters){ - char *command_parameters = yon_char_parsed_to_string(parameters,size," -- "); - char *command = yon_char_unite(ubconfig_dull_command,"--target system ",command_parameters,NULL); - if (!system(yon_debug_output("%s\n",command))){} - free(command); - yon_char_parsed_free(parameters,size); - } - } return 1; } diff --git a/source/ubinstall-gtk-startup-services.c b/source/ubinstall-gtk-startup-services.c index 45bb8db..2c5ee87 100644 --- a/source/ubinstall-gtk-startup-services.c +++ b/source/ubinstall-gtk-startup-services.c @@ -210,16 +210,5 @@ int yon_startup_save(main_window *widgets){ } else { yon_config_remove_by_key(SERVICES_ENABLE_parameter); } - if (!main_config.configure_mode){ - int size; - config_str parameters = yon_config_get_save_parameters_by_key(&size,SERVICES_ENABLE_parameter,NULL); - if (parameters){ - char *command_parameters = yon_char_parsed_to_string(parameters,size," -- "); - char *command = yon_char_unite(ubconfig_dull_command,"--target system ",command_parameters,NULL); - if (!system(yon_debug_output("%s\n",command))){} - free(command); - yon_char_parsed_free(parameters,size); - } - } return 1; } \ No newline at end of file diff --git a/source/ubinstall-gtk-users.c b/source/ubinstall-gtk-users.c index 18db20c..e399ded 100644 --- a/source/ubinstall-gtk-users.c +++ b/source/ubinstall-gtk-users.c @@ -32,22 +32,6 @@ int yon_users_save(main_window *widgets){ } } - if (!main_config.configure_mode){ - int size, users_size, final_size, save_size; - config_str users = yon_config_find_keys(USERADD_parameter_search,&users_size); - config_str save_parameters = yon_char_parsed_new(&size,root_password_parameter,autologin_parameter,NULL); - config_str final = yon_char_parsed_merge(save_parameters,size,users,users_size,&final_size); - config_str parameters = yon_config_get_save_parameters_by_list(&save_size,final,final_size); - if (parameters){ - char *command_parameters = yon_char_parsed_to_string(parameters,size," -- "); - char *command = yon_char_unite(ubconfig_dull_command,"--target system ",command_parameters,NULL); - if (!system(yon_debug_output("%s\n",command))){} - free(command); - yon_char_parsed_free(parameters,save_size); - } - if (users)yon_char_parsed_free(users,users_size); - if (save_parameters)yon_char_parsed_free(save_parameters,size); - } yon_debug_output("%s\n",yon_config_get_all_info()); return 1; } diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 584366d..0520595 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -858,7 +858,7 @@ void yon_main_window_create(main_window *widgets){ widgets->StartScenarioButton=yon_gtk_builder_get_widget(builder,"StartScenarioButton"); widgets->SourceButton=yon_gtk_builder_get_widget(builder,"SourceButton"); - widgets->SkipInstallationButton=yon_gtk_builder_get_widget(builder,"SkipInstallationButton"); + // widgets->SkipInstallationButton=yon_gtk_builder_get_widget(builder,"SkipInstallationButton"); widgets->InstallationRadio=yon_gtk_builder_get_widget(builder,"InstallationRadio"); widgets->InstallationNearRadio=yon_gtk_builder_get_widget(builder,"InstallationNearRadio"); @@ -1087,11 +1087,6 @@ void yon_main_window_create(main_window *widgets){ widgets->PackagesChosenCell = GTK_CELL_RENDERER(gtk_builder_get_object(builder,"PackagesChosenCell")); widgets->PackagesList = GTK_TREE_STORE(gtk_builder_get_object(builder,"Packages")); - widgets->AdditionalPageButton = yon_gtk_builder_get_widget(builder,"AdditionalPageButton"); - widgets->KernelComponentsPageButton = yon_gtk_builder_get_widget(builder,"KernelComponentsPageButton"); - widgets->KernelPageButton = yon_gtk_builder_get_widget(builder,"KernelPageButton"); - widgets->AdditionalPackagesPageButton = yon_gtk_builder_get_widget(builder,"AdditionalPackagesPageButton"); - widgets->HubPersonalListBox = yon_gtk_builder_get_widget(builder,"HubPersonalListBox"); widgets->HubHardwareListBox = yon_gtk_builder_get_widget(builder,"HubHardwareListBox"); widgets->HubSystemListBox = yon_gtk_builder_get_widget(builder,"HubSystemListBox"); @@ -1222,7 +1217,7 @@ void yon_main_window_create(main_window *widgets){ // g_signal_connect(G_OBJECT(widgets->AdvancedPartitionAddBox),"remove",G_CALLBACK(on_advanced_parts_removed),widgets); g_signal_connect(G_OBJECT(widgets->StartScenarioButton),"clicked",G_CALLBACK(yon_quick_install),widgets); g_signal_connect(G_OBJECT(widgets->SourceButton),"clicked",G_CALLBACK(on_source_clicked),widgets); - g_signal_connect(G_OBJECT(widgets->SkipInstallationButton),"clicked",G_CALLBACK(on_system_setup_pass),widgets); + // g_signal_connect(G_OBJECT(widgets->SkipInstallationButton),"clicked",G_CALLBACK(on_system_setup_pass),widgets); g_signal_connect(G_OBJECT(widgets->AdvancedAddButton),"clicked",G_CALLBACK(on_advanced_partition_create),widgets); g_signal_connect(G_OBJECT(widgets->AdvancedPartChosenCell),"toggled",G_CALLBACK(on_install_advanced_partition_chosen),widgets); g_signal_connect(G_OBJECT(widgets->AdvancedVirtualDeviceCombo),"changed",G_CALLBACK(on_advanced_virtual_device_changed),widgets); @@ -1230,11 +1225,6 @@ void yon_main_window_create(main_window *widgets){ g_signal_connect(G_OBJECT(widgets->PackagesTree),"row-activated",G_CALLBACK(yon_on_packages_activated),widgets); g_signal_connect(G_OBJECT(widgets->PackagesChosenCell),"toggled",G_CALLBACK(yon_on_packages_chosen),widgets); - g_signal_connect(G_OBJECT(widgets->AdditionalPageButton),"clicked",G_CALLBACK(on_additional_page_clicked),widgets); - g_signal_connect(G_OBJECT(widgets->KernelComponentsPageButton),"clicked",G_CALLBACK(on_kernel_components_page_clicked),widgets); - g_signal_connect(G_OBJECT(widgets->KernelPageButton),"clicked",G_CALLBACK(on_kernel_page_clicked),widgets); - g_signal_connect(G_OBJECT(widgets->AdditionalPackagesPageButton),"clicked",G_CALLBACK(on_additional_packages_page_clicked),widgets); - g_signal_connect(G_OBJECT(widgets->HubPersonalListBox),"child-activated",G_CALLBACK(on_configuration_hub_open),widgets); g_signal_connect(G_OBJECT(widgets->HubHardwareListBox),"child-activated",G_CALLBACK(on_configuration_hub_open),widgets); g_signal_connect(G_OBJECT(widgets->HubSystemListBox),"child-activated",G_CALLBACK(on_configuration_hub_open),widgets); diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index 19cd813..5bc67ef 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -84,6 +84,9 @@ #define slide_0_path "/com/ublinux/images/slide-0.png" +#define arrow_left_icon_path "com.ublinux.ubinstall-gtk.arrow-left-symbolic" +#define arrow_right_icon_path "com.ublinux.ubinstall-gtk.arrow-right-symbolic" + #define slide_repeat_path "/com/ublinux/images/slide-1.png", \ "/com/ublinux/images/slide-2.png", \ "/com/ublinux/images/slide-3.png", \ @@ -100,6 +103,7 @@ NULL #define get_modules_command "pacman --color never -Qs ^ubm- | sed -Enr -e 'N;s/\\n/ ;/' -e \"s/^([^\\/]+)\\/([^[:blank:]]+)[[:blank:]]+([^[:blank:]]+)[[:blank:]]+(\\(([^\\)]+)\\)[^\\;]+|[^\\;]*);[[:blank:]]*(.*)/\\2;\\3;\\5;\\6/p\"" +#define get_available_modules_command "pacman --color never -Ss ^ubm- | sed -Enr -e 'N;s/\\n/ ;/' -e \"s/^([^\\/]+)\\/([^[:blank:]]+)[[:blank:]]+([^[:blank:]]+)[[:blank:]]+(\\(([^\\)]+)\\)[^\\;]+|[^\\;]*);[[:blank:]]*(.*)/\\2;\\3;\\5;\\6/p\"" #define get_local_module_info_command(target) yon_char_unite("pacman --color never -Sp $(pacman -Ssq '",target,"') --print-format '%n;%v;%d' | grep -v \"^::\"",NULL); @@ -369,7 +373,7 @@ enum YON_PAGES { YON_PAGE_STARTUP, YON_PAGE_BOOTLOADER, YON_PAGE_NETWORK, - YON_PAGE_PACKAGES_HUB, + YON_PAGE_PACKAGES, YON_PAGE_INSTALLATION, YON_PAGE_COMPLETION, YON_PAGE_COMPLETED, @@ -463,7 +467,7 @@ typedef struct { GtkWidget *StartScenarioButton; GtkWidget *SourceButton; - GtkWidget *SkipInstallationButton; + // GtkWidget *SkipInstallationButton; GtkWidget *MainSpinner; GtkWidget *StatusBox; @@ -733,11 +737,6 @@ typedef struct { GtkCellRenderer *PackagesChosenCell; GtkWidget *PackagesTree; - GtkWidget *AdditionalPageButton; - GtkWidget *KernelComponentsPageButton; - GtkWidget *KernelPageButton; - GtkWidget *AdditionalPackagesPageButton; - // Configuration hub slide section GtkWidget *HubPersonalListBox; GtkWidget *HubHardwareListBox; @@ -1379,4 +1378,7 @@ void yon_flow_box_clear(GtkFlowBox *target); void yon_configuration_hub_section_get_max_size(GtkFlowBox *target, int *ret_width, int *ret_height); void yon_configuration_hub_section_set_max_size(GtkFlowBox *target, int width, int height); void yon_configuration_hub_resize(main_window *widgets); -void on_configuration_hub_selected(GtkWidget* self, main_window *widgets); \ No newline at end of file +void on_configuration_hub_selected(GtkWidget* self, main_window *widgets); +gboolean yon_software_insert(struct row_data *row_input); +int yon_configuration_hub_save(main_window *widgets); +int yon_packages_tab_save(main_window *widgets); \ No newline at end of file diff --git a/ubinstall-gtk-slider.glade b/ubinstall-gtk-slider.glade new file mode 100644 index 0000000..c3ed4e2 --- /dev/null +++ b/ubinstall-gtk-slider.glade @@ -0,0 +1,34 @@ + + + + + + True + False + 0 + in + + + True + False + 5 + 5 + 5 + 5 + + + True + False + label + True + 0 + 0 + + + + + + + + + diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index 71603f6..6056544 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -374,11 +374,6 @@ False com.ublinux.libublsettingsui-gtk3.flag-symbolic - - True - False - com.ublinux.libublsettingsui-gtk3.flag-finish-symbolic - True False @@ -419,11 +414,6 @@ False com.ublinux.libublsettingsui-gtk3.properties-symbolic - - True - False - document-edit-symbolic - True False @@ -2052,194 +2042,216 @@ agreement - + True - False - vertical - 5 - - - True - False - vertical - 5 - - - True - False - Personal - 0 - - - - - - - False - True - 0 - - - - - True - False - True - 150 - False - - - False - True - 1 - - - - - False - True - 0 - - - - - True - False - vertical - 5 - - - True - False - Hardware - 0 - - - - - - - False - True - 0 - - - - - True - False - True - 150 - False - - - False - True - 1 - - - - - False - True - 1 - - - - - True - False - vertical - 5 - - - True - False - System - 0 - - - - - - - False - True - 0 - - - - - True - False - True - 150 - False - - - False - True - 1 - - - - - False - True - 2 - - + True + never - + True False - vertical - 5 - - - True - False - Packages - 0 - - - - - - - False - True - 0 - - + none - + True False - True - 150 - False + vertical + 5 + + + True + False + vertical + 5 + + + True + False + Personal + 0 + + + + + + + False + True + 0 + + + + + True + False + True + 5 + 5 + 150 + False + + + False + True + 1 + + + + + False + True + 0 + + + + + True + False + vertical + 5 + + + True + False + Hardware + 0 + + + + + + + False + True + 0 + + + + + True + False + True + 5 + 5 + 150 + False + + + False + True + 1 + + + + + False + True + 1 + + + + + True + False + vertical + 5 + + + True + False + System + 0 + + + + + + + False + True + 0 + + + + + True + False + True + 5 + 5 + 150 + False + + + False + True + 1 + + + + + False + True + 2 + + + + + True + False + vertical + 5 + + + True + False + Packages + 0 + + + + + + + False + True + 0 + + + + + True + False + True + 5 + 5 + 150 + False + + + False + True + 1 + + + + + False + True + 3 + + - - False - True - 1 - - - False - True - 3 - @@ -3664,113 +3676,18 @@ agreement False True - 0 - - - - - True - False - - - False - True - 1 - - - - - True - False - 5 - - - True - False - Available languages in the system: - - - False - True - 0 - - - - - True - False - English, U.S.A.; Russian, Russia - - - True - True - 2 - - - - - True - True - True - image6 - - - - False - True - 3 - - - - - False - True - 2 - - - - - True - False - 5 - - - True - False - Language: - - - False - True - 0 - - - - - True - True - LanguagesFilter - 2 - - - - 1 - - - - - True - True - 2 - - + 0 + + + + + True + False False True - 3 + 1 @@ -6185,299 +6102,79 @@ agreement - - - - - True - True - 0 - - - - - + - True - True - True - - - - False - True - end - 1 - - - - - - - - - True - False - Net interfaces - - - - - True - True - 3 - - - - - False - True - 3 - - - - - 16 - - - - - True - False - Network - - - 16 - False - - - - - True - False - vertical - 5 - - - True - False - vertical - 5 - - - True - False - 10 - 10 - 10 - 10 - 5 - - - True - False - 48 - com.ublinux.ubinstall-gtk - 0 - - - False - True - 0 - - - - - True - False - vertical - - - True - False - Choose system kernel - True - 0 - - - - - - - - - False - True - 0 - - - - - True - False - This program will ask you few questions and help you install system on your computer - center - True - 0 - - - - - - False - True - 1 - - - - - True - True - 1 - - - - - False - True - 0 - - - - - True - False - - - False - True - 2 - - - - - False - True - 0 - - - - - True - False - vertical - 5 - - - True - False - 5 - 5 - 5 - 5 - 5 - - - True - False - Selecting additional installation components - - - False - True - 0 - - - - - Go to - True - True - True - - - False - True - end - 1 - - - - - False - True - 0 - - - - - - False - True - 1 - - - - - True - False - vertical - 5 - - - True - False - 5 - 5 - 5 - 5 - 5 - - - True - False - Selecting additional components for the system kernel + + + + + True + True + 0 + + + + + + + True + True + True + + + + False + True + end + 1 + + + + - - False - True - 0 - - - - Go to + + True - True - True + False + Net interfaces - - False - True - end - 1 - - False + True True - 0 + 3 - False True - 2 + 3 + + + 16 + + + + + True + False + Network + + + 16 + False + + + + + True + False + vertical + 5 True @@ -6488,16 +6185,18 @@ agreement True False - 5 - 5 - 5 - 5 + 10 + 10 + 10 + 10 5 - + True False - Selecting the system kernel + 48 + com.ublinux.ubinstall-gtk + 0 False @@ -6506,16 +6205,52 @@ agreement - - Go to + True - True - True + False + vertical + + + True + False + Additional system components + True + 0 + + + + + + + + + False + True + 0 + + + + + True + False + Configuring the installation of additional components + center + True + 0 + + + + + + False + True + 1 + + - False + True True - end 1 @@ -6526,72 +6261,22 @@ agreement 0 - - - - False - True - 3 - - - - - True - False - vertical - 5 - + True False - 5 - 5 - 5 - 5 - 5 - - - True - False - Selecting additional components from packages - - - False - True - 0 - - - - - Go to - True - True - True - - - False - True - end - 1 - - False True - 0 + 2 - False True - 4 + 0 @@ -6694,7 +6379,7 @@ agreement True False - Choose system kernel + Installation True 0 @@ -6761,15 +6446,66 @@ agreement - + True False - Installation - - - - - + vertical + 5 + + + True + False + 5 + + + True + False + + + + + + True + True + 0 + + + + + True + False + + + + + + True + True + 1 + + + + + False + True + 0 + + + + + True + False + 5 + + + + + + False + True + 1 + + False @@ -6777,17 +6513,6 @@ agreement 1 - - - True - False - - - False - True - 2 - - 18 @@ -13497,20 +13222,6 @@ separately into the selected partition. 1 - - - Skip configuration - True - True - image28 - - - False - True - end - 2 - - False -- 2.35.1 From 601d3880fa1fc9b43839e084603a2bf05e2e8ed8 Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Fri, 19 Dec 2025 16:11:43 +0000 Subject: [PATCH 4/5] Installation sliders rework --- gresource.xml | 1 + source/CMakeLists.txt | 1 + source/ubinstall-gtk-config-hub.c | 8 +- source/ubinstall-gtk-decorations.c | 154 ++++++++++++++++++++++++++--- source/ubinstall-gtk-page-switch.c | 1 + source/ubinstall-gtk.c | 17 +++- source/ubinstall-gtk.h | 35 ++++++- source/ubl-strings.h | 111 ++++++++++++++++++++- ubinstall-gtk-slider.glade | 68 +++++++++++-- ubinstall-gtk.css | 11 ++- ubinstall-gtk.glade | 71 +++++++++---- 11 files changed, 428 insertions(+), 50 deletions(-) diff --git a/gresource.xml b/gresource.xml index 758b5dc..e0b8ff0 100644 --- a/gresource.xml +++ b/gresource.xml @@ -21,6 +21,7 @@ ubinstall-gtk-source-element.glade ubinstall-gtk-layouts.glade ubinstall-gtk-keyboard-layouts.glade + ubinstall-gtk-slider.glade ubinstall-gtk.css diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 8065fc9..6ade559 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -74,6 +74,7 @@ set(DEPENDFILES ../ubinstall-gtk-source-element.glade ../ubinstall-gtk-layouts.glade ../ubinstall-gtk-keyboard-layouts.glade + ../ubinstall-gtk-slider.glade ../gresource.xml ../ubinstall-gtk.css ../modules.csv diff --git a/source/ubinstall-gtk-config-hub.c b/source/ubinstall-gtk-config-hub.c index 5830fc3..cfce52a 100644 --- a/source/ubinstall-gtk-config-hub.c +++ b/source/ubinstall-gtk-config-hub.c @@ -155,10 +155,10 @@ void yon_configuration_hub_add(GtkFlowBox *target, char *name, char *icon, enum gtk_container_add(GTK_CONTAINER(flow),cur_icon->MainBox); gtk_box_pack_start(GTK_BOX(cur_icon->MainBox),cur_icon->Image,0,0,0); gtk_box_pack_start(GTK_BOX(cur_icon->MainBox),cur_icon->Label,0,0,0); - gtk_widget_set_margin_bottom(cur_icon->MainBox,5); - gtk_widget_set_margin_top(cur_icon->MainBox,5); - gtk_widget_set_margin_start(cur_icon->MainBox,5); - gtk_widget_set_margin_end(cur_icon->MainBox,5); + gtk_widget_set_margin_bottom(cur_icon->MainBox,10); + gtk_widget_set_margin_top(cur_icon->MainBox,10); + gtk_widget_set_margin_start(cur_icon->MainBox,10); + gtk_widget_set_margin_end(cur_icon->MainBox,10); gtk_flow_box_insert(target,flow,-1); gtk_widget_show_all(flow); free(name_wrapped); diff --git a/source/ubinstall-gtk-decorations.c b/source/ubinstall-gtk-decorations.c index 19e4060..c8d9203 100644 --- a/source/ubinstall-gtk-decorations.c +++ b/source/ubinstall-gtk-decorations.c @@ -102,21 +102,143 @@ // return 1; // } -gboolean on_image_slide(void *data){ - main_window *widgets = (main_window*)data; - int size; - config_str target = yon_char_parsed_new(&size,slide_repeat_path); - if (size) - yon_char_parsed_free(target,size); - gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->SlidesImage),(GdkPixbuf*)g_list_nth_data(widgets->slides_original,main_config.cur_slide)); - // gtk_widget_queue_draw(widgets->SlidesImage); - if ((int)main_config.cur_slideNextInstallationSliderImage); + gtk_widget_show(widgets->PrevInstallationSliderImage); + return 0; +} + +gboolean on_install_slider_hover_highlight_end(GtkWidget *, GdkEvent *, main_window *widgets){ + gtk_widget_hide(widgets->NextInstallationSliderImage); + gtk_widget_hide(widgets->PrevInstallationSliderImage); + return 0; +} + + +void on_install_slider_next(GtkWidget* ,GdkEventButton *,main_window *widgets){ + main_config.chosen_slide=main_config.chosen_slide->next?main_config.chosen_slide->next:g_list_first(main_config.chosen_slide); + yon_install_slider_update(widgets); +} + +void on_install_slider_prev(GtkWidget* ,GdkEventButton *,main_window *widgets){ + main_config.chosen_slide=main_config.chosen_slide->prev?main_config.chosen_slide->prev:g_list_last(main_config.chosen_slide); + yon_install_slider_update(widgets); +} + +void yon_install_slider_update(main_window *widgets){ + slider_object *cur_slider = (slider_object*)main_config.chosen_slide->data; + slider_object *next_slider = main_config.chosen_slide->next?((slider_object*)main_config.chosen_slide->next->data):(slider_object*)(g_list_first(main_config.chosen_slide)->data); + GtkWidget *prevleft = gtk_bin_get_child(GTK_BIN(widgets->ScrollLeftEventBox)); + GtkWidget *prevright = gtk_bin_get_child(GTK_BIN(widgets->ScrollRightEventBox)); + if (cur_slider->MainBox==prevleft) return; + if (prevleft&&prevright) { + g_object_ref(G_OBJECT(prevleft)); + g_object_ref(G_OBJECT(prevright)); + gtk_container_remove(GTK_CONTAINER(widgets->ScrollLeftEventBox),prevleft); + gtk_container_remove(GTK_CONTAINER(widgets->ScrollRightEventBox),prevright); + } + gtk_container_add(GTK_CONTAINER(widgets->ScrollLeftEventBox),cur_slider->MainBox); + gtk_container_add(GTK_CONTAINER(widgets->ScrollRightEventBox),next_slider->MainBox); + gtk_container_check_resize(GTK_CONTAINER(widgets->ScrollLeftEventBox)); + gtk_container_check_resize(GTK_CONTAINER(widgets->ScrollRightEventBox)); + GList *dots = gtk_container_get_children(GTK_CONTAINER(widgets->SliderProgressBox)); + GList *iter; + for (iter=dots;iter;iter=iter->next){ + gtk_widget_destroy(GTK_WIDGET(iter->data)); + } + for (iter=main_config.slides;iter;iter=iter->next){ + GtkWidget *Image = NULL; + int chosen = iter==main_config.chosen_slide||(main_config.chosen_slide->next&&iter==main_config.chosen_slide->next)||(!main_config.chosen_slide->next&&iter==g_list_first(main_config.chosen_slide)); + if (chosen){ + GtkIconInfo *info = gtk_icon_theme_lookup_icon_for_scale(gtk_icon_theme_get_default(),toggled_icon_path,8,1,GTK_ICON_LOOKUP_FORCE_SIZE); + Image = gtk_image_new_from_pixbuf(gtk_icon_info_load_icon(info,NULL)); + } else { + GtkIconInfo *info = gtk_icon_theme_lookup_icon_for_scale(gtk_icon_theme_get_default(),untoggled_icon_path,8,1,GTK_ICON_LOOKUP_FORCE_SIZE); + Image = gtk_image_new_from_pixbuf(gtk_icon_info_load_icon(info,NULL)); + } + gtk_box_pack_start(GTK_BOX(widgets->SliderProgressBox),Image,0,0,0); + gtk_widget_show(Image); } } + +slider_object *yon_slider_object_new(){ + slider_object *slider = malloc(sizeof(slider_object)); + memset(slider,0,sizeof(slider_object)); + GtkBuilder *builder = gtk_builder_new_from_resource(glade_path_slider); + + slider->MainBox = yon_gtk_builder_get_widget(builder,"MainBox"); + slider->TitleImage = yon_gtk_builder_get_widget(builder,"TitleImage"); + slider->TitleLabel = yon_gtk_builder_get_widget(builder,"TitleLabel"); + slider->TextLabel = yon_gtk_builder_get_widget(builder,"TextLabel"); + g_object_set_data(G_OBJECT(slider->MainBox),"slider_object",slider); + return slider; +} + +void yon_slider_setup(slider_object *slider, char *title, char *icon, char *text_markup){ + gtk_label_set_text(GTK_LABEL(slider->TitleLabel),title); + gtk_label_set_markup(GTK_LABEL(slider->TextLabel),text_markup); + gtk_image_set_from_icon_name(GTK_IMAGE(slider->TitleImage),icon,GTK_ICON_SIZE_DND); +} + +slider_object *yon_slider_new_full(char *title, char *icon, char *text_markup){ + slider_object *slider = yon_slider_object_new(); + yon_slider_setup(slider,title,icon,text_markup); + return slider; +} + +void yon_install_slider_init(main_window *widgets){ + if (main_config.slides) return; + slider_object *slider1 = yon_slider_new_full(slide_1_title, icon_path,slide_1_text); + slider_object *slider2 = yon_slider_new_full(slide_2_title, icon_path,slide_2_text); + slider_object *slider3 = yon_slider_new_full(slide_3_title, icon_path,slide_3_text); + slider_object *slider4 = yon_slider_new_full(slide_4_title, icon_path,slide_4_text); + slider_object *slider5 = yon_slider_new_full(slide_5_title, icon_path,slide_5_text); + slider_object *slider6 = yon_slider_new_full(slide_6_title, icon_path,slide_6_text); + slider_object *slider7 = yon_slider_new_full(slide_7_title, icon_path,slide_7_text); + slider_object *slider8 = yon_slider_new_full(slide_8_title, icon_path,slide_8_text); + slider_object *slider9 = yon_slider_new_full(slide_9_title, icon_path,slide_9_text); + slider_object *slider10 = yon_slider_new_full(slide_10_title, icon_path,slide_10_text); + slider_object *slider11 = yon_slider_new_full(slide_11_title, icon_path,slide_11_text); + slider_object *slider12 = yon_slider_new_full(slide_12_title, icon_path,slide_12_text); + slider_object *slider13 = yon_slider_new_full(slide_13_title, icon_path,slide_13_text); + slider_object *slider14 = yon_slider_new_full(slide_14_title, icon_path,slide_14_text); + slider_object *slider15 = yon_slider_new_full(slide_15_title, icon_path,slide_15_text); + slider_object *slider16 = yon_slider_new_full(slide_16_title, icon_path,slide_16_text); + slider_object *slider17 = yon_slider_new_full(slide_17_title, icon_path,slide_17_text); + slider_object *slider18 = yon_slider_new_full(slide_18_title, icon_path,slide_18_text); + slider_object *slider19 = yon_slider_new_full(slide_19_title, icon_path,slide_19_text); + slider_object *slider20 = yon_slider_new_full(slide_20_title, icon_path,slide_20_text); + slider_object *slider21 = yon_slider_new_full(slide_21_title, icon_path,slide_21_text); + slider_object *slider22 = yon_slider_new_full(slide_22_title, icon_path,slide_22_text); + main_config.slides = g_list_prepend(main_config.slides,slider22); + main_config.slides = g_list_prepend(main_config.slides,slider21); + main_config.slides = g_list_prepend(main_config.slides,slider20); + main_config.slides = g_list_prepend(main_config.slides,slider19); + main_config.slides = g_list_prepend(main_config.slides,slider18); + main_config.slides = g_list_prepend(main_config.slides,slider17); + main_config.slides = g_list_prepend(main_config.slides,slider16); + main_config.slides = g_list_prepend(main_config.slides,slider15); + main_config.slides = g_list_prepend(main_config.slides,slider14); + main_config.slides = g_list_prepend(main_config.slides,slider13); + main_config.slides = g_list_prepend(main_config.slides,slider12); + main_config.slides = g_list_prepend(main_config.slides,slider11); + main_config.slides = g_list_prepend(main_config.slides,slider10); + main_config.slides = g_list_prepend(main_config.slides,slider9); + main_config.slides = g_list_prepend(main_config.slides,slider8); + main_config.slides = g_list_prepend(main_config.slides,slider7); + main_config.slides = g_list_prepend(main_config.slides,slider6); + main_config.slides = g_list_prepend(main_config.slides,slider5); + main_config.slides = g_list_prepend(main_config.slides,slider4); + main_config.slides = g_list_prepend(main_config.slides,slider3); + main_config.slides = g_list_prepend(main_config.slides,slider2); + main_config.slides = g_list_prepend(main_config.slides,slider1); + main_config.slides = g_list_reverse(main_config.slides); + main_config.chosen_slide = g_list_first(main_config.slides); + yon_install_slider_update(widgets); + gtk_overlay_add_overlay(GTK_OVERLAY(widgets->InstallationSliderArrowsOverlay),widgets->NextInstallationSliderImage); + gtk_overlay_add_overlay(GTK_OVERLAY(widgets->InstallationSliderArrowsOverlay),widgets->PrevInstallationSliderImage); +} + +// void *on_install_slider_slide(){ + +// } diff --git a/source/ubinstall-gtk-page-switch.c b/source/ubinstall-gtk-page-switch.c index 5a74103..ad46e39 100644 --- a/source/ubinstall-gtk-page-switch.c +++ b/source/ubinstall-gtk-page-switch.c @@ -421,6 +421,7 @@ void yon_page_init(main_window *widgets, enum YON_PAGES page){ yon_install_init(widgets,page); break; case YON_PAGE_INSTALLATION: + yon_install_slider_init(widgets); main_config.save_configured=1; g_mutex_lock(&main_config.install_mutex); if (main_config.install_complete){ diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 0520595..ec5fa5b 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -558,7 +558,9 @@ void config_init(){ main_config.dry_run=0; main_config.force_ini=NULL; main_config.network_types = g_hash_table_new(g_str_hash,g_str_equal); - main_config.cur_slide=0; + + main_config.slides = NULL; + main_config.chosen_slide = NULL; main_config.languages = g_hash_table_new(g_str_hash,g_str_equal); int size; @@ -1092,6 +1094,13 @@ void yon_main_window_create(main_window *widgets){ widgets->HubSystemListBox = yon_gtk_builder_get_widget(builder,"HubSystemListBox"); widgets->HubPackagesListBox = yon_gtk_builder_get_widget(builder,"HubPackagesListBox"); + widgets->ScrollLeftEventBox = yon_gtk_builder_get_widget(builder,"ScrollLeftEventBox"); + widgets->ScrollRightEventBox = yon_gtk_builder_get_widget(builder,"ScrollRightEventBox"); + widgets->SliderProgressBox = yon_gtk_builder_get_widget(builder,"SliderProgressBox"); + widgets->InstallationSliderArrowsOverlay = yon_gtk_builder_get_widget(builder,"InstallationSliderArrowsOverlay"); + widgets->NextInstallationSliderImage = yon_gtk_builder_get_widget(builder,"NextInstallationSliderImage"); + widgets->PrevInstallationSliderImage = yon_gtk_builder_get_widget(builder,"PrevInstallationSliderImage"); + widgets->network_connections = NULL; widgets->pacmanchosen = g_hash_table_new_full(g_str_hash,g_str_equal,free,NULL); @@ -1234,6 +1243,12 @@ void yon_main_window_create(main_window *widgets){ g_signal_connect(G_OBJECT(widgets->HubSystemListBox),"selected-children-changed",G_CALLBACK(on_configuration_hub_selected),widgets); g_signal_connect(G_OBJECT(widgets->HubPackagesListBox),"selected-children-changed",G_CALLBACK(on_configuration_hub_selected),widgets); + g_signal_connect(G_OBJECT(widgets->ScrollLeftEventBox),"button-release-event",G_CALLBACK(on_install_slider_prev),widgets); + g_signal_connect(G_OBJECT(widgets->ScrollRightEventBox),"button-release-event",G_CALLBACK(on_install_slider_next),widgets); + g_signal_connect(G_OBJECT(widgets->ScrollLeftEventBox),"enter-notify-event",G_CALLBACK(on_install_slider_hover_highlight),widgets); + g_signal_connect(G_OBJECT(widgets->ScrollRightEventBox),"enter-notify-event",G_CALLBACK(on_install_slider_hover_highlight),widgets); + g_signal_connect(G_OBJECT(widgets->ScrollLeftEventBox),"leave-notify-event",G_CALLBACK(on_install_slider_hover_highlight_end),widgets); + g_signal_connect(G_OBJECT(widgets->ScrollRightEventBox),"leave-notify-event",G_CALLBACK(on_install_slider_hover_highlight_end),widgets); g_signal_connect(G_OBJECT(widgets->AboutMenuItem),"activate",G_CALLBACK(on_about),widgets); g_signal_connect(G_OBJECT(widgets->DocumentationMenuItem),"activate",G_CALLBACK(on_open_documentation_confirmation),WIKI_LINK); diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index 5bc67ef..7da7022 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -40,11 +40,14 @@ #define glade_path_source_element "/com/ublinux/ui/ubinstall-gtk-source-element.glade" #define glade_locales_path "/com/ublinux/ui/ubinstall-gtk-layouts.glade" #define glade_layouts_path "/com/ublinux/ui/ubinstall-gtk-keyboard-layouts.glade" +#define glade_path_slider "/com/ublinux/ui/ubinstall-gtk-slider.glade" #define CssPath "/com/ublinux/css/ubinstall-gtk.css" #define config_path yon_char_unite(yon_ubl_user_get_home_directory(),"/.config/",LocaleName,"/",LocaleName,".conf",NULL) #define icon_path "com.ublinux.ubinstall-gtk" #define kernel_icon_path "com.ublinux.ubl-settings-kernel" +#define untoggled_icon_path "com.ublinux.libublsettingsui-gtk3.untoggled-symbolic" +#define toggled_icon_path "com.ublinux.libublsettingsui-gtk3.toggled-symbolic" #define LocalePath "/usr/share/locale" #define LocaleName "ubinstall-gtk" @@ -422,7 +425,7 @@ typedef struct { GHashTable *network_types; GtkWidget *kernel_unchosen_radio; - unsigned int cur_slide; + // unsigned int cur_slide; gboolean dry_run; GtkTreeStore *layouts_store; @@ -432,6 +435,9 @@ typedef struct { int variants_size; config_str layouts_list; int layouts_size; + + GList *slides; + GList *chosen_slide; } config; extern config main_config; @@ -733,6 +739,13 @@ typedef struct { dictionary *advanced_sections; GSequence *advanced_partition_order; + GtkWidget *ScrollLeftEventBox; + GtkWidget *ScrollRightEventBox; + GtkWidget *SliderProgressBox; + GtkWidget *InstallationSliderArrowsOverlay; + GtkWidget *PrevInstallationSliderImage; + GtkWidget *NextInstallationSliderImage; + GtkTreeStore *PackagesList; GtkCellRenderer *PackagesChosenCell; GtkWidget *PackagesTree; @@ -1093,6 +1106,13 @@ typedef struct { enum YON_PAGES page; } config_hub_icon; +typedef struct { + GtkWidget *MainBox; + GtkWidget *TitleImage; + GtkWidget *TitleLabel; + GtkWidget *TextLabel; +}slider_object; + void config_init(); main_window *yon_main_window_complete(); ubinstall_language_window *yon_ubinstall_language_new(); @@ -1147,7 +1167,18 @@ void on_page_changed(GtkWidget *,GtkWidget *,int page, main_window *widgets); void yon_installation_progress_update(GFileMonitor *,GFile *,GFile *,GFileMonitorEvent ,main_window *widgets); void *on_config_save(void *data); void *on_setup_system_configuration(void * data); -gboolean on_image_slide(void *data); +void yon_install_slider_init(main_window *widgets); +void on_install_slider_next(GtkWidget* ,GdkEventButton *,main_window *widgets); +void on_install_slider_prev(GtkWidget* ,GdkEventButton *,main_window *widgets); +void yon_install_slider_update(main_window *widgets); +slider_object *yon_slider_object_new(); +void yon_slider_setup(slider_object *slider, char *title, char *icon, char *text_markup); +slider_object *yon_slider_new_full(char *title, char *icon, char *text_markup); +gboolean on_install_slider_hover_highlight(GtkWidget *self, GdkEvent *, main_window *); +gboolean on_install_slider_hover_highlight(GtkWidget *self, GdkEvent *, main_window *); +gboolean on_install_slider_hover_highlight_end(GtkWidget *self, GdkEvent *, main_window *); +gboolean on_install_slider_hover_highlight_end(GtkWidget *self, GdkEvent *, main_window *); +// gboolean on_image_slide(void *data); // void on_region_resized(GtkWidget *,main_window *widgets); // int yon_image_resize_from_container(GtkImage *target, GdkPixbuf *pixbuf_unscaled); void on_configuration_mode_switch(GtkWidget *self,main_window *widgets); diff --git a/source/ubl-strings.h b/source/ubl-strings.h index 52bf414..db48096 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -391,4 +391,113 @@ NULL) // #define _LABEL _("Recovery section") // #define _LABEL _("Start installation scenario") // #define _LABEL _("Source") -// #define _LABEL _("Skip configuration") \ No newline at end of file +// #define _LABEL _("Skip configuration") + +#define slide_1_title _("Product ecosystem") +#define slide_1_text _("Developed by a team of professionals and successfully presented on the market.\n\ +Includes:\n\ +- modern versions of the Linux kernel,\n\ +- wide range of software,\n\ +- IT infrastructure management system,\n\ +- virtualization system") + +#define slide_2_title _("System Usage") +#define slide_2_text _("It has been successfully used in both government agencies and commercial companies of various sizes.") + +#define slide_3_title _("System Editions") +#define slide_3_text _("- UBLinux Desktop Enterprise for workstations (PCs, laptops, thin clients, dashboards, including interactive touchscreens, industrial computers, and hardware and software systems),\n\ +- UBLinux Server for server hardware and storage systems,\n\ +- UBLinux Network for network equipment,\n\ +- UBLinux Education for educational institutions,\n\ +- UBLinux Desktop Basic for personal (home) use") + +#define slide_4_title _("Device Support") +#define slide_4_text _("A wide range of devices is supported: printing equipment, scanners, webcams, etc.\n\ +\n\ +Support for multitouch input systems with detection of up to 20 simultaneous touch points") + +#define slide_5_title _("Modular secure architecture") +#define slide_5_text _("- each OS component is represented by a separate module with signature and integrity control\n\ +- connecting and disconnecting modules does not require stopping the system\n\ +- allows flexible adaptation of the system to the customer's workflows\n\ +- ensures high performance") + +#define slide_6_title _("Flexible Adaptation") +#define slide_6_text _("By changing the system's modules, its capabilities are tailored to the needs of each user.\n\ +\n\ +From a minimal configuration (a thin client that only allows remote connection to the server) to a configuration that includes the full range of system capabilities.") + +#define slide_7_title _("Domain architecture support") +#define slide_7_text _("A UBLinux-based domain controller allows you to:\n\ +- use group policies,\n\ +- centralized software deployment across your fleet,\n\ +- organize network resources and provide flexible access to them\n\ +\n\ +Allows you to integrate your workstation with Microsoft Active Directory, FreeIPA, and Samba DC, applying the necessary domain settings to your workstation.") + +#define slide_8_title _("Native compatibility with Windows applications") +#define slide_8_text _("Using Wine or the Winix integration module, you can launch and work with most Windows applications.") + +#define slide_9_title _("High level of optimization") +#define slide_9_text _("The system is lightweight. This allows for comfortable operation when booting from USB drives, on diskless workstations, and on thin clients. It also allows for the use of workstations with low performance.") + +#define slide_10_title _("Intuitive interface") +#define slide_10_text _("Support for XFCE, KDE Plasma, GNOME, MATE, LXQt, and other graphical environments allows you to choose and flexibly customize the most convenient desktop environment.\n\ +\n\ +This allows users to easily get started with the system, including when switching from Windows.") + +#define slide_11_title _("Multi-workstation (multi-seat)") +#define slide_11_text _("The ability for multiple users to work simultaneously at a single workstation.\n\ +\n\ +Each user has a separate profile (desktop), monitor, and keyboard/mouse. This can be implemented using the built-in video outputs without the need for a separate graphics card.") + +#define slide_12_title _("Application Software") +#define slide_12_text _("The system comes with a comprehensive set of software out of the box to solve most common problems.\n\ +\n\ +The graphical package manager allows for quick and intuitive installation of additional software and hardware drivers.") + +#define slide_13_title _("Corporate Services") +#define slide_13_text _("The system allows you to deploy and manage or connect to a variety of centralized corporate services: email, group chats, video conferencing, collaboration systems, etc.") + +#define slide_14_title _("Security and Resiliency, Sandbox Mode") +#define slide_14_text _("A robust application package management system and built-in information security mechanisms ensure a high level of security and resiliency for the workstation.\n\ +\n\ +Sandbox modes protect the workstation from failures and incorrect operations. Upon reboot, the system will return to its default state.") + +#define slide_15_title _("Custom repositories") +#define slide_15_text _("- repositories are developed and maintained by the system developer,\n\ +- hosted within the Russian Federation,\n\ +- contain the most popular and modern software tools\n\ +\n\ +The creation of service repositories is also supported, which users can create and adapt to their needs.") + +#define slide_16_title _("Quick deployment") +#define slide_16_text _("- System installation on modern hardware takes 3-5 minutes.\n\ +- Ability to install the system over a network\n\ +- Ability to create a custom ISO image from one of the configured workstations, including the necessary settings and a pre-installed set of required application software.") + +#define slide_17_title _("Modular graphical administration interface") +#define slide_17_text _("- A graphical administration interface that includes a comprehensive set of system utilities for system configuration\n\ +- Web-based tools for administering local and remote workstations") + +#define slide_18_title _("UBPile Infrastructure Monitoring and Management System") +#define slide_18_text _("Includes automation and orchestration mechanisms for comprehensive information infrastructure management.\n\ +\n\ +Used to automate deployment and configuration of workstations and servers, as well as manage computing equipment.") + +#define slide_19_title _("UBLinux Server virtualization tools") +#define slide_19_text _("The server and workstation virtualization system enables efficient deployment and management of virtual IT infrastructure in data centers.\n\ +\n\ +- Supports Microsoft Windows, GNU/Linux, and FreeBSD guest operating systems\n\ +- Backup, data protection, and VDI mechanisms.") + +#define slide_20_title _("Professional technical support") +#define slide_20_text _("You can choose the most appropriate level of system support for your situation.\n\ +\n\ +For more information, visit our website ublinux.ru in the \"Support Levels\" section.") + +#define slide_21_title _("Interactive Knowledge Base") +#define slide_21_text _("Continuously evolving and clearly describes the installation and configuration of the system, as well as the use of its features. Located at wiki.ublinux.ru") + +#define slide_22_title _("Network Boot") +#define slide_22_text _("Allows system booting for diskless and standard workstations over a local network or the Internet (even over slow connection channels).") \ No newline at end of file diff --git a/ubinstall-gtk-slider.glade b/ubinstall-gtk-slider.glade index c3ed4e2..b4960e0 100644 --- a/ubinstall-gtk-slider.glade +++ b/ubinstall-gtk-slider.glade @@ -2,7 +2,8 @@ - + + 350 True False 0 @@ -16,13 +17,68 @@ 5 5 - + True False - label - True - 0 - 0 + vertical + 5 + + + True + False + 5 + + + True + False + start + gtk-missing-image + 5 + + + False + True + 0 + + + + + True + False + True + 0 + + + + + + + False + True + 1 + + + + + False + True + 0 + + + + + True + False + True + True + 0 + + + False + True + 1 + + diff --git a/ubinstall-gtk.css b/ubinstall-gtk.css index 0636e16..9230005 100644 --- a/ubinstall-gtk.css +++ b/ubinstall-gtk.css @@ -328,4 +328,13 @@ button { .unsensitiveblock:disabled { opacity:1; background:@theme_selected_bg_color; -} \ No newline at end of file +} + +.install_slider_hover { + background-color:@theme_selected_bg_color; +} + +.install_slider_hover * { + color:@theme_selected_fg_color; + opacity: 1; +} diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index 6056544..eefbeff 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -177,6 +177,12 @@ False True + + False + end + center + com.ublinux.libublsettingsui-gtk3.pan-right-symbolic + @@ -259,6 +265,12 @@ + + False + start + center + com.ublinux.libublsettingsui-gtk3.pan-left-symbolic + @@ -585,6 +597,7 @@ @@ -610,6 +623,7 @@ agreement @@ -634,6 +648,7 @@ agreement @@ -658,6 +673,7 @@ agreement @@ -682,6 +698,7 @@ agreement @@ -706,6 +723,7 @@ agreement @@ -730,6 +748,7 @@ agreement @@ -754,6 +773,7 @@ agreement @@ -778,6 +798,7 @@ agreement @@ -822,6 +843,7 @@ agreement 5 5 left + False True @@ -6452,36 +6474,46 @@ agreement vertical 5 - + True False - 5 - + True False + 5 + True - + + True + False + + + + + + True + True + 1 + - - - True - True - 0 - - - - - True - False - + + True + False + + + + + + True + True + 2 + - True - True - 1 + -1 @@ -6495,6 +6527,7 @@ agreement True False + center 5 -- 2.35.1 From 1b782071bec751a863b15182dab3e88779a43dce Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Fri, 19 Dec 2025 17:40:43 +0000 Subject: [PATCH 5/5] Style changes --- source/ubinstall-gtk-decorations.c | 102 ----------------------------- ubinstall-gtk-slider.glade | 3 + ubinstall-gtk.css | 5 ++ ubinstall-gtk.glade | 6 ++ 4 files changed, 14 insertions(+), 102 deletions(-) diff --git a/source/ubinstall-gtk-decorations.c b/source/ubinstall-gtk-decorations.c index c8d9203..d79bbd4 100644 --- a/source/ubinstall-gtk-decorations.c +++ b/source/ubinstall-gtk-decorations.c @@ -1,107 +1,5 @@ #include "ubinstall-gtk.h" -// void yon_resize_images_update(main_window *widgets){ -// enum YON_PAGES page = gtk_notebook_get_current_page(GTK_NOTEBOOK(widgets->Notebook)); -// gtk_widget_hide(widgets->BootloaderImage); -// gtk_widget_hide(widgets->RegionImage); -// gtk_widget_hide(widgets->UserImage); -// gtk_widget_hide(widgets->StartupImage); -// gtk_widget_hide(widgets->NetworkImage); - -// switch(page){ -// case YON_PAGE_BOOTLOADER: -// gtk_widget_show(widgets->BootloaderImage); -// break; -// case YON_PAGE_REGION: -// gtk_widget_show(widgets->RegionImage); -// break; -// case YON_PAGE_USERS: -// gtk_widget_show(widgets->UserImage); -// break; -// case YON_PAGE_STARTUP: -// gtk_widget_show(widgets->StartupImage); -// break; -// case YON_PAGE_NETWORK: -// gtk_widget_show(widgets->NetworkImage); -// break; -// case YON_PAGE_INSTALLATION: -// gtk_widget_show(widgets->SlidesImage); -// g_timeout_add(7000,on_image_slide,widgets); - -// break; -// default: -// break; -// } -// } - -// void on_region_resized(GtkWidget *,main_window *widgets){ -// enum YON_PAGES page = gtk_notebook_get_current_page(GTK_NOTEBOOK(widgets->Notebook)); -// GtkImage *target = NULL; -// GdkPixbuf *pixbuf = NULL; -// switch (page){ -// case YON_PAGE_BOOTLOADER: -// target = GTK_IMAGE(widgets->BootloaderImage); -// pixbuf = widgets->bootloader_original; -// break; -// case YON_PAGE_REGION: -// target = GTK_IMAGE(widgets->RegionImage); -// pixbuf = widgets->region_original; - -// break; -// case YON_PAGE_USERS: -// target = GTK_IMAGE(widgets->UserImage); -// pixbuf = widgets->user_original; - -// break; -// case YON_PAGE_STARTUP: -// target = GTK_IMAGE(widgets->StartupImage); -// pixbuf = widgets->startup_original; - -// break; -// case YON_PAGE_NETWORK: -// target = GTK_IMAGE(widgets->NetworkImage); -// pixbuf = widgets->network_original; - -// break; -// case YON_PAGE_INSTALLATION: -// target = GTK_IMAGE(widgets->SlidesImage); -// pixbuf = g_list_nth_data(widgets->slides_original,main_config.cur_slide); - - -// break; -// default: -// break; -// } -// if (target){ -// yon_image_resize_from_container(target,pixbuf); -// } -// } - -// int yon_image_resize_from_container(GtkImage *target, GdkPixbuf *pixbuf_unscaled){ -// int width = gtk_widget_get_allocated_width((gtk_widget_get_parent(GTK_WIDGET(target)))); -// int height = gtk_widget_get_allocated_height((gtk_widget_get_parent(GTK_WIDGET(target)))); - -// int newImgWidthDef = (width <= 217) ? width : width - 30; -// int newImgHeightDef = (height <= 120) ? height : height - 80; - -// int originalWidth = gdk_pixbuf_get_width(pixbuf_unscaled); -// int originalHeight = gdk_pixbuf_get_height(pixbuf_unscaled); -// int newImgHeight = (int)(originalHeight / ((double) originalWidth / newImgWidthDef)); - -// if (newImgHeight > newImgHeightDef) { -// newImgHeight = newImgHeightDef; -// newImgWidthDef = (int)(originalWidth / ((double) originalHeight / newImgHeight)); -// } -// int newImageWidth = (int)(originalWidth / ((double) originalHeight / newImgHeight)); - -// GdkPixbuf *scaledPixBuf = gdk_pixbuf_scale_simple(pixbuf_unscaled, newImageWidth, newImgHeight, GDK_INTERP_BILINEAR); -// gtk_image_set_from_pixbuf(target, scaledPixBuf); - -// g_object_unref(scaledPixBuf); - -// return 1; -// } - gboolean on_install_slider_hover_highlight(GtkWidget *, GdkEvent *, main_window *widgets){ gtk_widget_show(widgets->NextInstallationSliderImage); gtk_widget_show(widgets->PrevInstallationSliderImage); diff --git a/ubinstall-gtk-slider.glade b/ubinstall-gtk-slider.glade index b4960e0..475e327 100644 --- a/ubinstall-gtk-slider.glade +++ b/ubinstall-gtk-slider.glade @@ -86,5 +86,8 @@ + diff --git a/ubinstall-gtk.css b/ubinstall-gtk.css index 9230005..46577de 100644 --- a/ubinstall-gtk.css +++ b/ubinstall-gtk.css @@ -16,6 +16,11 @@ background:transparent; .nobackground:active { background:transparent; } + +.bgcommon { + background:@theme_bg_color; +} + .textHead{ text-shadow: 2px 2px @theme_bg_color; color: @theme_text_color; diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index eefbeff..6e88335 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -6490,6 +6490,9 @@ agreement + True @@ -6504,6 +6507,9 @@ agreement + True -- 2.35.1