|
|
|
|
@ -113,7 +113,7 @@ void on_map_selection_changed(GtkWidget *,CcTimezoneLocation *location,main_wind
|
|
|
|
|
|
|
|
|
|
char *timezone = (char*)cc_timezone_location_get_zone(location);
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
int found = 0;
|
|
|
|
|
// int found = 0;
|
|
|
|
|
for_iter(widgets->RegionTimezoneCompletionList,&iter){
|
|
|
|
|
char *render, *tz;
|
|
|
|
|
gtk_tree_model_get(GTK_TREE_MODEL(widgets->RegionTimezoneCompletionList),&iter,0,&render,1,&tz,-1);
|
|
|
|
|
@ -124,20 +124,20 @@ void on_map_selection_changed(GtkWidget *,CcTimezoneLocation *location,main_wind
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(widgets->RegionEntry),render);
|
|
|
|
|
char *utc = yon_timezone_get_utc(tz);
|
|
|
|
|
yon_map_status_show(widgets,NULL,MAP_TITLE_LABEL(utc),render);
|
|
|
|
|
found = 1;
|
|
|
|
|
// found = 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!found){
|
|
|
|
|
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 *timezone = yon_char_unite(region,"/",zone,NULL);
|
|
|
|
|
g_signal_handlers_block_by_func(G_OBJECT(widgets->RegionMapTarget),G_CALLBACK(on_map_selection_changed),widgets);
|
|
|
|
|
cc_timezone_map_set_timezone(CC_TIMEZONE_MAP(widgets->RegionMapTarget),timezone);
|
|
|
|
|
g_signal_handlers_unblock_by_func(G_OBJECT(widgets->RegionMapTarget),G_CALLBACK(on_map_selection_changed),widgets);
|
|
|
|
|
free(timezone);
|
|
|
|
|
}
|
|
|
|
|
// if (!found){
|
|
|
|
|
// 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 *timezone = yon_char_unite(region,"/",zone,NULL);
|
|
|
|
|
// g_signal_handlers_block_by_func(G_OBJECT(widgets->RegionMapTarget),G_CALLBACK(on_map_selection_changed),widgets);
|
|
|
|
|
// cc_timezone_map_set_timezone(CC_TIMEZONE_MAP(widgets->RegionMapTarget),timezone);
|
|
|
|
|
// g_signal_handlers_unblock_by_func(G_OBJECT(widgets->RegionMapTarget),G_CALLBACK(on_map_selection_changed),widgets);
|
|
|
|
|
// free(timezone);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(region)) free(region);
|
|
|
|
|
g_signal_handlers_unblock_by_func(G_OBJECT(widgets->ZoneCombo),G_CALLBACK(on_zone_changed),widgets);
|
|
|
|
|
|