diff options
author | Andrea Azzarone andrea.azzarone@canonical.com <Unknown> | 2015-06-04 16:30:21 +0200 |
---|---|---|
committer | Andrea Azzarone andrea.azzarone@canonical.com <Unknown> | 2015-06-04 16:30:21 +0200 |
commit | 47e85742d81326bad56f476719109a0e71bc8237 (patch) | |
tree | 689c714996c7bd4c8cade77fc51a9d0e1481dec1 | |
parent | ffe4d92c8e76fd8385c5d3ed9907faf9b6bf1617 (diff) | |
download | ayatana-indicator-session-47e85742d81326bad56f476719109a0e71bc8237.tar.gz ayatana-indicator-session-47e85742d81326bad56f476719109a0e71bc8237.tar.bz2 ayatana-indicator-session-47e85742d81326bad56f476719109a0e71bc8237.zip |
Disable shutdown/reboot in the lockscreen.
-rw-r--r-- | src/service.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/service.c b/src/service.c index 9fda2f1..d9bd8e1 100644 --- a/src/service.c +++ b/src/service.c @@ -775,7 +775,7 @@ create_logout_section (IndicatorSessionService * self) } static GMenuModel * -create_session_section (IndicatorSessionService * self) +create_session_section (IndicatorSessionService * self, int profile) { GMenu * menu; const priv_t * const p = self->priv; @@ -790,13 +790,15 @@ create_session_section (IndicatorSessionService * self) if (indicator_session_actions_can_hibernate (p->backend_actions)) g_menu_append (menu, _("Hibernate"), "indicator.hibernate"); - if (indicator_session_actions_can_reboot (p->backend_actions)) + if (profile != PROFILE_LOCKSCREEN && + indicator_session_actions_can_reboot (p->backend_actions)) { const char * label = ellipsis ? _("Restart…") : _("Restart"); g_menu_append (menu, label, "indicator.reboot"); } - if (!g_settings_get_boolean (s, "suppress-shutdown-menuitem")) + if (profile != PROFILE_LOCKSCREEN && + !g_settings_get_boolean (s, "suppress-shutdown-menuitem")) { const char * label = ellipsis ? _("Shut Down…") : _("Shut Down"); g_menu_append (menu, label, "indicator.power-off"); @@ -824,16 +826,16 @@ create_menu (IndicatorSessionService * self, int profile) sections[n++] = create_settings_section (self); sections[n++] = create_switch_section (self, profile); sections[n++] = create_logout_section (self); - sections[n++] = create_session_section (self); + sections[n++] = create_session_section (self, profile); } else if (profile == PROFILE_GREETER) { - sections[n++] = create_session_section (self); + sections[n++] = create_session_section (self, profile); } else if (profile == PROFILE_LOCKSCREEN) { sections[n++] = create_switch_section (self, profile); - sections[n++] = create_session_section (self); + sections[n++] = create_session_section (self, profile); } /* add sections to the submenu */ @@ -1080,9 +1082,9 @@ rebuild_now (IndicatorSessionService * self, int sections) if (sections & SECTION_SESSION) { - rebuild_section (desktop->submenu, 4, create_session_section(self)); - rebuild_section (greeter->submenu, 0, create_session_section(self)); - rebuild_section (lockscreen->submenu, 1, create_session_section(self)); + rebuild_section (desktop->submenu, 4, create_session_section(self, PROFILE_DESKTOP)); + rebuild_section (greeter->submenu, 0, create_session_section(self, PROFILE_GREETER)); + rebuild_section (lockscreen->submenu, 1, create_session_section(self, PROFILE_LOCKSCREEN)); } } |