aboutsummaryrefslogtreecommitdiff
path: root/src/datetime-service.c
diff options
context:
space:
mode:
authorMichael Terry <mike@mterry.name>2011-02-15 15:32:56 -0500
committerMichael Terry <mike@mterry.name>2011-02-15 15:32:56 -0500
commit6bc13b2d4f6cab5a349a072d256dcb55418c6ef2 (patch)
tree68d4a6218513a1400c8201c55744daf937b6c7f6 /src/datetime-service.c
parent67264a791f282ac18eba02af4df73f71c9736886 (diff)
downloadayatana-indicator-datetime-6bc13b2d4f6cab5a349a072d256dcb55418c6ef2.tar.gz
ayatana-indicator-datetime-6bc13b2d4f6cab5a349a072d256dcb55418c6ef2.tar.bz2
ayatana-indicator-datetime-6bc13b2d4f6cab5a349a072d256dcb55418c6ef2.zip
re-enable setting the timezone when clicking
Diffstat (limited to 'src/datetime-service.c')
-rw-r--r--src/datetime-service.c23
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();