From 8915dc2e6711ad5514129fdb65815214d01e62ba Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Mon, 2 Feb 2026 11:27:13 +0600 Subject: [PATCH] Added Installation finish action combobox --- locale/ubinstall-gtk.pot | 12 +++++++++++ locale/ubinstall-gtk_ru.po | 12 +++++++++++ source/ubinstall-gtk-config-hub.c | 22 +++++++++++++++++-- source/ubinstall-gtk.c | 1 + source/ubinstall-gtk.h | 3 +++ source/ubl-strings.h | 4 ++++ ubinstall-gtk.glade | 36 +++++++++++++++++++++++++++++++ 7 files changed, 88 insertions(+), 2 deletions(-) diff --git a/locale/ubinstall-gtk.pot b/locale/ubinstall-gtk.pot index 0bfce82..aee69ee 100644 --- a/locale/ubinstall-gtk.pot +++ b/locale/ubinstall-gtk.pot @@ -1808,6 +1808,18 @@ msgstr "" msgid "Interactive Knowledge Base" msgstr "" +#: source/ubl-strings.h:543 +msgid "Reboot" +msgstr "" + +#: source/ubl-strings.h:543 +msgid "Shudown" +msgstr "" + +#: source/ubl-strings.h:543 +msgid "After successful installation:" +msgstr "" + #: source/ubl-strings.h:544 msgid "" "Continuously evolving and clearly describes the installation and " diff --git a/locale/ubinstall-gtk_ru.po b/locale/ubinstall-gtk_ru.po index 11cf630..0fabaf8 100644 --- a/locale/ubinstall-gtk_ru.po +++ b/locale/ubinstall-gtk_ru.po @@ -1813,6 +1813,18 @@ msgstr "" "Графический пакетный менеджер позволяет быстро и интуитивно понятно " "устанавливать дополнительное ПО, драйверы для оборудования" +#: source/ubl-strings.h:543 +msgid "Reboot" +msgstr "Перезагрузить" + +#: source/ubl-strings.h:543 +msgid "Shudown" +msgstr "Выключить" + +#: source/ubl-strings.h:543 +msgid "After successful installation:" +msgstr "После успешной установки:" + #: source/ubl-strings.h:505 msgid "Corporate Services" msgstr "Корпоративные сервисы" diff --git a/source/ubinstall-gtk-config-hub.c b/source/ubinstall-gtk-config-hub.c index 228a430..3034269 100644 --- a/source/ubinstall-gtk-config-hub.c +++ b/source/ubinstall-gtk-config-hub.c @@ -1,7 +1,12 @@ #include "ubinstall-gtk.h" -int yon_configuration_hub_save(main_window *){ - +int yon_configuration_hub_save(main_window *widgets){ + char *finish_button = (char *)gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->ConfigHubRebootCombo)); + if (!yon_char_is_empty(finish_button)){ + yon_config_register(finish_parameter,finish_parameter_command,finish_button); + } else { + yon_config_remove_by_key(finish_parameter); + } if (!main_config.configure_mode){ int size; config_str parameters = yon_config_get_save_parameters_by_key(&size,modules_parameter, @@ -32,6 +37,7 @@ int yon_configuration_hub_save(main_window *){ GRUB_TIMEOUT_parameter, GRUB_DEFAULT_parameter, AUTOLOGINUSER_parameter, + finish_parameter, NULL); if (parameters){ char *command_parameters = yon_char_parsed_to_string(parameters,size," -- "); @@ -170,6 +176,18 @@ void yon_flow_box_clear(GtkFlowBox *target){ } void yon_configuration_hub_init(main_window *widgets){ + gtk_combo_box_text_remove_all(GTK_COMBO_BOX_TEXT(widgets->ConfigHubRebootCombo)); + gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(widgets->ConfigHubRebootCombo),NULL,DEFAULT_LABEL); + gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(widgets->ConfigHubRebootCombo),"reboot",REBOOT_LABEL); + gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(widgets->ConfigHubRebootCombo),"shutdown",SHUTDOWN_LABEL); + char *finish_string = config(finish_parameter); + if (!yon_char_is_empty(finish_string)){ + gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->ConfigHubRebootCombo),finish_string); + + } else { + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->ConfigHubRebootCombo),0); + } + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->ConfigHubRebootCombo),0); 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->HubPackagesListBox)); diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index a0b61f1..8fe7423 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -706,6 +706,7 @@ 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->ConfigHubRebootCombo = yon_gtk_builder_get_widget(builder,"ConfigHubRebootCombo"); widgets->HubPersonalListBox = yon_gtk_builder_get_widget(builder,"HubPersonalListBox"); widgets->HubSystemListBox = yon_gtk_builder_get_widget(builder,"HubSystemListBox"); widgets->HubPackagesListBox = yon_gtk_builder_get_widget(builder,"HubPackagesListBox"); diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index 5f5c28a..78a9f0e 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -260,6 +260,8 @@ layout && /description:/ {\ #define installer_locale_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[installer_locale]" #define source_parameter "AUTOINSTALL[source]" #define source_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[source]" +#define finish_parameter "AUTOINSTALL[finish]" +#define finish_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[finish]" #define SYSTEM_LANG_parameter "AUTOINSTALL['ubconfig set [locale] LANG']" #define SYSTEM_LANG_parameter_command "ubconfig --source global get autoinstall AUTOINSTALL['ubconfig set [locale] LANG']" @@ -755,6 +757,7 @@ typedef struct GtkWidget *PackagesTree; // Configuration hub slide section + GtkWidget *ConfigHubRebootCombo; GtkWidget *HubPersonalListBox; GtkWidget *HubSystemListBox; GtkWidget *HubPackagesListBox; diff --git a/source/ubl-strings.h b/source/ubl-strings.h index 5da39e2..d7a6507 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -284,6 +284,10 @@ NULL) #define LOAD_GLOBAL_LABEL yon_char_get_localised_from_lib("Load global configuration") #define LOAD_LABEL yon_char_get_localised_from_lib("Load") +#define REBOOT_LABEL _("Reboot") +#define SHUTDOWN_LABEL _("Shudown") +#define FINISH_ACTION_LABEL _("After successful installation:") + // #define _LABEL _("Select your language:") // #define _LABEL _("Selecting additional system kernel components") // #define _LABEL _("Package:") diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index 11ee448..a51f622 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -2142,6 +2142,7 @@ agreement True False vertical + 5 True @@ -2245,6 +2246,41 @@ agreement 0 + + + True + False + 5 + + + True + False + After successful installation: + + + False + True + 0 + + + + + True + False + + + False + True + 1 + + + + + False + True + 1 + + True