|
|
|
@ -1,5 +1,7 @@
|
|
|
|
#include "ubinstall-gtk.h"
|
|
|
|
#include "ubinstall-gtk.h"
|
|
|
|
|
|
|
|
#ifdef TIMEZONEMAP_INCLUDE
|
|
|
|
#include "timezonemap/cc-timezone-map.h"
|
|
|
|
#include "timezonemap/cc-timezone-map.h"
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
int yon_region_save(main_window *widgets){
|
|
|
|
int yon_region_save(main_window *widgets){
|
|
|
|
if (gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->RegionCombo))==-1){
|
|
|
|
if (gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->RegionCombo))==-1){
|
|
|
|
@ -19,6 +21,19 @@ int yon_region_save(main_window *widgets){
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef TIMEZONEMAP_INCLUDE
|
|
|
|
|
|
|
|
void on_map_selection_changed(GtkWidget *,CcTimezoneLocation *location,main_window *);
|
|
|
|
|
|
|
|
void on_zone_changed(GtkWidget *, main_window *widgets){
|
|
|
|
|
|
|
|
g_signal_handlers_block_by_func(G_OBJECT(widgets->RegionMapTarget),G_CALLBACK(on_map_selection_changed),widgets);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
void on_region_changed(GtkComboBox *self, main_window *widgets){
|
|
|
|
void on_region_changed(GtkComboBox *self, main_window *widgets){
|
|
|
|
char *active = (char*)gtk_combo_box_get_active_id(self);
|
|
|
|
char *active = (char*)gtk_combo_box_get_active_id(self);
|
|
|
|
active = yon_char_append("/usr/share/zoneinfo/",active);
|
|
|
|
active = yon_char_append("/usr/share/zoneinfo/",active);
|
|
|
|
@ -35,15 +50,19 @@ void on_region_changed(GtkComboBox *self, main_window *widgets){
|
|
|
|
free(active);
|
|
|
|
free(active);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_map_selection_changed(GtkWidget *,CcTimezoneLocation *location,main_window *);
|
|
|
|
#ifdef TIMEZONEMAP_INCLUDE
|
|
|
|
void on_map_selection_changed(GtkWidget *,CcTimezoneLocation *location,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);
|
|
|
|
char *zone = yon_char_new(cc_timezone_location_get_zone(location));
|
|
|
|
char *zone = yon_char_new(cc_timezone_location_get_zone(location));
|
|
|
|
char *timezone = yon_char_divide_search(zone,"/",-1);
|
|
|
|
char *timezone = yon_char_divide_search(zone,"/",-1);
|
|
|
|
gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->RegionCombo),timezone);
|
|
|
|
gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->RegionCombo),timezone);
|
|
|
|
while(gtk_events_pending()) gtk_main_iteration();
|
|
|
|
while(gtk_events_pending()) gtk_main_iteration();
|
|
|
|
gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->ZoneCombo),zone);
|
|
|
|
gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->ZoneCombo),zone);
|
|
|
|
}
|
|
|
|
g_signal_handlers_unblock_by_func(G_OBJECT(widgets->ZoneCombo),G_CALLBACK(on_zone_changed),widgets);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
void yon_region_init(main_window *widgets){
|
|
|
|
void yon_region_init(main_window *widgets){
|
|
|
|
#ifdef TIMEZONEMAP_INCLUDE
|
|
|
|
#ifdef TIMEZONEMAP_INCLUDE
|
|
|
|
|