From 87c027f51847aa95515cff780a11839923dd0716 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 16 Mar 2012 18:50:32 +0100 Subject: Bug #665399 - Cannot change File Under to custom value --- addressbook/gui/contact-editor/e-contact-editor.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'addressbook') diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index 0022c4bb39..7676d62f5e 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -2662,7 +2662,16 @@ extract_simple_field (EContactEditor *editor, e_contact_set (contact, field_id, (gchar *) text); } else if (GTK_IS_COMBO_BOX_TEXT (widget)) { - gchar *text = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (widget)); + gchar *text = NULL; + + if (gtk_combo_box_get_has_entry (GTK_COMBO_BOX (widget))) { + GtkWidget *entry = gtk_bin_get_child (GTK_BIN (widget)); + + text = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry))); + } + + if (!text) + text = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (widget)); e_contact_set (contact, field_id, text); @@ -2671,7 +2680,13 @@ extract_simple_field (EContactEditor *editor, GtkTreeIter iter; gchar *text = NULL; - if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (widget), &iter)) { + if (gtk_combo_box_get_has_entry (GTK_COMBO_BOX (widget))) { + GtkWidget *entry = gtk_bin_get_child (GTK_BIN (widget)); + + text = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry))); + } + + if (!text && gtk_combo_box_get_active_iter (GTK_COMBO_BOX (widget), &iter)) { GtkListStore *store; store = GTK_LIST_STORE ( -- cgit v1.2.3