[Pkg-bazaar-commits] ./bzr-gtk/unstable r5: Reverse the meaning of the Back and Forward buttons so Back actually

Scott James Remnant scott at netsplit.com
Fri Apr 10 07:15:03 UTC 2009


------------------------------------------------------------
revno: 5
committer: Scott James Remnant <scott at netsplit.com>
timestamp: Mon 2005-10-17 05:51:22 +0100
message:
  Reverse the meaning of the Back and Forward buttons so Back actually
  goes BACK in time.
modified:
  branchwin.py
-------------- next part --------------
=== modified file 'branchwin.py'
--- a/branchwin.py	2005-10-17 04:39:30 +0000
+++ b/branchwin.py	2005-10-17 04:51:22 +0000
@@ -67,7 +67,6 @@
         scrollwin = gtk.ScrolledWindow()
         scrollwin.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
         scrollwin.set_shadow_type(gtk.SHADOW_IN)
-        #scrollwin.set_border_width(12)
         vbox.pack_start(scrollwin, expand=True, fill=True)
         scrollwin.show()
 
@@ -181,28 +180,13 @@
         (path, col) = self.treeview.get_cursor()
         revision = self.model[path][0]
 
-        self.back_button.set_sensitive(len(self.children[revision]) > 0)
-        self.fwd_button.set_sensitive(len(revision.parent_ids) > 0)
+        self.back_button.set_sensitive(len(revision.parent_ids) > 0)
+        self.fwd_button.set_sensitive(len(self.children[revision]) > 0)
 
     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]
-        if not len(self.children[revision]):
-            return
-
-        for child in self.children[revision]:
-            if same_branch(child, revision):
-                self.treeview.set_cursor(self.index[child])
-                break
-        else:
-            prev = list(self.children[revision])[0]
-            self.treeview.set_cursor(self.index[prev])
-
-    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]
         if not len(revision.parent_ids):
             return
 
@@ -215,3 +199,17 @@
             next = self.revisions[revision.parent_ids[0]]
             self.treeview.set_cursor(self.index[next])
 
+    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]
+        if not len(self.children[revision]):
+            return
+
+        for child in self.children[revision]:
+            if same_branch(child, revision):
+                self.treeview.set_cursor(self.index[child])
+                break
+        else:
+            prev = list(self.children[revision])[0]
+            self.treeview.set_cursor(self.index[prev])



More information about the Pkg-bazaar-commits mailing list