[evolution] Bug #665399 - Cannot change File Under to custom value



commit 87c027f51847aa95515cff780a11839923dd0716
Author: Milan Crha <mcrha redhat com>
Date:   Fri Mar 16 18:50:32 2012 +0100

    Bug #665399 - Cannot change File Under to custom value

 addressbook/gui/contact-editor/e-contact-editor.c |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)
---
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c
index 0022c4b..7676d62 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 (



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]