summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2012-07-10 00:42:27 +0200
committerStefano Karapetsas <[email protected]>2012-07-10 00:42:27 +0200
commitf586f849d6151ffde79c1f1b36c038a3916470dc (patch)
treecd2032cde7920e8b246b182bab72731681bb1f1e
parentb96b613c3ff317d6897dfc0228d5f91199b72f80 (diff)
parenta20404af7c2ece049d9d423a89be7707a37cefa5 (diff)
downloadmate-session-manager-f586f849d6151ffde79c1f1b36c038a3916470dc.tar.bz2
mate-session-manager-f586f849d6151ffde79c1f1b36c038a3916470dc.tar.xz
Merge branch 'master' of github.com:mate-desktop/mate-session-manager
-rw-r--r--mate-session/gsm-manager.c42
-rw-r--r--mate-session/gsm-manager.h6
-rw-r--r--mate-session/org.mate.SessionManager.xml16
3 files changed, 64 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)
{
diff --git a/mate-session/gsm-manager.h b/mate-session/gsm-manager.h
index 635590c..8daca06 100644
--- a/mate-session/gsm-manager.h
+++ b/mate-session/gsm-manager.h
@@ -151,6 +151,12 @@ gboolean gsm_manager_is_inhibited (GsmManager
gboolean *is_inhibited,
GError *error);
+gboolean gsm_manager_request_shutdown (GsmManager *manager,
+ GError **error);
+
+gboolean gsm_manager_request_reboot (GsmManager *manager,
+ GError **error);
+
gboolean gsm_manager_shutdown (GsmManager *manager,
GError **error);
diff --git a/mate-session/org.mate.SessionManager.xml b/mate-session/org.mate.SessionManager.xml
index 9d693e6..9577428 100644
--- a/mate-session/org.mate.SessionManager.xml
+++ b/mate-session/org.mate.SessionManager.xml
@@ -301,6 +301,22 @@
</doc:doc>
</method>
+ <method name="RequestShutdown">
+ <doc:doc>
+ <doc:description>
+ <doc:para>Request a shutdown with no diaog</doc:para>
+ </doc:description>
+ </doc:doc>
+ </method>
+
+ <method name="RequestReboot">
+ <doc:doc>
+ <doc:description>
+ <doc:para>Request a reboot with no dialog</doc:para>
+ </doc:description>
+ </doc:doc>
+ </method>
+
<!-- Signals -->
<signal name="ClientAdded">