diff options
author | Ted Gould <ted@gould.cx> | 2010-03-03 21:06:00 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-03-03 21:06:00 -0600 |
commit | d9bc98c8b728ffce04d5536501efb11a6084c831 (patch) | |
tree | 22f77b0048967d522ca9dea9c664adf286408c07 /src/gtk-dialog/gtk-logout-helper.c | |
parent | 4533e76797864b2e949ffa150359145d861f0045 (diff) | |
parent | 1af7a048d62b8616d3182a8bb48fe33e7b54d93d (diff) | |
download | ayatana-indicator-session-d9bc98c8b728ffce04d5536501efb11a6084c831.tar.gz ayatana-indicator-session-d9bc98c8b728ffce04d5536501efb11a6084c831.tar.bz2 ayatana-indicator-session-d9bc98c8b728ffce04d5536501efb11a6084c831.zip |
* Upstream Merge
* Fix naming to "Switch off" and "Sleep"
* Blocking the current user from the user list
* Change sorting to be based on real names and handle conflicts
* Removing some ConsoleKit errors
* Memory leak on PangoLayout allocation
* Don't set GTK decorations
* ConsoleKit fallback if gnome-session not available
Diffstat (limited to 'src/gtk-dialog/gtk-logout-helper.c')
-rw-r--r-- | src/gtk-dialog/gtk-logout-helper.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/gtk-dialog/gtk-logout-helper.c b/src/gtk-dialog/gtk-logout-helper.c index 4c6614c..7453ce4 100644 --- a/src/gtk-dialog/gtk-logout-helper.c +++ b/src/gtk-dialog/gtk-logout-helper.c @@ -43,19 +43,23 @@ consolekit_fallback (LogoutDialogAction action) return; } + GError * error = NULL; + switch (action) { case LOGOUT_DIALOG_LOGOUT: g_warning("Unable to fallback to ConsoleKit for logout as it's a session issue. We need some sort of session handler."); break; case LOGOUT_DIALOG_SHUTDOWN: - dbus_g_proxy_call_no_reply(proxy, - "Stop", - G_TYPE_INVALID); + dbus_g_proxy_call(proxy, + "Stop", + &error, + G_TYPE_INVALID); break; case LOGOUT_DIALOG_RESTART: - dbus_g_proxy_call_no_reply(proxy, - "Restart", - G_TYPE_INVALID); + dbus_g_proxy_call(proxy, + "Restart", + &error, + G_TYPE_INVALID); break; default: g_warning("Unknown action"); @@ -64,6 +68,11 @@ consolekit_fallback (LogoutDialogAction action) g_object_unref(proxy); + if (error != NULL) { + g_error("Unable to signal ConsoleKit: %s", error->message); + g_error_free(error); + } + return; } @@ -150,7 +159,7 @@ option_restart (const gchar * arg, const gchar * value, gpointer data, GError * static GOptionEntry options[] = { {"logout", 'l', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, option_logout, "Log out of the current session", NULL}, - {"shutdown", 's', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, option_shutdown, "Shutdown the entire system", NULL}, + {"shutdown", 's', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, option_shutdown, "Switch off the entire system", NULL}, {"restart", 'r', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, option_restart, "Restart the system", NULL}, {NULL} |