diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-10-21 04:10:15 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-10-21 04:10:15 +0800 |
commit | 4a08257b83512cc32b73d732ccc53266a22b917c (patch) | |
tree | f4bd68280af53cc696626055fb792795bc7628cc | |
parent | 8da37ea812d5b784dade3dc0f05df54fdc60fc7a (diff) | |
download | gsoc2013-evolution-4a08257b83512cc32b73d732ccc53266a22b917c.tar gsoc2013-evolution-4a08257b83512cc32b73d732ccc53266a22b917c.tar.gz gsoc2013-evolution-4a08257b83512cc32b73d732ccc53266a22b917c.tar.bz2 gsoc2013-evolution-4a08257b83512cc32b73d732ccc53266a22b917c.tar.lz gsoc2013-evolution-4a08257b83512cc32b73d732ccc53266a22b917c.tar.xz gsoc2013-evolution-4a08257b83512cc32b73d732ccc53266a22b917c.tar.zst gsoc2013-evolution-4a08257b83512cc32b73d732ccc53266a22b917c.zip |
Deal with GtkComboBoxEntry removal in gtk+-3.0.
-rw-r--r-- | addressbook/gui/contact-editor/e-contact-editor-fullname.c | 13 | ||||
-rw-r--r-- | addressbook/gui/contact-editor/e-contact-editor.c | 10 | ||||
-rw-r--r-- | calendar/gui/dialogs/event-page.c | 2 | ||||
-rw-r--r-- | calendar/gui/dialogs/memo-page.c | 2 | ||||
-rw-r--r-- | calendar/gui/dialogs/task-page.c | 2 | ||||
-rw-r--r-- | e-util/e-datetime-format.c | 24 | ||||
-rw-r--r-- | e-util/gtk-compat.h | 7 | ||||
-rw-r--r-- | mail/e-mail-tag-editor.c | 2 | ||||
-rw-r--r-- | modules/addressbook/addressbook-config.c | 5 | ||||
-rw-r--r-- | widgets/misc/e-dateedit.c | 9 |
10 files changed, 56 insertions, 20 deletions
diff --git a/addressbook/gui/contact-editor/e-contact-editor-fullname.c b/addressbook/gui/contact-editor/e-contact-editor-fullname.c index ea0bb6b206..c26b6e5e96 100644 --- a/addressbook/gui/contact-editor/e-contact-editor-fullname.c +++ b/addressbook/gui/contact-editor/e-contact-editor-fullname.c @@ -28,6 +28,9 @@ #include "e-contact-editor-fullname.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + static void fill_in_info (EContactEditorFullname *editor); static void extract_info (EContactEditorFullname *editor); @@ -89,7 +92,7 @@ e_contact_editor_fullname_set_property (GObject *object, gtk_editable_set_editable (GTK_EDITABLE (w), e_contact_editor_fullname->editable); } - else if (GTK_IS_COMBO_BOX_ENTRY (w)) { + else if (GTK_IS_COMBO_BOX (w)) { gtk_editable_set_editable (GTK_EDITABLE (gtk_bin_get_child (GTK_BIN (w))), e_contact_editor_fullname->editable); gtk_widget_set_sensitive (w, e_contact_editor_fullname->editable); @@ -232,9 +235,9 @@ e_contact_editor_fullname_init (EContactEditorFullname *e_contact_editor_fullnam GTK_WINDOW (e_contact_editor_fullname), "contact-new"); widget = e_builder_get_widget (builder, "comboentry-title"); - gtk_combo_box_entry_set_text_column (GTK_COMBO_BOX_ENTRY (widget), 0); + gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX_ENTRY (widget), 0); widget = e_builder_get_widget (builder, "comboentry-suffix"); - gtk_combo_box_entry_set_text_column (GTK_COMBO_BOX_ENTRY (widget), 0); + gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX_ENTRY (widget), 0); } GtkWidget* @@ -258,7 +261,7 @@ fill_in_field (EContactEditorFullname *editor, if (GTK_IS_ENTRY (widget)) entry = GTK_ENTRY (widget); - else if (GTK_IS_COMBO_BOX_ENTRY (widget)) + else if (GTK_IS_COMBO_BOX (widget)) entry = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (widget))); if (entry) { @@ -291,7 +294,7 @@ extract_field (EContactEditorFullname *editor, if (GTK_IS_ENTRY (widget)) entry = GTK_ENTRY (widget); - else if (GTK_IS_COMBO_BOX_ENTRY (widget)) + else if (GTK_IS_COMBO_BOX (widget)) entry = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (widget))); if (entry) diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index c597246700..e67305bb80 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -534,7 +534,7 @@ file_as_set_style (EContactEditor *editor, gint style) GtkEntry *company_w = GTK_ENTRY (e_builder_get_widget (editor->builder, "entry-company")); const gchar *company; - if (!(combo_file_as && GTK_IS_COMBO_BOX_ENTRY (combo_file_as))) + if (!(combo_file_as && GTK_IS_COMBO_BOX (combo_file_as))) return; company = gtk_entry_get_text (GTK_ENTRY (company_w)); @@ -2259,7 +2259,7 @@ init_simple_field (EContactEditor *editor, GtkWidget *widget) changed_object = G_OBJECT (widget); g_signal_connect_swapped (widget, "activate", G_CALLBACK (entry_activated), editor); } - else if (GTK_IS_COMBO_BOX_ENTRY (widget)) { + else if (GTK_IS_COMBO_BOX (widget)) { changed_object = G_OBJECT (/*gtk_bin_get_child (GTK_BIN*/ (widget)/*)*/); g_signal_connect_swapped (gtk_bin_get_child (GTK_BIN (widget)), "activate", G_CALLBACK (entry_activated), editor); } @@ -2301,7 +2301,7 @@ fill_in_simple_field (EContactEditor *editor, GtkWidget *widget, gint field_id) gtk_entry_set_text (GTK_ENTRY (widget), STRING_MAKE_NON_NULL (text)); g_free (text); } - else if (GTK_IS_COMBO_BOX_ENTRY (widget)) { + else if (GTK_IS_COMBO_BOX (widget)) { gchar *text = e_contact_get (contact, field_id); gtk_entry_set_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (widget))), STRING_MAKE_NON_NULL (text)); g_free (text); @@ -2371,7 +2371,7 @@ extract_simple_field (EContactEditor *editor, GtkWidget *widget, gint field_id) const gchar *text = gtk_entry_get_text (GTK_ENTRY (widget)); e_contact_set (contact, field_id, (gchar *) text); } - else if (GTK_IS_COMBO_BOX_ENTRY (widget)) { + else if (GTK_IS_COMBO_BOX (widget)) { gchar *text = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (widget)); e_contact_set (contact, field_id, text); @@ -2531,7 +2531,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_entry_set_text_column (GTK_COMBO_BOX_ENTRY (widget), 0); + gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX_ENTRY (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/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c index 753b9ca75f..94b25a0510 100644 --- a/calendar/gui/dialogs/event-page.c +++ b/calendar/gui/dialogs/event-page.c @@ -2244,7 +2244,7 @@ get_widgets (EventPage *epage) priv->organizer = GW ("organizer"); gtk_list_store_clear (GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (priv->organizer)))); - gtk_combo_box_entry_set_text_column (GTK_COMBO_BOX_ENTRY (priv->organizer), 0); + gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX_ENTRY (priv->organizer), 0); priv->summary = GW ("summary"); priv->summary_label = GW ("summary-label"); diff --git a/calendar/gui/dialogs/memo-page.c b/calendar/gui/dialogs/memo-page.c index 454060c7ea..dc0e9aeb1b 100644 --- a/calendar/gui/dialogs/memo-page.c +++ b/calendar/gui/dialogs/memo-page.c @@ -829,7 +829,7 @@ get_widgets (MemoPage *mpage) priv->org_label = GW ("org-label"); priv->org_combo = GW ("org-combo"); gtk_list_store_clear (GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (priv->org_combo)))); - gtk_combo_box_entry_set_text_column (GTK_COMBO_BOX_ENTRY (priv->org_combo), 0); + gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX_ENTRY (priv->org_combo), 0); priv->to_button = GW ("to-button"); priv->to_hbox = GW ("to-hbox"); diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c index 22cab43ff1..68fa61c36e 100644 --- a/calendar/gui/dialogs/task-page.c +++ b/calendar/gui/dialogs/task-page.c @@ -1420,7 +1420,7 @@ get_widgets (TaskPage *tpage) priv->organizer = e_builder_get_widget (priv->builder, "organizer"); gtk_list_store_clear (GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (priv->organizer)))); - gtk_combo_box_entry_set_text_column (GTK_COMBO_BOX_ENTRY (priv->organizer), 0); + gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX_ENTRY (priv->organizer), 0); priv->invite = e_builder_get_widget (priv->builder, "invite"); priv->add = e_builder_get_widget (priv->builder, "add-attendee"); diff --git a/e-util/e-datetime-format.c b/e-util/e-datetime-format.c index 05630d2ec7..fa0d0f23f6 100644 --- a/e-util/e-datetime-format.c +++ b/e-util/e-datetime-format.c @@ -338,7 +338,7 @@ fill_combo_formats (GtkWidget *combo, const gchar *key, DTFormatKind kind) gint i, idx = 0; const gchar *fmt; - g_return_if_fail (GTK_IS_COMBO_BOX_ENTRY (combo)); + g_return_if_fail (GTK_IS_COMBO_BOX (combo)); switch (kind) { case DTFormatKindDate: @@ -388,8 +388,7 @@ update_preview_widget (GtkWidget *combo) gchar *value; time_t now; - g_return_if_fail (combo != NULL); - g_return_if_fail (GTK_IS_COMBO_BOX_ENTRY (combo)); + g_return_if_fail (GTK_IS_COMBO_BOX (combo)); preview = g_object_get_data (G_OBJECT (combo), "preview-label"); g_return_if_fail (preview != NULL); @@ -412,8 +411,7 @@ format_combo_changed_cb (GtkWidget *combo, gpointer user_data) DTFormatKind kind; GKeyFile *keyfile; - g_return_if_fail (combo != NULL); - g_return_if_fail (GTK_IS_COMBO_BOX_ENTRY (combo)); + g_return_if_fail (GTK_IS_COMBO_BOX (combo)); key = g_object_get_data (G_OBJECT (combo), "format-key"); g_return_if_fail (key != NULL); @@ -509,7 +507,23 @@ e_datetime_format_add_setup_widget (GtkWidget *table, gint row, const gchar *com key = gen_key (component, part, kind); label = gtk_label_new_with_mnemonic (caption ? caption : _("Format:")); +#if GTK_CHECK_VERSION(2,23,0) + /* FIXME Rewrite this when removing the version check. */ + { + GtkListStore *store; + + store = gtk_list_store_new (1, G_TYPE_STRING); + combo = g_object_new ( + GTK_TYPE_COMBO_BOX, + "model", store, + "has-entry", TRUE, + "entry-text-column", 0, + NULL); + g_object_unref (store); + } +#else combo = gtk_combo_box_entry_new_text (); +#endif fill_combo_formats (combo, key, kind); gtk_label_set_mnemonic_widget ((GtkLabel *)label, combo); diff --git a/e-util/gtk-compat.h b/e-util/gtk-compat.h index cc27e0e7ec..3b9c7ef2e9 100644 --- a/e-util/gtk-compat.h +++ b/e-util/gtk-compat.h @@ -14,6 +14,13 @@ #define GtkComboBoxText GtkComboBox #endif +#if GTK_CHECK_VERSION (2,23,0) +#define GTK_COMBO_BOX_ENTRY GTK_COMBO_BOX +#else +#define gtk_combo_box_set_entry_text_column \ + gtk_combo_box_entry_set_text_column +#endif + #if GTK_CHECK_VERSION (2,90,5) /* Recreate GdkRegion until we drop GTK2 compatibility. */ diff --git a/mail/e-mail-tag-editor.c b/mail/e-mail-tag-editor.c index c55ed05f7b..659d00aa6e 100644 --- a/mail/e-mail-tag-editor.c +++ b/mail/e-mail-tag-editor.c @@ -335,7 +335,7 @@ mail_tag_editor_init (EMailTagEditor *editor) renderer, "text", 1, NULL); widget = e_builder_get_widget (builder, "combo"); - gtk_combo_box_entry_set_text_column (GTK_COMBO_BOX_ENTRY (widget), 0); + gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX_ENTRY (widget), 0); editor->priv->combo_entry = GTK_COMBO_BOX (widget); gtk_combo_box_set_active (GTK_COMBO_BOX (widget), DEFAULT_FLAG); diff --git a/modules/addressbook/addressbook-config.c b/modules/addressbook/addressbook-config.c index b6a80519d5..3066da022d 100644 --- a/modules/addressbook/addressbook-config.c +++ b/modules/addressbook/addressbook-config.c @@ -50,6 +50,9 @@ #include "addressbook/gui/widgets/eab-config.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define d(x) #ifdef HAVE_LDAP @@ -748,7 +751,7 @@ eabc_general_host (EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget g_signal_connect (sdialog->host, "changed", G_CALLBACK (host_changed_cb), sdialog); sdialog->port_comboentry = e_builder_get_widget (builder, "port-comboentry"); - gtk_combo_box_entry_set_text_column (GTK_COMBO_BOX_ENTRY (sdialog->port_comboentry), 0); + gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX_ENTRY (sdialog->port_comboentry), 0); gtk_widget_set_has_tooltip (sdialog->port_comboentry, TRUE); gtk_widget_set_tooltip_text (sdialog->port_comboentry, _("This is the port on the LDAP server that Evolution will try to connect to. A list of standard ports has been provided. Ask your system administrator what port you should specify.")); sprintf(port, "%u", lud && lud->lud_port? lud->lud_port : LDAP_PORT); diff --git a/widgets/misc/e-dateedit.c b/widgets/misc/e-dateedit.c index 01b70e4afc..da3c9dbad5 100644 --- a/widgets/misc/e-dateedit.c +++ b/widgets/misc/e-dateedit.c @@ -571,8 +571,17 @@ create_children (EDateEdit *dedit) "widget \"*.e-dateedit-timecombo\" style \"e-dateedit-timecombo-style\""); time_store = gtk_list_store_new (1, G_TYPE_STRING); +#if GTK_CHECK_VERSION(2,23,0) + priv->time_combo = g_object_new ( + GTK_TYPE_COMBO_BOX, + "model", time_store, + "has-entry", TRUE, + "entry-text-column", 0, + NULL); +#else priv->time_combo = gtk_combo_box_entry_new_with_model ( GTK_TREE_MODEL (time_store), 0); +#endif g_object_unref (time_store); child = gtk_bin_get_child (GTK_BIN (priv->time_combo)); |