/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: 2007-03-09 16:22:27 UTC
  • Revision ID: vernooij@lenovo-c29b82cd-20070309162227-wiodikw2iu0758l6
Fix PyGTK URL.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
    pass
22
22
 
23
23
import gtk
24
 
from bzrlib.plugins.gtk import _i18n
25
 
 
26
 
 
27
 
class StatusDialog(gtk.Dialog):
 
24
 
 
25
class StatusDialog(gtk.MessageDialog):
28
26
    """ Display Status window and perform the needed actions. """
29
 
    def __init__(self, wt, wtpath, revision=None):
 
27
    def __init__(self, wt, wtpath):
30
28
        """ Initialize the Status window. """
31
 
        super(StatusDialog, self).__init__(flags=gtk.DIALOG_MODAL, buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT))
 
29
        super(StatusDialog, self).__init__(flags=gtk.DIALOG_MODAL, buttons=gtk.BUTTONS_OK)
32
30
        self.set_title("Working tree changes")
 
31
        self.set_image(gtk.Label("Working tree status"))
33
32
        self._create()
34
33
        self.wt = wt
35
34
        self.wtpath = wtpath
36
 
        
37
 
        if revision is None:
38
 
            revision = self.wt.branch.last_revision()
39
 
            
40
35
        # Set the old working tree
41
 
        self.old_tree = self.wt.branch.repository.revision_tree(revision)
 
36
        self.old_tree = self.wt.branch.repository.revision_tree(self.wt.branch.last_revision())
42
37
        # Generate status output
43
38
        self._generate_status()
44
39
 
81
76
        
82
77
        if len(delta.added):
83
78
            changes = True
84
 
            titer = self.model.append(None, [ _i18n('Added'), None ])
 
79
            titer = self.model.append(None, [ _('Added'), None ])
85
80
            for path, id, kind in delta.added:
86
81
                self.model.append(titer, [ path, path ])
87
82
 
88
83
        if len(delta.removed):
89
84
            changes = True
90
 
            titer = self.model.append(None, [ _i18n('Removed'), None ])
 
85
            titer = self.model.append(None, [ _('Removed'), None ])
91
86
            for path, id, kind in delta.removed:
92
87
                self.model.append(titer, [ path, path ])
93
88
 
94
89
        if len(delta.renamed):
95
90
            changes = True
96
 
            titer = self.model.append(None, [ _i18n('Renamed'), None ])
 
91
            titer = self.model.append(None, [ _('Renamed'), None ])
97
92
            for oldpath, newpath, id, kind, text_modified, meta_modified \
98
93
                    in delta.renamed:
99
94
                self.model.append(titer, [ oldpath, newpath ])
100
95
 
101
96
        if len(delta.modified):
102
97
            changes = True
103
 
            titer = self.model.append(None, [ _i18n('Modified'), None ])
 
98
            titer = self.model.append(None, [ _('Modified'), None ])
104
99
            for path, id, kind, text_modified, meta_modified in delta.modified:
105
100
                self.model.append(titer, [ path, path ])
106
101
        
108
103
        for path in self.wt.unknowns():
109
104
            changes = True
110
105
            if not done_unknown:
111
 
                titer = self.model.append(None, [ _i18n('Unknown'), None ])
 
106
                titer = self.model.append(None, [ _('Unknown'), None ])
112
107
                done_unknown = True
113
108
            self.model.append(titer, [ path, path ])
114
109
 
115
110
        if not changes:
116
 
            self.model.append(None, [ _i18n('No changes.'), None ])
 
111
            self.model.append(None, [ _('No changes.'), None ])
117
112
 
118
113
        self.treeview.expand_all()
119
114
    
 
115
    def display(self):
 
116
        """ Display the Diff window. """
 
117
        self.window.show_all()
 
118
 
120
119
    def close(self, widget=None):
121
120
        self.window.destroy()