diff options
author | Ted Gould <ted@gould.cx> | 2010-03-03 14:13:11 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-03-03 14:13:11 -0600 |
commit | 25a24b5af992231732e58763786d7fc82914da8e (patch) | |
tree | fcca109d8d5d61004b99132ab317ef4e46b5bbf6 | |
parent | 087e8950fc86d9a6e2454d54df505ff167f5dc71 (diff) | |
download | ayatana-indicator-session-25a24b5af992231732e58763786d7fc82914da8e.tar.gz ayatana-indicator-session-25a24b5af992231732e58763786d7fc82914da8e.tar.bz2 ayatana-indicator-session-25a24b5af992231732e58763786d7fc82914da8e.zip |
Provide the basis for the window
-rw-r--r-- | src/gtk-dialog/dialog.c | 27 | ||||
-rw-r--r-- | src/gtk-dialog/dialog.h | 4 |
2 files changed, 26 insertions, 5 deletions
diff --git a/src/gtk-dialog/dialog.c b/src/gtk-dialog/dialog.c index 186a506..9dcc194 100644 --- a/src/gtk-dialog/dialog.c +++ b/src/gtk-dialog/dialog.c @@ -26,9 +26,11 @@ static const gchar * button_strings[LOGOUT_DIALOG_TYPE_CNT] = { /* LOGOUT_DIALOG_SHUTDOWN, */ NC_("button", "Switch Off") }; +/* static const gchar * restart_updates = N_("Restart Instead"); static const gchar * restart_auth = N_("Restart..."); static const gchar * body_logout_update = N_("Some software updates won't apply until the computer next restarts."); +*/ static const gchar * icon_strings[LOGOUT_DIALOG_TYPE_CNT] = { /* LOGOUT_DIALOG_LOGOUT, */ "system-log-out", @@ -51,7 +53,7 @@ static void logout_dialog_init (LogoutDialog *self); static void logout_dialog_dispose (GObject *object); static void logout_dialog_finalize (GObject *object); -G_DEFINE_TYPE (LogoutDialog, logout_dialog, GTK_TYPE_DIALOG); +G_DEFINE_TYPE (LogoutDialog, logout_dialog, GTK_TYPE_MESSAGE_DIALOG); static void logout_dialog_class_init (LogoutDialogClass *klass) @@ -94,6 +96,25 @@ logout_dialog_finalize (GObject *object) LogoutDialog * logout_dialog_new (LogoutDialogType type) { - - return NULL; + LogoutDialog * dialog = LOGOUT_DIALOG(g_object_new(LOGOUT_DIALOG_TYPE, + /* Window */ + "icon-name", icon_strings[type], + "modal", TRUE, + "resizable", FALSE, + "title", _(title_strings[type]), + "window-position", GTK_WIN_POS_CENTER_ALWAYS, + /* Dialog */ + "has-separator", FALSE, + /* Message Dialog */ + "message-type", GTK_MESSAGE_OTHER, + "buttons", GTK_BUTTONS_NONE, + "text", _(body_strings[type]), + NULL)); + + gtk_dialog_add_buttons(GTK_DIALOG(dialog), + _(button_strings[type]), GTK_RESPONSE_OK, + _("Cancel"), GTK_RESPONSE_CANCEL, + NULL); + + return dialog; } diff --git a/src/gtk-dialog/dialog.h b/src/gtk-dialog/dialog.h index 1e6f575..3240a8e 100644 --- a/src/gtk-dialog/dialog.h +++ b/src/gtk-dialog/dialog.h @@ -27,11 +27,11 @@ typedef struct _LogoutDialog LogoutDialog; typedef struct _LogoutDialogClass LogoutDialogClass; struct _LogoutDialogClass { - GtkDialogClass parent_class; + GtkMessageDialogClass parent_class; }; struct _LogoutDialog { - GtkDialog parent; + GtkMessageDialog parent; }; GType logout_dialog_get_type (void); |