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
=== modified file 'debian/changelog'
--- debian/changelog 2015-04-04 09:29:37 +0000
+++ debian/changelog 2015-10-21 15:24:40 +0000
@@ -1,3 +1,17 @@
1indicator-session (12.10.5+14.04.20151021-0ubuntu1) trusty; urgency=medium
2
3 * Disable shutdown if screen is locked (lp: #1460626)
4
5 -- Andrea Azzarone <andrea.azzarone@canonical.com> Wed, 21 Oct 2015 17:22:37 +0200
6
7indicator-session (12.10.5+14.04.20151008-0ubuntu1) trusty; urgency=medium
8
9 * Backport fix for segfault in get_user_label() (lp: #1501244) (LP:
10 #1501244)
11 * chmod +x debian/rules
12
13 -- Sebastien Bacher <seb128@ubuntu.com> Thu, 08 Oct 2015 16:33:40 +0000
14
1indicator-session (12.10.5+14.04.20150404-0ubuntu1) trusty; urgency=medium15indicator-session (12.10.5+14.04.20150404-0ubuntu1) trusty; urgency=medium
216
3 [ Dmitry Shachnev ]17 [ Dmitry Shachnev ]
418
=== modified file 'debian/rules' (properties changed: -x to +x)
=== modified file 'src/service.c'
--- src/service.c 2014-04-02 15:02:59 +0000
+++ src/service.c 2015-10-21 15:24:40 +0000
@@ -295,12 +295,21 @@
295{295{
296 const char * c;296 const char * c;
297297
298 /* If blank or whitespace, use username instead */298 /* if real_name exists and is printable, use it */
299 for (c = user->real_name; *c != '\0' && g_ascii_isspace (*c); c++);299 c = user->real_name;
300 if (*c == '\0')300 if ((c != NULL) && g_utf8_validate(c, -1, NULL))
301 return user->user_name;301 {
302302 while (*c != '\0')
303 return user->real_name;303 {
304 if (g_unichar_isgraph(g_utf8_get_char(c)))
305 return user->real_name;
306
307 c = g_utf8_next_char(c);
308 }
309 }
310
311 /* otherwise, use this as a fallback */
312 return user->user_name;
304}313}
305314
306static const char *315static const char *
@@ -675,7 +684,7 @@
675}684}
676685
677static GMenuModel *686static GMenuModel *
678create_session_section (IndicatorSessionService * self)687create_session_section (IndicatorSessionService * self, int profile)
679{688{
680 GMenu * menu;689 GMenu * menu;
681 const priv_t * const p = self->priv;690 const priv_t * const p = self->priv;
@@ -690,13 +699,15 @@
690 if (indicator_session_actions_can_hibernate (p->backend_actions))699 if (indicator_session_actions_can_hibernate (p->backend_actions))
691 g_menu_append (menu, _("Hibernate"), "indicator.hibernate");700 g_menu_append (menu, _("Hibernate"), "indicator.hibernate");
692701
693 if (indicator_session_actions_can_reboot (p->backend_actions))702 if (profile != PROFILE_LOCKSCREEN &&
703 indicator_session_actions_can_reboot (p->backend_actions))
694 {704 {
695 const char * label = ellipsis ? _("Restart…") : _("Restart");705 const char * label = ellipsis ? _("Restart…") : _("Restart");
696 g_menu_append (menu, label, "indicator.reboot");706 g_menu_append (menu, label, "indicator.reboot");
697 }707 }
698708
699 if (!g_settings_get_boolean (s, "suppress-shutdown-menuitem"))709 if (profile != PROFILE_LOCKSCREEN &&
710 !g_settings_get_boolean (s, "suppress-shutdown-menuitem"))
700 {711 {
701 const char * label = ellipsis ? _("Shut Down…") : _("Shut Down");712 const char * label = ellipsis ? _("Shut Down…") : _("Shut Down");
702 g_menu_append (menu, label, "indicator.power-off");713 g_menu_append (menu, label, "indicator.power-off");
@@ -724,16 +735,16 @@
724 sections[n++] = create_settings_section (self);735 sections[n++] = create_settings_section (self);
725 sections[n++] = create_switch_section (self, profile);736 sections[n++] = create_switch_section (self, profile);
726 sections[n++] = create_logout_section (self);737 sections[n++] = create_logout_section (self);
727 sections[n++] = create_session_section (self);738 sections[n++] = create_session_section (self, profile);
728 }739 }
729 else if (profile == PROFILE_GREETER)740 else if (profile == PROFILE_GREETER)
730 {741 {
731 sections[n++] = create_session_section (self);742 sections[n++] = create_session_section (self, profile);
732 }743 }
733 else if (profile == PROFILE_LOCKSCREEN)744 else if (profile == PROFILE_LOCKSCREEN)
734 {745 {
735 sections[n++] = create_switch_section (self, profile);746 sections[n++] = create_switch_section (self, profile);
736 sections[n++] = create_session_section (self);747 sections[n++] = create_session_section (self, profile);
737 }748 }
738749
739 /* add sections to the submenu */750 /* add sections to the submenu */
@@ -980,9 +991,9 @@
980991
981 if (sections & SECTION_SESSION)992 if (sections & SECTION_SESSION)
982 {993 {
983 rebuild_section (desktop->submenu, 4, create_session_section(self));994 rebuild_section (desktop->submenu, 4, create_session_section(self, PROFILE_DESKTOP));
984 rebuild_section (greeter->submenu, 0, create_session_section(self));995 rebuild_section (greeter->submenu, 0, create_session_section(self, PROFILE_GREETER));
985 rebuild_section (lockscreen->submenu, 1, create_session_section(self));996 rebuild_section (lockscreen->submenu, 1, create_session_section(self, PROFILE_LOCKSCREEN));
986 }997 }
987}998}
988999

Subscribers

People subscribed via source and target branches