diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2008-06-21 21:26:09 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2008-06-21 21:26:09 +0800 |
commit | 936490012d0c39fa0439b684acf25b3051afb07f (patch) | |
tree | 275fc4882a7450bac8ea630013c3c45de4014460 /composer/e-msg-composer.c | |
parent | 4f0c7992e06eeb483e4d1a567f7f2530b6ce0890 (diff) | |
download | gsoc2013-evolution-936490012d0c39fa0439b684acf25b3051afb07f.tar.gz gsoc2013-evolution-936490012d0c39fa0439b684acf25b3051afb07f.tar.zst gsoc2013-evolution-936490012d0c39fa0439b684acf25b3051afb07f.zip |
** Fixes bug #310988
2008-06-21 Matthew Barnes <mbarnes@redhat.com>
** Fixes bug #310988
* e-msg-composer.c:
Don't even show the "send-options" action unless an Exchange
or GroupWise account appears in the From combo box.
svn path=/trunk/; revision=35667
Diffstat (limited to 'composer/e-msg-composer.c')
-rw-r--r-- | composer/e-msg-composer.c | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 27cb33f33d..6ccbde98f6 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -1718,6 +1718,45 @@ exit: } static void +msg_composer_account_list_changed_cb (EMsgComposer *composer) +{ + EComposerHeaderTable *table; + EAccountList *account_list; + EIterator *iterator; + gboolean visible = FALSE; + + /* Determine whether to show the "send-options" action by + * examining the account list for account types that support it. + * + * XXX I'd prefer a more general way of doing this. The composer + * should not know about particular account types. Perhaps + * add a "supports advanced send options" flag to EAccount. */ + + table = E_COMPOSER_HEADER_TABLE (composer->priv->header_table); + account_list = e_composer_header_table_get_account_list (table); + iterator = e_list_get_iterator (E_LIST (account_list)); + + while (!visible && e_iterator_is_valid (iterator)) { + EAccount *account; + const gchar *url; + + /* XXX EIterator misuses const. */ + account = (EAccount *) e_iterator_get (iterator); + e_iterator_next (iterator); + + if (!account->enabled) + continue; + + url = account->transport->url; + visible |= (strstr (url, "exchange") != NULL); + visible |= (strstr (url, "groupwise") != NULL); + } + + gtk_action_set_visible (ACTION (SEND_OPTIONS), visible); + g_object_unref (iterator); +} + +static void msg_composer_attach_message (EMsgComposer *composer, CamelMimeMessage *msg) { @@ -2764,6 +2803,9 @@ msg_composer_init (EMsgComposer *composer) table, "notify::account", G_CALLBACK (msg_composer_account_changed_cb), composer); g_signal_connect_swapped ( + table, "notify::account-list", + G_CALLBACK (msg_composer_account_list_changed_cb), composer); + g_signal_connect_swapped ( table, "notify::destinations-bcc", G_CALLBACK (msg_composer_notify_header_cb), composer); g_signal_connect_swapped ( @@ -2786,6 +2828,7 @@ msg_composer_init (EMsgComposer *composer) G_CALLBACK (msg_composer_notify_header_cb), composer); msg_composer_account_changed_cb (composer); + msg_composer_account_list_changed_cb (composer); /* Attachment Bar */ @@ -2846,14 +2889,12 @@ static EMsgComposer * create_composer (gint visible_mask) { EMsgComposer *composer; - EMsgComposerPrivate *p; EComposerHeaderTable *table; GtkToggleAction *action; gboolean active; composer = g_object_new (E_TYPE_MSG_COMPOSER, NULL); table = E_COMPOSER_HEADER_TABLE (composer->priv->header_table); - p = composer->priv; /* Configure View Menu */ |