/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 status.py

  • Committer: Jelmer Vernooij
  • Date: 2012-03-29 13:15:14 UTC
  • mfrom: (786.1.1 register-lazy)
  • Revision ID: jelmer@samba.org-20120329131514-knrl1w2wzntx89rv
Use lazy registration.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
 
try:
18
 
    import pygtk
19
 
    pygtk.require("2.0")
20
 
except:
21
 
    pass
22
 
 
23
 
import gtk
24
 
from bzrlib.plugins.gtk import (
25
 
    _i18n,
26
 
    window,
27
 
    )
 
17
from gi.repository import Gtk
 
18
from bzrlib.plugins.gtk import window
 
19
from bzrlib.plugins.gtk.i18n import _i18n
28
20
 
29
21
 
30
22
class StatusWindow(window.Window):
31
23
    """ Display Status window and perform the needed actions. """
 
24
 
32
25
    def __init__(self, wt, wtpath, revision=None):
33
26
        """ Initialize the Status window. """
34
27
        super(StatusWindow, self).__init__()
47
40
 
48
41
    def _create(self):
49
42
        self.set_default_size(400, 300)
50
 
        sw = gtk.ScrolledWindow()
51
 
        sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
52
 
        sw.set_shadow_type(gtk.SHADOW_IN)
53
 
        self.treeview = gtk.TreeView()
 
43
        sw = Gtk.ScrolledWindow()
 
44
        sw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
 
45
        sw.set_shadow_type(Gtk.ShadowType.IN)
 
46
        self.treeview = Gtk.TreeView()
54
47
        sw.add(self.treeview)
55
48
        self.add(sw)
56
49
 
73
66
 
74
67
    def _generate_status(self):
75
68
        """ Generate 'bzr status' output. """
76
 
        self.model = gtk.TreeStore(str, str)
 
69
        self.model = Gtk.TreeStore(str, str)
77
70
        self.treeview.set_headers_visible(False)
78
71
        self.treeview.set_model(self.model)
79
72
        self.treeview.connect("row-activated", self.row_diff)
80
73
 
81
 
        cell = gtk.CellRendererText()
 
74
        cell = Gtk.CellRendererText()
82
75
        cell.set_property("width-chars", 20)
83
 
        column = gtk.TreeViewColumn()
84
 
        column.pack_start(cell, expand=True)
 
76
        column = Gtk.TreeViewColumn()
 
77
        column.pack_start(cell, True)
85
78
        column.add_attribute(cell, "text", 0)
86
79
        self.treeview.append_column(column)
87
80