diff options
author | Matthias Clasen <mclasen@redhat.com> | 2010-10-21 03:06:38 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-10-21 03:08:16 +0800 |
commit | 8da37ea812d5b784dade3dc0f05df54fdc60fc7a (patch) | |
tree | 04bf6d75a584f2f8af8c4b061e38bf8220a0bf15 /e-util | |
parent | 4142c97c7b59de8d859a217d7b76667b339e33c0 (diff) | |
download | gsoc2013-evolution-8da37ea812d5b784dade3dc0f05df54fdc60fc7a.tar gsoc2013-evolution-8da37ea812d5b784dade3dc0f05df54fdc60fc7a.tar.gz gsoc2013-evolution-8da37ea812d5b784dade3dc0f05df54fdc60fc7a.tar.bz2 gsoc2013-evolution-8da37ea812d5b784dade3dc0f05df54fdc60fc7a.tar.lz gsoc2013-evolution-8da37ea812d5b784dade3dc0f05df54fdc60fc7a.tar.xz gsoc2013-evolution-8da37ea812d5b784dade3dc0f05df54fdc60fc7a.tar.zst gsoc2013-evolution-8da37ea812d5b784dade3dc0f05df54fdc60fc7a.zip |
Bug 632641 - Handle combo box text API going away
Diffstat (limited to 'e-util')
-rw-r--r-- | e-util/e-datetime-format.c | 15 | ||||
-rw-r--r-- | e-util/e-plugin-util.c | 13 | ||||
-rw-r--r-- | e-util/gtk-compat.h | 9 |
3 files changed, 28 insertions, 9 deletions
diff --git a/e-util/e-datetime-format.c b/e-util/e-datetime-format.c index 11e7fb2707..05630d2ec7 100644 --- a/e-util/e-datetime-format.c +++ b/e-util/e-datetime-format.c @@ -25,6 +25,9 @@ #include "e-datetime-format.h" #include "e-util.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define KEYS_FILENAME "datetime-formats.ini" #define KEYS_GROUPNAME "formats" @@ -358,16 +361,19 @@ fill_combo_formats (GtkWidget *combo, const gchar *key, DTFormatKind kind) for (i = 0; items[i]; i++) { if (i == 0) { - gtk_combo_box_append_text ((GtkComboBox *) combo, _(items[i])); + gtk_combo_box_text_append_text ( + GTK_COMBO_BOX_TEXT (combo), _(items[i])); } else { - gtk_combo_box_append_text ((GtkComboBox *) combo, items[i]); + gtk_combo_box_text_append_text ( + GTK_COMBO_BOX_TEXT (combo), items[i]); if (!idx && fmt && g_str_equal (fmt, items[i])) idx = i; } } if (idx == 0 && fmt && !g_str_equal (fmt, get_default_format (kind, key))) { - gtk_combo_box_append_text ((GtkComboBox *) combo, fmt); + gtk_combo_box_text_append_text ( + GTK_COMBO_BOX_TEXT (combo), fmt); idx = i; } @@ -421,7 +427,8 @@ format_combo_changed_cb (GtkWidget *combo, gpointer user_data) } else { gchar *text; - text = gtk_combo_box_get_active_text (GTK_COMBO_BOX (combo)); + text = gtk_combo_box_text_get_active_text ( + GTK_COMBO_BOX_TEXT (combo)); set_format_internal (key, text, keyfile); g_free (text); } diff --git a/e-util/e-plugin-util.c b/e-util/e-plugin-util.c index c49ec3691a..8ff3b28778 100644 --- a/e-util/e-plugin-util.c +++ b/e-util/e-plugin-util.c @@ -25,6 +25,9 @@ #include "e-plugin-util.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + /* name of a property on a widget with corresponding property name for an ESource */ #define EPU_SP_NAME "e-source-property-name" @@ -418,12 +421,12 @@ e_plugin_util_add_refresh (GtkWidget *parent, const gchar *label, ESource *sourc gtk_widget_show (spin); gtk_box_pack_start (GTK_BOX (hbox), spin, FALSE, TRUE, 0); - combo = gtk_combo_box_new_text (); + combo = gtk_combo_box_text_new (); gtk_widget_show (combo); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _("minutes")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _("hours")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _("days")); - gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _("weeks")); + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("minutes")); + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("hours")); + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("days")); + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("weeks")); gtk_box_pack_start (GTK_BOX (hbox), combo, FALSE, TRUE, 0); value_num = value ? atoi (value) : 30; diff --git a/e-util/gtk-compat.h b/e-util/gtk-compat.h index 786cc04721..cc27e0e7ec 100644 --- a/e-util/gtk-compat.h +++ b/e-util/gtk-compat.h @@ -5,6 +5,15 @@ /* Provide a GTK+ compatibility layer. */ +#if !GTK_CHECK_VERSION (2,23,0) +#define gtk_combo_box_text_new gtk_combo_box_new_text +#define gtk_combo_box_text_append_text gtk_combo_box_append_text +#define gtk_combo_box_text_prepend_text gtk_combo_box_prepend_text +#define gtk_combo_box_text_get_active_text gtk_combo_box_get_active_text +#define GTK_COMBO_BOX_TEXT GTK_COMBO_BOX +#define GtkComboBoxText GtkComboBox +#endif + #if GTK_CHECK_VERSION (2,90,5) /* Recreate GdkRegion until we drop GTK2 compatibility. */ |