Commit 835f4bb4 authored by Luca Weiss's avatar Luca Weiss

panel: implement restart action

Fixes #241
parent 04c4f602
......@@ -82,6 +82,22 @@ on_shutdown_action (GSimpleAction *action,
}
static void
on_restart_action (GSimpleAction *action,
GVariant *parameter,
gpointer data)
{
PhoshPanel *self = PHOSH_PANEL(data);
g_return_if_fail (PHOSH_IS_PANEL (self));
phosh_session_reboot ();
/* TODO: Since we don't implement
* gnome.SessionManager.EndSessionDialog yet */
phosh_session_reboot ();
phosh_panel_fold (self);
}
static void
on_lockscreen_action (GSimpleAction *action,
GVariant *parameter,
......@@ -242,6 +258,7 @@ on_button_press_event (PhoshPanel *self, GdkEventKey *event, gpointer data)
static GActionEntry entries[] = {
{ "poweroff", on_shutdown_action, NULL, NULL, NULL },
{ "restart", on_restart_action, NULL, NULL, NULL },
{ "lockscreen", on_lockscreen_action, NULL, NULL, NULL },
{ "logout", on_logout_action, NULL, NULL, NULL },
};
......
......@@ -181,6 +181,23 @@ phosh_session_shutdown (void)
NULL);
}
void
phosh_session_reboot (void)
{
g_return_if_fail (G_IS_DBUS_PROXY(_proxy));
g_dbus_proxy_call (_proxy,
"Reboot",
NULL,
G_DBUS_CALL_FLAGS_NONE,
-1,
NULL,
NULL,
NULL);
}
void
phosh_session_logout (void)
{
......
......@@ -11,4 +11,5 @@
void phosh_session_register (const char *client_id);
void phosh_session_unregister (void);
void phosh_session_shutdown (void);
void phosh_session_reboot (void);
void phosh_session_logout (void);
......@@ -22,6 +22,13 @@
<property name="text" translatable="yes">Logout</property>
</object>
</child>
<child>
<object class="GtkModelButton">
<property name="visible">True</property>
<property name="action-name">panel.restart</property>
<property name="text" translatable="yes">Restart</property>
</object>
</child>
<child>
<object class="GtkModelButton">
<property name="visible">True</property>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment