diff options
author | Not Zed <NotZed@Ximian.com> | 2004-12-06 12:25:54 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2004-12-06 12:25:54 +0800 |
commit | 96805fe4fdd535c7bbae414c62364a9bbcb09ba2 (patch) | |
tree | 42f5a8d3da0c0540677e0de80410c48e440c4361 | |
parent | 9f9683d27e22bd2e09b7be3d2630529a85ccea49 (diff) | |
download | gsoc2013-evolution-96805fe4fdd535c7bbae414c62364a9bbcb09ba2.tar.gz gsoc2013-evolution-96805fe4fdd535c7bbae414c62364a9bbcb09ba2.tar.zst gsoc2013-evolution-96805fe4fdd535c7bbae414c62364a9bbcb09ba2.zip |
set the active item based on the current group.
2004-12-06 Not Zed <NotZed@Ximian.com>
* gui/component/addressbook-config.c (eabc_general_type): set the
active item based on the current group.
svn path=/trunk/; revision=28070
-rw-r--r-- | addressbook/ChangeLog | 5 | ||||
-rw-r--r-- | addressbook/gui/component/addressbook-config.c | 9 |
2 files changed, 12 insertions, 2 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index b3ac540e46..149f24f0da 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,8 @@ +2004-12-06 Not Zed <NotZed@Ximian.com> + + * gui/component/addressbook-config.c (eabc_general_type): set the + active item based on the current group. + 2004-12-01 Sivaiah Nallagatla <snallagatla@novell.com> * gui/contact-editor/e-contact-editor.c (save_contact) : diff --git a/addressbook/gui/component/addressbook-config.c b/addressbook/gui/component/addressbook-config.c index ddf44281fb..54fe37d314 100644 --- a/addressbook/gui/component/addressbook-config.c +++ b/addressbook/gui/component/addressbook-config.c @@ -500,6 +500,7 @@ eabc_general_type(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, str GtkTreeIter iter; GSList *l; GtkWidget *w, *label; + int i, row; if (old) return old; @@ -511,18 +512,22 @@ eabc_general_type(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, str dropdown = (GtkComboBox *)gtk_combo_box_new(); cell = gtk_cell_renderer_text_new(); store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_POINTER); + i = 0; for (l=sdialog->menu_source_groups;l;l=g_slist_next(l)) { ESourceGroup *group = l->data; gtk_list_store_append(store, &iter); - gtk_list_store_set(store, &iter, 0, e_source_group_peek_name(group), 1, group, -1); + gtk_list_store_set(store, &iter, 0, e_source_group_peek_name(group), 1, group, -1); + if (e_source_peek_group(sdialog->source) == group) + row = i; + i++; } gtk_cell_layout_pack_start((GtkCellLayout *)dropdown, cell, TRUE); gtk_cell_layout_set_attributes((GtkCellLayout *)dropdown, cell, "text", 0, NULL); gtk_combo_box_set_model(dropdown, (GtkTreeModel *)store); gtk_combo_box_set_active(dropdown, -1); - gtk_combo_box_set_active(dropdown, 0); + gtk_combo_box_set_active(dropdown, row); g_signal_connect(dropdown, "changed", G_CALLBACK(eabc_type_changed), sdialog); gtk_widget_show((GtkWidget *)dropdown); gtk_box_pack_start((GtkBox *)w, (GtkWidget *)dropdown, TRUE, TRUE, 0); |