diff options
author | Jeffrey Stedfast <fejj@helixcode.com> | 2000-09-03 13:56:14 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2000-09-03 13:56:14 +0800 |
commit | e6220851e3ae208ad833c4fcce282b1b2a730e86 (patch) | |
tree | 900751c851f59670ea08303a538f33810f8dbb1e /mail/mail-callbacks.c | |
parent | a1a876f80d5610ad72628c9d1451afbb2d25b2a4 (diff) | |
download | gsoc2013-evolution-e6220851e3ae208ad833c4fcce282b1b2a730e86.tar gsoc2013-evolution-e6220851e3ae208ad833c4fcce282b1b2a730e86.tar.gz gsoc2013-evolution-e6220851e3ae208ad833c4fcce282b1b2a730e86.tar.bz2 gsoc2013-evolution-e6220851e3ae208ad833c4fcce282b1b2a730e86.tar.lz gsoc2013-evolution-e6220851e3ae208ad833c4fcce282b1b2a730e86.tar.xz gsoc2013-evolution-e6220851e3ae208ad833c4fcce282b1b2a730e86.tar.zst gsoc2013-evolution-e6220851e3ae208ad833c4fcce282b1b2a730e86.zip |
Change the "Get Mail" toolbar button to become "Send & Receieve"
2000-09-03 Jeffrey Stedfast <fejj@helixcode.com>
* folder-browser-factory.c: Change the "Get Mail" toolbar button
to become "Send & Receieve"
* mail-callbacks.c (send_queued_mail): New callback function for
sending queued mail
(send_receieve_mail): New callback for Send & Receieve that
basically just calls send_queued_mail and then fetch_mail
* mail-ops.c (cleanup_send_mail): Mod to be able to handle a NULL
composer window
(setup_send_mail): Modified to handle a NULL composer widget
(mail_do_send_queue): New convenience async function to send all
messages in a folder (aka all messages in a queue)
svn path=/trunk/; revision=5184
Diffstat (limited to 'mail/mail-callbacks.c')
-rw-r--r-- | mail/mail-callbacks.c | 74 |
1 files changed, 60 insertions, 14 deletions
diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c index 70ae463a29..e0338eda5f 100644 --- a/mail/mail-callbacks.c +++ b/mail/mail-callbacks.c @@ -135,59 +135,105 @@ select_first_unread (CamelObject *object, gpointer event_data, gpointer data) } void -fetch_mail (GtkWidget *button, gpointer user_data) +fetch_mail (GtkWidget *widget, gpointer user_data) { GSList *sources; - + if (!check_configured (FOLDER_BROWSER (user_data))) { GtkWidget *win = gtk_widget_get_ancestor (GTK_WIDGET (user_data), GTK_TYPE_WINDOW); - + gnome_error_dialog_parented ("You have no mail sources " "configured", GTK_WINDOW (win)); return; } - + sources = mail_config_get_sources (); - + if (!sources || !sources->data) { GtkWidget *win = gtk_widget_get_ancestor (GTK_WIDGET (user_data), GTK_TYPE_WINDOW); - + gnome_error_dialog_parented ("You have no mail sources " "configured", GTK_WINDOW (win)); return; } - + while (sources) { MailConfigService *source; - + source = (MailConfigService *) sources->data; sources = sources->next; - + if (!source || !source->url) { g_warning ("Bad source in fetch_mail??"); continue; } - + mail_do_fetch_mail (source->url, source->keep_on_server, NULL, select_first_unread, user_data); } } +void +send_queued_mail (GtkWidget *widget, gpointer user_data) +{ + extern CamelFolder *outbox_folder; + MailConfigService *transport; + + if (!mail_config_is_configured ()) { + GtkWidget *win = gtk_widget_get_ancestor (GTK_WIDGET (user_data), + GTK_TYPE_WINDOW); + + gnome_error_dialog_parented ("You have not set any configuration settings", + GTK_WINDOW (win)); + return; + } + + transport = mail_config_get_transport (); + if (!transport) { + GtkWidget *win = gtk_widget_get_ancestor (GTK_WIDGET (user_data), + GTK_TYPE_WINDOW); + + gnome_error_dialog_parented ("You have not set a transport method", + GTK_WINDOW (win)); + return; + } + + if (!outbox_folder) { + GtkWidget *win = gtk_widget_get_ancestor (GTK_WIDGET (user_data), + GTK_TYPE_WINDOW); + + gnome_error_dialog_parented ("You have no Outbox configured", + GTK_WINDOW (win)); + return; + } + + mail_do_send_queue (outbox_folder, transport->url); + + mail_do_expunge_folder (outbox_folder); +} + +void +send_receieve_mail (GtkWidget *widget, gpointer user_data) +{ + send_queued_mail (widget, user_data); + fetch_mail (widget, user_data); +} + static gboolean ask_confirm_for_empty_subject (EMsgComposer *composer) { GtkWidget *message_box; 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); - + button = gnome_dialog_run_and_close (GNOME_DIALOG (message_box)); - + if (button == 0) return TRUE; else @@ -198,7 +244,7 @@ static void free_psd (GtkWidget *composer, gpointer user_data) { struct post_send_data *psd = user_data; - + if (psd->folder) camel_object_unref (CAMEL_OBJECT (psd->folder)); if (psd->uid) |