From 58ab5be0e5735cb966eaffa715dfbcc1062289a6 Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Wed, 4 Feb 2026 15:59:00 +0600 Subject: [PATCH] WIP Region changes --- source/ubinstall-gtk-installation.c | 1 - source/ubinstall-gtk-region.c | 15 +++++++++++++++ source/ubinstall-gtk.c | 1 + ubinstall-gtk.glade | 3 --- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/source/ubinstall-gtk-installation.c b/source/ubinstall-gtk-installation.c index 6240408..06ebbfd 100644 --- a/source/ubinstall-gtk-installation.c +++ b/source/ubinstall-gtk-installation.c @@ -325,7 +325,6 @@ void on_device_selection_changed(GtkWidget *self, main_window *widgets){ void yon_devices_setup(main_window *widgets){ GtkTreeIter iter; - // if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(widgets->DevicesList),&iter)) return; gtk_list_store_clear(widgets->DevicesList); int size; config_str parsed = NULL; diff --git a/source/ubinstall-gtk-region.c b/source/ubinstall-gtk-region.c index d5b5bfe..dc1f59e 100644 --- a/source/ubinstall-gtk-region.c +++ b/source/ubinstall-gtk-region.c @@ -57,12 +57,27 @@ void on_zone_changed(GtkWidget *, main_window *widgets){ void on_map_selection_changed(GtkWidget *,CcTimezoneLocation *location,main_window *widgets){ if (!location) return; g_signal_handlers_block_by_func(G_OBJECT(widgets->ZoneCombo),G_CALLBACK(on_zone_changed),widgets); + g_signal_handlers_block_by_func(G_OBJECT(widgets->RegionEntry),G_CALLBACK(on_region_entry_changed),widgets); char *zone = yon_char_new(cc_timezone_location_get_zone(location)); char *timezone = yon_char_divide_search(zone,"/",-1); gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->RegionCombo),timezone); while(gtk_events_pending()) gtk_main_iteration(); gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->ZoneCombo),zone); + if (!yon_char_is_empty(timezone)) free(timezone); + + timezone = (char*)cc_timezone_location_get_zone(location); + GtkTreeIter iter; + for_iter(widgets->RegionTimezoneCompletionList,&iter){ + char *render, *tz; + gtk_tree_model_get(GTK_TREE_MODEL(widgets->RegionTimezoneCompletionList),&iter,0,&render,1,&tz,-1); + if (!strcmp(timezone,tz)){ + gtk_entry_set_text(GTK_ENTRY(widgets->RegionEntry),render); + + } + } g_signal_handlers_unblock_by_func(G_OBJECT(widgets->ZoneCombo),G_CALLBACK(on_zone_changed),widgets); + g_signal_handlers_unblock_by_func(G_OBJECT(widgets->RegionEntry),G_CALLBACK(on_region_entry_changed),widgets); + } diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 3e20f91..e366cfb 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -780,6 +780,7 @@ void yon_main_window_create(main_window *widgets){ g_signal_connect(G_OBJECT(widgets->RegionSensitiveSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch),widgets->RegionCombo); g_signal_connect(G_OBJECT(widgets->RegionSensitiveSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch),widgets->ZoneCombo); g_signal_connect(G_OBJECT(widgets->RegionSensitiveSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch),widgets->RegionMapBox); + g_signal_connect(G_OBJECT(widgets->RegionSensitiveSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch),widgets->RegionEntry); g_signal_connect(G_OBJECT(widgets->KeyboardLayoutTree),"cursor-changed",G_CALLBACK(on_layout_selection_changed),widgets); g_signal_connect(G_OBJECT(widgets->KeyboardDefaultLayoutsSwitch),"state-set",G_CALLBACK(on_layout_default_toggled),widgets); diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index 36d6105..9ad3676 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -3712,7 +3712,6 @@ agreement - True True Region: @@ -3724,7 +3723,6 @@ agreement - True False 5 @@ -3760,7 +3758,6 @@ agreement 5 - True False Zone: