[Pkg-bazaar-commits] ./bzr-gtk/unstable r302: Merged Gary's fix of the buttons in the viz.

Daniel Schierbeck daniel.schierbeck at gmail.com
Fri Apr 10 07:49:53 UTC 2009


------------------------------------------------------------
revno: 302
committer: Daniel Schierbeck <daniel.schierbeck at gmail.com>
branch nick: revhistoryview
timestamp: Sat 2007-10-20 22:47:44 +0200
message:
  Merged Gary's fix of the buttons in the viz.
modified:
  viz/branchwin.py
    ------------------------------------------------------------
    revno: 298.1.1
    committer: Gary van der Merwe <garyvdm at gmail.com>
    branch nick: gtk
    timestamp: Sat 2007-10-20 18:16:03 +0200
    message:
      [Bug 154926] forward/back buttons in viz are broken
    modified:
      viz/branchwin.py
    ------------------------------------------------------------
    revno: 298.1.2
    committer: Gary van der Merwe <garyvdm at gmail.com>
    branch nick: gtk
    timestamp: Sat 2007-10-20 21:51:03 +0200
    message:
      Use set_cursor to select the tip, so that the back button works at start up.
    modified:
      viz/branchwin.py
-------------- next part --------------
=== modified file 'viz/branchwin.py'
--- a/viz/branchwin.py	2007-10-17 11:56:50 +0000
+++ b/viz/branchwin.py	2007-10-20 20:47:44 +0000
@@ -214,7 +214,7 @@
         self.graph_column.set_max_width(width)
         self.index = index
         self.treeview.set_model(self.model)
-        self.treeview.get_selection().select_path(0)
+        self.treeview.set_cursor(0)
         self.loading_msg_box.hide()
         return False
     
@@ -256,15 +256,16 @@
     def _back_clicked_cb(self, *args):
         """Callback for when the back button is clicked."""
         (path, col) = self.treeview.get_cursor()
-        revision = self.model[path][0]
-        parents = self.model[path][4]
+        revision = self.model[path][treemodel.REVISION]
+        parents = self.model[path][treemodel.PARENTS]
         if not len(parents):
             return
 
         for parent_id in parents:
-            parent = self.revisions[self.index[parent_id]]
+            parent_index = self.index[parent_id]
+            parent = self.model[parent_index][treemodel.REVISION]
             if same_branch(revision, parent):
-                self.treeview.set_cursor(self.index[parent_id])
+                self.treeview.set_cursor(parent_index)
                 break
         else:
             self.treeview.set_cursor(self.index[parents[0]])
@@ -273,15 +274,16 @@
     def _fwd_clicked_cb(self, *args):
         """Callback for when the forward button is clicked."""
         (path, col) = self.treeview.get_cursor()
-        revision = self.model[path][0]
-        children = self.model[path][5]
+        revision = self.model[path][treemodel.REVISION]
+        children = self.model[path][treemodel.CHILDREN]
         if not len(children):
             return
 
         for child_id in children:
-            child = self.revisions[self.index[child_id]]
+            child_index = self.index[child_id]
+            child = self.model[child_index][treemodel.REVISION]
             if same_branch(child, revision):
-                self.treeview.set_cursor(self.index[child_id])
+                self.treeview.set_cursor(child_index)
                 break
         else:
             self.treeview.set_cursor(self.index[children[0]])



More information about the Pkg-bazaar-commits mailing list