aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-callbacks.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@helixcode.com>2001-01-13 05:15:36 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-01-13 05:15:36 +0800
commit7b02bff8210ca98f1d3ff0720091b512602571e8 (patch)
treeb8d018aed6389006e17678e6ff8929ba1c012992 /mail/mail-callbacks.c
parent8ad2b343a02b954f2393e08deece19861352329e (diff)
downloadgsoc2013-evolution-7b02bff8210ca98f1d3ff0720091b512602571e8.tar
gsoc2013-evolution-7b02bff8210ca98f1d3ff0720091b512602571e8.tar.gz
gsoc2013-evolution-7b02bff8210ca98f1d3ff0720091b512602571e8.tar.bz2
gsoc2013-evolution-7b02bff8210ca98f1d3ff0720091b512602571e8.tar.lz
gsoc2013-evolution-7b02bff8210ca98f1d3ff0720091b512602571e8.tar.xz
gsoc2013-evolution-7b02bff8210ca98f1d3ff0720091b512602571e8.tar.zst
gsoc2013-evolution-7b02bff8210ca98f1d3ff0720091b512602571e8.zip
Get the account by using the new e_msg_composer_get_preferred_account()
2001-01-12 Jeffrey Stedfast <fejj@helixcode.com> * mail-callbacks.c (composer_send_cb): Get the account by using the new e_msg_composer_get_preferred_account() function. Also check to make sure everything is configured (in case they deleted their accounts while composing mail?). * mail-config.c (mail_config_get_account_by_address): New convenience function. svn path=/trunk/; revision=7459
Diffstat (limited to 'mail/mail-callbacks.c')
-rw-r--r--mail/mail-callbacks.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c
index b691fbe591..636f95aecd 100644
--- a/mail/mail-callbacks.c
+++ b/mail/mail-callbacks.c
@@ -208,6 +208,8 @@ send_queued_mail (GtkWidget *widget, gpointer user_data)
return;
}
+ /* FIXME: use the preferred transport for each message */
+
account = mail_config_get_default_account ();
if (!account || !account->transport) {
GtkWidget *win = gtk_widget_get_ancestor (GTK_WIDGET (user_data),
@@ -305,9 +307,21 @@ composer_send_cb (EMsgComposer *composer, gpointer data)
const char *subject;
struct post_send_data *psd = data;
struct _send_data *send;
-
- /* Config info */
- account = mail_config_get_default_account ();
+
+ if (!mail_config_is_configured ()) {
+ GtkWidget *dialog;
+
+ dialog = gnome_ok_dialog_parented (_("You must configure an account before you "
+ "can send this email."),
+ GTK_WINDOW (composer));
+ gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
+ return;
+ }
+
+ /* Use the preferred account */
+ account = e_msg_composer_get_preferred_account (composer);
+ if (!account)
+ account = mail_config_get_default_account ();
/* Get the message */
message = e_msg_composer_get_message (composer);
@@ -317,7 +331,8 @@ composer_send_cb (EMsgComposer *composer, gpointer data)
if (!iaddr || CAMEL_ADDRESS (iaddr)->addresses->len == 0) {
GtkWidget *message_box;
- message_box = gnome_message_box_new (_("You must specify recipients in order to send this message."),
+ message_box = gnome_message_box_new (_("You must specify recipients in order to "
+ "send this message."),
GNOME_MESSAGE_BOX_WARNING,
GNOME_STOCK_BUTTON_OK,
NULL);