patches/gnome-session-07-logout-dialog.diff
author jedy
Wed, 22 Apr 2009 08:27:49 +0000
changeset 15664 a7da06521b44
parent 15635 0556629619ed
child 16138 94ffe24d3e52
permissions -rw-r--r--
2009-04-22 Wang Xin <[email protected]> * SUNWgnome-session.spec: Add "-lsecdb -lsocket -lnsl" to the ldflags. * base-specs/gnome-power-manager.spec: Add new patch 12-autorestart.diff * patches/gnome-session-07-logout-dialog.diff: Updated the patch to fix shutdown menu entry missing problem. * patches/gnome-gnome-power-12-autorestart.diff: New patch.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13117
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
     1
diff -Nur gnome-session-2.23.6-orig/gnome-session/gsm-logout-dialog.c gnome-session-2.23.6/gnome-session/gsm-logout-dialog.c
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
     2
--- gnome-session-2.23.6-orig/gnome-session/gsm-logout-dialog.c	2008-08-07 12:32:18.469687950 +0800
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
     3
+++ gnome-session-2.23.6/gnome-session/gsm-logout-dialog.c	2008-08-07 12:32:53.941874874 +0800
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
     4
@@ -26,6 +26,7 @@
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
     5
 
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
     6
 #include <glib/gi18n.h>
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
     7
 #include <gtk/gtk.h>
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
     8
+#include <gdk/gdkx.h>
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
     9
 
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    10
 #include "gsm-logout-dialog.h"
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    11
 #include "gsm-power-manager.h"
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    12
@@ -210,11 +211,30 @@
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    13
 }
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    14
 
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    15
 static gboolean
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    16
+vt_is_available (void)
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    17
+{
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    18
+  Display *xdisplay;
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    19
+  GdkDisplay *gdisplay;
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    20
+  Atom prop;
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    21
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    22
+  gdisplay = gdk_display_get_default ();
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    23
+  xdisplay = gdk_x11_display_get_xdisplay (gdisplay);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    24
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    25
+  prop = XInternAtom (xdisplay, "XFree86_VT", TRUE);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    26
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    27
+  return (prop == None ? FALSE : TRUE);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    28
+}
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    29
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    30
+static gboolean
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    31
 gsm_logout_supports_switch_user (GsmLogoutDialog *logout_dialog)
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    32
 {
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    33
         gboolean ret;
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    34
 
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    35
+#if defined(sun) && defined(__SVR4)
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    36
+        ret = gdm_is_available () && vt_is_available ();
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    37
+#else
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    38
         ret = gsm_consolekit_can_switch_user (logout_dialog->priv->consolekit);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    39
+#endif
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    40
 
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    41
         return ret;
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    42
 }
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    43
@@ -224,10 +244,14 @@
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    44
 {
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    45
         gboolean ret;
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    46
 
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    47
+#if defined(sun) && defined(__SVR4)
14671
4122ba665aa8 2008-11-28 Wang Xin <[email protected]>
jedy
parents: 13117
diff changeset
    48
+        ret = gsm_power_manager_can_reboot (logout_dialog->priv->power_manager);
13117
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    49
+#else
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    50
         ret = gsm_consolekit_can_restart (logout_dialog->priv->consolekit);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    51
         if (!ret) {
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    52
                 ret = gdm_supports_logout_action (GDM_LOGOUT_ACTION_REBOOT);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    53
         }
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    54
+#endif
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    55
 
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    56
         return ret;
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    57
 }
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    58
@@ -237,11 +261,15 @@
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    59
 {
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    60
         gboolean ret;
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    61
 
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    62
+#if defined(sun) && defined(__SVR4)
14671
4122ba665aa8 2008-11-28 Wang Xin <[email protected]>
jedy
parents: 13117
diff changeset
    63
+        ret = gsm_power_manager_can_shutdown (logout_dialog->priv->power_manager);
13117
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    64
+#else
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    65
         ret = gsm_consolekit_can_stop (logout_dialog->priv->consolekit);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    66
 
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    67
         if (!ret) {
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    68
                 ret = gdm_supports_logout_action (GDM_LOGOUT_ACTION_SHUTDOWN);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    69
         }
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    70
+#endif
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    71
 
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    72
         return ret;
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    73
 }
15635
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
    74
diff -Nur gnome-session-2.26.1-orig/gnome-session/gsm-manager.c gnome-session-2.23.6/gnome-session/gsm-manager.c
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
    75
--- gnome-session-2.26.1-orig/gnome-session/gsm-manager.c	2008-08-07 12:32:18.468966829 +0800
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
    76
+++ gnome-session-2.26.1/gnome-session/gsm-manager.c	2008-08-07 12:36:16.283146624 +0800
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
    77
@@ -2540,48 +2556,13 @@ request_reboot_privileges_completed (Gsm
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
    78
 static void
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
    79
 request_reboot (GsmManager *manager)
13117
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    80
 {
15635
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
    81
-        GsmConsolekit *consolekit;
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
    82
-        gboolean       success;
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
    83
-
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
    84
-        g_debug ("GsmManager: requesting reboot");
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
    85
+	GsmPowerManager *power_manager;
13117
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    86
 
15635
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
    87
-        /* We request the privileges before doing anything. There are a few
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
    88
-         * different cases here:
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
    89
-         *
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
    90
-         *   - no ConsoleKit: we fallback on GDM
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
    91
-         *   - no password required: everything is fine
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
    92
-         *   - password asked once: we ask for it now. If the user enters it
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
    93
-         *     fine, then all is great. If the user doesn't enter it fine, we
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
    94
-         *     don't do anything (so no logout).
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
    95
-         *   - password asked each time: we don't ask it for now since we don't
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
    96
-         *     want to ask for it twice. Instead we'll ask for it at the very
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
    97
-         *     end. If the user will enter it fine, then all is great again. If
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
    98
-         *     the user doesn't enter it fine, then we'll just fallback to GDM.
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
    99
-         *
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   100
-         * The last case (password asked each time) is a bit broken, but
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   101
-         * there's really nothing we can do about it. Generally speaking,
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   102
-         * though, the password will only be asked once (unless the system is
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   103
-         * configured in paranoid mode), and most probably only if there are
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   104
-         * more than one user connected. So the general case is that it will
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   105
-         * just work fine.
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   106
-         */
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   107
-
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   108
-        consolekit = gsm_get_consolekit ();
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   109
-        g_signal_connect (consolekit,
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   110
-                          "privileges-completed",
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   111
-                          G_CALLBACK (request_reboot_privileges_completed),
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   112
-                          manager);
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   113
-        success = gsm_consolekit_get_restart_privileges (consolekit);
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   114
-
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   115
-        if (!success) {
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   116
-                g_signal_handlers_disconnect_by_func (consolekit,
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   117
-                                                      request_reboot_privileges_completed,
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   118
-                                                      manager);
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   119
-                g_object_unref (consolekit);
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   120
-
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   121
-                manager->priv->logout_type = GSM_MANAGER_LOGOUT_REBOOT_GDM;
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   122
-                end_phase (manager);
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   123
-        }
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   124
+	power_manager = gsm_get_power_manager ();
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   125
+	if (gsm_power_manager_can_reboot (power_manager)) {
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   126
+		gsm_power_manager_attempt_reboot (power_manager);
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   127
+	}
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   128
+	g_object_unref (power_manager);
13117
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   129
 }
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   130
 
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   131
 static void
15635
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   132
@@ -2614,30 +2595,13 @@ request_shutdown_privileges_completed (G
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   133
 static void
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   134
 request_shutdown (GsmManager *manager)
13117
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   135
 {
15635
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   136
-        GsmConsolekit *consolekit;
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   137
-        gboolean       success;
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   138
-
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   139
-        g_debug ("GsmManager: requesting shutdown");
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   140
+	GsmPowerManager *power_manager;
13117
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   141
 
15635
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   142
-        /* See the comment in request_reboot() for some more details about how
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   143
-         * this works. */
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   144
-
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   145
-        consolekit = gsm_get_consolekit ();
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   146
-        g_signal_connect (consolekit,
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   147
-                          "privileges-completed",
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   148
-                          G_CALLBACK (request_shutdown_privileges_completed),
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   149
-                          manager);
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   150
-        success = gsm_consolekit_get_stop_privileges (consolekit);
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   151
-
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   152
-        if (!success) {
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   153
-                g_signal_handlers_disconnect_by_func (consolekit,
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   154
-                                                      request_shutdown_privileges_completed,
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   155
-                                                      manager);
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   156
-                g_object_unref (consolekit);
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   157
-
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   158
-                manager->priv->logout_type = GSM_MANAGER_LOGOUT_SHUTDOWN_GDM;
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   159
-                end_phase (manager);
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   160
-        }
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   161
+	power_manager = gsm_get_power_manager ();
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   162
+	if (gsm_power_manager_can_shutdown (power_manager)) {
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   163
+		gsm_power_manager_attempt_shutdown (power_manager);
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   164
+	}
0556629619ed 2009-04-16 Wang Xin <[email protected]>
jedy
parents: 15419
diff changeset
   165
+	g_object_unref (power_manager);
13117
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   166
 }
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   167
 
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   168
 static void
15419
3af1b3ab7008 2009-03-18 Wang Xin <[email protected]>
jedy
parents: 15330
diff changeset
   169
@@ -2589,6 +2589,7 @@ gsm_manager_can_shutdown (GsmManager *ma
3af1b3ab7008 2009-03-18 Wang Xin <[email protected]>
jedy
parents: 15330
diff changeset
   170
         power_manager = gsm_get_power_manager ();
3af1b3ab7008 2009-03-18 Wang Xin <[email protected]>
jedy
parents: 15330
diff changeset
   171
         *shutdown_available = gsm_consolekit_can_stop (consolekit)
3af1b3ab7008 2009-03-18 Wang Xin <[email protected]>
jedy
parents: 15330
diff changeset
   172
                               || gsm_consolekit_can_restart (consolekit)
3af1b3ab7008 2009-03-18 Wang Xin <[email protected]>
jedy
parents: 15330
diff changeset
   173
+                              || gsm_power_manager_can_shutdown (power_manager)
3af1b3ab7008 2009-03-18 Wang Xin <[email protected]>
jedy
parents: 15330
diff changeset
   174
                               || gsm_power_manager_can_suspend (power_manager)
3af1b3ab7008 2009-03-18 Wang Xin <[email protected]>
jedy
parents: 15330
diff changeset
   175
                               || gsm_power_manager_can_hibernate (power_manager);
3af1b3ab7008 2009-03-18 Wang Xin <[email protected]>
jedy
parents: 15330
diff changeset
   176
         g_object_unref (consolekit);
13117
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   177
diff -Nur gnome-session-2.23.6-orig/gnome-session/gsm-power-manager.c gnome-session-2.23.6/gnome-session/gsm-power-manager.c
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   178
--- gnome-session-2.23.6-orig/gnome-session/gsm-power-manager.c	2008-08-07 12:32:18.470657410 +0800
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   179
+++ gnome-session-2.23.6/gnome-session/gsm-power-manager.c	2008-08-07 12:32:49.365776065 +0800
15664
a7da06521b44 2009-04-22 Wang Xin <[email protected]>
jedy
parents: 15635
diff changeset
   180
@@ -391,6 +391,29 @@
13117
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   181
         return can_hibernate;
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   182
 }
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   183
 
15664
a7da06521b44 2009-04-22 Wang Xin <[email protected]>
jedy
parents: 15635
diff changeset
   184
+#include <pwd.h>
a7da06521b44 2009-04-22 Wang Xin <[email protected]>
jedy
parents: 15635
diff changeset
   185
+
13117
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   186
+gboolean
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   187
+gsm_power_manager_can_reboot (GsmPowerManager *manager)
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   188
+{
15664
a7da06521b44 2009-04-22 Wang Xin <[email protected]>
jedy
parents: 15635
diff changeset
   189
+        uid_t uid;
a7da06521b44 2009-04-22 Wang Xin <[email protected]>
jedy
parents: 15635
diff changeset
   190
+        struct passwd *pw;
13117
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   191
+
15664
a7da06521b44 2009-04-22 Wang Xin <[email protected]>
jedy
parents: 15635
diff changeset
   192
+        uid = getuid ();
a7da06521b44 2009-04-22 Wang Xin <[email protected]>
jedy
parents: 15635
diff changeset
   193
+        if ((pw = getpwuid (uid)) != NULL) {
a7da06521b44 2009-04-22 Wang Xin <[email protected]>
jedy
parents: 15635
diff changeset
   194
+                return (gboolean)chkauthattr ("solaris.system.shutdown",
a7da06521b44 2009-04-22 Wang Xin <[email protected]>
jedy
parents: 15635
diff changeset
   195
+                                       pw->pw_name);
13117
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   196
+        }
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   197
+
15664
a7da06521b44 2009-04-22 Wang Xin <[email protected]>
jedy
parents: 15635
diff changeset
   198
+        return FALSE;
13117
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   199
+}
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   200
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   201
+gboolean
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   202
+gsm_power_manager_can_shutdown (GsmPowerManager *manager)
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   203
+{
15664
a7da06521b44 2009-04-22 Wang Xin <[email protected]>
jedy
parents: 15635
diff changeset
   204
+        return gsm_power_manager_can_reboot (manager);
13117
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   205
+}
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   206
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   207
 void
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   208
 gsm_power_manager_attempt_suspend (GsmPowerManager *manager)
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   209
 {
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   210
@@ -466,6 +538,81 @@
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   211
         }
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   212
 }
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   213
 
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   214
+void
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   215
+gsm_power_manager_attempt_reboot (GsmPowerManager *manager)
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   216
+{
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   217
+        GError *error;
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   218
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   219
+        error = NULL;
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   220
+        if (!ensure_gpm_connection (manager, &error)) {
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   221
+                g_warning ("Could not connect to power manager: %s",
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   222
+                           error->message);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   223
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   224
+                g_error_free (error);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   225
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   226
+                return;
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   227
+        }
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   228
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   229
+        if (!dbus_g_proxy_call (manager->priv->gpm_proxy, "Reboot",
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   230
+                                &error,
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   231
+                                G_TYPE_INVALID, G_TYPE_INVALID) &&
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   232
+            error != NULL) {
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   233
+                GError *call_error;
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   234
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   235
+                g_warning ("Could not ask power manager to reboot: %s",
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   236
+                           error->message);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   237
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   238
+                call_error = g_error_new_literal (GSM_POWER_MANAGER_ERROR,
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   239
+                                                  GSM_POWER_MANAGER_ERROR_REBOOTING,
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   240
+                                                  error->message);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   241
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   242
+                g_error_free (error);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   243
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   244
+                g_signal_emit (G_OBJECT (manager),
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   245
+                               signals[REQUEST_FAILED],
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   246
+                               0, call_error);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   247
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   248
+                g_error_free (call_error);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   249
+        }
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   250
+}
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   251
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   252
+void
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   253
+gsm_power_manager_attempt_shutdown (GsmPowerManager *manager)
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   254
+{
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   255
+        GError *error;
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   256
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   257
+        error = NULL;
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   258
+        if (!ensure_gpm_connection (manager, &error)) {
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   259
+                g_warning ("Could not connect to power manager: %s",
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   260
+                           error->message);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   261
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   262
+                g_error_free (error);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   263
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   264
+                return;
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   265
+        }
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   266
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   267
+        if (!dbus_g_proxy_call (manager->priv->gpm_proxy, "Shutdown",
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   268
+                                &error,
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   269
+                                G_TYPE_INVALID, G_TYPE_INVALID) &&
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   270
+            error != NULL) {
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   271
+                GError *call_error;
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   272
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   273
+                g_warning ("Could not ask power manager to shutdown: %s",
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   274
+                           error->message);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   275
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   276
+                call_error = g_error_new_literal (GSM_POWER_MANAGER_ERROR,
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   277
+                                                  GSM_POWER_MANAGER_ERROR_SHUTDOWNING,
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   278
+                                                  error->message);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   279
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   280
+                g_error_free (error);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   281
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   282
+                g_signal_emit (G_OBJECT (manager),
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   283
+                               signals[REQUEST_FAILED],
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   284
+                               0, call_error);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   285
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   286
+                g_error_free (call_error);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   287
+        }
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   288
+}
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   289
 
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   290
 GsmPowerManager *
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   291
 gsm_get_power_manager (void)
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   292
diff -Nur gnome-session-2.23.6-orig/gnome-session/gsm-power-manager.h gnome-session-2.23.6/gnome-session/gsm-power-manager.h
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   293
--- gnome-session-2.23.6-orig/gnome-session/gsm-power-manager.h	2008-08-07 12:32:18.468173386 +0800
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   294
+++ gnome-session-2.23.6/gnome-session/gsm-power-manager.h	2008-08-07 12:35:21.509699117 +0800
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   295
@@ -59,6 +59,8 @@
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   296
 enum _GsmPowerManagerError
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   297
 {
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   298
   GSM_POWER_MANAGER_ERROR_SUSPENDING = 0,
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   299
+  GSM_POWER_MANAGER_ERROR_REBOOTING,
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   300
+  GSM_POWER_MANAGER_ERROR_SHUTDOWNING,
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   301
   GSM_POWER_MANAGER_ERROR_HIBERNATING
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   302
 };
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   303
 
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   304
@@ -74,14 +76,18 @@
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   305
 
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   306
 gboolean           gsm_power_manager_can_hibernate      (GsmPowerManager *manager);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   307
 
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   308
-gboolean           gsm_power_manager_can_power_down     (GsmPowerManager *manager);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   309
+gboolean           gsm_power_manager_can_shutdown     (GsmPowerManager *manager);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   310
 
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   311
-gboolean           gsm_power_manager_can_restart        (GsmPowerManager *manager);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   312
+gboolean           gsm_power_manager_can_reboot        (GsmPowerManager *manager);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   313
 
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   314
 void               gsm_power_manager_attempt_suspend    (GsmPowerManager *manager);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   315
 
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   316
 void               gsm_power_manager_attempt_hibernate  (GsmPowerManager *manager);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   317
 
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   318
+void               gsm_power_manager_attempt_shutdown  (GsmPowerManager *manager);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   319
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   320
+void               gsm_power_manager_attempt_reboot  (GsmPowerManager *manager);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   321
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   322
 G_END_DECLS
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   323
 
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   324
 #endif /* __GSM_POWER_MANAGER_H__ */
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   325