From 6843b6b5796433de2949169d8fcb85443b0c1a3b Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Tue, 24 Feb 2026 10:34:30 +0600 Subject: [PATCH] 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