From 44fb1ec00d9c1ed129574fa3efd631a663b096a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Fri, 8 Apr 2016 22:49:07 +0200 Subject: Actions: add force-restart-menuitem option to make it visible in any environments Basically it allows to see the "Reboot..." option when indicator-session is in unity --- data/org.ayatana.indicator.session.gschema.xml.in | 5 +++++ src/backend-dbus/actions.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/data/org.ayatana.indicator.session.gschema.xml.in b/data/org.ayatana.indicator.session.gschema.xml.in index 9e099fb..c46a738 100644 --- a/data/org.ayatana.indicator.session.gschema.xml.in +++ b/data/org.ayatana.indicator.session.gschema.xml.in @@ -20,6 +20,11 @@ <_summary>Remove the shutdown item from the session menu. <_description>Makes it so that the shutdown button doesn’t show in the session menu. + + false + <_summary>Force the visibility of Restart item in the session menu + <_description>Makes it so that the restart shows in the session menu even in the environments where it should not show. + false Determine the visibility of the User's real name on the panel diff --git a/src/backend-dbus/actions.c b/src/backend-dbus/actions.c index 88caf80..c83d352 100644 --- a/src/backend-dbus/actions.c +++ b/src/backend-dbus/actions.c @@ -414,6 +414,9 @@ my_can_reboot (IndicatorSessionActions * actions) if (g_settings_get_boolean (p->indicator_settings, "suppress-restart-menuitem")) return FALSE; + if (g_settings_get_boolean (p->indicator_settings, "force-restart-menuitem")) + return TRUE; + /* Shutdown and Restart are the same dialog prompt in Unity, so disable the redundant 'Restart' menuitem in that mode */ if (!g_settings_get_boolean (p->indicator_settings, "suppress-shutdown-menuitem")) @@ -1184,6 +1187,8 @@ indicator_session_actions_dbus_init (IndicatorSessionActionsDbus * self) G_CALLBACK(indicator_session_actions_notify_can_reboot), self); g_signal_connect_swapped (s, "changed::suppress-shutdown-menuitem", G_CALLBACK(indicator_session_actions_notify_can_reboot), self); + g_signal_connect_swapped (s, "changed::force-restart-menuitem", + G_CALLBACK(indicator_session_actions_notify_can_reboot), self); p->indicator_settings = s; gnome_screen_saver_proxy_new_for_bus (G_BUS_TYPE_SESSION, -- cgit v1.2.3