plug-ins: add some GTK_CHECK_VERSION(2,24,0) and use the new GtkComboBoxText

This commit is contained in:
Michael Natterer 2011-03-17 14:31:39 +01:00
parent 41b1bd36da
commit bdf8d3d776
4 changed files with 45 additions and 1 deletions

View File

@ -649,7 +649,11 @@ build_dialog (GimpImageBaseType basetype,
gtk_box_pack_end (GTK_BOX (hbox), progress, TRUE, TRUE, 0);
gtk_widget_show (progress);
#if GTK_CHECK_VERSION (2, 24, 0)
speedcombo = gtk_combo_box_text_new ();
#else
speedcombo = gtk_combo_box_new_text ();
#endif
gtk_box_pack_end (GTK_BOX (hbox), speedcombo, FALSE, FALSE, 0);
gtk_widget_show (speedcombo);
@ -659,7 +663,11 @@ build_dialog (GimpImageBaseType basetype,
/* list is given in "fps" - frames per second */
text = g_strdup_printf (_("%d fps"), get_fps (index));
#if GTK_CHECK_VERSION (2, 24, 0)
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (speedcombo), text);
#else
gtk_combo_box_append_text (GTK_COMBO_BOX (speedcombo), text);
#endif
g_free (text);
}
@ -671,7 +679,11 @@ build_dialog (GimpImageBaseType basetype,
gimp_help_set_help_data (speedcombo, _("Default framerate"), NULL);
#if GTK_CHECK_VERSION (2, 24, 0)
speedcombo = gtk_combo_box_text_new ();
#else
speedcombo = gtk_combo_box_new_text ();
#endif
gtk_box_pack_end (GTK_BOX (hbox), speedcombo, FALSE, FALSE, 0);
gtk_widget_show (speedcombo);
@ -680,7 +692,11 @@ build_dialog (GimpImageBaseType basetype,
gchar *text;
text = g_strdup_printf ("%g\303\227", (100 / get_duration_factor (index)) / 100);
#if GTK_CHECK_VERSION (2, 24, 0)
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (speedcombo), text);
#else
gtk_combo_box_append_text (GTK_COMBO_BOX (speedcombo), text);
#endif
g_free (text);
}

View File

@ -1060,10 +1060,19 @@ gih_save_dialog (gint32 image_ID)
cellw_adjust.rank0 = cellh_adjust.rank0 = NULL;
}
#if GTK_CHECK_VERSION (2, 24, 0)
cb = gtk_combo_box_text_new ();
#else
cb = gtk_combo_box_new_text ();
#endif
for (j = 0; j < G_N_ELEMENTS (selection_modes); j++)
#if GTK_CHECK_VERSION (2, 24, 0)
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (cb),
selection_modes[j]);
#else
gtk_combo_box_append_text (GTK_COMBO_BOX (cb), selection_modes[j]);
#endif
gtk_combo_box_set_active (GTK_COMBO_BOX (cb), 2); /* random */

View File

@ -3196,11 +3196,21 @@ load_dialog (const gchar *filename,
gimp_help_set_help_data (GTK_WIDGET (entry),
_("Pages to load (e.g.: 1-4 or 1,3,5-7)"), NULL);
#if GTK_CHECK_VERSION (2, 24, 0)
target = gtk_combo_box_text_new ();
gtk_combo_box_text_insert_text (GTK_COMBO_BOX_TEXT (target),
GIMP_PAGE_SELECTOR_TARGET_LAYERS,
_("Layers"));
gtk_combo_box_text_insert_text (GTK_COMBO_BOX_TEXT (target),
GIMP_PAGE_SELECTOR_TARGET_IMAGES,
_("Images"));
#else
target = gtk_combo_box_new_text ();
gtk_combo_box_insert_text (GTK_COMBO_BOX (target),
GIMP_PAGE_SELECTOR_TARGET_LAYERS, _("Layers"));
gtk_combo_box_insert_text (GTK_COMBO_BOX (target),
GIMP_PAGE_SELECTOR_TARGET_IMAGES, _("Images"));
#endif
gtk_combo_box_set_active (GTK_COMBO_BOX (target), (int) ps_pagemode);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 4,
_("Open as"), 0.0, 0.5,

View File

@ -503,13 +503,22 @@ script_fu_interface (SFScript *script,
break;
case SF_OPTION:
#if GTK_CHECK_VERSION (2, 24, 0)
widget = gtk_combo_box_text_new ();
#else
widget = gtk_combo_box_new_text ();
#endif
for (list = arg->default_value.sfa_option.list;
list;
list = g_slist_next (list))
{
#if GTK_CHECK_VERSION (2, 24, 0)
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget),
gettext (list->data));
#else
gtk_combo_box_append_text (GTK_COMBO_BOX (widget),
gettext ((const gchar *) list->data));
gettext (list->data));
#endif
}
gtk_combo_box_set_active (GTK_COMBO_BOX (widget),