Merge lp:~azzar1/indicator-session/lp-1460626 into lp:indicator-session/15.10

Proposed by Andrea Azzarone on 2015-06-04
Status: Merged
Approved by: Marco Trevisan (Treviño) on 2015-08-17
Approved revision: 465
Merged at revision: 465
Proposed branch: lp:~azzar1/indicator-session/lp-1460626
Merge into: lp:indicator-session/15.10
Diff against target: 62 lines (+11/-9)
1 file modified
src/service.c (+11/-9)
To merge this branch: bzr merge lp:~azzar1/indicator-session/lp-1460626
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) 2015-06-04 Approve on 2015-08-17
PS Jenkins bot (community) continuous-integration Approve on 2015-06-04
Review via email: mp+261089@code.launchpad.net

Commit message

Disable shutdown/reboot in the lockscreen.

Description of the change

Disable shutdown/reboot in the lockscreen.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/service.c'
--- src/service.c 2015-03-25 22:30:30 +0000
+++ src/service.c 2015-06-04 14:31:59 +0000
@@ -775,7 +775,7 @@
775}775}
776776
777static GMenuModel *777static GMenuModel *
778create_session_section (IndicatorSessionService * self)778create_session_section (IndicatorSessionService * self, int profile)
779{779{
780 GMenu * menu;780 GMenu * menu;
781 const priv_t * const p = self->priv;781 const priv_t * const p = self->priv;
@@ -790,13 +790,15 @@
790 if (indicator_session_actions_can_hibernate (p->backend_actions))790 if (indicator_session_actions_can_hibernate (p->backend_actions))
791 g_menu_append (menu, _("Hibernate"), "indicator.hibernate");791 g_menu_append (menu, _("Hibernate"), "indicator.hibernate");
792792
793 if (indicator_session_actions_can_reboot (p->backend_actions))793 if (profile != PROFILE_LOCKSCREEN &&
794 indicator_session_actions_can_reboot (p->backend_actions))
794 {795 {
795 const char * label = ellipsis ? _("Restart…") : _("Restart");796 const char * label = ellipsis ? _("Restart…") : _("Restart");
796 g_menu_append (menu, label, "indicator.reboot");797 g_menu_append (menu, label, "indicator.reboot");
797 }798 }
798799
799 if (!g_settings_get_boolean (s, "suppress-shutdown-menuitem"))800 if (profile != PROFILE_LOCKSCREEN &&
801 !g_settings_get_boolean (s, "suppress-shutdown-menuitem"))
800 {802 {
801 const char * label = ellipsis ? _("Shut Down…") : _("Shut Down");803 const char * label = ellipsis ? _("Shut Down…") : _("Shut Down");
802 g_menu_append (menu, label, "indicator.power-off");804 g_menu_append (menu, label, "indicator.power-off");
@@ -824,16 +826,16 @@
824 sections[n++] = create_settings_section (self);826 sections[n++] = create_settings_section (self);
825 sections[n++] = create_switch_section (self, profile);827 sections[n++] = create_switch_section (self, profile);
826 sections[n++] = create_logout_section (self);828 sections[n++] = create_logout_section (self);
827 sections[n++] = create_session_section (self);829 sections[n++] = create_session_section (self, profile);
828 }830 }
829 else if (profile == PROFILE_GREETER)831 else if (profile == PROFILE_GREETER)
830 {832 {
831 sections[n++] = create_session_section (self);833 sections[n++] = create_session_section (self, profile);
832 }834 }
833 else if (profile == PROFILE_LOCKSCREEN)835 else if (profile == PROFILE_LOCKSCREEN)
834 {836 {
835 sections[n++] = create_switch_section (self, profile);837 sections[n++] = create_switch_section (self, profile);
836 sections[n++] = create_session_section (self);838 sections[n++] = create_session_section (self, profile);
837 }839 }
838840
839 /* add sections to the submenu */841 /* add sections to the submenu */
@@ -1080,9 +1082,9 @@
10801082
1081 if (sections & SECTION_SESSION)1083 if (sections & SECTION_SESSION)
1082 {1084 {
1083 rebuild_section (desktop->submenu, 4, create_session_section(self));1085 rebuild_section (desktop->submenu, 4, create_session_section(self, PROFILE_DESKTOP));
1084 rebuild_section (greeter->submenu, 0, create_session_section(self));1086 rebuild_section (greeter->submenu, 0, create_session_section(self, PROFILE_GREETER));
1085 rebuild_section (lockscreen->submenu, 1, create_session_section(self));1087 rebuild_section (lockscreen->submenu, 1, create_session_section(self, PROFILE_LOCKSCREEN));
1086 }1088 }
1087}1089}
10881090

Subscribers

People subscribed via source and target branches