From d5699b66585d3c278b635e0b99d5a66c86698555 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Tue, 30 Sep 2008 19:38:49 +0000 Subject: ** Fix for bug #545045 2008-09-30 Philip Withnall ** Fix for bug #545045 * mail-send-recv.c (build_dialog): Don't show SMTP in the Send/Receive dialogue if there are no unsent mails. svn path=/trunk/; revision=36505 --- mail/ChangeLog | 7 +++++++ mail/mail-send-recv.c | 9 +++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index 6675438231..e2ec45b256 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,10 @@ +2008-09-30 Philip Withnall + + ** Fix for bug #545045 + + * mail-send-recv.c (build_dialog): Don't show SMTP in the + Send/Receive dialogue if there are no unsent mails. + 2008-09-30 Sankar P License Changes 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); -- cgit v1.2.3