From dd47c48d54f35e1fb0fdffcf6824e27ca96825a5 Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Mon, 9 Feb 2026 14:21:28 +0600 Subject: [PATCH] Advanced format combo fixes --- source/ubinstall-gtk-advanced.c | 11 ++--------- source/ubinstall-gtk-installation.c | 6 ++++-- ubinstall-gtk.glade | 1 + 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/source/ubinstall-gtk-advanced.c b/source/ubinstall-gtk-advanced.c index da26162..d2b163f 100644 --- a/source/ubinstall-gtk-advanced.c +++ b/source/ubinstall-gtk-advanced.c @@ -693,14 +693,7 @@ void yon_advanced_part_parameter_changed(GtkWidget *self, advanced_partition *pa section->encryption = yon_char_new(gtk_combo_box_get_active_id(GTK_COMBO_BOX(part->EncryptionCombo))); section->encryption_password = yon_char_new(gtk_entry_get_text(GTK_ENTRY(part->EncryptionEntry))); } else if (self == part->FormatCombo){ - int format_active = gtk_combo_box_get_active(GTK_COMBO_BOX(part->FormatCombo)); - if (format_active == 2){ - section->format=2; - } else if (format_active == 1){ - section->format=1; - } else { - section->format=0; - } + section->format = gtk_combo_box_get_active(GTK_COMBO_BOX(part->FormatCombo)); } } @@ -743,8 +736,8 @@ advanced_partition *yon_advanced_partition_new(){ gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(part->SizeCombo),"T",_("Tb")); gtk_combo_box_set_active(GTK_COMBO_BOX(part->SizeCombo),0); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(part->FormatCombo),DEFAULT_LABEL); gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(part->FormatCombo),DO_NOT_FORMAT_LABEL); - gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(part->FormatCombo),AUTOMATIC_FORMAT_LABEL); gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(part->FormatCombo),FORMAT_LABEL); gtk_combo_box_set_active(GTK_COMBO_BOX(part->FormatCombo),0); diff --git a/source/ubinstall-gtk-installation.c b/source/ubinstall-gtk-installation.c index 1a2db87..d5fc62f 100644 --- a/source/ubinstall-gtk-installation.c +++ b/source/ubinstall-gtk-installation.c @@ -194,8 +194,10 @@ int yon_advanced_sections_save(dictionary *dict){ char *part = yon_char_unite(part_first,last_section?",":NULL,part_last,NULL); yon_config_register(part_parameter,part_parameter_command,part); - char * format_first = gtk_switch_get_active(GTK_SWITCH(first_section->FormatCombo))?"yes":"no"; - char * format_last = last_section?gtk_switch_get_active(GTK_SWITCH(last_section->FormatCombo))?"yes":"no":NULL; + int format_first_active = gtk_switch_get_active(GTK_SWITCH(first_section->FormatCombo)); + int format_last_active = gtk_switch_get_active(GTK_SWITCH(last_section->FormatCombo)); + char * format_first = format_first_active==1?"yes":format_first_active==2?"no":NULL; + char * format_last = format_last_active==1?"yes":format_last_active==2?"no":NULL; char *format = yon_char_unite(format_first,part_last?",":NULL,format_last,NULL); yon_config_register(part_format_parameter,part_format_parameter_command,format); diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index 4e5e2d3..61a2ce5 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -3840,6 +3840,7 @@ agreement True + False True entrycompletion1