/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: Vincent Ladeuil
  • Date: 2008-06-10 15:25:47 UTC
  • mto: This revision was merged to the branch mainline in revision 504.
  • Revision ID: v.ladeuil+lp@free.fr-20080610152547-dwmil1p8pd0mfpnl
Fix third failing test (thanks to jam).

* tests/test_commit.py:
(TestPendingRevisions.test_pending_revisions_multi_merge): Fix
provided by jam: bzr we now filter the pending merges so that only
the 'heads()' are included. We just ensure that the pending merges
contain the unique tips for the ancestries.

Show diffs side-by-side

added added

removed removed

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