From fbc89c9d81653b782438c55b0e5259c5524759de Mon Sep 17 00:00:00 2001 From: Jason Leach Date: Thu, 19 Jul 2001 01:25:35 +0000 Subject: Update to the new way of finding the default account. 2001-07-18 Jason Leach * e-msg-composer-hdrs.c (create_from_optionmenu): Update to the new way of finding the default account. svn path=/trunk/; revision=11219 --- composer/ChangeLog | 5 +++++ composer/e-msg-composer-hdrs.c | 12 +++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/composer/ChangeLog b/composer/ChangeLog index 0af11d69eb..5ac58d046d 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,3 +1,8 @@ +2001-07-18 Jason Leach + + * e-msg-composer-hdrs.c (create_from_optionmenu): Update to the + new way of finding the default account. + 2001-07-18 Iain Holmes * e-msg-composer.c (do_exit): Use a messagebox. diff --git a/composer/e-msg-composer-hdrs.c b/composer/e-msg-composer-hdrs.c index b21f7ca323..f27f32fe2d 100644 --- a/composer/e-msg-composer-hdrs.c +++ b/composer/e-msg-composer-hdrs.c @@ -183,10 +183,13 @@ create_from_optionmenu (EMsgComposerHdrs *hdrs) const GSList *accounts; GtkWidget *item; int i = 0, history = 0; + int default_account; omenu = gtk_option_menu_new (); menu = gtk_menu_new (); - + + default_account = mail_config_get_default_account_num (); + accounts = mail_config_get_accounts (); while (accounts) { const MailConfigAccount *account; @@ -217,7 +220,7 @@ create_from_optionmenu (EMsgComposerHdrs *hdrs) gtk_signal_connect (GTK_OBJECT (item), "activate", GTK_SIGNAL_FUNC (from_changed), hdrs); - if (account->default_account) { + if (i == default_account) { first = item; history = i; } @@ -733,12 +736,15 @@ e_msg_composer_hdrs_set_from_account (EMsgComposerHdrs *hdrs, GtkWidget *item; GSList *l; int i = 0; + int default_account = 0; g_return_if_fail (hdrs != NULL); g_return_if_fail (E_IS_MSG_COMPOSER_HDRS (hdrs)); omenu = GTK_OPTION_MENU (hdrs->priv->from.entry); + default_account = mail_config_get_default_account_num (); + /* find the item that represents the account and activate it */ l = hdrs->priv->from_options; while (l) { @@ -747,7 +753,7 @@ e_msg_composer_hdrs_set_from_account (EMsgComposerHdrs *hdrs, account = gtk_object_get_data (GTK_OBJECT (item), "account"); if ((account_name && !strcmp (account_name, account->name)) || - (!account_name && account->default_account)) { + (!account_name && i == default_account)) { /* set the correct optionlist item */ gtk_option_menu_set_history (omenu, i); gtk_signal_emit_by_name (GTK_OBJECT (item), "activate", hdrs); -- cgit v1.2.3