aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog10
-rw-r--r--mail/mail-callbacks.c39
-rw-r--r--mail/mail-config.c25
-rw-r--r--mail/mail-config.h3
4 files changed, 71 insertions, 6 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 3a07712f10..1ea0df32ee 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,13 @@
+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.
+
2001-01-16 Jeffrey Stedfast <fejj@ximian.com>
* mail-account-editor.c (apply_changes): Modify to be able to
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;
diff --git a/mail/mail-config.c b/mail/mail-config.c
index 47a2392767..78107cce95 100644
--- a/mail/mail-config.c
+++ b/mail/mail-config.c
@@ -39,6 +39,7 @@ typedef struct {
gboolean view_source;
gint paned_size;
gboolean send_html;
+ gboolean prompt_empty_subject;
gint seen_timeout;
GSList *accounts;
@@ -331,6 +332,12 @@ config_read (void)
config->paned_size = gnome_config_get_int (str);
g_free (str);
+ /* Empty Subject */
+ str = g_strdup_printf ("=%s/config/Mail=/Prompts/empty_subject=true",
+ evolution_dir);
+ config->prompt_empty_subject = gnome_config_get_bool (str);
+ g_free (str);
+
gnome_config_sync ();
}
@@ -424,6 +431,12 @@ mail_config_write (void)
gnome_config_set_bool (str, config->send_html);
g_free (str);
+ /* Empty Subject */
+ str = g_strdup_printf ("=%s/config/Mail=/Prompts/empty_subject",
+ evolution_dir);
+ gnome_config_set_bool (str, config->prompt_empty_subject);
+ g_free (str);
+
gnome_config_sync ();
}
@@ -526,6 +539,18 @@ mail_config_set_mark_as_seen_timeout (gint timeout)
config->seen_timeout = timeout;
}
+gboolean
+mail_config_get_prompt_empty_subject (void)
+{
+ return config->prompt_empty_subject;
+}
+
+void
+mail_config_set_prompt_empty_subject (gboolean value)
+{
+ config->prompt_empty_subject = value;
+}
+
const MailConfigAccount *
mail_config_get_default_account (void)
{
diff --git a/mail/mail-config.h b/mail/mail-config.h
index 8998893e3b..d2c7b63593 100644
--- a/mail/mail-config.h
+++ b/mail/mail-config.h
@@ -93,6 +93,9 @@ void mail_config_set_send_html (gboolean send_html);
gint mail_config_get_mark_as_seen_timeout (void);
void mail_config_set_mark_as_seen_timeout (gint timeout);
+gboolean mail_config_get_prompt_empty_subject (void);
+void mail_config_set_prompt_empty_subject (gboolean value);
+
const MailConfigAccount *mail_config_get_default_account (void);
const MailConfigAccount *mail_config_get_account_by_name (const char *account_name);
const GSList *mail_config_get_accounts (void);