diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-01-14 12:22:29 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-01-25 23:37:10 +0800 |
commit | adc0e71ea6d243e815a7fed8fdd37b69bbf352db (patch) | |
tree | 85a2233ee3ad7cd64a5ec1d4e5e51ee9d62fa4f6 /addressbook/gui | |
parent | ee8232d7ee82e39d0dee27c39622b927ab86da0e (diff) | |
download | gsoc2013-evolution-adc0e71ea6d243e815a7fed8fdd37b69bbf352db.tar.gz gsoc2013-evolution-adc0e71ea6d243e815a7fed8fdd37b69bbf352db.tar.zst gsoc2013-evolution-adc0e71ea6d243e815a7fed8fdd37b69bbf352db.zip |
Adapt to GtkComboBox class reorg.
Diffstat (limited to 'addressbook/gui')
4 files changed, 30 insertions, 14 deletions
diff --git a/addressbook/gui/contact-editor/contact-editor.ui b/addressbook/gui/contact-editor/contact-editor.ui index 668fa63ab6..428b17a600 100644 --- a/addressbook/gui/contact-editor/contact-editor.ui +++ b/addressbook/gui/contact-editor/contact-editor.ui @@ -255,8 +255,10 @@ </packing> </child> <child> - <object class="GtkComboBoxEntry" id="combo-file-as"> + <object class="GtkComboBox" id="combo-file-as"> <property name="visible">True</property> + <property name="has-entry">True</property> + <property name="entry-text-column">0</property> <property name="model">model1</property> </object> <packing> diff --git a/addressbook/gui/contact-editor/e-contact-editor-fullname.c b/addressbook/gui/contact-editor/e-contact-editor-fullname.c index ce9092c411..15eddbd53f 100644 --- a/addressbook/gui/contact-editor/e-contact-editor-fullname.c +++ b/addressbook/gui/contact-editor/e-contact-editor-fullname.c @@ -227,11 +227,6 @@ e_contact_editor_fullname_init (EContactEditorFullname *e_contact_editor_fullnam gtk_window_set_icon_name ( GTK_WINDOW (e_contact_editor_fullname), "contact-new"); - - widget = e_builder_get_widget (builder, "comboentry-title"); - gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX_ENTRY (widget), 0); - widget = e_builder_get_widget (builder, "comboentry-suffix"); - gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX_ENTRY (widget), 0); } GtkWidget* diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index 44a272f3a3..2ef0fd0ee9 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -537,8 +537,13 @@ file_as_set_style (EContactEditor *editor, gint style) company = gtk_entry_get_text (GTK_ENTRY (company_w)); if (style == -1) { - string = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (combo_file_as)); - strings = g_list_append (strings, string); + GtkWidget *entry; + + entry = gtk_bin_get_child (GTK_BIN (combo_file_as)); + if (entry) { + string = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry))); + strings = g_list_append (strings, string); + } } for (i = 0; i < 6; i++) { @@ -554,11 +559,16 @@ file_as_set_style (EContactEditor *editor, gint style) if (combo_file_as) { GList *l; + GtkListStore *list_store; + GtkTreeIter iter; - gtk_list_store_clear (GTK_LIST_STORE (gtk_combo_box_get_model (combo_file_as))); + list_store = GTK_LIST_STORE (gtk_combo_box_get_model (combo_file_as)); + + gtk_list_store_clear (list_store); for (l = strings; l; l = l->next) { - gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_file_as), l->data); + gtk_list_store_append (list_store, &iter); + gtk_list_store_set (list_store, &iter, 0, l->data, -1); } } @@ -592,7 +602,12 @@ name_entry_changed (GtkWidget *widget, EContactEditor *editor) static void file_as_combo_changed (GtkWidget *widget, EContactEditor *editor) { - gchar *string = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (widget)); + GtkWidget *entry; + gchar *string = NULL; + + entry = gtk_bin_get_child (GTK_BIN (widget)); + if (entry) + string = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry))); if (string && *string) { gchar *title; @@ -2550,7 +2565,7 @@ init_simple (EContactEditor *editor) widget = e_builder_get_widget (editor->builder, "entry-fullname"); g_signal_connect (widget, "changed", G_CALLBACK (name_entry_changed), editor); widget = e_builder_get_widget (editor->builder, "combo-file-as"); - gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX_ENTRY (widget), 0); + gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX (widget), 0); g_signal_connect (widget, "changed", G_CALLBACK (file_as_combo_changed), editor); widget = e_builder_get_widget (editor->builder, "entry-company"); g_signal_connect (widget, "changed", G_CALLBACK (company_entry_changed), editor); diff --git a/addressbook/gui/contact-editor/fullname.ui b/addressbook/gui/contact-editor/fullname.ui index 47cfde5d2e..227bec9d31 100644 --- a/addressbook/gui/contact-editor/fullname.ui +++ b/addressbook/gui/contact-editor/fullname.ui @@ -312,8 +312,10 @@ </packing> </child> <child> - <object class="GtkComboBoxEntry" id="comboentry-title"> + <object class="GtkComboBox" id="comboentry-title"> <property name="visible">True</property> + <property name="has-entry">True</property> + <property name="entry-text-column">0</property> <property name="add_tearoffs">False</property> <property name="has_frame">True</property> <property name="focus_on_click">True</property> @@ -329,8 +331,10 @@ </packing> </child> <child> - <object class="GtkComboBoxEntry" id="comboentry-suffix"> + <object class="GtkComboBox" id="comboentry-suffix"> <property name="visible">True</property> + <property name="has-entry">True</property> + <property name="entry-text-column">0</property> <property name="add_tearoffs">False</property> <property name="has_frame">True</property> <property name="focus_on_click">True</property> |