aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2016-04-08 22:49:07 +0200
committerRobert Tari <robert@tari.in>2021-06-22 23:20:07 +0200
commit44fb1ec00d9c1ed129574fa3efd631a663b096a0 (patch)
tree245b785921a8ce28c478d4e8c24288a5e619bf29
parentdd4e19f35bfe81395d20f3a8f52805ab138a5c1e (diff)
downloadayatana-indicator-session-44fb1ec00d9c1ed129574fa3efd631a663b096a0.tar.gz
ayatana-indicator-session-44fb1ec00d9c1ed129574fa3efd631a663b096a0.tar.bz2
ayatana-indicator-session-44fb1ec00d9c1ed129574fa3efd631a663b096a0.zip
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
-rw-r--r--data/org.ayatana.indicator.session.gschema.xml.in5
-rw-r--r--src/backend-dbus/actions.c5
2 files changed, 10 insertions, 0 deletions
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.</_summary>
<_description>Makes it so that the shutdown button doesn’t show in the session menu.</_description>
</key>
+ <key name="force-restart-menuitem" type="b">
+ <default>false</default>
+ <_summary>Force the visibility of Restart item in the session menu</_summary>
+ <_description>Makes it so that the restart shows in the session menu even in the environments where it should not show.</_description>
+ </key>
<key type="b" name="show-real-name-on-panel">
<default>false</default>
<summary>Determine the visibility of the User's real name on the panel</summary>
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,