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
1=== modified file 'src/service.c'
2--- src/service.c 2015-03-25 22:30:30 +0000
3+++ src/service.c 2015-06-04 14:31:59 +0000
4@@ -775,7 +775,7 @@
5 }
6
7 static GMenuModel *
8-create_session_section (IndicatorSessionService * self)
9+create_session_section (IndicatorSessionService * self, int profile)
10 {
11 GMenu * menu;
12 const priv_t * const p = self->priv;
13@@ -790,13 +790,15 @@
14 if (indicator_session_actions_can_hibernate (p->backend_actions))
15 g_menu_append (menu, _("Hibernate"), "indicator.hibernate");
16
17- if (indicator_session_actions_can_reboot (p->backend_actions))
18+ if (profile != PROFILE_LOCKSCREEN &&
19+ indicator_session_actions_can_reboot (p->backend_actions))
20 {
21 const char * label = ellipsis ? _("Restart…") : _("Restart");
22 g_menu_append (menu, label, "indicator.reboot");
23 }
24
25- if (!g_settings_get_boolean (s, "suppress-shutdown-menuitem"))
26+ if (profile != PROFILE_LOCKSCREEN &&
27+ !g_settings_get_boolean (s, "suppress-shutdown-menuitem"))
28 {
29 const char * label = ellipsis ? _("Shut Down…") : _("Shut Down");
30 g_menu_append (menu, label, "indicator.power-off");
31@@ -824,16 +826,16 @@
32 sections[n++] = create_settings_section (self);
33 sections[n++] = create_switch_section (self, profile);
34 sections[n++] = create_logout_section (self);
35- sections[n++] = create_session_section (self);
36+ sections[n++] = create_session_section (self, profile);
37 }
38 else if (profile == PROFILE_GREETER)
39 {
40- sections[n++] = create_session_section (self);
41+ sections[n++] = create_session_section (self, profile);
42 }
43 else if (profile == PROFILE_LOCKSCREEN)
44 {
45 sections[n++] = create_switch_section (self, profile);
46- sections[n++] = create_session_section (self);
47+ sections[n++] = create_session_section (self, profile);
48 }
49
50 /* add sections to the submenu */
51@@ -1080,9 +1082,9 @@
52
53 if (sections & SECTION_SESSION)
54 {
55- rebuild_section (desktop->submenu, 4, create_session_section(self));
56- rebuild_section (greeter->submenu, 0, create_session_section(self));
57- rebuild_section (lockscreen->submenu, 1, create_session_section(self));
58+ rebuild_section (desktop->submenu, 4, create_session_section(self, PROFILE_DESKTOP));
59+ rebuild_section (greeter->submenu, 0, create_session_section(self, PROFILE_GREETER));
60+ rebuild_section (lockscreen->submenu, 1, create_session_section(self, PROFILE_LOCKSCREEN));
61 }
62 }
63

Subscribers

People subscribed via source and target branches