From 3114b6d07e68d06af1310ff95274c8025ae10f52 Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Tue, 7 Apr 2026 15:31:38 +0600 Subject: [PATCH] Fixed region removing --- source/ubinstall-gtk-region.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/source/ubinstall-gtk-region.c b/source/ubinstall-gtk-region.c index e335b74..4437408 100644 --- a/source/ubinstall-gtk-region.c +++ b/source/ubinstall-gtk-region.c @@ -13,11 +13,15 @@ int yon_region_save(main_window *widgets){ yon_ubl_status_highlight_incorrect(widgets->ZoneCombo); return 0; } - const char *region = gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->RegionCombo)); - const char *zone = gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->ZoneCombo)); - char *final = yon_char_unite(region,"/",zone,NULL); - yon_config_register(zone_parameter,zone_parameter_command,final); - free(final); + if (gtk_switch_get_active(GTK_SWITCH(widgets->RegionSensitiveSwitch))){ + const char *region = gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->RegionCombo)); + const char *zone = gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->ZoneCombo)); + char *final = yon_char_unite(region,"/",zone,NULL); + yon_config_register(zone_parameter,zone_parameter_command,final); + free(final); + } else { + yon_config_remove_by_key(zone_parameter); + } if (!main_config.configure_mode){ yon_debug_output("%s\n",yon_config_save_args_simple(main_config.config_load_path,zone_parameter,NULL)); }