aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-callbacks.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-01-17 17:14:36 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-01-17 17:14:36 +0800
commit80a00a6df927a9e5561e97cfdbac5856e2269370 (patch)
tree45e49550bef48acd6b14f40bfbb3be1dd52ea235 /mail/mail-callbacks.c
parent485d80d3360e1fcfb9bf08da6e22d09526d3db52 (diff)
downloadgsoc2013-evolution-80a00a6df927a9e5561e97cfdbac5856e2269370.tar
gsoc2013-evolution-80a00a6df927a9e5561e97cfdbac5856e2269370.tar.gz
gsoc2013-evolution-80a00a6df927a9e5561e97cfdbac5856e2269370.tar.bz2
gsoc2013-evolution-80a00a6df927a9e5561e97cfdbac5856e2269370.tar.lz
gsoc2013-evolution-80a00a6df927a9e5561e97cfdbac5856e2269370.tar.xz
gsoc2013-evolution-80a00a6df927a9e5561e97cfdbac5856e2269370.tar.zst
gsoc2013-evolution-80a00a6df927a9e5561e97cfdbac5856e2269370.zip
Update to use EMessageBox and to record if the user doesn't want to ever
2001-01-17 Jeffrey Stedfast <fejj@ximian.com> * mail-callbacks.c (ask_confirm_for_empty_subject): Update to use EMessageBox and to record if the user doesn't want to ever see this dialog again. * mail-config.c (mail_config_get_prompt_empty_subject): New config function. (mail_config_set_prompt_empty_subject): Another new one. svn path=/trunk/; revision=7567
Diffstat (limited to 'mail/mail-callbacks.c')
-rw-r--r--mail/mail-callbacks.c39
1 files changed, 33 insertions, 6 deletions
diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c
index 9c3ad0f121..a1f5ce3852 100644
--- a/mail/mail-callbacks.c
+++ b/mail/mail-callbacks.c
@@ -46,6 +46,7 @@
#include "filter/filter-driver.h"
#include <gal/e-table/e-table.h>
#include <gal/widgets/e-gui-utils.h>
+#include "e-messagebox.h"
/* FIXME: is there another way to do this? */
#include "Evolution.h"
@@ -249,18 +250,44 @@ send_receieve_mail (GtkWidget *widget, gpointer user_data)
send_queued_mail (widget, user_data);
}
+static void
+empty_subject_destroyed (GtkWidget *widget, gpointer data)
+{
+ gboolean *show_again = data;
+ GtkWidget *checkbox;
+
+ checkbox = e_message_box_get_checkbox (E_MESSAGE_BOX (widget));
+ *show_again = !GTK_TOGGLE_BUTTON (checkbox)->active;
+}
+
static gboolean
ask_confirm_for_empty_subject (EMsgComposer *composer)
{
- GtkWidget *message_box;
+ /* 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;
int button;
- message_box = gnome_message_box_new (_("This message has no subject.\nReally send?"),
- GNOME_MESSAGE_BOX_QUESTION,
- GNOME_STOCK_BUTTON_YES, GNOME_STOCK_BUTTON_NO,
- NULL);
+ 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,
+ GNOME_STOCK_BUTTON_YES,
+ GNOME_STOCK_BUTTON_NO,
+ NULL);
+
+ gtk_signal_connect (GTK_OBJECT (mbox), "destroy",
+ empty_subject_destroyed, &show_again);
+
+ button = gnome_dialog_run_and_close (GNOME_DIALOG (mbox));
- button = gnome_dialog_run_and_close (GNOME_DIALOG (message_box));
+ mail_config_set_prompt_empty_subject (show_again);
if (button == 0)
return TRUE;