aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-07-23 15:46:07 -0500
committerTed Gould <ted@canonical.com>2009-07-23 15:46:07 -0500
commit624c4acbd0c256f5cf8e7067e8dab935bf6c2b5f (patch)
tree8a02b27128f71528a7877eb75f57927a3be4ad39
parentbf936e17c6ac25344055de4eab06afc8b3893cb2 (diff)
downloadayatana-indicator-session-624c4acbd0c256f5cf8e7067e8dab935bf6c2b5f.tar.gz
ayatana-indicator-session-624c4acbd0c256f5cf8e7067e8dab935bf6c2b5f.tar.bz2
ayatana-indicator-session-624c4acbd0c256f5cf8e7067e8dab935bf6c2b5f.zip
Now check for the PK dialog and otherwise run ours. If we get restart, restart
-rw-r--r--src/gtk-dialog/gtk-logout-helper.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/gtk-dialog/gtk-logout-helper.c b/src/gtk-dialog/gtk-logout-helper.c
index 505ea16..c7f67a5 100644
--- a/src/gtk-dialog/gtk-logout-helper.c
+++ b/src/gtk-dialog/gtk-logout-helper.c
@@ -2,6 +2,7 @@
#include <glib.h>
#include <gtk/gtk.h>
#include "logout-dialog.h"
+#include "ck-pk-helper.h"
static LogoutDialogAction type = LOGOUT_DIALOG_LOGOUT;
@@ -51,8 +52,24 @@ main (int argc, char * argv[])
return 1;
}
- GtkWidget * dialog = logout_dialog_new(type);
- gtk_dialog_run(GTK_DIALOG(dialog));
+ GtkWidget * dialog = NULL;
+ if (!pk_require_auth(type)) {
+ dialog = logout_dialog_new(type);
+ }
+
+ if (dialog != NULL) {
+ GtkResponseType response = gtk_dialog_run(GTK_DIALOG(dialog));
+ gtk_widget_hide(dialog);
+
+ if (response == GTK_RESPONSE_HELP) {
+ type = LOGOUT_DIALOG_RESTART;
+ response = GTK_RESPONSE_OK;
+ }
+
+ if (response != GTK_RESPONSE_OK) {
+ return 0;
+ }
+ }
return 0;
}