diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/datetime-service.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/datetime-service.c b/src/datetime-service.c index 795403f..432657d 100644 --- a/src/datetime-service.c +++ b/src/datetime-service.c @@ -216,7 +216,7 @@ update_current_timezone (void) { return; } -/* See how our timezone setting went +/* See how our timezone setting went */ static void quick_set_tz_cb (OobsObject * obj, OobsResult result, gpointer user_data) { @@ -226,26 +226,27 @@ quick_set_tz_cb (OobsObject * obj, OobsResult result, gpointer user_data) g_warning("Unable to quick set timezone"); } return; -}*/ +} -/* Set the timezone to the Geoclue discovered one +/* Set the timezone to the Geoclue discovered one */ static void -quick_set_tz (DbusmenuMenuitem * menuitem, guint timestamp, const gchar *command) +quick_set_tz (DbusmenuMenuitem * menuitem, guint timestamp, gpointer user_data) { - g_debug("Quick setting timezone to: %s", geo_timezone); + const gchar * tz = dbusmenu_menuitem_property_get(menuitem, TIMEZONE_MENUITEM_PROP_LABEL); + g_debug("Quick setting timezone to: %s", tz); - g_return_if_fail(geo_timezone != NULL); + g_return_if_fail(tz != NULL); OobsObject * obj = oobs_time_config_get(); g_return_if_fail(obj != NULL); OobsTimeConfig * timeconfig = OOBS_TIME_CONFIG(obj); - oobs_time_config_set_timezone(timeconfig, geo_timezone); + oobs_time_config_set_timezone(timeconfig, tz); oobs_object_commit_async(obj, quick_set_tz_cb, NULL); return; -}*/ +} /* Updates the label in the date menuitem */ static gboolean @@ -405,7 +406,7 @@ update_timezone_menu_items(gpointer user_data) { dbusmenu_menuitem_property_set_bool (item, DBUSMENU_MENUITEM_PROP_ENABLED, TRUE); dbusmenu_menuitem_property_set_bool (item, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE); dbusmenu_menuitem_child_add_position (root, item, offset++); - //g_signal_connect(G_OBJECT(item), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(quick_set_tz), NULL); + g_signal_connect(G_OBJECT(item), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(quick_set_tz), NULL); dconflocations = g_list_append(dconflocations, item); } } @@ -694,7 +695,7 @@ build_menus (DbusmenuMenuitem * root) dbusmenu_menuitem_property_set (geo_location, TIMEZONE_MENUITEM_PROP_LABEL, "Updating location information..."); dbusmenu_menuitem_property_set_bool (geo_location, DBUSMENU_MENUITEM_PROP_ENABLED, FALSE); dbusmenu_menuitem_property_set_bool (geo_location, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE); - //g_signal_connect(G_OBJECT(geo_location), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(quick_set_tz), NULL); + g_signal_connect(G_OBJECT(geo_location), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(quick_set_tz), NULL); dbusmenu_menuitem_child_append(root, geo_location); current_location = dbusmenu_menuitem_new(); @@ -702,7 +703,7 @@ build_menus (DbusmenuMenuitem * root) dbusmenu_menuitem_property_set (current_location, TIMEZONE_MENUITEM_PROP_LABEL, "Current Timezone"); dbusmenu_menuitem_property_set_bool (current_location, DBUSMENU_MENUITEM_PROP_ENABLED, FALSE); dbusmenu_menuitem_property_set_bool (current_location, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE); - //g_signal_connect(G_OBJECT(current_location), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(quick_set_tz), NULL); + g_signal_connect(G_OBJECT(current_location), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(quick_set_tz), NULL); dbusmenu_menuitem_child_append(root, current_location); check_timezone_sync(); |