aboutsummaryrefslogtreecommitdiff
path: root/src/gtk-dialog/gtk-logout-helper.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gtk-dialog/gtk-logout-helper.c')
-rw-r--r--src/gtk-dialog/gtk-logout-helper.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/src/gtk-dialog/gtk-logout-helper.c b/src/gtk-dialog/gtk-logout-helper.c
index c8635e6..a76a135 100644
--- a/src/gtk-dialog/gtk-logout-helper.c
+++ b/src/gtk-dialog/gtk-logout-helper.c
@@ -25,8 +25,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include <glib.h>
#include <gtk/gtk.h>
#include <dbus/dbus-glib.h>
-#include "logout-dialog.h"
-#include "ck-pk-helper.h"
+#include "dialog.h"
#include "gconf-helper.h"
static void
@@ -77,7 +76,7 @@ consolekit_fallback (LogoutDialogAction action)
}
static void
-session_action (LogoutDialogAction action)
+session_action (LogoutDialogType action)
{
DBusGConnection * sbus;
DBusGProxy * sm_proxy;
@@ -104,13 +103,13 @@ session_action (LogoutDialogAction action)
g_clear_error (&error);
- if (action == LOGOUT_DIALOG_LOGOUT) {
+ if (action == LOGOUT_DIALOG_TYPE_LOG_OUT) {
res = dbus_g_proxy_call_with_timeout (sm_proxy, "Logout", INT_MAX, &error,
G_TYPE_UINT, 1, G_TYPE_INVALID, G_TYPE_INVALID);
- } else if (action == LOGOUT_DIALOG_SHUTDOWN) {
+ } else if (action == LOGOUT_DIALOG_TYPE_SHUTDOWN) {
res = dbus_g_proxy_call_with_timeout (sm_proxy, "RequestShutdown", INT_MAX, &error,
G_TYPE_INVALID, G_TYPE_INVALID);
- } else if (action == LOGOUT_DIALOG_RESTART) {
+ } else if (action == LOGOUT_DIALOG_TYPE_RESTART) {
res = dbus_g_proxy_call_with_timeout (sm_proxy, "RequestReboot", INT_MAX, &error,
G_TYPE_INVALID, G_TYPE_INVALID);
} else {
@@ -134,26 +133,26 @@ session_action (LogoutDialogAction action)
return;
}
-static LogoutDialogAction type = LOGOUT_DIALOG_LOGOUT;
+static LogoutDialogType type = LOGOUT_DIALOG_TYPE_LOG_OUT;
static gboolean
option_logout (const gchar * arg, const gchar * value, gpointer data, GError * error)
{
- type = LOGOUT_DIALOG_LOGOUT;
+ type = LOGOUT_DIALOG_TYPE_LOG_OUT;
return TRUE;
}
static gboolean
option_shutdown (const gchar * arg, const gchar * value, gpointer data, GError * error)
{
- type = LOGOUT_DIALOG_SHUTDOWN;
+ type = LOGOUT_DIALOG_TYPE_SHUTDOWN;
return TRUE;
}
static gboolean
option_restart (const gchar * arg, const gchar * value, gpointer data, GError * error)
{
- type = LOGOUT_DIALOG_RESTART;
+ type = LOGOUT_DIALOG_TYPE_RESTART;
return TRUE;
}
@@ -193,13 +192,8 @@ main (int argc, char * argv[])
INDICATOR_ICONS_DIR);
GtkWidget * dialog = NULL;
- /* TODO: We're disabling PolicyKit checking here because there
- is a bug in ConsoleKit where the dialog doesn't come up until
- the session is entirely closed. Stupid, but it's better than
- not getting a dialog at all. */
- /* if (!pk_require_auth(type) && !supress_confirmations()) { */
if (!supress_confirmations()) {
- dialog = logout_dialog_new(type);
+ dialog = GTK_WIDGET(logout_dialog_new(type));
}
if (dialog != NULL) {
@@ -207,7 +201,7 @@ main (int argc, char * argv[])
gtk_widget_hide(dialog);
if (response == GTK_RESPONSE_HELP) {
- type = LOGOUT_DIALOG_RESTART;
+ type = LOGOUT_DIALOG_TYPE_RESTART;
response = GTK_RESPONSE_OK;
}