/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-05-05 18:16:46 UTC
  • mto: (487.1.1 gtk)
  • mto: This revision was merged to the branch mainline in revision 490.
  • Revision ID: v.ladeuil+lp@free.fr-20080505181646-n95l8ltw2u6jtr26
Fix bug #187283 fix replacing _() by _i18n().

* genpot.sh 
Remove duplication. Add the ability to specify the genrated pot
file on command-line for debugging purposes.

* po/olive-gtk.pot:
Regenerated.

* __init__.py, branch.py, branchview/treeview.py, checkout.py,
commit.py, conflicts.py, diff.py, errors.py, initialize.py,
merge.py, nautilus-bzr.py, olive/__init__.py, olive/add.py,
olive/bookmark.py, olive/guifiles.py, olive/info.py,
olive/menu.py, olive/mkdir.py, olive/move.py, olive/remove.py,
olive/rename.py, push.py, revbrowser.py, status.py, tags.py:
Replace all calls to _() by calls to _i18n(), the latter being
defined in __init__.py and imported in the other modules from
there. This fix the problem encountered countless times when
running bzr selftest and getting silly error messages about
boolean not being callables.

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
 
24
26
 
25
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
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
33
        self._create()
32
34
        self.wt = wt
33
35
        self.wtpath = wtpath
 
36
        
 
37
        if revision is None:
 
38
            revision = self.wt.branch.last_revision()
 
39
            
34
40
        # Set the old working tree
35
 
        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)
36
42
        # Generate status output
37
43
        self._generate_status()
38
44
 
75
81
        
76
82
        if len(delta.added):
77
83
            changes = True
78
 
            titer = self.model.append(None, [ _('Added'), None ])
 
84
            titer = self.model.append(None, [ _i18n('Added'), None ])
79
85
            for path, id, kind in delta.added:
80
86
                self.model.append(titer, [ path, path ])
81
87
 
82
88
        if len(delta.removed):
83
89
            changes = True
84
 
            titer = self.model.append(None, [ _('Removed'), None ])
 
90
            titer = self.model.append(None, [ _i18n('Removed'), None ])
85
91
            for path, id, kind in delta.removed:
86
92
                self.model.append(titer, [ path, path ])
87
93
 
88
94
        if len(delta.renamed):
89
95
            changes = True
90
 
            titer = self.model.append(None, [ _('Renamed'), None ])
 
96
            titer = self.model.append(None, [ _i18n('Renamed'), None ])
91
97
            for oldpath, newpath, id, kind, text_modified, meta_modified \
92
98
                    in delta.renamed:
93
99
                self.model.append(titer, [ oldpath, newpath ])
94
100
 
95
101
        if len(delta.modified):
96
102
            changes = True
97
 
            titer = self.model.append(None, [ _('Modified'), None ])
 
103
            titer = self.model.append(None, [ _i18n('Modified'), None ])
98
104
            for path, id, kind, text_modified, meta_modified in delta.modified:
99
105
                self.model.append(titer, [ path, path ])
100
106
        
102
108
        for path in self.wt.unknowns():
103
109
            changes = True
104
110
            if not done_unknown:
105
 
                titer = self.model.append(None, [ _('Unknown'), None ])
 
111
                titer = self.model.append(None, [ _i18n('Unknown'), None ])
106
112
                done_unknown = True
107
113
            self.model.append(titer, [ path, path ])
108
114
 
109
115
        if not changes:
110
 
            self.model.append(None, [ _('No changes.'), None ])
 
116
            self.model.append(None, [ _i18n('No changes.'), None ])
111
117
 
112
118
        self.treeview.expand_all()
113
119