/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: Curtis Hovey
  • Date: 2011-07-31 15:52:43 UTC
  • mto: This revision was merged to the branch mainline in revision 741.
  • Revision ID: sinzui.is@verizon.net-20110731155243-ln8istmxbryhb4pz
Mechanical changes made by pygi.convert.sh.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
except:
21
21
    pass
22
22
 
23
 
import gtk
24
 
import gobject
 
23
from gi.repository import Gtk
 
24
from gi.repository import GObject
25
25
 
26
26
from bzrlib.plugins.gtk.diff import DiffWidget
27
27
from bzrlib.plugins.gtk.dialog import question_dialog
32
32
from bzrlib.plugins.gtk.i18n import _i18n
33
33
 
34
34
 
35
 
class LoomDialog(gtk.Dialog):
 
35
class LoomDialog(Gtk.Dialog):
36
36
    """Simple Loom browse dialog."""
37
37
 
38
38
    def __init__(self, branch, tree=None, parent=None):
39
 
        gtk.Dialog.__init__(self, title="Threads",
 
39
        GObject.GObject.__init__(self, title="Threads",
40
40
                                  parent=parent,
41
41
                                  flags=0,
42
 
                                  buttons=(gtk.STOCK_CLOSE,gtk.RESPONSE_OK))
 
42
                                  buttons=(Gtk.STOCK_CLOSE,Gtk.ResponseType.OK))
43
43
        self.branch = branch
44
44
        if tree is not None:
45
45
            self.tree = loom_tree.LoomTreeDecorator(tree)
57
57
                _i18n("Branch is not a loom branch. Upgrade to Loom format?"),
58
58
                parent=self)
59
59
                # Doesn't set a parent for the dialog..
60
 
            if response == gtk.RESPONSE_NO:
 
60
            if response == Gtk.ResponseType.NO:
61
61
                return
62
62
            assert self.branch.nick is not None
63
63
            loom_branch.loomify(self.branch)
65
65
        return super(LoomDialog, self).run()
66
66
 
67
67
    def _construct(self):
68
 
        hbox = gtk.HBox()
 
68
        hbox = Gtk.HBox()
69
69
 
70
 
        self._threads_scroller = gtk.ScrolledWindow()
71
 
        self._threads_scroller.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
72
 
        self._threads_view = gtk.TreeView()
 
70
        self._threads_scroller = Gtk.ScrolledWindow()
 
71
        self._threads_scroller.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
 
72
        self._threads_view = Gtk.TreeView()
73
73
        self._threads_scroller.add(self._threads_view)
74
 
        self._threads_scroller.set_shadow_type(gtk.SHADOW_IN)
75
 
        hbox.pack_start(self._threads_scroller)
 
74
        self._threads_scroller.set_shadow_type(Gtk.ShadowType.IN)
 
75
        hbox.pack_start(self._threads_scroller, True, True, 0)
76
76
 
77
 
        self._threads_store = gtk.ListStore(
78
 
                gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_PYOBJECT, gobject.TYPE_STRING)
 
77
        self._threads_store = Gtk.ListStore(
 
78
                GObject.TYPE_STRING, GObject.TYPE_STRING, GObject.TYPE_PYOBJECT, GObject.TYPE_STRING)
79
79
        self._threads_view.set_model(self._threads_store)
80
 
        self._threads_view.append_column(gtk.TreeViewColumn("Name", gtk.CellRendererText(), text=0))
 
80
        self._threads_view.append_column(Gtk.TreeViewColumn("Name", Gtk.CellRendererText(), text=0))
81
81
        self._threads_view.connect('cursor-changed', self._on_view_thread)
82
82
        if self.tree is not None:
83
83
            self._threads_view.connect('row-activated', self._on_switch_thread)
87
87
        hbox.pack_end(self._diff)
88
88
 
89
89
        hbox.show_all()
90
 
        self.vbox.pack_start(hbox)
 
90
        self.vbox.pack_start(hbox, True, True, 0)
91
91
 
92
92
        # FIXME: Buttons: combine-thread, revert-loom, record
93
93
        self.set_default_size(500, 350)