[Pkg-bazaar-commits] ./bzr-gtk/unstable r315: Removed BranchWindow.set_branch(), used constructor instead.
Daniel Schierbeck
daniel.schierbeck at gmail.com
Fri Apr 10 07:45:22 UTC 2009
------------------------------------------------------------
revno: 315
committer: Daniel Schierbeck <daniel.schierbeck at gmail.com>
branch nick: revhistoryview
timestamp: Sun 2007-10-21 18:25:29 +0200
message:
Removed BranchWindow.set_branch(), used constructor instead.
modified:
__init__.py
olive/__init__.py
viz/branchwin.py
-------------- next part --------------
=== modified file '__init__.py'
--- a/__init__.py 2007-10-17 11:56:50 +0000
+++ b/__init__.py 2007-10-21 16:25:29 +0000
@@ -225,10 +225,7 @@
:return: The viz window object.
"""
from viz.branchwin import BranchWindow
- pp = BranchWindow()
- pp.set_branch(branch, revision, limit)
- # cleanup locks when the window is closed
- return pp
+ return BranchWindow(branch, revision, limit)
class cmd_visualise(Command):
=== modified file 'olive/__init__.py'
--- a/olive/__init__.py 2007-10-14 01:02:38 +0000
+++ b/olive/__init__.py 2007-10-21 16:25:29 +0000
@@ -742,11 +742,13 @@
def on_menuitem_stats_log_activate(self, widget):
""" Statistics/Log... menu handler. """
- window = branchwin.BranchWindow(parent=self.window)
+
if not self.remote:
- window.set_branch(self.wt.branch, self.wt.branch.last_revision(), None)
+ branch = self.wt.branch
else:
- window.set_branch(self.remote_branch, self.remote_branch.last_revision(), None)
+ branch = self.remote_branch
+
+ window = branchwin.BranchWindow(branch, branch.last_revision(), None, parent=self.window)
window.show()
def on_menuitem_view_refresh_activate(self, widget):
=== modified file 'viz/branchwin.py'
--- a/viz/branchwin.py 2007-10-21 16:09:12 +0000
+++ b/viz/branchwin.py 2007-10-21 16:25:29 +0000
@@ -28,10 +28,15 @@
for a particular branch.
"""
- def __init__(self, parent=None):
+ def __init__(self, branch, start, maxnum, parent=None):
gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)
self.set_border_width(0)
- self.set_title("Revision history")
+
+ self.branch = branch
+ self.start = start
+ self.maxnum = maxnum
+
+ self.set_title(branch.nick + " - revision history")
self._parent = parent
@@ -92,6 +97,8 @@
"""Construct the top-half of the window."""
self.treeview = TreeView()
+ self.treeview.set_branch(self.branch, self.start, self.maxnum)
+
self.treeview.connect("revision-selected",
self._treeselection_changed_cb)
@@ -141,17 +148,6 @@
self.logview.set_go_callback(self._go_clicked_cb)
return self.logview
- def set_branch(self, branch, start, maxnum):
- """Set the branch and start position for this window.
-
- Creates a new TreeModel and populates it with information about
- the new branch before updating the window title and model of the
- treeview itself.
- """
- self.branch = branch
- self.set_title(branch.nick + " - revision history")
- self.treeview.set_branch(branch, start, maxnum)
-
def _on_key_pressed(self, widget, event):
""" Key press event handler. """
keyname = gtk.gdk.keyval_name(event.keyval)
More information about the Pkg-bazaar-commits
mailing list