aboutsummaryrefslogtreecommitdiff
path: root/src/gtk-dialog
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-03-03 15:27:51 -0600
committerTed Gould <ted@gould.cx>2010-03-03 15:27:51 -0600
commitb51d58db757ccec277216f3e4f3e74c67ea75884 (patch)
tree2d3584cbb39583aa583b152cd78941c438cd8a25 /src/gtk-dialog
parentf998b8b0d4bb9d9965f804ad5004b089a61f0248 (diff)
downloadayatana-indicator-session-b51d58db757ccec277216f3e4f3e74c67ea75884.tar.gz
ayatana-indicator-session-b51d58db757ccec277216f3e4f3e74c67ea75884.tar.bz2
ayatana-indicator-session-b51d58db757ccec277216f3e4f3e74c67ea75884.zip
Skeleton for checking the different states.
Diffstat (limited to 'src/gtk-dialog')
-rw-r--r--src/gtk-dialog/dialog.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/gtk-dialog/dialog.c b/src/gtk-dialog/dialog.c
index 18f345f..7e2347e 100644
--- a/src/gtk-dialog/dialog.c
+++ b/src/gtk-dialog/dialog.c
@@ -93,6 +93,25 @@ logout_dialog_finalize (GObject *object)
return;
}
+/* Checks for updates that would signal that a restart is
+ required for them to apply */
+static gboolean
+check_restart_required (void)
+{
+
+ return FALSE;
+}
+
+/* Checks with console kit to see if we can do what we want */
+static gboolean
+ck_check_allowed (LogoutDialogType type)
+{
+
+
+
+ return TRUE;
+}
+
LogoutDialog *
logout_dialog_new (LogoutDialogType type)
{
@@ -113,6 +132,18 @@ logout_dialog_new (LogoutDialogType type)
"text", _(body_strings[type]),
NULL));
+ gboolean allowed = FALSE;
+ if (type == LOGOUT_DIALOG_TYPE_LOG_OUT) {
+ allowed = ck_check_allowed(LOGOUT_DIALOG_TYPE_RESTART);
+ } else {
+ allowed = ck_check_allowed(type);
+ }
+
+ gboolean restart_required = FALSE;
+ if (type == LOGOUT_DIALOG_TYPE_LOG_OUT) {
+ restart_required = check_restart_required();
+ }
+
gtk_dialog_add_buttons(GTK_DIALOG(dialog),
_("Cancel"), GTK_RESPONSE_CANCEL,
_(button_strings[type]), GTK_RESPONSE_OK,