aboutsummaryrefslogtreecommitdiff
path: root/src/service.c
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2013-07-12 02:03:13 -0500
committerCharles Kerr <charles.kerr@canonical.com>2013-07-12 02:03:13 -0500
commit98d1379784757b63e317bcd9ac7af69836e473d9 (patch)
treeee960cfd6593540d48bc7b57c92754c8e5e0b76d /src/service.c
parentf71bc96e3131f4241256a850ab8c0b556bdac4dd (diff)
downloadayatana-indicator-session-98d1379784757b63e317bcd9ac7af69836e473d9.tar.gz
ayatana-indicator-session-98d1379784757b63e317bcd9ac7af69836e473d9.tar.bz2
ayatana-indicator-session-98d1379784757b63e317bcd9ac7af69836e473d9.zip
Add a 'can-reboot' property to the Actions class.
This is used for handling a couple of pathological cases where features and states mix and match: 1. unity has the same dialog for 'reboot' and 'power off', so remove the duplicate menuitem, EXCEPT: 2. if the unity prompt isn't available (such as in the greeter), show both menuitems, OR 3. if the user has prompting disabled we need both, OR 4. if the user has the 'power off' button disabled, don't treat 'reboot' as redundant.
Diffstat (limited to 'src/service.c')
-rw-r--r--src/service.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/service.c b/src/service.c
index 166f729..3de37e3 100644
--- a/src/service.c
+++ b/src/service.c
@@ -529,8 +529,7 @@ create_session_section (IndicatorSessionService * self, int profile)
menu = g_menu_new ();
if ((profile == PROFILE_DESKTOP) &&
- (indicator_session_actions_can_logout (p->backend_actions)) &&
- (!g_settings_get_boolean (s, "suppress-logout-menuitem")))
+ (indicator_session_actions_can_logout (p->backend_actions)))
{
const char * label = ellipsis ? _("Log Out…") : _("Log Out");
g_menu_append (menu, label, "indicator.logout");
@@ -542,9 +541,7 @@ create_session_section (IndicatorSessionService * self, int profile)
if (indicator_session_actions_can_hibernate (p->backend_actions))
g_menu_append (menu, _("Hibernate"), "indicator.hibernate");
- /* NB: check 'ellipsis' here to skip this item if prompting is enabled
- because this shows the same prompt as 'Shut Down' in Unity */
- if (!ellipsis && !g_settings_get_boolean (s, "suppress-restart-menuitem"))
+ if (indicator_session_actions_can_reboot (p->backend_actions))
{
const char * label = ellipsis ? _("Restart…") : _("Restart");
g_menu_append (menu, label, "indicator.reboot");
@@ -1021,10 +1018,6 @@ indicator_session_service_init (IndicatorSessionService * self)
G_CALLBACK(rebuild_switch_section_soon), self);
g_signal_connect_swapped (gp, "changed::suppress-logout-restart-shutdown",
G_CALLBACK(rebuild_session_section_soon), self);
- g_signal_connect_swapped (gp, "changed::suppress-logout-menuitem",
- G_CALLBACK(rebuild_session_section_soon), self);
- g_signal_connect_swapped (gp, "changed::suppress-restart-menuitem",
- G_CALLBACK(rebuild_session_section_soon), self);
g_signal_connect_swapped (gp, "changed::suppress-shutdown-menuitem",
G_CALLBACK(rebuild_session_section_soon), self);
g_signal_connect_swapped (gp, "changed::show-real-name-on-panel",