summaryrefslogtreecommitdiff
path: root/mate-session/gsm-manager.c
diff options
context:
space:
mode:
authorSteve Zesch <[email protected]>2012-05-10 12:50:16 -0400
committerSteve Zesch <[email protected]>2012-05-10 12:50:16 -0400
commitd2717333e57bd8b2e8533d8c3de8ceb120830f6a (patch)
treec60130107cae42b8ee80c40a43f823d5112b16db /mate-session/gsm-manager.c
parent22feb13f2d163436ab2c3af1b30823ddee6e43b5 (diff)
downloadmate-session-manager-d2717333e57bd8b2e8533d8c3de8ceb120830f6a.tar.bz2
mate-session-manager-d2717333e57bd8b2e8533d8c3de8ceb120830f6a.tar.xz
Fixed reboot/shutdown issue.
Diffstat (limited to 'mate-session/gsm-manager.c')
-rw-r--r--mate-session/gsm-manager.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/mate-session/gsm-manager.c b/mate-session/gsm-manager.c
index eb84b87..8bdc49e 100644
--- a/mate-session/gsm-manager.c
+++ b/mate-session/gsm-manager.c
@@ -2947,6 +2947,48 @@ gsm_manager_set_phase (GsmManager *manager,
}
gboolean
+gsm_manager_request_shutdown (GsmManager *manager,
+ GError **error)
+{
+ g_debug ("GsmManager: RequestShutdown called");
+
+ g_return_val_if_fail(GSM_IS_MANAGER (manager), FALSE);
+
+ if (manager->priv->phase != GSM_MANAGER_PHASE_RUNNING) {
+ g_set_error (error,
+ GSM_MANAGER_ERROR,
+ GSM_MANAGER_ERROR_NOT_IN_RUNNING,
+ "RequestShutdown interface is only available during the Running phase");
+ return FALSE;
+ }
+
+ request_shutdown (manager);
+
+ return TRUE;
+}
+
+gboolean
+gsm_manager_request_reboot (GsmManager *manager,
+ GError **error)
+{
+ g_debug ("GsmManager: RequestReboot called");
+
+ g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE);
+
+ if (manager->priv->phase != GSM_MANAGER_PHASE_RUNNING) {
+ g_set_error (error,
+ GSM_MANAGER_ERROR,
+ GSM_MANAGER_ERROR_NOT_IN_RUNNING,
+ "RequestReboot interface is only available during the running phase");
+ return FALSE;
+ }
+
+ request_reboot (manager);
+
+ return TRUE;
+}
+
+gboolean
gsm_manager_shutdown (GsmManager *manager,
GError **error)
{