From 68d2a24bb72bfdd9a012bd5233ceefb691b6e953 Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Wed, 17 Dec 2025 18:03:56 +0000 Subject: [PATCH] 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