aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2013-03-06 13:48:42 +0100
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2013-03-06 13:48:42 +0100
commitd93ba6784f824c4a19f85f6368a88744743171c9 (patch)
tree26c044f95bb7c4b85c7995d5c173c0f833a3eca6 /src
parenta169fe5c78143eb91864c6cee3d9e537834c7c39 (diff)
downloadayatana-indicator-session-d93ba6784f824c4a19f85f6368a88744743171c9.tar.gz
ayatana-indicator-session-d93ba6784f824c4a19f85f6368a88744743171c9.tar.bz2
ayatana-indicator-session-d93ba6784f824c4a19f85f6368a88744743171c9.zip
SessionMenuMgr: call also Reboot method in shell mode
To make the entry to work in dialog suppression mode
Diffstat (limited to 'src')
-rw-r--r--src/session-menu-mgr.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/session-menu-mgr.c b/src/session-menu-mgr.c
index ba82645..2173e86 100644
--- a/src/session-menu-mgr.c
+++ b/src/session-menu-mgr.c
@@ -135,6 +135,7 @@ static void action_func_lock (SessionMenuMgr *);
static void action_func_suspend (SessionMenuMgr *);
static void action_func_hibernate (SessionMenuMgr *);
static void action_func_shutdown (SessionMenuMgr *);
+static void action_func_reboot (SessionMenuMgr *);
static void action_func_logout (SessionMenuMgr *);
static void action_func_switch_to_lockscreen (SessionMenuMgr *);
static void action_func_switch_to_greeter (SessionMenuMgr *);
@@ -565,7 +566,7 @@ build_session_menuitems (SessionMenuMgr* mgr)
mi = mgr->restart_mi = mi_new (_("Restart\342\200\246"));
dbusmenu_menuitem_child_append (mgr->top_mi, mi);
g_signal_connect_swapped (mi, DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,
- G_CALLBACK(action_func_spawn_async), CMD_RESTART);
+ G_CALLBACK(action_func_reboot), mgr);
mi = mgr->shutdown_mi = mi_new (_("Shut Down\342\200\246"));
dbusmenu_menuitem_child_append (mgr->top_mi, mi);
@@ -1210,7 +1211,8 @@ action_func_shutdown (SessionMenuMgr * mgr)
{
if (mgr->shell_mode)
{
- if (g_settings_get_boolean (mgr->indicator_settings, "suppress-logout-restart-shutdown"))
+ if (g_settings_get_boolean (mgr->indicator_settings,
+ "suppress-logout-restart-shutdown"))
{
call_session_manager_method ("Shutdown", NULL);
}
@@ -1234,7 +1236,8 @@ action_func_logout (SessionMenuMgr * mgr)
if (mgr->shell_mode)
{
guint interactive_mode = 0;
- call_session_manager_method ("Logout", g_variant_new ("(u)", interactive_mode));
+ call_session_manager_method ("Logout",
+ g_variant_new ("(u)", interactive_mode));
}
else
{
@@ -1242,6 +1245,19 @@ action_func_logout (SessionMenuMgr * mgr)
}
}
+static void
+action_func_reboot (SessionMenuMgr * mgr)
+{
+ if (mgr->shell_mode)
+ {
+ call_session_manager_method ("Reboot", NULL);
+ }
+ else
+ {
+ action_func_spawn_async (CMD_RESTART);
+ }
+}
+
/***
****
***/