From b51d58db757ccec277216f3e4f3e74c67ea75884 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 3 Mar 2010 15:27:51 -0600 Subject: Skeleton for checking the different states. --- src/gtk-dialog/dialog.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'src/gtk-dialog') 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, -- cgit v1.2.3