Merge lp:~azzar1/indicator-session/lp-1460626-trusty into lp:indicator-session/14.04

Proposed by Andrea Azzarone
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: no longer in the source branch.
Merged at revision: 456
Proposed branch: lp:~azzar1/indicator-session/lp-1460626-trusty
Merge into: lp:indicator-session/14.04
Diff against target: 113 lines (+40/-15)
2 files modified
debian/changelog (+14/-0)
src/service.c (+26/-15)
To merge this branch: bzr merge lp:~azzar1/indicator-session/lp-1460626-trusty
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve
Review via email: mp+261087@code.launchpad.net

Commit message

Disable shutdown/reboot in the lockscreen.

To post a comment you must log in.
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

+1

review: Approve
453. By Andrea Azzarone

Sync.

454. By Andrea Azzarone

Merge lp:~azzar1/indicator-session/lp-1460626-trusty.

455. By Andrea Azzarone

chmod +x debian/rules

456. By Andrea Azzarone

Moidfy changelog.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2015-04-04 09:29:37 +0000
3+++ debian/changelog 2015-10-21 15:24:40 +0000
4@@ -1,3 +1,17 @@
5+indicator-session (12.10.5+14.04.20151021-0ubuntu1) trusty; urgency=medium
6+
7+ * Disable shutdown if screen is locked (lp: #1460626)
8+
9+ -- Andrea Azzarone <andrea.azzarone@canonical.com> Wed, 21 Oct 2015 17:22:37 +0200
10+
11+indicator-session (12.10.5+14.04.20151008-0ubuntu1) trusty; urgency=medium
12+
13+ * Backport fix for segfault in get_user_label() (lp: #1501244) (LP:
14+ #1501244)
15+ * chmod +x debian/rules
16+
17+ -- Sebastien Bacher <seb128@ubuntu.com> Thu, 08 Oct 2015 16:33:40 +0000
18+
19 indicator-session (12.10.5+14.04.20150404-0ubuntu1) trusty; urgency=medium
20
21 [ Dmitry Shachnev ]
22
23=== modified file 'debian/rules' (properties changed: -x to +x)
24=== modified file 'src/service.c'
25--- src/service.c 2014-04-02 15:02:59 +0000
26+++ src/service.c 2015-10-21 15:24:40 +0000
27@@ -295,12 +295,21 @@
28 {
29 const char * c;
30
31- /* If blank or whitespace, use username instead */
32- for (c = user->real_name; *c != '\0' && g_ascii_isspace (*c); c++);
33- if (*c == '\0')
34- return user->user_name;
35-
36- return user->real_name;
37+ /* if real_name exists and is printable, use it */
38+ c = user->real_name;
39+ if ((c != NULL) && g_utf8_validate(c, -1, NULL))
40+ {
41+ while (*c != '\0')
42+ {
43+ if (g_unichar_isgraph(g_utf8_get_char(c)))
44+ return user->real_name;
45+
46+ c = g_utf8_next_char(c);
47+ }
48+ }
49+
50+ /* otherwise, use this as a fallback */
51+ return user->user_name;
52 }
53
54 static const char *
55@@ -675,7 +684,7 @@
56 }
57
58 static GMenuModel *
59-create_session_section (IndicatorSessionService * self)
60+create_session_section (IndicatorSessionService * self, int profile)
61 {
62 GMenu * menu;
63 const priv_t * const p = self->priv;
64@@ -690,13 +699,15 @@
65 if (indicator_session_actions_can_hibernate (p->backend_actions))
66 g_menu_append (menu, _("Hibernate"), "indicator.hibernate");
67
68- if (indicator_session_actions_can_reboot (p->backend_actions))
69+ if (profile != PROFILE_LOCKSCREEN &&
70+ indicator_session_actions_can_reboot (p->backend_actions))
71 {
72 const char * label = ellipsis ? _("Restart…") : _("Restart");
73 g_menu_append (menu, label, "indicator.reboot");
74 }
75
76- if (!g_settings_get_boolean (s, "suppress-shutdown-menuitem"))
77+ if (profile != PROFILE_LOCKSCREEN &&
78+ !g_settings_get_boolean (s, "suppress-shutdown-menuitem"))
79 {
80 const char * label = ellipsis ? _("Shut Down…") : _("Shut Down");
81 g_menu_append (menu, label, "indicator.power-off");
82@@ -724,16 +735,16 @@
83 sections[n++] = create_settings_section (self);
84 sections[n++] = create_switch_section (self, profile);
85 sections[n++] = create_logout_section (self);
86- sections[n++] = create_session_section (self);
87+ sections[n++] = create_session_section (self, profile);
88 }
89 else if (profile == PROFILE_GREETER)
90 {
91- sections[n++] = create_session_section (self);
92+ sections[n++] = create_session_section (self, profile);
93 }
94 else if (profile == PROFILE_LOCKSCREEN)
95 {
96 sections[n++] = create_switch_section (self, profile);
97- sections[n++] = create_session_section (self);
98+ sections[n++] = create_session_section (self, profile);
99 }
100
101 /* add sections to the submenu */
102@@ -980,9 +991,9 @@
103
104 if (sections & SECTION_SESSION)
105 {
106- rebuild_section (desktop->submenu, 4, create_session_section(self));
107- rebuild_section (greeter->submenu, 0, create_session_section(self));
108- rebuild_section (lockscreen->submenu, 1, create_session_section(self));
109+ rebuild_section (desktop->submenu, 4, create_session_section(self, PROFILE_DESKTOP));
110+ rebuild_section (greeter->submenu, 0, create_session_section(self, PROFILE_GREETER));
111+ rebuild_section (lockscreen->submenu, 1, create_session_section(self, PROFILE_LOCKSCREEN));
112 }
113 }
114

Subscribers

People subscribed via source and target branches