[anjuta-extras] scratchbox, scintilla: Add an id column to GtkComboBox used in preferences widgets



commit ec8592f2cf5b6ff99928101d2ff29d593e5d33ef
Author: SÃbastien Granjoux <seb sfo free fr>
Date:   Fri Nov 11 14:58:14 2011 +0100

    scratchbox, scintilla: Add an id column to GtkComboBox used in preferences widgets
    
    This is needed to work with the new preference code in anjuta.

 plugins/scintilla/anjuta-editor-scintilla.ui |    7 +++++
 plugins/scratchbox/anjuta-scratchbox.ui      |   34 +++++--------------------
 plugins/scratchbox/plugin.c                  |    2 +-
 3 files changed, 15 insertions(+), 28 deletions(-)
---
diff --git a/plugins/scintilla/anjuta-editor-scintilla.ui b/plugins/scintilla/anjuta-editor-scintilla.ui
index 06e4d59..d42fba1 100644
--- a/plugins/scintilla/anjuta-editor-scintilla.ui
+++ b/plugins/scintilla/anjuta-editor-scintilla.ui
@@ -58,19 +58,25 @@
     <columns>
       <!-- column-name gchararray -->
       <column type="gchararray"/>
+      <!-- column-name id -->
+      <column type="gchararray"/>
     </columns>
     <data>
       <row>
         <col id="0" translatable="yes">Plus/Minus</col>
+        <col id="1">Plus/Minus</col>
       </row>
       <row>
         <col id="0" translatable="yes">Arrows</col>
+        <col id="1">Arrows</col>
       </row>
       <row>
         <col id="0" translatable="yes">Circular</col>
+        <col id="1">Circular</col>
       </row>
       <row>
         <col id="0" translatable="yes">Squares</col>
+        <col id="1">Squares</col>
       </row>
     </data>
   </object>
@@ -368,6 +374,7 @@
                                 <property name="can_focus">False</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                 <property name="model">model1</property>
+                                <property name="id_column">1</property>
                                 <child>
                                   <object class="GtkCellRendererText" id="renderer1"/>
                                   <attributes>
diff --git a/plugins/scratchbox/anjuta-scratchbox.ui b/plugins/scratchbox/anjuta-scratchbox.ui
index 760ca05..566cace 100644
--- a/plugins/scratchbox/anjuta-scratchbox.ui
+++ b/plugins/scratchbox/anjuta-scratchbox.ui
@@ -1,31 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <!-- interface-requires gtk+ 2.12 -->
-  <object class="GtkListStore" id="model1">
-    <columns>
-      <!-- column-name gchararray -->
-      <column type="gchararray"/>
-    </columns>
-    <data>
-      <row>
-        <col id="0" translatable="yes">Sbox1</col>
-      </row>
-      <row>
-        <col id="0" translatable="yes">Sbox2</col>
-      </row>
-    </data>
-  </object>
-  <object class="GtkListStore" id="model2">
-    <columns>
-      <!-- column-name gchararray -->
-      <column type="gchararray"/>
-    </columns>
-    <data>
-      <row>
-        <col id="0" translatable="yes">host</col>
-      </row>
-    </data>
-  </object>
   <object class="GtkWindow" id="preferences_dialog_scratchbox">
     <property name="can_focus">False</property>
     <property name="title" translatable="yes">window1</property>
@@ -142,9 +117,10 @@
                   <object class="GtkComboBoxText" id="preferences_combo:text:Sbox1,Sbox2:0:scratchbox-version">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
+                    <property name="id_column">0</property>
                     <items>
-                      <item translatable="yes">Sbox1</item>
-                      <item translatable="yes">Sbox2</item>
+                      <item>Sbox1</item>
+                      <item>Sbox2</item>
                     </items>
                   </object>
                   <packing>
@@ -160,6 +136,10 @@
                   <object class="GtkComboBoxText" id="preferences_combo:text:None:0:scratchbox-target">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
+                    <property name="id_column">0</property>
+                    <items>
+                      <item>None</item>
+                    </items>
                   </object>
                   <packing>
                     <property name="left_attach">1</property>
diff --git a/plugins/scratchbox/plugin.c b/plugins/scratchbox/plugin.c
index 74cb449..49181eb 100644
--- a/plugins/scratchbox/plugin.c
+++ b/plugins/scratchbox/plugin.c
@@ -133,7 +133,7 @@ static void on_list_terminated (AnjutaLauncher *launcher, gint child_pid,
 		plugin->combo_element = 1;
 
 		for (i = 0; i < str_splitted_length; i++) {
-			gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT(combo_target_entry), plugin->target_list[i]);
+			gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT(combo_target_entry), plugin->target_list[i], plugin->target_list[i]);
 			if (g_strcmp0 (plugin->target, plugin->target_list[i]) == 0) gtk_combo_box_set_active (GTK_COMBO_BOX(combo_target_entry), i);
 			plugin->combo_element++;
 		}



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