2007-08-12 [ticho] 2.10.0cvs114
authorAndrej Kacian <ticho@claws-mail.org>
Sun, 12 Aug 2007 12:23:35 +0000 (12:23 +0000)
committerAndrej Kacian <ticho@claws-mail.org>
Sun, 12 Aug 2007 12:23:35 +0000 (12:23 +0000)
* src/prefs_folder_item.c
Make sure that folder default account combobox always has some
account preselected.
* src/gtk/combobox.c
Handle empty combobox gracefully (warning instead of crash).

ChangeLog
PATCHSETS
configure.ac
src/gtk/combobox.c
src/prefs_folder_item.c

index 5f8fa59..4d24608 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2007-08-12 [ticho]     2.10.0cvs114
+
+       * src/prefs_folder_item.c
+               Make sure that folder default account combobox always has some
+               account preselected.
+       * src/gtk/combobox.c
+               Handle empty combobox gracefully (warning instead of crash).
+
+2007-08-12 [ticho]     2.10.0cvs114
+
+       * src/prefs_folder_item.c
+               Make sure that folder default account combobox is not empty.
+       * src/gtk/combobox.c
+               Handle empty combobox gracefully (warning instead of crash).
+
 2007-08-11 [paul]      2.10.0cvs113
 
        * src/addrgather.c
index 8648639..0ed6d57 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.16.2.55 -r 1.16.2.56 src/msgcache.c;  cvs diff -u -r 1.17.2.10 -r 1.17.2.11 src/recv.c;  ) > 2.10.0cvs111.patchset
 ( cvs diff -u -r 1.16.2.56 -r 1.16.2.57 src/msgcache.c;  ) > 2.10.0cvs112.patchset
 ( cvs diff -u -r 1.5.10.19 -r 1.5.10.20 src/addrgather.c;  cvs diff -u -r 1.207.2.172 -r 1.207.2.173 src/folderview.c;  cvs diff -u -r 1.1.2.48 -r 1.1.2.49 src/imap_gtk.c;  ) > 2.10.0cvs113.patchset
+( cvs diff -u -r 1.52.2.47 -r 1.52.2.48 src/prefs_folder_item.c;  cvs diff -u -r 1.1.2.10 -r 1.1.2.11 src/gtk/combobox.c;  ) > 2.10.0cvs114.patchset
+( cvs diff -u -r 1.52.2.47 -r 1.52.2.48 src/prefs_folder_item.c;  cvs diff -u -r 1.1.2.10 -r 1.1.2.11 src/gtk/combobox.c;  ) > 2.10.0cvs114.patchset
index 7216c6c..46c27d9 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=10
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=113
+EXTRA_VERSION=114
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 38fc9ec..9390b68 100644 (file)
@@ -74,7 +74,7 @@ gint combobox_get_active_data(GtkComboBox *combobox)
 
        g_return_val_if_fail(combobox != NULL, -1);
 
-       gtk_combo_box_get_active_iter(combobox, &iter);
+       g_return_val_if_fail(gtk_combo_box_get_active_iter(combobox, &iter), -1);
 
        model = gtk_combo_box_get_model(combobox);
 
index 6bc9d80..ca660e2 100644 (file)
@@ -721,6 +721,7 @@ static void prefs_folder_item_compose_create_widget_func(PrefsPage * page_,
        GList *cur_ac;
        GList *account_list;
        PrefsAccount *ac_prefs;
+       gboolean default_account_set = FALSE;
 
        page->item         = item;
 
@@ -857,11 +858,20 @@ static void prefs_folder_item_compose_create_widget_func(PrefsPage * page_,
                                        ac_prefs->account_id);
 
                /* Set combobox to current default account id */
-               if (ac_prefs->account_id == item->prefs->default_account)
+               if (ac_prefs->account_id == item->prefs->default_account) {
                        combobox_select_by_data(GTK_COMBO_BOX(optmenu_default_account),
                                        ac_prefs->account_id);
+                       default_account_set = TRUE;
+               }
        }
 
+       /* If nothing has been set (folder doesn't have a default account set),
+        * pre-select global default account, since that's what actually used
+        * anyway. We don't want nothing selected in combobox. */
+       if( !default_account_set )
+               combobox_select_by_data(GTK_COMBO_BOX(optmenu_default_account),
+                               account_get_default()->account_id);
+
        SET_TOGGLE_SENSITIVITY(checkbtn_enable_default_account, optmenu_default_account);
 
        default_account_rec_checkbtn = gtk_check_button_new();