/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 olive/menu.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:
30
30
import bzrlib.errors as errors
31
31
from bzrlib.workingtree import WorkingTree
32
32
 
 
33
from bzrlib.plugins.gtk import _i18n
33
34
from bzrlib.plugins.gtk.dialog import error_dialog, info_dialog, question_dialog, warning_dialog
34
35
from bzrlib.plugins.gtk.errors import show_bzr_error
35
36
from bzrlib.plugins.gtk.annotate.gannotate import GAnnotateWindow
59
60
        
60
61
        self.actiongroup = gtk.ActionGroup('context')
61
62
        self.actiongroup.add_actions([('add', gtk.STOCK_ADD,
62
 
                                       _('Add'), None,
63
 
                                       _('Add the selected file'),
 
63
                                       _i18n('Add'), None,
 
64
                                       _i18n('Add the selected file'),
64
65
                                       self.add_file),
65
66
                                      ('remove', gtk.STOCK_REMOVE,
66
 
                                       _('Remove'), None,
67
 
                                       _('Remove the selected file'),
 
67
                                       _i18n('Remove'), None,
 
68
                                       _i18n('Remove the selected file'),
68
69
                                       self.remove_file),
69
70
                                      ('remove_and_delete', gtk.STOCK_REMOVE,
70
 
                                       _('Remove and delete'), None,
71
 
                                       _('Remove the selected file/dir and delete from disk'),
 
71
                                       _i18n('Remove and delete'), None,
 
72
                                       _i18n('Remove the selected file/dir and delete from disk'),
72
73
                                       self.remove_and_delete_file),
73
74
                                      ('rename', None,
74
 
                                       _('Rename'), None,
75
 
                                       _('Rename the selected file'),
 
75
                                       _i18n('Rename'), None,
 
76
                                       _i18n('Rename the selected file'),
76
77
                                       self.rename_file),
77
78
                                      ('open', gtk.STOCK_OPEN,
78
 
                                       _('Open'), None,
79
 
                                       _('Open the selected file'),
 
79
                                       _i18n('Open'), None,
 
80
                                       _i18n('Open the selected file'),
80
81
                                       self.open_file),
81
82
                                      ('revert', None,
82
 
                                       _('Revert'), None,
83
 
                                       _('Revert the changes'),
 
83
                                       _i18n('Revert'), None,
 
84
                                       _i18n('Revert the changes'),
84
85
                                       self.revert),
85
86
                                      ('commit', None,
86
 
                                       _('Commit'), None,
87
 
                                       _('Commit the changes'),
 
87
                                       _i18n('Commit'), None,
 
88
                                       _i18n('Commit the changes'),
88
89
                                       self.commit),
89
90
                                      ('annotate', None,
90
 
                                       _('Annotate'), None,
91
 
                                       _('Annotate the selected file'),
 
91
                                       _i18n('Annotate'), None,
 
92
                                       _i18n('Annotate the selected file'),
92
93
                                       self.annotate),
93
94
                                      ('diff', None,
94
 
                                       _('Diff'), None,
95
 
                                       _('Show the diff of the file'),
 
95
                                       _i18n('Diff'), None,
 
96
                                       _i18n('Show the diff of the file'),
96
97
                                       self.diff),
97
98
                                      ('bookmark', None,
98
 
                                       _('Bookmark'), None,
99
 
                                       _('Bookmark current location'),
 
99
                                       _i18n('Bookmark'), None,
 
100
                                       _i18n('Bookmark current location'),
100
101
                                       self.bookmark),
101
102
                                      ('edit_bookmark', gtk.STOCK_EDIT,
102
 
                                       _('Edit'), None,
103
 
                                       _('Edit the selected bookmark'),
 
103
                                       _i18n('Edit'), None,
 
104
                                       _i18n('Edit the selected bookmark'),
104
105
                                       self.edit_bookmark),
105
106
                                      ('remove_bookmark', gtk.STOCK_REMOVE,
106
 
                                       _('Remove'), None,
107
 
                                       _('Remove the selected bookmark'),
 
107
                                       _i18n('Remove'), None,
 
108
                                       _i18n('Remove the selected bookmark'),
108
109
                                       self.remove_bookmark),
109
110
                                      ('open_folder', gtk.STOCK_OPEN,
110
 
                                       _('Open Folder'), None,
111
 
                                       _('Open bookmark folder in Nautilus'),
 
111
                                       _i18n('Open Folder'), None,
 
112
                                       _i18n('Open bookmark folder in Nautilus'),
112
113
                                       self.open_folder),
113
114
                                      ('diff_selected', None,
114
 
                                       _('Selected...'), None,
115
 
                                       _('Show the differences of the selected file'),
 
115
                                       _i18n('Selected...'), None,
 
116
                                       _i18n('Show the differences of the selected file'),
116
117
                                       self.diff_selected),
117
118
                                      ('diff_all', None,
118
 
                                       _('All...'), None,
119
 
                                       _('Show the differences of all files'),
 
119
                                       _i18n('All...'), None,
 
120
                                       _i18n('Show the differences of all files'),
120
121
                                       self.diff_all),
121
122
                                      ('view_remote', None,
122
 
                                       _('View contents'), None,
123
 
                                       _('View the contents of the file in a builtin viewer'),
 
123
                                       _i18n('View contents'), None,
 
124
                                       _i18n('View the contents of the file in a builtin viewer'),
124
125
                                       self.view_remote),
125
126
                                      ('diff_remote', None,
126
 
                                       _('Show differences'), None,
127
 
                                       _('Show the differences between two revisions of the file'),
 
127
                                       _i18n('Show differences'), None,
 
128
                                       _i18n('Show the differences between two revisions of the file'),
128
129
                                       self.diff_remote),
129
130
                                      ('revert_remote', None,
130
 
                                       _('Revert to this revision'), None,
131
 
                                       _('Revert the selected file to the selected revision'),
 
131
                                       _i18n('Revert to this revision'), None,
 
132
                                       _i18n('Revert the selected file to the selected revision'),
132
133
                                       self.revert_remote)
133
134
                                     ])
134
135
        
174
175
        filename = self.selected
175
176
            
176
177
        if filename is None:
177
 
            error_dialog(_('No file was selected'),
178
 
                         _('Please select a file from the list,\nor choose the other option.'))
 
178
            error_dialog(_i18n('No file was selected'),
 
179
                         _i18n('Please select a file from the list,\nor choose the other option.'))
179
180
            return
180
181
        
181
182
        bzrlib.add.smart_add([os.path.join(directory, filename)])
187
188
        filename = self.selected
188
189
        
189
190
        if filename is None:
190
 
            error_dialog(_('No file was selected'),
191
 
                         _('Please select a file from the list.'))
 
191
            error_dialog(_i18n('No file was selected'),
 
192
                         _i18n('Please select a file from the list.'))
192
193
            return
193
194
        
194
195
        wt, path = WorkingTree.open_containing(os.path.join(directory, filename))
214
215
        filename = self.selected
215
216
        
216
217
        if filename is None:
217
 
            error_dialog(_('No file was selected'),
218
 
                         _('Please select a file from the list,\nor choose the other option.'))
 
218
            error_dialog(_i18n('No file was selected'),
 
219
                         _i18n('Please select a file from the list,\nor choose the other option.'))
219
220
            return
220
221
        
221
222
        wt, path = WorkingTree.open_containing(os.path.join(directory, filename))
224
225
        if delete_on_disk:
225
226
            abs_filename = os.path.join(directory,filename)
226
227
            if os.path.isdir(abs_filename):
227
 
                response = question_dialog(_('Delete directory with all directories below ?'), abs_filename )
 
228
                response = question_dialog(_i18n('Delete directory with all directories below ?'), abs_filename )
228
229
                if response == gtk.RESPONSE_YES:
229
230
                    shutil.rmtree(abs_filename)
230
231
            else:
250
251
        filename = self.selected
251
252
        
252
253
        if filename is None:
253
 
            error_dialog(_('No file was selected'),
254
 
                         _('Please select a file from the list,\nor choose the other option.'))
 
254
            error_dialog(_i18n('No file was selected'),
 
255
                         _i18n('Please select a file from the list,\nor choose the other option.'))
255
256
            return
256
257
 
257
258
        if filename == '..':
271
272
        wt, path = WorkingTree.open_containing(self.path)
272
273
        ret = wt.revert([os.path.join(path, self.selected)])
273
274
        if ret:
274
 
            warning_dialog(_('Conflicts detected'),
275
 
                           _('Please have a look at the working tree before continuing.'))
 
275
            warning_dialog(_i18n('Conflicts detected'),
 
276
                           _i18n('Please have a look at the working tree before continuing.'))
276
277
        else:
277
 
            info_dialog(_('Revert successful'),
278
 
                        _('All files reverted to last revision.'))
 
278
            info_dialog(_i18n('Revert successful'),
 
279
                        _i18n('All files reverted to last revision.'))
279
280
        self.app.refresh_right()       
280
281
    
281
282
    def commit(self, action):
315
316
    def bookmark(self, action):
316
317
        """ Right context menu -> Bookmark """
317
318
        if self.pref.add_bookmark(self.path):
318
 
            info_dialog(_('Bookmark successfully added'),
319
 
                        _('The current directory was bookmarked. You can reach\nit by selecting it from the left panel.'))
 
319
            info_dialog(_i18n('Bookmark successfully added'),
 
320
                        _i18n('The current directory was bookmarked. You can reach\nit by selecting it from the left panel.'))
320
321
            self.pref.write()
321
322
        else:
322
 
            warning_dialog(_('Location already bookmarked'),
323
 
                           _('The current directory is already bookmarked.\nSee the left panel for reference.'))
 
323
            warning_dialog(_i18n('Location already bookmarked'),
 
324
                           _i18n('The current directory is already bookmarked.\nSee the left panel for reference.'))
324
325
        
325
326
        self.app.refresh_left()
326
327