diff options
author | David Barth <david.barth@canonical.com> | 2010-02-16 19:40:23 +0100 |
---|---|---|
committer | David Barth <david.barth@canonical.com> | 2010-02-16 19:40:23 +0100 |
commit | 07f36b8de87ccdaebee842105bd86892f6465d3d (patch) | |
tree | ac26161544e62c8c989a64a5a40cddd1a5faf7ac /src | |
parent | 3ccc99e803d8a43bd932275b2e172cdcce213ad9 (diff) | |
download | ayatana-indicator-session-07f36b8de87ccdaebee842105bd86892f6465d3d.tar.gz ayatana-indicator-session-07f36b8de87ccdaebee842105bd86892f6465d3d.tar.bz2 ayatana-indicator-session-07f36b8de87ccdaebee842105bd86892f6465d3d.zip |
add forgotten separator and re-order the user switch entry according to the spec
Diffstat (limited to 'src')
-rw-r--r-- | src/session-service.c | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/src/session-service.c b/src/session-service.c index e89a9a0..a2da207 100644 --- a/src/session-service.c +++ b/src/session-service.c @@ -437,6 +437,10 @@ rebuild_items (DbusmenuMenuitem *root, if (can_activate == TRUE) { + DbusmenuMenuitem * separator1 = dbusmenu_menuitem_new(); + dbusmenu_menuitem_property_set(separator1, DBUSMENU_MENUITEM_PROP_TYPE, DBUSMENU_CLIENT_TYPES_SEPARATOR); + dbusmenu_menuitem_child_append(root, separator1); + if (check_guest_session ()) { mi = dbusmenu_menuitem_new (); @@ -445,6 +449,25 @@ rebuild_items (DbusmenuMenuitem *root, g_signal_connect (G_OBJECT (mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK (activate_guest_session), NULL); } + if (check_new_session ()) + { + ensure_gconf_client (); + + switch_menuitem = dbusmenu_menuitem_new (); + dbusmenu_menuitem_property_set (switch_menuitem, DBUSMENU_MENUITEM_PROP_LABEL, _("Switch User...")); + dbusmenu_menuitem_child_append (root, switch_menuitem); + g_signal_connect (G_OBJECT (switch_menuitem), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK (activate_new_session), NULL); + + if (gconf_client_get_bool (gconf_client, LOCKDOWN_KEY, NULL)) + { + dbusmenu_menuitem_property_set_bool (switch_menuitem, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE); + } + else + { + dbusmenu_menuitem_property_set_bool (switch_menuitem, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE); + } + } + if (count > MINIMUM_USERS && count < MAXIMUM_USERS) { if (users != NULL) @@ -476,24 +499,6 @@ rebuild_items (DbusmenuMenuitem *root, } } - if (check_new_session ()) - { - ensure_gconf_client (); - - switch_menuitem = dbusmenu_menuitem_new (); - dbusmenu_menuitem_property_set (switch_menuitem, DBUSMENU_MENUITEM_PROP_LABEL, _("Switch User...")); - dbusmenu_menuitem_child_append (root, switch_menuitem); - g_signal_connect (G_OBJECT (switch_menuitem), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK (activate_new_session), NULL); - - if (gconf_client_get_bool (gconf_client, LOCKDOWN_KEY, NULL)) - { - dbusmenu_menuitem_property_set_bool (switch_menuitem, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE); - } - else - { - dbusmenu_menuitem_property_set_bool (switch_menuitem, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE); - } - } } DbusmenuMenuitem * separator = dbusmenu_menuitem_new(); |