/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to loom.py

  • Committer: Jelmer Vernooij
  • Date: 2008-07-31 00:07:21 UTC
  • mto: (580.2.1 gtk.gloom)
  • mto: This revision was merged to the branch mainline in revision 581.
  • Revision ID: jelmer@samba.org-20080731000721-tbg7rh6302eywkj8
Show threads in loom dialog.

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
                # Doesn't set a parent for the dialog..
51
51
            if response == gtk.RESPONSE_NO:
52
52
                return
 
53
            assert self.branch.nick is not None
53
54
            loom_branch.loomify(self.branch)
54
55
        return super(LoomDialog, self).run()
55
56
 
56
57
    def _construct(self):
 
58
        self._threads_scroller = gtk.ScrolledWindow()
 
59
        self._threads_scroller.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
57
60
        self._threads_view = gtk.TreeView()
58
61
        self._threads_view.show()
59
 
        self.vbox.pack_start(self._threads_view)
 
62
        self._threads_scroller.add(self._threads_view)
 
63
        self._threads_scroller.set_shadow_type(gtk.SHADOW_IN)
 
64
        self._threads_scroller.show()
 
65
        self.vbox.pack_start(self._threads_scroller)
 
66
 
 
67
        self._threads_store = gtk.ListStore(
 
68
                gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_PYOBJECT)
 
69
        self._threads_view.set_model(self._threads_store)
 
70
        self._threads_view.append_column(gtk.TreeViewColumn("Name", gtk.CellRendererText(), text=0))
60
71
 
61
72
        # Buttons: combine-thread, export-loom, revert-loom, up-thread
62
 
 
 
73
        self.set_default_size(200, 350)
 
74
 
 
75
        self._load_threads()
 
76
 
 
77
    def _load_threads(self):
 
78
        self._threads_store.clear()
 
79
        
 
80
        self.branch.lock_read()
 
81
        try:
 
82
            threads = self.branch.get_loom_state().get_threads()
 
83
            for thread in reversed(threads):
 
84
                self._threads_store.append(thread)
 
85
        finally:
 
86
            self.branch.unlock()