aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-send-recv.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/mail-send-recv.c')
-rw-r--r--mail/mail-send-recv.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c
index df45ffb814..29cbb57322 100644
--- a/mail/mail-send-recv.c
+++ b/mail/mail-send-recv.c
@@ -415,6 +415,10 @@ build_dialog (EAccountList *accounts, CamelFolder *outbox, const char *destinati
g_object_unref (iter);
+ /* Check to see if we have to send any mails --- if we don't, don't display the SMTP row in the table */
+ if (outbox && destination && camel_folder_get_message_count (outbox) == 0)
+ num_sources--;
+
table = gtk_table_new (num_sources, 4, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (table), 6);
gtk_table_set_row_spacings (GTK_TABLE (table), 6);
@@ -539,7 +543,8 @@ build_dialog (EAccountList *accounts, CamelFolder *outbox, const char *destinati
target = em_event_target_new_send_receive (em_event_peek(), table, data, row, EM_EVENT_SEND_RECEIVE);
e_event_emit ((EEvent *)em_event_peek (), "mail.sendreceive", (EEventTarget *) target);
- if (outbox && destination) {
+ /* Skip displaying the SMTP row if we've got no outbox, destination or unsent mails */
+ if (outbox && destination && camel_folder_get_message_count (outbox) != 0) {
info = g_hash_table_lookup (data->active, SEND_URI_KEY);
if (info == NULL) {
info = g_malloc0 (sizeof (*info));
@@ -601,9 +606,9 @@ build_dialog (EAccountList *accounts, CamelFolder *outbox, const char *destinati
g_signal_connect (
cancel_button, "clicked",
G_CALLBACK (receive_cancel), info);
- gtk_widget_show_all (table);
}
+ gtk_widget_show_all (table);
gtk_widget_show (GTK_WIDGET (gd));
g_signal_connect (gd, "response", G_CALLBACK (dialog_response), data);