[gnome-terminal] Fix the gtk3 build for combo box text API changes



commit e6dc7a41a49ab4a3a95d9bfa6c7649b6c655a90a
Author: Christian Persch <chpe gnome org>
Date:   Thu Oct 28 22:33:28 2010 +0200

    Fix the gtk3 build for combo box text API changes
    
    Bug #633226.

 src/profile-editor.c          |   26 +++++++++++++++++++-------
 src/profile-preferences.glade |    1 -
 2 files changed, 19 insertions(+), 8 deletions(-)
---
diff --git a/src/profile-editor.c b/src/profile-editor.c
index 7c04717..4f88f3b 100644
--- a/src/profile-editor.c
+++ b/src/profile-editor.c
@@ -509,16 +509,28 @@ reset_compat_defaults_cb (GtkWidget       *button,
  */
 
 static void
-init_color_scheme_menu (GtkWidget *combo_box)
+init_color_scheme_menu (GtkWidget *widget)
 {
+  GtkCellRenderer *renderer;
+  GtkTreeIter iter;
+  GtkListStore *store;
   int i;
 
-  i = G_N_ELEMENTS (color_schemes);
-  while (i > 0)
-    {
-      gtk_combo_box_prepend_text (GTK_COMBO_BOX (combo_box),
-                                  _(color_schemes[--i].name));
-    }
+  store = gtk_list_store_new (1, G_TYPE_STRING);
+  for (i = 0; i < G_N_ELEMENTS (color_schemes); ++i)
+    gtk_list_store_insert_with_values (store, &iter, -1,
+                                       0, _(color_schemes[i].name),
+                                       -1);
+  gtk_list_store_insert_with_values (store, &iter, -1,
+                                      0, _("Custom"),
+                                      -1);
+
+  gtk_combo_box_set_model (GTK_COMBO_BOX (widget), GTK_TREE_MODEL (store));
+  g_object_unref (store);
+
+  renderer = gtk_cell_renderer_text_new ();
+  gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (widget), renderer, TRUE);
+  gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (widget), renderer, "text", 0, NULL);
 }
 
 static char*
diff --git a/src/profile-preferences.glade b/src/profile-preferences.glade
index 6a89056..5c2ecd8 100644
--- a/src/profile-preferences.glade
+++ b/src/profile-preferences.glade
@@ -1201,7 +1201,6 @@ Hold the terminal open</property>
 			      <child>
 				<widget class="GtkComboBox" id="color-scheme-combobox">
 				  <property name="visible">True</property>
-				  <property name="items" translatable="yes">Custom</property>
 				  <property name="add_tearoffs">False</property>
 				  <property name="focus_on_click">True</property>
 				</widget>



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