|
|
|
|
@ -1,4 +1,5 @@
|
|
|
|
|
#include "ubinstall-gtk.h"
|
|
|
|
|
#include "timezonemap/cc-timezone-map.h"
|
|
|
|
|
|
|
|
|
|
int yon_region_save(main_window *widgets){
|
|
|
|
|
if (gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->RegionCombo))==-1){
|
|
|
|
|
@ -34,7 +35,37 @@ void on_region_changed(GtkComboBox *self, main_window *widgets){
|
|
|
|
|
free(active);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_map_selection_changed(GtkWidget *,CcTimezoneLocation *location,main_window *);
|
|
|
|
|
void on_map_selection_changed(GtkWidget *,CcTimezoneLocation *location,main_window *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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void yon_region_init(main_window *widgets){
|
|
|
|
|
#ifdef TIMEZONEMAP_INCLUDE
|
|
|
|
|
yon_debug_output("%s\n","TIMEZONEMAP enabled");
|
|
|
|
|
GList *list = gtk_container_get_children(GTK_CONTAINER(widgets->RegionMapBox));
|
|
|
|
|
if (list){
|
|
|
|
|
GList *iter;
|
|
|
|
|
for (iter = list; iter; iter=iter->next){
|
|
|
|
|
gtk_widget_destroy(iter->data);
|
|
|
|
|
}
|
|
|
|
|
g_list_free(list);
|
|
|
|
|
}
|
|
|
|
|
widgets->RegionMapTarget = GTK_WIDGET(cc_timezone_map_new());
|
|
|
|
|
gtk_box_pack_start(GTK_BOX(widgets->RegionMapBox),GTK_WIDGET(widgets->RegionMapTarget),1,1,0);
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->RegionMapTarget),"location-changed",G_CALLBACK(on_map_selection_changed),widgets);
|
|
|
|
|
gtk_widget_show(GTK_WIDGET(widgets->RegionMapTarget));
|
|
|
|
|
char *config_param = config(zone_parameter);
|
|
|
|
|
if (!yon_char_is_empty(config_param)){
|
|
|
|
|
cc_timezone_map_set_timezone(CC_TIMEZONE_MAP(widgets->RegionMapTarget),config_param);
|
|
|
|
|
// cc_timezone_map_set_location(CC_TIMEZONE_MAP(widgets->RegionMapTarget),lon, lat);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
int size;
|
|
|
|
|
config_str parsed = NULL;
|
|
|
|
|
parsed = yon_dir_get_contents(zone_path,&size);
|
|
|
|
|
|