aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2002-11-25 08:31:50 +0800
committerMichael Zucci <zucchi@src.gnome.org>2002-11-25 08:31:50 +0800
commit3324e67a17442c8e3c8a3936d2f063ee675004d3 (patch)
treef887ca8f293d7abcb4d21cbd40fb0435e1e57aba /mail
parent2fd9ea3c7ee9d1847c9c0fed6538f95a284a301c (diff)
downloadgsoc2013-evolution-3324e67a17442c8e3c8a3936d2f063ee675004d3.tar.gz
gsoc2013-evolution-3324e67a17442c8e3c8a3936d2f063ee675004d3.tar.zst
gsoc2013-evolution-3324e67a17442c8e3c8a3936d2f063ee675004d3.zip
removed e_messagebox, and use gtk_message_dialog directly.
2002-11-22 Not Zed <NotZed@Ximian.com> * mail-callbacks.c (ask_confirm_for_unwanted_html_mail): removed e_messagebox, and use gtk_message_dialog directly. (ask_confirm_for_empty_subject): and here. (ask_confirm_for_only_bcc): And here too. (msgbox_destroy_cb): Removed, since no longer needed. svn path=/trunk/; revision=18905
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog8
-rw-r--r--mail/mail-callbacks.c100
2 files changed, 45 insertions, 63 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 812f2cb740..bed571fc0d 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,11 @@
+2002-11-22 Not Zed <NotZed@Ximian.com>
+
+ * mail-callbacks.c (ask_confirm_for_unwanted_html_mail): removed
+ e_messagebox, and use gtk_message_dialog directly.
+ (ask_confirm_for_empty_subject): and here.
+ (ask_confirm_for_only_bcc): And here too.
+ (msgbox_destroy_cb): Removed, since no longer needed.
+
2002-11-15 Harry Lu <harry.lu@sun.com>
* mail-display.c (write_data_to_file): Show file name when prompt
diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c
index 7ffb8ccb00..7b2578c1b8 100644
--- a/mail/mail-callbacks.c
+++ b/mail/mail-callbacks.c
@@ -33,6 +33,8 @@
#include <errno.h>
#include <gtkhtml/gtkhtml.h>
+#include <gtk/gtkmessagedialog.h>
+
#include <libgnomeprint/gnome-print-master.h>
#include <libgnomeprintui/gnome-print-dialog.h>
#include <libgnomeprintui/gnome-print-master-preview.h>
@@ -62,7 +64,6 @@
#include "subscribe-dialog.h"
#include "message-tag-editor.h"
#include "message-tag-followup.h"
-#include "e-messagebox.h"
#include "Evolution.h"
#include "evolution-storage.h"
@@ -220,22 +221,12 @@ check_send_configuration (FolderBrowser *fb)
return TRUE;
}
-static void
-msgbox_destroy_cb (gpointer user_data, GObject *widget)
-{
- gboolean *show_again = user_data;
- GtkWidget *checkbox;
-
- checkbox = e_message_box_get_checkbox (E_MESSAGE_BOX (widget));
- *show_again = !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbox));
-}
-
static gboolean
ask_confirm_for_unwanted_html_mail (EMsgComposer *composer, EDestination **recipients)
{
- gboolean show_again = TRUE;
+ gboolean show_again;
GString *str;
- GtkWidget *mbox;
+ GtkWidget *mbox, *check;
int i, button;
if (!mail_config_get_confirm_unwanted_html ()) {
@@ -257,18 +248,16 @@ ask_confirm_for_unwanted_html_mail (EMsgComposer *composer, EDestination **recip
}
g_string_append (str, _("Send anyway?"));
-
- mbox = e_message_box_new (str->str,
- E_MESSAGE_BOX_QUESTION,
- GTK_STOCK_YES,
- GTK_STOCK_NO,
- NULL);
-
- g_string_free (str, TRUE);
-
- g_object_weak_ref ((GObject *) mbox, (GWeakNotify) msgbox_destroy_cb, &show_again);
-
- button = gtk_dialog_run (GTK_DIALOG (mbox));
+
+ mbox = gtk_message_dialog_new((GtkWindow *)composer, GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
+ "%s", str->str);
+ check = gtk_check_button_new_with_label (_("Don't show this message again."));
+ gtk_box_pack_start((GtkBox *)((GtkDialog *)mbox)->vbox, check, TRUE, TRUE, 10);
+ gtk_widget_show(check);
+ button = gtk_dialog_run((GtkDialog *)mbox);
+ show_again = !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check));
+ gtk_widget_destroy(mbox);
if (!show_again) {
mail_config_set_confirm_unwanted_html (show_again);
@@ -281,28 +270,22 @@ ask_confirm_for_unwanted_html_mail (EMsgComposer *composer, EDestination **recip
static gboolean
ask_confirm_for_empty_subject (EMsgComposer *composer)
{
- /* FIXME: EMessageBox should really handle this stuff
- automagically. What Miguel thinks would be nice is to pass
- in a unique id which could be used as a key in the config
- file and the value would be an int. -1 for always show or
- the button pressed otherwise. This probably means we'd have
- to write e_messagebox_run () */
- gboolean show_again = TRUE;
- GtkWidget *mbox;
+ gboolean show_again;
+ GtkWidget *mbox, *check;
int button;
if (!mail_config_get_prompt_empty_subject ())
return TRUE;
-
- mbox = e_message_box_new (_("This message has no subject.\nReally send?"),
- E_MESSAGE_BOX_QUESTION,
- GTK_STOCK_YES,
- GTK_STOCK_NO,
- NULL);
-
- g_object_weak_ref ((GObject *) mbox, (GWeakNotify) msgbox_destroy_cb, &show_again);
-
- button = gtk_dialog_run (GTK_DIALOG (mbox));
+
+ mbox = gtk_message_dialog_new((GtkWindow *)composer, GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
+ _("This message has no subject.\nReally send?"));
+ check = gtk_check_button_new_with_label (_("Don't show this message again."));
+ gtk_box_pack_start((GtkBox *)((GtkDialog *)mbox)->vbox, check, TRUE, TRUE, 10);
+ gtk_widget_show(check);
+ button = gtk_dialog_run((GtkDialog *)mbox);
+ show_again = !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check));
+ gtk_widget_destroy(mbox);
mail_config_set_prompt_empty_subject (show_again);
@@ -312,14 +295,8 @@ ask_confirm_for_empty_subject (EMsgComposer *composer)
static gboolean
ask_confirm_for_only_bcc (EMsgComposer *composer, gboolean hidden_list_case)
{
- /* FIXME: EMessageBox should really handle this stuff
- automagically. What Miguel thinks would be nice is to pass
- in a message-id which could be used as a key in the config
- file and the value would be an int. -1 for always show or
- the button pressed otherwise. This probably means we'd have
- to write e_messagebox_run () */
- gboolean show_again = TRUE;
- GtkWidget *mbox;
+ gboolean show_again;
+ GtkWidget *mbox, *check;
int button;
const char *first_text;
char *message_text;
@@ -341,20 +318,17 @@ ask_confirm_for_only_bcc (EMsgComposer *composer, gboolean hidden_list_case)
first_text = _("This message contains only Bcc recipients.");
}
- message_text = g_strdup_printf ("%s\n%s", first_text,
+ mbox = gtk_message_dialog_new((GtkWindow *)composer, GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
+ "%s\n%s", first_text,
_("It is possible that the mail server may reveal the recipients "
"by adding an Apparently-To header.\nSend anyway?"));
-
- mbox = e_message_box_new (message_text,
- E_MESSAGE_BOX_QUESTION,
- GNOME_STOCK_BUTTON_YES,
- GNOME_STOCK_BUTTON_NO,
- NULL);
-
- g_object_weak_ref ((GObject *) mbox, (GWeakNotify) msgbox_destroy_cb, &show_again);
- g_free (message_text);
-
- button = gtk_dialog_run (GTK_DIALOG (mbox));
+ check = gtk_check_button_new_with_label (_("Don't show this message again."));
+ gtk_box_pack_start((GtkBox *)((GtkDialog *)mbox)->vbox, check, TRUE, TRUE, 10);
+ gtk_widget_show(check);
+ button = gtk_dialog_run((GtkDialog *)mbox);
+ show_again = !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check));
+ gtk_widget_destroy(mbox);
mail_config_set_prompt_only_bcc (show_again);