From 8209489895498d61afe43c61a6c517069b0f52b3 Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Tue, 24 Feb 2026 19:12:26 +0600 Subject: [PATCH] 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 +