diff options
author | Not Zed <NotZed@Ximian.com> | 2004-04-28 14:39:25 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2004-04-28 14:39:25 +0800 |
commit | e23cf1ca36bcf886bcac15545166eff0e930a4bd (patch) | |
tree | 22462408dc2fe4da0306bb472cdd6239d739b650 /mail/mail-session.c | |
parent | 9e7d28c8bc1c14cbb627f0375a60c312c5569536 (diff) | |
download | gsoc2013-evolution-e23cf1ca36bcf886bcac15545166eff0e930a4bd.tar.gz gsoc2013-evolution-e23cf1ca36bcf886bcac15545166eff0e930a4bd.tar.zst gsoc2013-evolution-e23cf1ca36bcf886bcac15545166eff0e930a4bd.zip |
** Changed error messages to use EError.
2004-04-28 Not Zed <NotZed@Ximian.com>
** Changed error messages to use EError.
svn path=/trunk/; revision=25653
Diffstat (limited to 'mail/mail-session.c')
-rw-r--r-- | mail/mail-session.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/mail/mail-session.c b/mail/mail-session.c index 38718eac9c..9b0761462f 100644 --- a/mail/mail-session.c +++ b/mail/mail-session.c @@ -52,6 +52,7 @@ #include "e-util/e-passwords.h" #include "e-util/e-msgport.h" #include "em-junk-filter.h" +#include "widgets/misc/e-error.h" #define d(x) @@ -270,14 +271,10 @@ request_password (struct _pass_msg *m) else title = g_strdup (_("Enter Password")); - password_dialog = (GtkDialog *) gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_QUESTION, - GTK_BUTTONS_OK_CANCEL, "%s", m->prompt); + password_dialog = (GtkDialog *)e_error_new(NULL, "mail:ask-session-password", m->prompt, NULL); gtk_window_set_title (GTK_WINDOW (password_dialog), title); - gtk_dialog_set_default_response (password_dialog, GTK_RESPONSE_OK); g_free (title); - gtk_container_set_border_width ((GtkContainer *) password_dialog, 6); - m->entry = gtk_entry_new (); gtk_entry_set_visibility ((GtkEntry *) m->entry, !(m->flags & CAMEL_SESSION_PASSWORD_SECRET)); g_signal_connect (m->entry, "activate", G_CALLBACK (pass_activate), password_dialog); @@ -456,11 +453,17 @@ user_message_destroy_notify (struct _user_message_msg *m, GObject *deadbeef) message_dialog = NULL; } +/* This is kinda ugly/inefficient, but oh well, it works */ +static const char *error_type[] = { + "session-message-info", "session-message-warning", "session-message-error", + "session-message-info-cancel", "session-message-warning-cancel", "session-message-error-cancel" +}; + static void do_user_message (struct _mail_msg *mm) { struct _user_message_msg *m = (struct _user_message_msg *)mm; - GtkMessageType msg_type; + int type; if (!m->ismain && message_dialog != NULL) { e_dlist_addtail (&message_list, (EDListNode *)m); @@ -469,23 +472,22 @@ do_user_message (struct _mail_msg *mm) switch (m->type) { case CAMEL_SESSION_ALERT_INFO: - msg_type = GTK_MESSAGE_INFO; + type = 0; break; case CAMEL_SESSION_ALERT_WARNING: - msg_type = GTK_MESSAGE_WARNING; + type = 1; break; case CAMEL_SESSION_ALERT_ERROR: - msg_type = GTK_MESSAGE_ERROR; + type = 2; break; default: - msg_type = GTK_MESSAGE_INFO; + type = 0; } + + if (m->allow_cancel) + type += 3; - message_dialog = (GtkDialog *) gtk_message_dialog_new ( - NULL, 0, msg_type, - m->allow_cancel ? GTK_BUTTONS_OK_CANCEL : GTK_BUTTONS_OK, - "%s", m->prompt); - gtk_dialog_set_default_response (message_dialog, m->allow_cancel ? GTK_RESPONSE_CANCEL : GTK_RESPONSE_OK); + message_dialog = (GtkDialog *)e_error_new(NULL, error_type[type], m->prompt, NULL); g_object_set ((GObject *) message_dialog, "allow_shrink", TRUE, "allow_grow", TRUE, NULL); /* We only need to wait for the result if we allow cancel otherwise show but send result back instantly */ |