Rev 582: Show threads in loom dialog. in file:///data/jelmer/bzr-gtk/trunk/
Jelmer Vernooij
jelmer at samba.org
Thu Jul 31 01:07:22 BST 2008
At file:///data/jelmer/bzr-gtk/trunk/
------------------------------------------------------------
revno: 582
revision-id: jelmer at samba.org-20080731000721-tbg7rh6302eywkj8
parent: jelmer at samba.org-20080730235206-4stv1rmgw5ey0ttw
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Thu 2008-07-31 02:07:21 +0200
message:
Show threads in loom dialog.
modified:
commit.py commit.py-20060721181724-0mfkrqwpsa09q1t3-3
loom.py loom.py-20080730235158-elzoq27ll0eh6401-1
=== modified file 'commit.py'
--- a/commit.py 2008-07-27 07:59:23 +0000
+++ b/commit.py 2008-07-31 00:07:21 +0000
@@ -101,7 +101,7 @@
"""Implementation of Commit."""
def __init__(self, wt, selected=None, parent=None):
- gtk.Dialog.__init__(self, title="Commit - Olive",
+ gtk.Dialog.__init__(self, title="Commit",
parent=parent,
flags=0,
buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))
=== modified file 'loom.py'
--- a/loom.py 2008-07-30 23:52:06 +0000
+++ b/loom.py 2008-07-31 00:07:21 +0000
@@ -50,13 +50,37 @@
# Doesn't set a parent for the dialog..
if response == gtk.RESPONSE_NO:
return
+ assert self.branch.nick is not None
loom_branch.loomify(self.branch)
return super(LoomDialog, self).run()
def _construct(self):
+ self._threads_scroller = gtk.ScrolledWindow()
+ self._threads_scroller.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
self._threads_view = gtk.TreeView()
self._threads_view.show()
- self.vbox.pack_start(self._threads_view)
+ self._threads_scroller.add(self._threads_view)
+ self._threads_scroller.set_shadow_type(gtk.SHADOW_IN)
+ self._threads_scroller.show()
+ self.vbox.pack_start(self._threads_scroller)
+
+ self._threads_store = gtk.ListStore(
+ gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_PYOBJECT)
+ self._threads_view.set_model(self._threads_store)
+ self._threads_view.append_column(gtk.TreeViewColumn("Name", gtk.CellRendererText(), text=0))
# Buttons: combine-thread, export-loom, revert-loom, up-thread
-
+ self.set_default_size(200, 350)
+
+ self._load_threads()
+
+ def _load_threads(self):
+ self._threads_store.clear()
+
+ self.branch.lock_read()
+ try:
+ threads = self.branch.get_loom_state().get_threads()
+ for thread in reversed(threads):
+ self._threads_store.append(thread)
+ finally:
+ self.branch.unlock()
More information about the bazaar-commits
mailing list