From 8e5e9ec391e1daa5cc55dd2d23f73c3f3b7bc812 Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Tue, 24 Feb 2026 09:32:59 +0600 Subject: [PATCH 01/15] Advanced page virtual device sensitivity change --- source/ubinstall-gtk-advanced.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ubinstall-gtk-advanced.c b/source/ubinstall-gtk-advanced.c index c7859c2..99931b8 100644 --- a/source/ubinstall-gtk-advanced.c +++ b/source/ubinstall-gtk-advanced.c @@ -419,7 +419,7 @@ void on_install_advanced_device_chosen(GtkCellRenderer *, gchar *path, main_wind gtk_tree_model_get(model,&iter,5,&status,-1); if (status)chosen_amount++; } - gtk_widget_set_sensitive(widgets->AdvancedVirtualDeviceCombo,chosen_amount>=2); + // gtk_widget_set_sensitive(widgets->AdvancedVirtualDeviceCombo,chosen_amount>=2); // if (chosen) gtk_widget_set_sensitive(widgets->AdvancedAddButton,1); // else gtk_widget_set_sensitive(widgets->AdvancedAddButton,0); yon_advanced_parts_update(widgets); From 59cb43f707f1791f0cfb12872c08f1d132e9cfcc Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Tue, 24 Feb 2026 09:37:02 +0600 Subject: [PATCH 02/15] installation modes entries and combo boxes style changes --- ubinstall-gtk.glade | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index ce69dfb..51b5c2d 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -8054,7 +8054,7 @@ or continue working in the system Live environment. True - True + False True 4 @@ -8085,7 +8085,7 @@ or continue working in the system Live environment. - True + False True 6 @@ -9484,7 +9484,7 @@ or continue working in the system Live environment. True - True + False True 4 @@ -9516,7 +9516,7 @@ or continue working in the system Live environment. - True + False True 6 @@ -9749,7 +9749,6 @@ separately into the selected partition. True - False False 0 From b3769a878dc107b543b14dd2a9bd622ce8e91381 Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Tue, 24 Feb 2026 09:48:41 +0600 Subject: [PATCH 03/15] Removed scroll from all combo boxes and spin buttons --- source/ubinstall-gtk-advanced.c | 1 + source/ubinstall-gtk.c | 14 +++++++++++++- source/ubinstall-gtk.h | 3 ++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/source/ubinstall-gtk-advanced.c b/source/ubinstall-gtk-advanced.c index 99931b8..745d95c 100644 --- a/source/ubinstall-gtk-advanced.c +++ b/source/ubinstall-gtk-advanced.c @@ -731,6 +731,7 @@ void on_format_changed(GtkWidget *self, advanced_partition *part){ advanced_partition *yon_advanced_partition_new(){ advanced_partition *part = new(advanced_partition); GtkBuilder *builder = gtk_builder_new_from_resource(glade_path_advanced_part); + yon_scroll_block_for_builder(builder); part->MainBox = yon_gtk_builder_get_widget(builder,"MainBox"); part->SectionLabel = yon_gtk_builder_get_widget(builder,"SectionLabel"); part->SystemSectionToggle = yon_gtk_builder_get_widget(builder,"SystemSectionToggle"); diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 8158699..ba19509 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -288,9 +288,21 @@ void yon_licence_load(main_window *widgets){ } } +void yon_scroll_block_for_builder(GtkBuilder *builder){ + GSList *list = gtk_builder_get_objects(builder); + GSList *iter; + for (iter = list; iter; iter=iter->next){ + if (GTK_IS_COMBO_BOX(iter->data)||GTK_IS_SPIN_BUTTON(iter->data)){ + yon_gtk_combo_box_block_scroll((GtkComboBox*)iter->data); + } + } + g_slist_free(list); +} + void yon_main_window_create(main_window *widgets){ __attribute__((unused)) char *locale = setlocale(LC_ALL, "en_US.UTF-8"); - GtkBuilder *builder = gtk_builder_new_from_resource(glade_path); + GtkBuilder *builder = gtk_builder_new_from_resource(glade_path); + yon_scroll_block_for_builder(builder); yon_translation_init(builder); gtk_builder_add_callback_symbol(builder,"yon_gtk_widget_set_sensitive_from_toggle_button",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button)); gtk_builder_add_callback_symbol(builder,"on_toggle_button_switch_on",G_CALLBACK(on_toggle_button_switch_on)); diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index 8b19523..c2e19b2 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -1525,4 +1525,5 @@ int yon_os_components_check_packages_size(GtkWidget *, main_window *widgets); void on_pacman_search_enter(GtkEntry *self, main_window *widgets); gboolean yon_log_scroll(log_window *window); gboolean on_log_window_exit(GtkWidget *,GdkEvent*, log_window *window); -void yon_modules_missed_func(main_window *widgets); \ No newline at end of file +void yon_modules_missed_func(main_window *widgets); +void yon_scroll_block_for_builder(GtkBuilder *builder); \ No newline at end of file From 6843b6b5796433de2949169d8fcb85443b0c1a3b Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Tue, 24 Feb 2026 10:34:30 +0600 Subject: [PATCH 04/15] Advanced installaion page changed --- source/ubinstall-gtk-advanced.c | 55 +++++++++++++++++++++++--------- source/ubl-strings.h | 4 +-- ubinstall-gtk-advanced-box.glade | 30 +++++++++++------ ubinstall-gtk.glade | 2 ++ 4 files changed, 65 insertions(+), 26 deletions(-) diff --git a/source/ubinstall-gtk-advanced.c b/source/ubinstall-gtk-advanced.c index 745d95c..093d6f4 100644 --- a/source/ubinstall-gtk-advanced.c +++ b/source/ubinstall-gtk-advanced.c @@ -517,9 +517,49 @@ int yon_advanced_save(main_window *widgets){ char *encryption[2] = {NULL}; char *format[2] = {NULL}; if (!sections_size){ + yon_ubl_status_box_spawn(GTK_COMBO_BOX(widgets->StatusBox),NOTHING_CHOSEN_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); return 0; } advanced_section *cur_section = sections[0]->sys_section?sections[0]:sections[1]; + if (cur_section->part_source == PART_SOURCE_VIRTUAL){ + + char *device = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->AdvancedVirtualDeviceCombo)); + int size; + config_str vfs_file = yon_resource_open_file(vfs_list_path,&size); + config_str cur_device = NULL; + for (int i=0;iDevicesList); + int active_devices=0; + for_iter(model,&iter){ + int status; + gtk_tree_model_get(model,&iter,5,&status,-1); + if (status) active_devices++; + } + if (atoi(cur_device[3])>active_devices){ + yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),COUNT_INVALID_LABEL(cur_device[3]),5,BACKGROUND_IMAGE_INFO_TYPE); + yon_ubl_status_highlight_incorrect(widgets->AdvancedVirtualDeviceCombo); + yon_char_parsed_free(cur_device,4); + return 0; + } + + if (atoi(cur_device[4])%active_devices!=0){ + yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),PARITY_INVALID_LABEL(cur_device[4]),5,BACKGROUND_IMAGE_INFO_TYPE); + yon_ubl_status_highlight_incorrect(widgets->AdvancedVirtualDeviceCombo); + yon_char_parsed_free(cur_device,4); + return 0; + } + } + } if (!yon_char_is_empty(cur_section->partition)){ if (!yon_char_is_empty(cur_section->partition)){ parts[0]=cur_section->partition; @@ -814,12 +854,10 @@ void on_advanced_virtual_device_changed(GtkWidget *, main_window *widgets){ char *device = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->AdvancedVirtualDeviceCombo)); int size; config_str vfs_file = yon_resource_open_file(vfs_list_path,&size); - config_str cur_device = NULL; for (int i=0;iAdvancedVirtualDeviceLabel),parsed[1]); } else { yon_char_parsed_free(parsed,parsed_size); @@ -834,19 +872,6 @@ void on_advanced_virtual_device_changed(GtkWidget *, main_window *widgets){ gtk_tree_model_get(model,&iter,5,&status,-1); if (status) active_devices++; } - if (atoi(cur_device[3])>active_devices){ - yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),COUNT_INVALID_LABEL(cur_device[3]),5,BACKGROUND_IMAGE_INFO_TYPE); - yon_ubl_status_highlight_incorrect(widgets->AdvancedVirtualDeviceCombo); - yon_char_parsed_free(cur_device,4); - return; - } - - if (atoi(cur_device[4])%active_devices!=0){ - yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),PARITY_INVALID_LABEL(cur_device[4]),5,BACKGROUND_IMAGE_INFO_TYPE); - yon_ubl_status_highlight_incorrect(widgets->AdvancedVirtualDeviceCombo); - yon_char_parsed_free(cur_device,4); - return; - } advanced_section *section = yon_advanced_section_new(); section->part_source = PART_SOURCE_VIRTUAL; diff --git a/source/ubl-strings.h b/source/ubl-strings.h index aaf748d..ec7f64b 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -206,8 +206,8 @@ NULL) #define SAVE_AND_EXIT_LABEL _("Save and exit") #define NO_LABEL _("No") -#define PARITY_INVALID_LABEL(target) yon_char_unite("Cu",target,NULL) -#define COUNT_INVALID_LABEL(target) yon_char_unite("Cues",target,NULL) +#define PARITY_INVALID_LABEL(target) yon_char_unite("Invalid devices parity. Needed: ",target,NULL) +#define COUNT_INVALID_LABEL(target) yon_char_unite("Invalid devices chosen. Needed: ",target,NULL) #define ABOUT_TITLE_LABEL _("About system installation") #define VALUE_REPEAT_LABEL _("Repeating values") diff --git a/ubinstall-gtk-advanced-box.glade b/ubinstall-gtk-advanced-box.glade index 495fb2b..21cd559 100644 --- a/ubinstall-gtk-advanced-box.glade +++ b/ubinstall-gtk-advanced-box.glade @@ -402,6 +402,11 @@ Default + + + False + + False @@ -460,25 +465,32 @@ - - - - - - - - + - + + + + + + + + + + + + + + + diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index 51b5c2d..051edbd 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -9762,6 +9762,8 @@ separately into the selected partition. True False + True + word-char False From b47ad7c05b70e3116ef316d8d7eb61b8ab71dce9 Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Tue, 24 Feb 2026 10:39:09 +0600 Subject: [PATCH 05/15] Fixed build --- locale/ubinstall-gtk.pot | 8 ++++++++ locale/ubinstall-gtk_ru.po | 8 ++++++++ source/ubinstall-gtk-advanced.c | 2 +- source/ubl-strings.h | 4 ++-- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/locale/ubinstall-gtk.pot b/locale/ubinstall-gtk.pot index 8aa54a8..f371b98 100644 --- a/locale/ubinstall-gtk.pot +++ b/locale/ubinstall-gtk.pot @@ -1874,6 +1874,14 @@ msgstr "" msgid "Reboot" msgstr "" +#: source/ubl-strings.h:543 +msgid "Invalid devices parity. Needed:" +msgstr "" + +#: source/ubl-strings.h:543 +msgid "Invalid devices chosen. Needed:" +msgstr "" + #: source/ubl-strings.h:543 msgid "Shudown" msgstr "" diff --git a/locale/ubinstall-gtk_ru.po b/locale/ubinstall-gtk_ru.po index 07a08ca..9734938 100644 --- a/locale/ubinstall-gtk_ru.po +++ b/locale/ubinstall-gtk_ru.po @@ -1865,6 +1865,14 @@ msgstr "" msgid "Reboot" msgstr "Перезагрузить" +#: source/ubl-strings.h:543 +msgid "Invalid devices parity. Needed:" +msgstr "Неверная проверка четности устройств. Требуется:" + +#: source/ubl-strings.h:543 +msgid "Invalid devices chosen. Needed:" +msgstr "Выбраны недействительные устройства. Требуется:" + #: source/ubl-strings.h:543 msgid "Shudown" msgstr "Выключить" diff --git a/source/ubinstall-gtk-advanced.c b/source/ubinstall-gtk-advanced.c index 093d6f4..d383a4c 100644 --- a/source/ubinstall-gtk-advanced.c +++ b/source/ubinstall-gtk-advanced.c @@ -517,7 +517,7 @@ int yon_advanced_save(main_window *widgets){ char *encryption[2] = {NULL}; char *format[2] = {NULL}; if (!sections_size){ - yon_ubl_status_box_spawn(GTK_COMBO_BOX(widgets->StatusBox),NOTHING_CHOSEN_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); + yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),NOTHING_CHOSEN_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); return 0; } advanced_section *cur_section = sections[0]->sys_section?sections[0]:sections[1]; diff --git a/source/ubl-strings.h b/source/ubl-strings.h index ec7f64b..1deb54c 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -206,8 +206,8 @@ NULL) #define SAVE_AND_EXIT_LABEL _("Save and exit") #define NO_LABEL _("No") -#define PARITY_INVALID_LABEL(target) yon_char_unite("Invalid devices parity. Needed: ",target,NULL) -#define COUNT_INVALID_LABEL(target) yon_char_unite("Invalid devices chosen. Needed: ",target,NULL) +#define PARITY_INVALID_LABEL(target) yon_char_unite("Invalid devices parity. Needed:"," ",target,NULL) +#define COUNT_INVALID_LABEL(target) yon_char_unite("Invalid devices chosen. Needed:"," ",target,NULL) #define ABOUT_TITLE_LABEL _("About system installation") #define VALUE_REPEAT_LABEL _("Repeating values") From 8c3b1399e07103659f6bfbed49c02431b82fb620 Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Tue, 24 Feb 2026 17:57:15 +0600 Subject: [PATCH 06/15] Updated status messages for library update --- source/ubinstall-gtk-configuration-mode.c | 8 ++++---- source/ubinstall-gtk.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/source/ubinstall-gtk-configuration-mode.c b/source/ubinstall-gtk-configuration-mode.c index f4c1f06..a3c8b93 100644 --- a/source/ubinstall-gtk-configuration-mode.c +++ b/source/ubinstall-gtk-configuration-mode.c @@ -98,7 +98,7 @@ void on_configuration_mode_switch(GtkWidget *self,main_window *widgets){ g_object_set_data(G_OBJECT(window->Window),"widgets",widgets); yon_gtk_window_setup(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->MainWindow),CONFIGURATION_MODE_TITLE_LABEL,icon_path,"configuration_window"); if (getuid()){ - yon_ubl_status_box_spawn_infinite(GTK_CONTAINER(window->StatusBox),"force_configure_mode",ROOT_FORCE_CONFIGURATION_MODE_LABEL,BACKGROUND_IMAGE_INFO_TYPE); + yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),ROOT_FORCE_CONFIGURATION_MODE_LABEL,0,BACKGROUND_IMAGE_INFO_TYPE); } if (!yon_char_is_empty(main_config.config_save_path)) gtk_entry_set_text(GTK_ENTRY(window->PathEntry),main_config.config_save_path); @@ -106,8 +106,8 @@ void on_configuration_mode_switch(GtkWidget *self,main_window *widgets){ gtk_main(); if (main_config.config_save_path){ - yon_ubl_status_box_spawn_infinite(GTK_CONTAINER(widgets->StatusBox),"config_mode",CONFIGURATION_MODE_STATUS_LABEL,BACKGROUND_IMAGE_INFO_TYPE); - yon_ubl_status_box_spawn_infinite(GTK_CONTAINER(widgets->StatusBox2),"config_mede",CONFIG_PATH_LABEL(main_config.config_save_path),BACKGROUND_IMAGE_INFO_TYPE); + yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),CONFIGURATION_MODE_STATUS_LABEL,0,BACKGROUND_IMAGE_INFO_TYPE); + yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox2),CONFIG_PATH_LABEL(main_config.config_save_path),0,BACKGROUND_IMAGE_INFO_TYPE); GList *revealerlist = gtk_container_get_children(GTK_CONTAINER(widgets->StatusBox2)); GList *list = gtk_container_get_children(GTK_CONTAINER(g_list_nth_data(revealerlist,0))); GtkWidget *box = GTK_WIDGET(list->data); @@ -122,7 +122,7 @@ void on_configuration_mode_switch(GtkWidget *self,main_window *widgets){ gtk_widget_destroy(window->Window); } else { - yon_ubl_status_box_despawn_infinite(GTK_CONTAINER(widgets->StatusBox)); + yon_ubl_status_box_despawn(GTK_CONTAINER(widgets->StatusBox)); GList *revealerlist = gtk_container_get_children(GTK_CONTAINER(widgets->StatusBox2)); gtk_widget_destroy(GTK_WIDGET(g_list_nth_data(revealerlist,0))); g_list_free(revealerlist); diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index ba19509..803e10e 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -896,8 +896,8 @@ void yon_main_window_create(main_window *widgets){ GtkWidget *Check = GTK_WIDGET(g_list_nth_data(children,1)); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(Check),1); - yon_ubl_status_box_spawn_infinite(GTK_CONTAINER(widgets->StatusBox),"config_mode",CONFIGURATION_MODE_STATUS_LABEL,BACKGROUND_IMAGE_INFO_TYPE); - yon_ubl_status_box_spawn_infinite(GTK_CONTAINER(widgets->StatusBox2),"config_mede",CONFIG_PATH_LABEL(main_config.config_save_path),BACKGROUND_IMAGE_INFO_TYPE); + yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),CONFIGURATION_MODE_STATUS_LABEL,0,BACKGROUND_IMAGE_INFO_TYPE); + yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox2),CONFIG_PATH_LABEL(main_config.config_save_path),0,BACKGROUND_IMAGE_INFO_TYPE); } else { exit (1); } From 0079f9ad1b621b245e12683a8c8c78d0e3225337 Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Tue, 24 Feb 2026 18:21:21 +0600 Subject: [PATCH 07/15] Fixed modules size checking --- source/ubinstall-gtk-components.c | 3 +++ source/ubinstall-gtk-config-hub.c | 4 ++-- source/ubinstall-gtk.h | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/source/ubinstall-gtk-components.c b/source/ubinstall-gtk-components.c index b730643..a74bd29 100644 --- a/source/ubinstall-gtk-components.c +++ b/source/ubinstall-gtk-components.c @@ -164,6 +164,9 @@ void *yon_modules_list_load(main_window *widgets){ g_idle_add((GSourceFunc)yon_os_component_insert,row); } g_idle_add((GSourceFunc)yon_spinner_switch_off,widgets->OSSpinner); + if (main_config.modules_size) yon_char_parsed_free(main_config.modules,main_config.modules_size); + main_config.modules = modules; + main_config.modules_size = size; g_thread_exit(NULL); } diff --git a/source/ubinstall-gtk-config-hub.c b/source/ubinstall-gtk-config-hub.c index 6843526..b9c32ac 100644 --- a/source/ubinstall-gtk-config-hub.c +++ b/source/ubinstall-gtk-config-hub.c @@ -2,8 +2,8 @@ config_str yon_os_components_get_modules(int *size){ (*size) = 0; - int modules_size = main_config.devices_size; - config_str modules_list = main_config.devices; + int modules_size = main_config.modules_size; + config_str modules_list = main_config.modules; config_str module_names = NULL; for (int i=1;i Date: Tue, 24 Feb 2026 19:12:26 +0600 Subject: [PATCH 08/15] Fixed advanced installation page crash; Fixed advanced installation page part and selected sizes check --- source/ubinstall-gtk-advanced.c | 16 +++++++++++----- source/ubinstall-gtk.h | 1 + ubinstall-gtk-advanced-box.glade | 3 ++- ubinstall-gtk.glade | 3 +++ 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/source/ubinstall-gtk-advanced.c b/source/ubinstall-gtk-advanced.c index d383a4c..4d88e27 100644 --- a/source/ubinstall-gtk-advanced.c +++ b/source/ubinstall-gtk-advanced.c @@ -147,7 +147,7 @@ void yon_advanced_update(main_window *widgets){ g_signal_connect(G_OBJECT(part->RemoveButton),"clicked",G_CALLBACK(on_advanced_part_remove),widgets); g_signal_connect(G_OBJECT(part->SystemSectionToggle),"clicked",G_CALLBACK(on_advanced_section_toggled),widgets); g_signal_connect(G_OBJECT(part->UserDataSectionToggle),"clicked",G_CALLBACK(on_advanced_section_toggled),widgets); - g_signal_connect(G_OBJECT(part->SizeCombo),"changed",G_CALLBACK(on_advanced_size_changed),widgets); + // g_signal_connect(G_OBJECT(part->SizeCombo),"changed",G_CALLBACK(on_advanced_size_changed),widgets); if (i==0){ gtk_widget_set_sensitive(part->SystemSectionToggle,0); gtk_widget_set_sensitive(part->UserDataSectionToggle,0); @@ -277,22 +277,24 @@ void on_install_advanced_partition_chosen(GtkCellRenderer*, gchar *path, main_wi gtk_tree_model_get_iter_from_string(model,&iter,path); int status; char *target_part, *device; - gtk_tree_model_get(model,&iter,0,&target_part,7,&status,9,&device,-1); + gulong part_size; + gtk_tree_model_get(model,&iter,0,&target_part,5,&part_size,7,&status,9,&device,-1); if (!status){ if (chosen<2){ - gtk_list_store_set(widgets->PartitionsList,&iter,7,!status,-1); + gtk_list_store_set(widgets->PartitionsList,&iter,7,1,-1); chosen++; advanced_section *section = yon_advanced_section_new(); section->part_source = PART_SOURCE_PART; section->partition = target_part; section->device = NULL; + section->full_part_size = part_size; sections[sections_size]=section; sections_size++; } } else { - gtk_list_store_set(widgets->PartitionsList,&iter,7,!status,-1); yon_advanced_section_remove_by_name(target_part); + gtk_list_store_set(widgets->PartitionsList,&iter,7,0,-1); } yon_advanced_update(widgets); } @@ -580,10 +582,14 @@ int yon_advanced_save(main_window *widgets){ devices[1]=cur_section->device; } } - if (cur_section->size){ + if (cur_section->size&&yon_size_long_convert_to_mod(cur_section->full_part_size,cur_section->size_letter)>cur_section->size){ + char *size_str = yon_char_from_long(cur_section->size); char *sz_str = yon_char_append_c(size_str,cur_section->size_letter); part_size[0]=sz_str; + } else { + yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),NOT_ENOUGH_SPACE_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); + return 0; } if (!yon_char_is_empty(cur_section->part_label)){ part_label[0]=cur_section->part_label; diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index 7d28e42..507ad0f 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -1097,6 +1097,7 @@ typedef struct int sys_section; int user_section; gboolean format; + gulong full_part_size; unsigned long size; char size_letter; char *part_label; diff --git a/ubinstall-gtk-advanced-box.glade b/ubinstall-gtk-advanced-box.glade index 21cd559..035138d 100644 --- a/ubinstall-gtk-advanced-box.glade +++ b/ubinstall-gtk-advanced-box.glade @@ -4,7 +4,8 @@ - 100 + 1 + 9999999999999 1 10 diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index 051edbd..974d0d3 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -9989,6 +9989,9 @@ separately into the selected partition. + + 7 + From 9dcbc8fdb9b7fc9ceac6213c56bd8e42b322ba3a Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Wed, 25 Feb 2026 10:05:05 +0600 Subject: [PATCH 09/15] Advanced installation page format fix --- source/ubinstall-gtk-advanced.c | 22 +++++++++++++--------- source/ubinstall-gtk.h | 2 +- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/source/ubinstall-gtk-advanced.c b/source/ubinstall-gtk-advanced.c index 4d88e27..7330d76 100644 --- a/source/ubinstall-gtk-advanced.c +++ b/source/ubinstall-gtk-advanced.c @@ -116,7 +116,7 @@ void yon_advanced_partition_set_from_section(advanced_partition *part, advanced_ if (!yon_char_is_empty(part->part)) part->part_type = ADVANCED_PART_NEW; else part->part_type = ADVANCED_PART_EXISTING; if (section->format){ - gtk_switch_set_active(GTK_SWITCH(part->FormatCombo),1); + gtk_combo_box_set_active(GTK_COMBO_BOX(part->FormatCombo),section->format); if (section->size){ gtk_spin_button_set_value(GTK_SPIN_BUTTON(part->SizeSpin),section->size); gtk_combo_box_set_active(GTK_COMBO_BOX(part->SizeCombo),yon_get_size_get_from_letter(section->size_letter)-1); @@ -157,7 +157,7 @@ void yon_advanced_update(main_window *widgets){ gtk_image_set_from_icon_name(GTK_IMAGE(UserImage),toggled_icon_name,GTK_ICON_SIZE_BUTTON); } yon_advanced_partition_set_from_section(part,sections[i]); - yon_advanced_set_max_size_from_partition(part,widgets); + // yon_advanced_set_max_size_from_partition(part,widgets); gtk_box_pack_start(GTK_BOX(widgets->AdvancedPartitionAddBox),part->MainBox,0,0,0); g_signal_handlers_block_by_func(G_OBJECT(widgets->AdvancedVirtualDeviceCombo),G_CALLBACK(on_advanced_virtual_device_changed),widgets); if (!virtual_found&>k_combo_box_set_active_id(GTK_COMBO_BOX(widgets->AdvancedVirtualDeviceCombo),sections[i]->part_source==PART_SOURCE_PART?sections[i]->partition:sections[i]->device)){ @@ -389,9 +389,9 @@ void yon_advanced_set_max_size_from_partition(advanced_partition *part, main_win } } -void on_advanced_size_changed(GtkWidget *self,main_window *widgets){ - advanced_partition *part = g_object_get_data(G_OBJECT(self),"advanced_partition"); - yon_advanced_set_max_size_from_partition(part,widgets); +void on_advanced_size_changed(GtkWidget *,main_window *){ + // advanced_partition *part = g_object_get_data(G_OBJECT(self),"advanced_partition"); + // yon_advanced_set_max_size_from_partition(part,widgets); } void on_install_advanced_device_chosen(GtkCellRenderer *, gchar *path, main_window *widgets){ @@ -600,10 +600,12 @@ int yon_advanced_save(main_window *widgets){ if (!yon_char_is_empty(cur_section->fs_label)){ fs_label[0]=cur_section->fs_label; } - if (cur_section->format){ + if (cur_section->format==2){ format[0]="yes"; - } else { + } else if (cur_section->format == 1){ format[0]="no"; + } else { + format[0]=NULL; } if (!yon_char_is_empty(cur_section->encryption)){ char *encrypt_str = yon_char_unite(cur_section->encryption,":",cur_section->encryption_password,NULL); @@ -632,10 +634,12 @@ int yon_advanced_save(main_window *widgets){ if (!yon_char_is_empty(cur_section->fs_label)){ fs_label[1]=cur_section->fs_label; } - if (cur_section->format){ + if (cur_section->format==2){ format[1]="yes"; - } else { + } else if (cur_section->format==1){ format[1]="no"; + } else { + format[1] = NULL; } if (!yon_char_is_empty(cur_section->encryption)){ char *encrypt_str = yon_char_unite(cur_section->encryption,":",cur_section->encryption_password,NULL); diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index 507ad0f..14a02c2 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -1096,7 +1096,7 @@ typedef struct char *device; int sys_section; int user_section; - gboolean format; + int format; gulong full_part_size; unsigned long size; char size_letter; From 7bd5240483be435b70f7c5769627d8137555eeca Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Wed, 25 Feb 2026 10:40:37 +0600 Subject: [PATCH 10/15] Fixed advanced inistallation page partition creation --- source/ubinstall-gtk-advanced.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source/ubinstall-gtk-advanced.c b/source/ubinstall-gtk-advanced.c index 7330d76..a4efc7d 100644 --- a/source/ubinstall-gtk-advanced.c +++ b/source/ubinstall-gtk-advanced.c @@ -191,9 +191,10 @@ void yon_advanced_update(main_window *widgets){ } void on_advanced_partition_create(GtkWidget *, main_window *widgets){ - GtkTreeIter iter, *last_unvalid = NULL; int found = 0; - for_iter(GTK_TREE_MODEL(widgets->DevicesList),&iter){ + GtkTreeIter iter, *last_unvalid = NULL; + GtkTreeModel *model; + if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->AdvancedDeviceTree)),&model,&iter)){ char *target; int active; gtk_tree_model_get(GTK_TREE_MODEL(widgets->DevicesList),&iter,0,&target,5,&active,-1); @@ -202,16 +203,16 @@ void on_advanced_partition_create(GtkWidget *, main_window *widgets){ last_unvalid = gtk_tree_iter_copy(&iter); } else { found=1; - if (sections_size==2) break; + if (sections_size==2) return; advanced_section *section = yon_advanced_section_new(); section->part_source = PART_SOURCE_DEVICE; section->device = target; section->partition = NULL; sections[sections_size]=section; sections_size++; - break; } } + } if (!found&&last_unvalid){ char *target; From 7b8a4810ddb27706fc0843bff968c8984e01caa8 Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Wed, 25 Feb 2026 11:15:00 +0600 Subject: [PATCH 11/15] Fixed advanced installation page virtual device description style --- source/ubinstall-gtk-advanced.c | 8 +++++++- ubinstall-gtk.glade | 28 ++++++++++++++++++++++------ 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/source/ubinstall-gtk-advanced.c b/source/ubinstall-gtk-advanced.c index a4efc7d..1475268 100644 --- a/source/ubinstall-gtk-advanced.c +++ b/source/ubinstall-gtk-advanced.c @@ -254,6 +254,7 @@ void on_advanced_partition_add(GtkWidget *, char *path, main_window *widgets){ } void yon_install_advanced_init(main_window *widgets){ + g_signal_handlers_block_by_func(G_OBJECT(widgets->AdvancedVirtualDeviceCombo),G_CALLBACK(on_advanced_virtual_device_changed),widgets); gtk_combo_box_text_remove_all(GTK_COMBO_BOX_TEXT(widgets->AdvancedVirtualDeviceCombo)); gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widgets->AdvancedVirtualDeviceCombo),NO_LABEL); gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->AdvancedVirtualDeviceCombo),0); @@ -266,6 +267,7 @@ void yon_install_advanced_init(main_window *widgets){ yon_char_parsed_free(parsed,parsed_size); } yon_char_parsed_free(vmf_file,size); + g_signal_handlers_unblock_by_func(G_OBJECT(widgets->AdvancedVirtualDeviceCombo),G_CALLBACK(on_advanced_virtual_device_changed),widgets); } void on_install_advanced_partition_chosen(GtkCellRenderer*, gchar *path, main_window *widgets){ @@ -868,9 +870,13 @@ void on_advanced_virtual_device_changed(GtkWidget *, main_window *widgets){ for (int i=0;iAdvancedVirtualDeviceLabel),parsed[1]); + gtk_widget_show(gtk_widget_get_parent(widgets->AdvancedVirtualDeviceLabel)); + yon_char_parsed_free(parsed,parsed_size); + break; } else { + gtk_widget_hide(gtk_widget_get_parent(widgets->AdvancedVirtualDeviceLabel)); yon_char_parsed_free(parsed,parsed_size); } } diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index 974d0d3..99c8f21 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -9758,24 +9758,40 @@ separately into the selected partition. 1 + + + False + True + 0 + + + + + False + vertical True False True word-char + 0 False True - 2 + 0 + False True - 0 + 1 @@ -9947,7 +9963,7 @@ separately into the selected partition. False True - 1 + 2 @@ -10096,7 +10112,7 @@ separately into the selected partition. False True - 2 + 3 @@ -10141,7 +10157,7 @@ separately into the selected partition. False True - 3 + 4 @@ -10657,7 +10673,7 @@ separately into the selected partition. False True - 4 + 5 From d8b3699d7af56e25456d0522a618e8b4c3f139c4 Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Wed, 25 Feb 2026 11:29:43 +0600 Subject: [PATCH 12/15] Localisation update --- locale/vfs-list.pot | 23 ++++++++++++++++++ locale/vfs-list_ru.po | 42 +++++++++++++++++++++++++++++++++ source/ubinstall-gtk-advanced.c | 2 +- source/ubl-strings.h | 4 ++-- ubinstall-gtk.glade | 4 ++++ 5 files changed, 72 insertions(+), 3 deletions(-) create mode 100644 locale/vfs-list.pot create mode 100644 locale/vfs-list_ru.po diff --git a/locale/vfs-list.pot b/locale/vfs-list.pot new file mode 100644 index 0000000..53ea2fc --- /dev/null +++ b/locale/vfs-list.pot @@ -0,0 +1,23 @@ +msgid "RAID 0 (Striping). Combines two or more drives to increase read/write speed. Failure of one disk leads to a complete loss of all data." +msgstr "" + +msgid "RAID 1 (Mirroring). Data is written identically to two or more drives." +msgstr "" + +msgid "RAID 4 (Striping with dedicated parity). It uses block striping of data across multiple disks and a dedicated parity disk to ensure fault tolerance." +msgstr "" + +msgid "RAID 5 (Striping with distributed parity). Data striping with a checksum distributed over all disks (parity). It allows you to survive a single disk failure without data loss, but requires at least 3 disks and suffers from slower writes." +msgstr "" + +msgid "RAID 6 (Striping with double distributed parity). It provides high fault tolerance, allowing you to survive the simultaneous failure of two disks by using two independent parity schemes (P and Q) distributed across all disks." +msgstr "" + +msgid "RAID 1+0 (Striping from of mirrored drives). Combines mirroring (RAID 1) for reliability and interleaving (RAID 0) for performance. It requires at least 4 disks (an even number), creating mirrored pairs (RAID 1), which are then combined into a single array using striping (RAID 0)." +msgstr "" + +msgid "LVM (Logical Volume Manager). Allows you to flexibly combine multiple disks or partitions into shared pools (volume groups, VG) and create logical volumes (LV) from them." +msgstr "" + +msgid "LVM DYNAMIC (Logical Volume Manager DYNAMIC). Allows you to flexibly dynamically combine multiple disks or partitions into shared pools (volume groups, VG) and dynamically create logical volumes (LV) from them." +msgstr "" diff --git a/locale/vfs-list_ru.po b/locale/vfs-list_ru.po new file mode 100644 index 0000000..af6b18a --- /dev/null +++ b/locale/vfs-list_ru.po @@ -0,0 +1,42 @@ +# Language translations for ubinstal package. +# Copyright (C) 2022, UBTech LLC +# This file is distributed under the same license as the ubinstal package. +# UBLinux Team , 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: ubinstal 1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-05-22 16:12+0600\n" +"PO-Revision-Date: \n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +msgid "RAID 0 (Striping). Combines two or more drives to increase read/write speed. Failure of one disk leads to a complete loss of all data." +msgstr "RAID 0 (чередование). Объединяет два или более дисков для увеличения скорости чтения/записи. Выход из строя одного диска приводит к полной потере всех данных." + +msgid "RAID 1 (Mirroring). Data is written identically to two or more drives." +msgstr "RAID 1 (зеркалирование). Данные записываются идентично на два или более дисков." + +msgid "RAID 4 (Striping with dedicated parity). It uses block striping of data across multiple disks and a dedicated parity disk to ensure fault tolerance." +msgstr "RAID 4 (чередование с выделенным контролем четности). Использует блочное чередование данных по нескольким дискам и выделенный диск контроля четности для обеспечения отказоустойчивости." + +msgid "RAID 5 (Striping with distributed parity). Data striping with a checksum distributed over all disks (parity). It allows you to survive a single disk failure without data loss, but requires at least 3 disks and suffers from slower writes." +msgstr "RAID 5 (чередование с распределенным контролем четности). Чередование данных с контрольной суммой, распределенной по всем дискам (контроль четности). Позволяет пережить отказ одного диска без потери данных, но требует как минимум 3 дисков и имеет более низкую скорость записи." + +msgid "RAID 6 (Striping with double distributed parity). It provides high fault tolerance, allowing you to survive the simultaneous failure of two disks by using two independent parity schemes (P and Q) distributed across all disks." +msgstr "RAID 6 (чередование с двойным распределенным контролем четности). Обеспечивает высокую отказоустойчивость, позволяя пережить одновременный отказ двух дисков за счет использования двух независимых схем контроля четности (P и Q), распределенных по всем дискам." + +msgid "RAID 1+0 (Striping from of mirrored drives). Combines mirroring (RAID 1) for reliability and interleaving (RAID 0) for performance. It requires at least 4 disks (an even number), creating mirrored pairs (RAID 1), which are then combined into a single array using striping (RAID 0)." +msgstr "RAID 1+0 (чередование из зеркалированных дисков). Сочетает зеркалирование (RAID 1) для надежности и чередование (RAID 0) для повышения производительности. Требует как минимум 4 дисков (четное число), создавая зеркальные пары (RAID 1), которые затем объединяются в один массив с использованием чередования (RAID 0)." + +msgid "LVM (Logical Volume Manager). Allows you to flexibly combine multiple disks or partitions into shared pools (volume groups, VG) and create logical volumes (LV) from them." +msgstr "LVM (Logical Volume Manager). Позволяет гибко объединять несколько дисков или разделов в общие пулы (группы томов, VG) и создавать из них логические тома (LV)." + +msgid "LVM DYNAMIC (Logical Volume Manager DYNAMIC). Allows you to flexibly dynamically combine multiple disks or partitions into shared pools (volume groups, VG) and dynamically create logical volumes (LV) from them." +msgstr "LVM DYNAMIC (Logical Volume Manager DYNAMIC). Позволяет гибко динамически объединять несколько дисков или разделов в общие пулы (группы томов, VG) и динамически создавать из них логические тома (LV)." diff --git a/source/ubinstall-gtk-advanced.c b/source/ubinstall-gtk-advanced.c index 1475268..7d71119 100644 --- a/source/ubinstall-gtk-advanced.c +++ b/source/ubinstall-gtk-advanced.c @@ -871,7 +871,7 @@ void on_advanced_virtual_device_changed(GtkWidget *, main_window *widgets){ int parsed_size; config_str parsed = yon_char_parse(vfs_file[i],&parsed_size,";"); if (!yon_char_is_empty(device)&&!yon_char_is_empty(parsed[2])&&!strcmp(parsed[2],device)){ - gtk_label_set_text(GTK_LABEL(widgets->AdvancedVirtualDeviceLabel),parsed[1]); + gtk_label_set_text(GTK_LABEL(widgets->AdvancedVirtualDeviceLabel),_(parsed[1])); gtk_widget_show(gtk_widget_get_parent(widgets->AdvancedVirtualDeviceLabel)); yon_char_parsed_free(parsed,parsed_size); break; diff --git a/source/ubl-strings.h b/source/ubl-strings.h index 1deb54c..37bc047 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -206,8 +206,8 @@ NULL) #define SAVE_AND_EXIT_LABEL _("Save and exit") #define NO_LABEL _("No") -#define PARITY_INVALID_LABEL(target) yon_char_unite("Invalid devices parity. Needed:"," ",target,NULL) -#define COUNT_INVALID_LABEL(target) yon_char_unite("Invalid devices chosen. Needed:"," ",target,NULL) +#define PARITY_INVALID_LABEL(target) yon_char_unite(_("Invalid devices parity. Needed:")," ",target,NULL) +#define COUNT_INVALID_LABEL(target) yon_char_unite(_("Invalid devices chosen. Needed:")," ",target,NULL) #define ABOUT_TITLE_LABEL _("About system installation") #define VALUE_REPEAT_LABEL _("Repeating values") diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index 99c8f21..1a30674 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -9773,6 +9773,10 @@ separately into the selected partition. True False + 5 + 5 + 5 + 5 True word-char 0 From 6dc506e5db5ac9ff214b89751dbc6210752ba6e0 Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Wed, 25 Feb 2026 13:33:14 +0600 Subject: [PATCH 13/15] Fixed config creating cancel --- source/ubinstall-gtk-configuration-mode.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/source/ubinstall-gtk-configuration-mode.c b/source/ubinstall-gtk-configuration-mode.c index a3c8b93..85aba75 100644 --- a/source/ubinstall-gtk-configuration-mode.c +++ b/source/ubinstall-gtk-configuration-mode.c @@ -30,6 +30,8 @@ int yon_configuration_path_check(const char *path){ struct passwd *user = getpwnam(yon_ubl_root_user_get()); if (chown(full_path,user->pw_uid,user->pw_gid)){}; + } else { + return 0; } } main_config.config_load_path = full_path; @@ -45,9 +47,9 @@ void configuration_mode_accept(GtkWidget *,configuration_window *window){ yon_ubl_status_highlight_incorrect(window->PathEntry); return; } - yon_configuration_path_check(path); - - gtk_widget_destroy(window->Window); + if (yon_configuration_path_check(path)){ + gtk_widget_destroy(window->Window); + } } void on_path_choose(GtkWidget *,configuration_window *window){ From 211f785253b746a42dc99c6c7b79a38da668b048 Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Wed, 25 Feb 2026 13:38:31 +0600 Subject: [PATCH 14/15] Test fix for advanced installation mode size checking --- locale/ubinstall-gtk.pot | 16 ++++++ locale/ubinstall-gtk_ru.po | 16 ++++++ source/ubinstall-gtk-advanced.c | 94 ++++++++++++++++--------------- source/ubinstall-gtk-config-hub.c | 36 +++++++++--- 4 files changed, 108 insertions(+), 54 deletions(-) diff --git a/locale/ubinstall-gtk.pot b/locale/ubinstall-gtk.pot index f371b98..8014d98 100644 --- a/locale/ubinstall-gtk.pot +++ b/locale/ubinstall-gtk.pot @@ -1882,6 +1882,22 @@ msgstr "" msgid "Invalid devices chosen. Needed:" msgstr "" +#: source/ubl-strings.h:543 +msgid "The size of the new partition exceeds the free space of the selected partition" +msgstr "" + +#: source/ubl-strings.h:543 +msgid "The size of the new disk partition is larger than the size of the selected partition" +msgstr "" + +#: source/ubl-strings.h:543 +msgid "There is not enough space to install modules" +msgstr "" + +#: source/ubl-strings.h:543 +msgid "There is not enough space to install packages" +msgstr "" + #: source/ubl-strings.h:543 msgid "Shudown" msgstr "" diff --git a/locale/ubinstall-gtk_ru.po b/locale/ubinstall-gtk_ru.po index 9734938..e6268b4 100644 --- a/locale/ubinstall-gtk_ru.po +++ b/locale/ubinstall-gtk_ru.po @@ -1873,6 +1873,22 @@ msgstr "Неверная проверка четности устройств. msgid "Invalid devices chosen. Needed:" msgstr "Выбраны недействительные устройства. Требуется:" +#: source/ubl-strings.h:543 +msgid "The size of the new partition exceeds the free space of the selected partition" +msgstr "Размер нового раздела превышает свободное место выбранного раздела" + +#: source/ubl-strings.h:543 +msgid "The size of the new disk partition is larger than the size of the selected partition" +msgstr "Размер нового раздела диска превышает размер выбранного раздела" + +#: source/ubl-strings.h:543 +msgid "There is not enough space to install modules" +msgstr "Недостаточно места для установки модулей" + +#: source/ubl-strings.h:543 +msgid "There is not enough space to install packages" +msgstr "Недостаточно места для установки пакетов" + #: source/ubl-strings.h:543 msgid "Shudown" msgstr "Выключить" diff --git a/source/ubinstall-gtk-advanced.c b/source/ubinstall-gtk-advanced.c index 7d71119..ee838ac 100644 --- a/source/ubinstall-gtk-advanced.c +++ b/source/ubinstall-gtk-advanced.c @@ -565,6 +565,14 @@ int yon_advanced_save(main_window *widgets){ } } } + + if (cur_section->format==2){ + format[0]="yes"; + } else if (cur_section->format == 1){ + format[0]="no"; + } else { + format[0]=NULL; + } if (!yon_char_is_empty(cur_section->partition)){ if (!yon_char_is_empty(cur_section->partition)){ parts[0]=cur_section->partition; @@ -585,58 +593,30 @@ int yon_advanced_save(main_window *widgets){ devices[1]=cur_section->device; } } - if (cur_section->size&&yon_size_long_convert_to_mod(cur_section->full_part_size,cur_section->size_letter)>cur_section->size){ - - char *size_str = yon_char_from_long(cur_section->size); - char *sz_str = yon_char_append_c(size_str,cur_section->size_letter); - part_size[0]=sz_str; - } else { - yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),NOT_ENOUGH_SPACE_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); - return 0; - } - if (!yon_char_is_empty(cur_section->part_label)){ - part_label[0]=cur_section->part_label; - } - if (!yon_char_is_empty(cur_section->fs_type)){ - fs_type[0]=cur_section->fs_type; - } - if (!yon_char_is_empty(cur_section->fs_label)){ - fs_label[0]=cur_section->fs_label; - } - if (cur_section->format==2){ - format[0]="yes"; - } else if (cur_section->format == 1){ - format[0]="no"; - } else { - format[0]=NULL; - } - if (!yon_char_is_empty(cur_section->encryption)){ - char *encrypt_str = yon_char_unite(cur_section->encryption,":",cur_section->encryption_password,NULL); - encryption[0]=encrypt_str; - } - if (sections_size>1){ - cur_section = sections[0]->sys_section?sections[1]:sections[0]; - devices[1]=cur_section->device; - if (!yon_char_is_empty(cur_section->partition)){ - parts[1]=cur_section->partition; - } else { - parts[1]=""; - } - if (cur_section->size){ + if (cur_section->format==2){ + if (cur_section->size&&yon_size_long_convert_to_mod(cur_section->full_part_size,cur_section->size_letter)>cur_section->size){ + char *size_str = yon_char_from_long(cur_section->size); char *sz_str = yon_char_append_c(size_str,cur_section->size_letter); - part_size[1]=sz_str; + part_size[0]=sz_str; + } else { + yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),NOT_ENOUGH_SPACE_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); + return 0; } if (!yon_char_is_empty(cur_section->part_label)){ - part_label[1]=cur_section->part_label; + part_label[0]=cur_section->part_label; } if (!yon_char_is_empty(cur_section->fs_type)){ - fs_type[1]=cur_section->fs_type; + fs_type[0]=cur_section->fs_type; } if (!yon_char_is_empty(cur_section->fs_label)){ - fs_label[1]=cur_section->fs_label; + fs_label[0]=cur_section->fs_label; } + } + if (sections_size>1){ + cur_section = sections[0]->sys_section?sections[1]:sections[0]; + if (cur_section->format==2){ format[1]="yes"; } else if (cur_section->format==1){ @@ -644,9 +624,33 @@ int yon_advanced_save(main_window *widgets){ } else { format[1] = NULL; } - if (!yon_char_is_empty(cur_section->encryption)){ - char *encrypt_str = yon_char_unite(cur_section->encryption,":",cur_section->encryption_password,NULL); - encryption[1]=encrypt_str; + + devices[1]=cur_section->device; + if (!yon_char_is_empty(cur_section->partition)){ + parts[1]=cur_section->partition; + } else { + parts[1]=""; + } + + if (cur_section->format==2){ + if (cur_section->size){ + char *size_str = yon_char_from_long(cur_section->size); + char *sz_str = yon_char_append_c(size_str,cur_section->size_letter); + part_size[1]=sz_str; + } + if (!yon_char_is_empty(cur_section->part_label)){ + part_label[1]=cur_section->part_label; + } + if (!yon_char_is_empty(cur_section->fs_type)){ + fs_type[1]=cur_section->fs_type; + } + if (!yon_char_is_empty(cur_section->fs_label)){ + fs_label[1]=cur_section->fs_label; + } + if (!yon_char_is_empty(cur_section->encryption)){ + char *encrypt_str = yon_char_unite(cur_section->encryption,":",cur_section->encryption_password,NULL); + encryption[1]=encrypt_str; + } } } diff --git a/source/ubinstall-gtk-config-hub.c b/source/ubinstall-gtk-config-hub.c index b9c32ac..9920f73 100644 --- a/source/ubinstall-gtk-config-hub.c +++ b/source/ubinstall-gtk-config-hub.c @@ -25,8 +25,23 @@ int yon_installation_check_packages_size(main_window *widgets){ modules = yon_char_parsed_to_string(module_names,modules_size,","); } - if (strcmp(install_mode,"fast")){ + if (!strcmp(install_mode,"fast")){ + char *device = config(AUTOINSTALL_DEVICE); + GtkTreeIter iter; + for_iter(widgets->DevicesList,&iter){ + char *target; + long disk_size; + gtk_tree_model_get(GTK_TREE_MODEL(widgets->DevicesList),&iter,0,&target,7,&disk_size,-1); + if (!strcmp(device,target)){ + part_size = disk_size; + } + } + } else if (!strcmp(install_mode,"advanced")) { char *part = config(part_parameter); + part = yon_char_new(part); + char *sys_part = yon_char_divide_search(part,",",-1); + free(part); + part = sys_part; for (int i=0;iDevicesList,&iter){ - char *target; - long disk_size; - gtk_tree_model_get(GTK_TREE_MODEL(widgets->DevicesList),&iter,0,&target,7,&disk_size,-1); - if (!strcmp(device,target)){ - part_size = disk_size; + char *part = config(part_parameter); + for (int i=0;i3&&!yon_char_is_empty(parsed[3])){ + part_size = atol(parsed[3]); + + yon_char_parsed_free(parsed,parsed_size); + break; } + yon_char_parsed_free(parsed,parsed_size); } } long packages_size = 0; From f545f6d59b141e7583ed2c51ab34c7716340648c Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Wed, 25 Feb 2026 15:02:55 +0600 Subject: [PATCH 15/15] Fixed configuration menu item checking --- source/ubinstall-gtk-configuration-mode.c | 25 ++++++++--------------- source/ubinstall-gtk.c | 4 ++-- source/ubinstall-gtk.h | 1 + 3 files changed, 11 insertions(+), 19 deletions(-) diff --git a/source/ubinstall-gtk-configuration-mode.c b/source/ubinstall-gtk-configuration-mode.c index 85aba75..7fc9e84 100644 --- a/source/ubinstall-gtk-configuration-mode.c +++ b/source/ubinstall-gtk-configuration-mode.c @@ -47,8 +47,12 @@ void configuration_mode_accept(GtkWidget *,configuration_window *window){ yon_ubl_status_highlight_incorrect(window->PathEntry); return; } + main_window *widgets = g_object_get_data(G_OBJECT(window->Window),"widgets"); if (yon_configuration_path_check(path)){ gtk_widget_destroy(window->Window); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->ConfigurationModeCheck),1); + } else { + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->ConfigurationModeCheck),0); } } @@ -64,25 +68,15 @@ void on_path_choose(GtkWidget *,configuration_window *window){ void on_configuration_exit(GtkWidget *,configuration_window *window){ main_window *widgets = g_object_get_data(G_OBJECT(window->Window),"widgets"); - GList *box = gtk_container_get_children(GTK_CONTAINER(widgets->ConfigurationModeMenuItem)); - GList *children = gtk_container_get_children(GTK_CONTAINER(box->data)); - GtkWidget *Check = GTK_WIDGET(g_list_nth_data(children,1)); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(Check),0); - g_list_free(box); - g_list_free(children); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->ConfigurationModeCheck),0); gtk_widget_destroy(window->Window); if (getuid()){ gtk_main_quit(); } } -void on_configuration_mode_switch(GtkWidget *self,main_window *widgets){ - - GList *box = gtk_container_get_children(GTK_CONTAINER(self)); - GList *children = gtk_container_get_children(GTK_CONTAINER(box->data)); - - GtkWidget *Check = GTK_WIDGET(g_list_nth_data(children,0)); - int active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(Check)); +void on_configuration_mode_switch(GtkWidget *,main_window *widgets){ + int active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->ConfigurationModeCheck)); if (!active){ GtkBuilder *builder = gtk_builder_new_from_resource(glade_path_configuration_mode); configuration_window *window = malloc(sizeof(configuration_window)); @@ -96,6 +90,7 @@ void on_configuration_mode_switch(GtkWidget *self,main_window *widgets){ g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_configuration_exit),window); g_signal_connect(G_OBJECT(window->Window),"destroy",G_CALLBACK(gtk_main_quit),NULL); g_signal_connect(G_OBJECT(window->ChooseButton),"clicked",G_CALLBACK(configuration_mode_accept),window); + g_object_set_data(G_OBJECT(window->Window),"widgets",widgets); g_signal_connect(G_OBJECT(window->PathButton),"clicked",G_CALLBACK(on_path_choose),window); g_object_set_data(G_OBJECT(window->Window),"widgets",widgets); yon_gtk_window_setup(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->MainWindow),CONFIGURATION_MODE_TITLE_LABEL,icon_path,"configuration_window"); @@ -131,8 +126,4 @@ void on_configuration_mode_switch(GtkWidget *self,main_window *widgets){ main_config.configure_mode = 0; } - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(Check),!active); - g_list_free(box); - g_list_free(children); - } diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 803e10e..d731b25 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -856,8 +856,8 @@ void yon_main_window_create(main_window *widgets){ widgets->ConfigurationModeMenuItem = gtk_menu_item_new(); GtkWidget *Box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,5); GtkWidget *Label = gtk_label_new(CONFIGURATION_MODE_LABEL); - GtkWidget *Check = gtk_check_button_new(); - gtk_box_pack_start(GTK_BOX(Box),Check,0,0,0); + widgets->ConfigurationModeCheck = gtk_check_button_new(); + gtk_box_pack_start(GTK_BOX(Box),widgets->ConfigurationModeCheck,0,0,0); gtk_box_pack_start(GTK_BOX(Box),Label,0,0,0); gtk_container_add(GTK_CONTAINER(widgets->ConfigurationModeMenuItem),Box); g_signal_connect(G_OBJECT(widgets->ConfigurationModeMenuItem),"activate",G_CALLBACK(on_configuration_mode_switch),widgets); diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index 14a02c2..8c229be 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -610,6 +610,7 @@ typedef struct GtkWidget *ReadFullLogButton; GtkWidget *ConfigurationModeMenuItem; + GtkWidget *ConfigurationModeCheck; GtkWidget *EnableVNCMenuItem; GtkWidget *EnableRDPMenuItem; GtkWidget *AboutMenuItem;