aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-09-16 11:34:26 -0500
committerTed Gould <ted@canonical.com>2009-09-16 11:34:26 -0500
commitcd4b5a1f7a0a9a3905dee1557e3edf9be46b826e (patch)
treeea1b81c7ea1b4d6aa84e802ae5a3710ed0dd4cc4 /src
parent24543619fb480c635209d8f2382845cb2562a5f1 (diff)
parent35cc4970e77115c83c54bd6a4035a3af761cc0b1 (diff)
downloadayatana-indicator-session-cd4b5a1f7a0a9a3905dee1557e3edf9be46b826e.tar.gz
ayatana-indicator-session-cd4b5a1f7a0a9a3905dee1557e3edf9be46b826e.tar.bz2
ayatana-indicator-session-cd4b5a1f7a0a9a3905dee1557e3edf9be46b826e.zip
Merging in design team requested fixes for labels and menu item placement.
Diffstat (limited to 'src')
-rw-r--r--src/session-service.c4
-rw-r--r--src/status-service.c36
-rw-r--r--src/users-service.c34
3 files changed, 36 insertions, 38 deletions
diff --git a/src/session-service.c b/src/session-service.c
index 4db0a6e..9c3c4ef 100644
--- a/src/session-service.c
+++ b/src/session-service.c
@@ -259,9 +259,9 @@ create_items (DbusmenuMenuitem * root) {
shutdown_mi = dbusmenu_menuitem_new();
if (supress_confirmations()) {
- dbusmenu_menuitem_property_set(shutdown_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Shutdown"));
+ dbusmenu_menuitem_property_set(shutdown_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Shut Down"));
} else {
- dbusmenu_menuitem_property_set(shutdown_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Shutdown..."));
+ dbusmenu_menuitem_property_set(shutdown_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Shut Down..."));
}
dbusmenu_menuitem_child_append(root, shutdown_mi);
g_signal_connect(G_OBJECT(shutdown_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(show_dialog), "shutdown");
diff --git a/src/status-service.c b/src/status-service.c
index b4a2e09..fe02dd0 100644
--- a/src/status-service.c
+++ b/src/status-service.c
@@ -96,8 +96,6 @@ status_update (void) {
if (global_status != oldglobal) {
g_debug("Global status changed to: %s", _(status_strings[global_status]));
- /* Set the status name on the menu item */
- dbusmenu_menuitem_property_set(status_menuitem, DBUSMENU_MENUITEM_PROP_LABEL, _(status_strings[global_status]));
/* Configure the icon on the panel */
status_service_dbus_set_status(dbus_interface, status_icons[global_status]);
@@ -125,33 +123,6 @@ status_update (void) {
return;
}
-/* A fun little function to actually lock the screen. If,
- that's what you want, let's do it! */
-static void
-lock_screen (DbusmenuMenuitem * mi, gpointer data)
-{
- g_debug("Lock Screen");
-
- DBusGConnection * session_bus = dbus_g_bus_get(DBUS_BUS_SESSION, NULL);
- g_return_if_fail(session_bus != NULL);
-
- DBusGProxy * proxy = dbus_g_proxy_new_for_name_owner(session_bus,
- "org.gnome.ScreenSaver",
- "/",
- "org.gnome.ScreenSaver",
- NULL);
- g_return_if_fail(proxy != NULL);
-
- dbus_g_proxy_call_no_reply(proxy,
- "Lock",
- G_TYPE_INVALID,
- G_TYPE_INVALID);
-
- g_object_unref(proxy);
-
- return;
-}
-
static void
status_menu_click (DbusmenuMenuitem * mi, gpointer data)
{
@@ -219,7 +190,7 @@ build_menu (gpointer data)
build_user_item(root);
status_menuitem = dbusmenu_menuitem_new();
- dbusmenu_menuitem_property_set(status_menuitem, DBUSMENU_MENUITEM_PROP_LABEL, _(status_strings[global_status]));
+ dbusmenu_menuitem_property_set(status_menuitem, DBUSMENU_MENUITEM_PROP_LABEL, _("Set Status"));
dbusmenu_menuitem_child_append(root, status_menuitem);
StatusProviderStatus i;
@@ -245,11 +216,6 @@ build_menu (gpointer data)
g_debug("Built %s", status_strings[i]);
}
- DbusmenuMenuitem * mi = dbusmenu_menuitem_new();
- dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Lock Screen"));
- g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(lock_screen), GINT_TO_POINTER(i));
- dbusmenu_menuitem_child_append(root, mi);
-
return FALSE;
}
diff --git a/src/users-service.c b/src/users-service.c
index d50a277..7ad1732 100644
--- a/src/users-service.c
+++ b/src/users-service.c
@@ -109,10 +109,42 @@ activate_new_session (DbusmenuMenuitem * mi, gpointer user_data)
return;
}
+/* A fun little function to actually lock the screen. If,
+ that's what you want, let's do it! */
+static void
+lock_screen (DbusmenuMenuitem * mi, gpointer data)
+{
+ g_debug("Lock Screen");
+
+ DBusGConnection * session_bus = dbus_g_bus_get(DBUS_BUS_SESSION, NULL);
+ g_return_if_fail(session_bus != NULL);
+
+ DBusGProxy * proxy = dbus_g_proxy_new_for_name_owner(session_bus,
+ "org.gnome.ScreenSaver",
+ "/",
+ "org.gnome.ScreenSaver",
+ NULL);
+ g_return_if_fail(proxy != NULL);
+
+ dbus_g_proxy_call_no_reply(proxy,
+ "Lock",
+ G_TYPE_INVALID,
+ G_TYPE_INVALID);
+
+ g_object_unref(proxy);
+
+ return;
+}
+
static void
create_items (DbusmenuMenuitem * root) {
DbusmenuMenuitem * mi = NULL;
+ mi = dbusmenu_menuitem_new();
+ dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Lock Screen"));
+ g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(lock_screen), NULL);
+ dbusmenu_menuitem_child_append(root, mi);
+
if (check_guest_session()) {
mi = dbusmenu_menuitem_new();
dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Guest Session"));
@@ -122,7 +154,7 @@ create_items (DbusmenuMenuitem * root) {
if (check_new_session()) {
mi = dbusmenu_menuitem_new();
- dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("New Session..."));
+ dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Switch User..."));
dbusmenu_menuitem_child_append(root, mi);
g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(activate_new_session), NULL);
}