~ci-train-bot/indicator-session/indicator-session-ubuntu-zesty-2188.1

« back to all changes in this revision

Viewing changes to src/service.c

  • Committer: CI Train Bot
  • Author(s): andrea.azzarone at canonical
  • Date: 2015-09-15 07:47:21 UTC
  • mfrom: (464.1.1 indicator-session)
  • Revision ID: ci-train-bot@canonical.com-20150915074721-e0pmwym4jshj3j8f
Disable shutdown/reboot in the lockscreen. Fixes: #1460626
Approved by: PS Jenkins bot, Marco Trevisan (Treviño)

Show diffs side-by-side

added added

removed removed

Lines of Context:
775
775
}
776
776
 
777
777
static GMenuModel *
778
 
create_session_section (IndicatorSessionService * self)
 
778
create_session_section (IndicatorSessionService * self, int profile)
779
779
{
780
780
  GMenu * menu;
781
781
  const priv_t * const p = self->priv;
790
790
  if (indicator_session_actions_can_hibernate (p->backend_actions))
791
791
    g_menu_append (menu, _("Hibernate"), "indicator.hibernate");
792
792
 
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
796
      const char * label = ellipsis ? _("Restart…") : _("Restart");
796
797
      g_menu_append (menu, label, "indicator.reboot");
797
798
    }
798
799
 
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
803
      const char * label = ellipsis ? _("Shut Down…") : _("Shut Down");
802
804
      g_menu_append (menu, label, "indicator.power-off");
824
826
      sections[n++] = create_settings_section (self);
825
827
      sections[n++] = create_switch_section (self, profile);
826
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
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
835
  else if (profile == PROFILE_LOCKSCREEN)
834
836
    {
835
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
    }
838
840
 
839
841
  /* add sections to the submenu */
1080
1082
 
1081
1083
  if (sections & SECTION_SESSION)
1082
1084
    {
1083
 
      rebuild_section (desktop->submenu, 4, create_session_section(self));
1084
 
      rebuild_section (greeter->submenu, 0, create_session_section(self));
1085
 
      rebuild_section (lockscreen->submenu, 1, create_session_section(self));
 
1085
      rebuild_section (desktop->submenu, 4, create_session_section(self, PROFILE_DESKTOP));
 
1086
      rebuild_section (greeter->submenu, 0, create_session_section(self, PROFILE_GREETER));
 
1087
      rebuild_section (lockscreen->submenu, 1, create_session_section(self, PROFILE_LOCKSCREEN));
1086
1088
    }
1087
1089
}
1088
1090