[meld] vcview: Move most of combobox creation into glade



commit 964eb51386a8d10beec07ece758e90ec01c32210
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sun Aug 18 14:20:14 2013 +1000

    vcview: Move most of combobox creation into glade

 data/ui/vcview.ui |   24 ++++++++++++++++++++++++
 meld/vcview.py    |   10 ++--------
 2 files changed, 26 insertions(+), 8 deletions(-)
---
diff --git a/data/ui/vcview.ui b/data/ui/vcview.ui
index ac99430..d1408f1 100644
--- a/data/ui/vcview.ui
+++ b/data/ui/vcview.ui
@@ -37,6 +37,20 @@
                 <property name="padding">0</property>
                 <property name="expand">True</property>
                 <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkComboBox" id="combobox_vcs">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="model">liststore_vcs</property>
+                <signal name="changed" handler="on_vc_change" swapped="no"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
               </packing>
             </child>
           </object>
@@ -224,6 +238,16 @@
       </object>
     </child>
   </object>
+  <object class="GtkListStore" id="liststore_vcs">
+    <columns>
+      <!-- column-name gchararray1 -->
+      <column type="gchararray"/>
+      <!-- column-name gpointer1 -->
+      <column type="PyObject"/>
+      <!-- column-name gboolean1 -->
+      <column type="gboolean"/>
+    </columns>
+  </object>
   <object class="GtkDialog" id="commitdialog">
     <property name="default_width">450</property>
     <property name="visible">True</property>
diff --git a/meld/vcview.py b/meld/vcview.py
index 499c664..7186837 100644
--- a/meld/vcview.py
+++ b/meld/vcview.py
@@ -155,7 +155,7 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
     def __init__(self, prefs):
         melddoc.MeldDoc.__init__(self, prefs)
         gnomeglade.Component.__init__(self, paths.ui_dir("vcview.ui"),
-                                      "vcview")
+                                      "vcview", ['liststore_vcs'])
 
         actions = (
             ("VcCompare", gtk.STOCK_DIALOG_INFO, _("_Compare"), None,
@@ -279,18 +279,12 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
             self.on_console_view_toggle(self.console_hide_box)
         self.vc = None
         self.valid_vc_actions = tuple()
-        # VC ComboBox
-        self.combobox_vcs = gtk.ComboBox()
-        self.combobox_vcs.lock = True
-        self.combobox_vcs.set_model(gtk.ListStore(str, object, bool))
+
         cell = gtk.CellRendererText()
         self.combobox_vcs.pack_start(cell, False)
         self.combobox_vcs.add_attribute(cell, 'text', 0)
         self.combobox_vcs.add_attribute(cell, 'sensitive', 2)
         self.combobox_vcs.lock = False
-        self.hbox2.pack_end(self.combobox_vcs, expand=False)
-        self.combobox_vcs.show()
-        self.combobox_vcs.connect("changed", self.on_vc_change)
 
     def on_container_switch_in_event(self, ui):
         melddoc.MeldDoc.on_container_switch_in_event(self, ui)


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