diff options
-rw-r--r-- | mail/ChangeLog | 6 | ||||
-rw-r--r-- | mail/mail-accounts.c | 11 | ||||
-rw-r--r-- | mail/mail-accounts.h | 1 | ||||
-rw-r--r-- | mail/mail-config.glade | 15 | ||||
-rw-r--r-- | mail/mail-ops.c | 86 |
5 files changed, 82 insertions, 37 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index c7cbefae16..017a9f56b9 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,5 +1,11 @@ 2001-07-05 Jeffrey Stedfast <fejj@ximian.com> + * mail-accounts.c (construct): Add a checkbox for prompting when + sending a message with an empty subject. + + * mail-ops.c (mail_send_message): If filtering fails, return right + away. + * mail-config.c (mail_config_set_show_preview): Okay, apparently I was wrong. Oh well. (mail_config_set_thread_list): Fix this one too. diff --git a/mail/mail-accounts.c b/mail/mail-accounts.c index f084d163e7..edb147f49d 100644 --- a/mail/mail-accounts.c +++ b/mail/mail-accounts.c @@ -648,6 +648,12 @@ empty_trash_toggled (GtkWidget *toggle, gpointer data) } static void +prompt_empty_subject_toggled (GtkWidget *toggle, gpointer data) +{ + mail_config_set_prompt_empty_subject (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toggle))); +} + +static void forward_style_activated (GtkWidget *item, gpointer data) { int style = GPOINTER_TO_INT (data); @@ -802,6 +808,11 @@ construct (MailAccountsDialog *dialog) gtk_signal_connect (GTK_OBJECT (dialog->empty_trash), "toggled", GTK_SIGNAL_FUNC (empty_trash_toggled), dialog); + dialog->prompt_empty_subject = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkPromptEmptySubject")); + gtk_toggle_button_set_active (dialog->prompt_empty_subject, mail_config_get_prompt_empty_subject ()); + gtk_signal_connect (GTK_OBJECT (dialog->prompt_empty_subject), "toggled", + GTK_SIGNAL_FUNC (prompt_empty_subject_toggled), dialog); + /* now to fill in the clists */ dialog->accounts_row = -1; dialog->accounts = mail_config_get_accounts (); diff --git a/mail/mail-accounts.h b/mail/mail-accounts.h index ebc67b3dec..f0ece925d9 100644 --- a/mail/mail-accounts.h +++ b/mail/mail-accounts.h @@ -85,6 +85,7 @@ struct _MailAccountsDialog { /* Other page */ GtkToggleButton *empty_trash; + GtkToggleButton *prompt_empty_subject; /* PGP page */ GnomeFileEntry *pgp_path; diff --git a/mail/mail-config.glade b/mail/mail-config.glade index d4bae0fcea..3fcc2bba07 100644 --- a/mail/mail-config.glade +++ b/mail/mail-config.glade @@ -2047,7 +2047,6 @@ Kerberos <xpad>0</xpad> <ypad>0</ypad> </widget> - </widget> </widget> @@ -2768,6 +2767,20 @@ Quoted <fill>False</fill> </child> </widget> + + <widget> + <class>GtkCheckButton</class> + <name>chkPromptEmptySubject</name> + <can_focus>True</can_focus> + <label>Prompt when sending messages with an empty subject</label> + <active>True</active> + <draw_indicator>True</draw_indicator> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>False</fill> + </child> + </widget> </widget> <widget> diff --git a/mail/mail-ops.c b/mail/mail-ops.c index 1ca74631d0..5725e27980 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -471,7 +471,7 @@ mail_send_message(CamelMimeMessage *message, const char *destination, CamelFilte camel_medium_remove_header (CAMEL_MEDIUM (message), "X-Evolution-Fcc"); } } - + xport = camel_session_get_transport (session, transport_url ? transport_url : destination, ex); g_free (transport_url); if (!xport) { @@ -496,9 +496,15 @@ mail_send_message(CamelMimeMessage *message, const char *destination, CamelFilte g_free (acct_header); } - if (driver) + if (driver) { camel_filter_driver_filter_message (driver, message, info, NULL, NULL, NULL, "", ex); + + if (camel_exception_is_set (ex)) { + camel_message_info_free (info); + return; + } + } if (sent_folder_uri) { folder = mail_tool_uri_to_folder (sent_folder_uri, NULL); @@ -534,48 +540,52 @@ struct _send_mail_msg { void *data; }; -static char *send_mail_desc(struct _mail_msg *mm, int done) +static char * +send_mail_desc (struct _mail_msg *mm, int done) { struct _send_mail_msg *m = (struct _send_mail_msg *)mm; char *subject; const char *subject_utf8; - subject_utf8 = camel_mime_message_get_subject(m->message); + subject_utf8 = camel_mime_message_get_subject (m->message); if (subject_utf8) { char *desc; - + subject = e_utf8_to_locale_string (subject_utf8); desc = g_strdup_printf (_("Sending \"%s\""), subject); g_free (subject); return desc; } else - return g_strdup(_("Sending message")); + return g_strdup (_("Sending message")); } -static void send_mail_send(struct _mail_msg *mm) +static void +send_mail_send (struct _mail_msg *mm) { struct _send_mail_msg *m = (struct _send_mail_msg *)mm; - - camel_operation_register(mm->cancel); - mail_send_message(m->message, m->destination, m->driver, &mm->ex); - camel_operation_unregister(mm->cancel); + + camel_operation_register (mm->cancel); + mail_send_message (m->message, m->destination, m->driver, &mm->ex); + camel_operation_unregister (mm->cancel); } -static void send_mail_sent(struct _mail_msg *mm) +static void +send_mail_sent (struct _mail_msg *mm) { struct _send_mail_msg *m = (struct _send_mail_msg *)mm; - + if (m->done) - m->done(m->destination, m->message, !camel_exception_is_set(&mm->ex), m->data); + m->done (m->destination, m->message, !camel_exception_is_set (&mm->ex), m->data); } -static void send_mail_free(struct _mail_msg *mm) +static void +send_mail_free (struct _mail_msg *mm) { struct _send_mail_msg *m = (struct _send_mail_msg *)mm; - - camel_object_unref((CamelObject *)m->message); - g_free(m->destination); + + camel_object_unref (CAMEL_OBJECT (m->message)); + g_free (m->destination); } static struct _mail_msg_op send_mail_op = { @@ -586,23 +596,25 @@ static struct _mail_msg_op send_mail_op = { }; int -mail_send_mail(const char *uri, CamelMimeMessage *message, void (*done) (char *uri, CamelMimeMessage *message, gboolean sent, void *data), void *data) +mail_send_mail (const char *uri, CamelMimeMessage *message, + void (*done) (char *uri, CamelMimeMessage *message, gboolean sent, void *data), + void *data) { struct _send_mail_msg *m; int id; - - m = mail_msg_new(&send_mail_op, NULL, sizeof(*m)); - m->destination = g_strdup(uri); + + m = mail_msg_new (&send_mail_op, NULL, sizeof (*m)); + m->destination = g_strdup (uri); m->message = message; - camel_object_ref((CamelObject *)message); + camel_object_ref (CAMEL_OBJECT (message)); m->data = data; m->done = done; - + id = m->msg.seq; - - m->driver = camel_session_get_filter_driver(session, FILTER_SOURCE_OUTGOING, NULL); - - e_thread_put(mail_thread_new, (EMsg *)m); + + m->driver = camel_session_get_filter_driver (session, FILTER_SOURCE_OUTGOING, NULL); + + e_thread_put (mail_thread_new, (EMsg *)m); return id; } @@ -765,12 +777,14 @@ struct _append_msg { void *data; }; -static char *append_mail_desc(struct _mail_msg *mm, int done) +static char * +append_mail_desc (struct _mail_msg *mm, int done) { - return g_strdup(_("Saving message to folder")); + return g_strdup (_("Saving message to folder")); } -static void append_mail_append(struct _mail_msg *mm) +static void +append_mail_append (struct _mail_msg *mm) { struct _append_msg *m = (struct _append_msg *)mm; @@ -778,7 +792,8 @@ static void append_mail_append(struct _mail_msg *mm) camel_folder_append_message(m->folder, m->message, m->info, &mm->ex); } -static void append_mail_appended(struct _mail_msg *mm) +static void +append_mail_appended (struct _mail_msg *mm) { struct _append_msg *m = (struct _append_msg *)mm; @@ -786,7 +801,8 @@ static void append_mail_appended(struct _mail_msg *mm) m->done(m->folder, m->message, m->info, !camel_exception_is_set(&mm->ex), m->data); } -static void append_mail_free(struct _mail_msg *mm) +static void +append_mail_free (struct _mail_msg *mm) { struct _append_msg *m = (struct _append_msg *)mm; @@ -802,9 +818,7 @@ static struct _mail_msg_op append_mail_op = { }; void -mail_append_mail (CamelFolder *folder, - CamelMimeMessage *message, - CamelMessageInfo *info, +mail_append_mail (CamelFolder *folder, CamelMimeMessage *message, CamelMessageInfo *info, void (*done)(CamelFolder *folder, CamelMimeMessage *msg, CamelMessageInfo *info, int ok, void *data), void *data) { |