aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac2
-rw-r--r--data/datetime-dialog.ui2
-rw-r--r--data/indicator-datetime-preferences.desktop.in2
-rw-r--r--src/datetime-service.c89
4 files changed, 55 insertions, 40 deletions
diff --git a/configure.ac b/configure.ac
index defb12e..ec4720e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
AC_INIT([indicator-datetime],
- [0.2.91],
+ [0.2.92],
[http://bugs.launchpad.net/indicator-datetime],
[indicator-datetime],
[http://launchpad.net/indicator-datetime])
diff --git a/data/datetime-dialog.ui b/data/datetime-dialog.ui
index c7729b3..59d6753 100644
--- a/data/datetime-dialog.ui
+++ b/data/datetime-dialog.ui
@@ -414,7 +414,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xpad">1</property>
- <property name="label" translatable="yes">_Time and Date</property>
+ <property name="label" translatable="yes">_Time &amp; Date</property>
<property name="use_underline">True</property>
</object>
<packing>
diff --git a/data/indicator-datetime-preferences.desktop.in b/data/indicator-datetime-preferences.desktop.in
index 7e933c3..226ae67 100644
--- a/data/indicator-datetime-preferences.desktop.in
+++ b/data/indicator-datetime-preferences.desktop.in
@@ -1,7 +1,7 @@
[Desktop Entry]
Version=1.0
-_Name=Time and Date
+_Name=Time & Date
_Comment=Change your clock and date settings
Icon=preferences-system-time
diff --git a/src/datetime-service.c b/src/datetime-service.c
index 85c4ddc..c1f1eb6 100644
--- a/src/datetime-service.c
+++ b/src/datetime-service.c
@@ -60,6 +60,7 @@ static gboolean update_timezone_menu_items(gpointer user_data);
static void setup_timer (void);
static void geo_client_invalid (GeoclueMasterClient * client, gpointer user_data);
static void geo_address_change (GeoclueMasterClient * client, gchar * a, gchar * b, gchar * c, gchar * d, gpointer user_data);
+static gboolean get_greeter_mode (void);
static IndicatorService * service = NULL;
static GMainLoop * mainloop = NULL;
@@ -534,6 +535,10 @@ static gboolean
update_timezone_menu_items(gpointer user_data) {
g_debug("Updating timezone menu items");
+ if (locations_separator == NULL || current_location == NULL) {
+ return FALSE;
+ }
+
gchar ** locations = g_settings_get_strv(conf, SETTINGS_LOCATIONS_S);
if (locations == NULL) {
@@ -1077,45 +1082,47 @@ build_menus (DbusmenuMenuitem * root)
g_idle_add(check_for_calendar, NULL);
}
+
+ if (!get_greeter_mode ()) {
+ locations_separator = dbusmenu_menuitem_new();
+ dbusmenu_menuitem_property_set(locations_separator, DBUSMENU_MENUITEM_PROP_TYPE, DBUSMENU_CLIENT_TYPES_SEPARATOR);
+ dbusmenu_menuitem_property_set_bool (locations_separator, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE);
+ dbusmenu_menuitem_child_append(root, locations_separator);
+
+ geo_location = dbusmenu_menuitem_new();
+ dbusmenu_menuitem_property_set (geo_location, DBUSMENU_MENUITEM_PROP_TYPE, TIMEZONE_MENUITEM_TYPE);
+ set_current_timezone_label (geo_location, "");
+ 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);
+ dbusmenu_menuitem_child_append(root, geo_location);
+
+ current_location = dbusmenu_menuitem_new();
+ dbusmenu_menuitem_property_set (current_location, DBUSMENU_MENUITEM_PROP_TYPE, TIMEZONE_MENUITEM_TYPE);
+ set_current_timezone_label (current_location, "");
+ dbusmenu_menuitem_property_set_bool (current_location, DBUSMENU_MENUITEM_PROP_ENABLED, FALSE);
+ dbusmenu_menuitem_property_set_bool (current_location, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE);
+ dbusmenu_menuitem_child_append(root, current_location);
- locations_separator = dbusmenu_menuitem_new();
- dbusmenu_menuitem_property_set(locations_separator, DBUSMENU_MENUITEM_PROP_TYPE, DBUSMENU_CLIENT_TYPES_SEPARATOR);
- dbusmenu_menuitem_property_set_bool (locations_separator, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE);
- dbusmenu_menuitem_child_append(root, locations_separator);
-
- geo_location = dbusmenu_menuitem_new();
- dbusmenu_menuitem_property_set (geo_location, DBUSMENU_MENUITEM_PROP_TYPE, TIMEZONE_MENUITEM_TYPE);
- set_current_timezone_label (geo_location, "");
- 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);
- dbusmenu_menuitem_child_append(root, geo_location);
-
- current_location = dbusmenu_menuitem_new();
- dbusmenu_menuitem_property_set (current_location, DBUSMENU_MENUITEM_PROP_TYPE, TIMEZONE_MENUITEM_TYPE);
- set_current_timezone_label (current_location, "");
- dbusmenu_menuitem_property_set_bool (current_location, DBUSMENU_MENUITEM_PROP_ENABLED, FALSE);
- dbusmenu_menuitem_property_set_bool (current_location, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE);
- dbusmenu_menuitem_child_append(root, current_location);
-
- check_timezone_sync();
+ check_timezone_sync();
- g_signal_connect (conf, "changed::" SETTINGS_SHOW_LOCATIONS_S, G_CALLBACK (show_locations_changed), NULL);
- g_signal_connect (conf, "changed::" SETTINGS_LOCATIONS_S, G_CALLBACK (show_locations_changed), NULL);
- g_signal_connect (conf, "changed::" SETTINGS_SHOW_EVENTS_S, G_CALLBACK (show_events_changed), NULL);
- g_signal_connect (conf, "changed::" SETTINGS_TIME_FORMAT_S, G_CALLBACK (time_format_changed), NULL);
-
- DbusmenuMenuitem * separator = dbusmenu_menuitem_new();
- dbusmenu_menuitem_property_set(separator, DBUSMENU_MENUITEM_PROP_TYPE, DBUSMENU_CLIENT_TYPES_SEPARATOR);
- dbusmenu_menuitem_child_append(root, separator);
-
- settings = dbusmenu_menuitem_new();
- dbusmenu_menuitem_property_set (settings, DBUSMENU_MENUITEM_PROP_LABEL, _("Time and Date Settingsā€¦"));
- /* insensitive until we check for available apps */
- dbusmenu_menuitem_property_set_bool(settings, DBUSMENU_MENUITEM_PROP_ENABLED, FALSE);
- g_signal_connect(G_OBJECT(settings), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(activate_cb), "gnome-control-center indicator-datetime");
- dbusmenu_menuitem_child_append(root, settings);
- g_idle_add(check_for_timeadmin, NULL);
+ g_signal_connect (conf, "changed::" SETTINGS_SHOW_LOCATIONS_S, G_CALLBACK (show_locations_changed), NULL);
+ g_signal_connect (conf, "changed::" SETTINGS_LOCATIONS_S, G_CALLBACK (show_locations_changed), NULL);
+ g_signal_connect (conf, "changed::" SETTINGS_SHOW_EVENTS_S, G_CALLBACK (show_events_changed), NULL);
+ g_signal_connect (conf, "changed::" SETTINGS_TIME_FORMAT_S, G_CALLBACK (time_format_changed), NULL);
+
+ DbusmenuMenuitem * separator = dbusmenu_menuitem_new();
+ dbusmenu_menuitem_property_set(separator, DBUSMENU_MENUITEM_PROP_TYPE, DBUSMENU_CLIENT_TYPES_SEPARATOR);
+ dbusmenu_menuitem_child_append(root, separator);
+
+ settings = dbusmenu_menuitem_new();
+ dbusmenu_menuitem_property_set (settings, DBUSMENU_MENUITEM_PROP_LABEL, _("Time & Date Settingsā€¦"));
+ /* insensitive until we check for available apps */
+ dbusmenu_menuitem_property_set_bool(settings, DBUSMENU_MENUITEM_PROP_ENABLED, FALSE);
+ g_signal_connect(G_OBJECT(settings), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(activate_cb), "gnome-control-center indicator-datetime");
+ dbusmenu_menuitem_child_append(root, settings);
+ g_idle_add(check_for_timeadmin, NULL);
+ }
return;
}
@@ -1396,6 +1403,14 @@ geo_create_client (GeoclueMaster * master, GeoclueMasterClient * client, gchar *
return;
}
+static gboolean
+get_greeter_mode (void)
+{
+ const gchar *var;
+ var = g_getenv("INDICATOR_GREETER_MODE");
+ return (g_strcmp0(var, "1") == 0);
+}
+
/* Repsonds to the service object saying it's time to shutdown.
It stops the mainloop. */
static void