/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 conflicts.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:
26
26
import gobject
27
27
 
28
28
from bzrlib.config import GlobalConfig
 
29
from bzrlib.plugins.gtk import _i18n
29
30
 
30
31
from dialog import error_dialog, warning_dialog
31
32
from errors import show_bzr_error
45
46
        # Create the widgets
46
47
        self._scrolledwindow = gtk.ScrolledWindow()
47
48
        self._treeview = gtk.TreeView()
48
 
        self._label_diff3 = gtk.Label(_("External utility:"))
 
49
        self._label_diff3 = gtk.Label(_i18n("External utility:"))
49
50
        self._entry_diff3 = gtk.Entry()
50
51
        self._image_diff3 = gtk.Image()
51
52
        self._button_diff3 = gtk.Button()
96
97
        if len(self.wt.conflicts()) == 0:
97
98
            self.model = gtk.ListStore(gobject.TYPE_STRING)
98
99
            self._treeview.set_model(self.model)
99
 
            self._treeview.append_column(gtk.TreeViewColumn(_('Conflicts'),
 
100
            self._treeview.append_column(gtk.TreeViewColumn(_i18n('Conflicts'),
100
101
                                         gtk.CellRendererText(), text=0))
101
102
            self._treeview.set_headers_visible(False)            
102
 
            self.model.append([ _("No conflicts in working tree.") ])
 
103
            self.model.append([ _i18n("No conflicts in working tree.") ])
103
104
            self._button_diff3.set_sensitive(False)
104
105
        else:
105
106
            self.model = gtk.ListStore(gobject.TYPE_STRING,
106
107
                                       gobject.TYPE_STRING,
107
108
                                       gobject.TYPE_STRING)
108
109
            self._treeview.set_model(self.model)
109
 
            self._treeview.append_column(gtk.TreeViewColumn(_('Path'),
 
110
            self._treeview.append_column(gtk.TreeViewColumn(_i18n('Path'),
110
111
                                         gtk.CellRendererText(), text=0))
111
 
            self._treeview.append_column(gtk.TreeViewColumn(_('Type'),
 
112
            self._treeview.append_column(gtk.TreeViewColumn(_i18n('Type'),
112
113
                                         gtk.CellRendererText(), text=1))
113
114
            self._treeview.set_search_column(0)
114
115
            for conflict in self.wt.conflicts():
115
116
                if conflict.typestring == 'path conflict':
116
 
                    t = _("path conflict")
 
117
                    t = _i18n("path conflict")
117
118
                elif conflict.typestring == 'contents conflict':
118
 
                    t = _("contents conflict")
 
119
                    t = _i18n("contents conflict")
119
120
                elif conflict.typestring == 'text conflict':
120
 
                    t = _("text conflict")
 
121
                    t = _i18n("text conflict")
121
122
                elif conflict.typestring == 'duplicate id':
122
 
                    t = _("duplicate id")
 
123
                    t = _i18n("duplicate id")
123
124
                elif conflict.typestring == 'duplicate':
124
 
                    t = _("duplicate")
 
125
                    t = _i18n("duplicate")
125
126
                elif conflict.typestring == 'parent loop':
126
 
                    t = _("parent loop")
 
127
                    t = _i18n("parent loop")
127
128
                elif conflict.typestring == 'unversioned parent':
128
 
                    t = _("unversioned parent")
 
129
                    t = _i18n("unversioned parent")
129
130
                elif conflict.typestring == 'missing parent':
130
 
                    t = _("missing parent")
 
131
                    t = _i18n("missing parent")
131
132
                elif conflict.typestring == 'deleting parent':
132
 
                    t = _("deleting parent")
 
133
                    t = _i18n("deleting parent")
133
134
                else:
134
 
                    t = _("unknown type of conflict")
 
135
                    t = _i18n("unknown type of conflict")
135
136
                
136
137
                self.model.append([ conflict.path, t, conflict.typestring ]) 
137
138
    
160
161
        self._set_diff3(self._entry_diff3.get_text())
161
162
        selected = self._get_selected_file()
162
163
        if selected is None:
163
 
            error_dialog(_('No file was selected'),
164
 
                         _('Please select a file from the list.'))
 
164
            error_dialog(_i18n('No file was selected'),
 
165
                         _i18n('Please select a file from the list.'))
165
166
            return
166
167
        elif self._get_selected_type() == 'text conflict':
167
168
            base = self.wt.abspath(selected) + '.BASE'
171
172
                p = subprocess.Popen([ self._entry_diff3.get_text(), base, this, other ])
172
173
                p.wait()
173
174
            except OSError, e:
174
 
                warning_dialog(_('Call to external utility failed'), str(e))
 
175
                warning_dialog(_i18n('Call to external utility failed'), str(e))
175
176
        else:
176
 
            warning_dialog(_('Cannot resolve conflict'),
177
 
                           _('Only conflicts on the text of files can be resolved with Olive at the moment. Content conflicts, on the structure of the tree, need to be resolved using the command line.'))
 
177
            warning_dialog(_i18n('Cannot resolve conflict'),
 
178
                           _i18n('Only conflicts on the text of files can be resolved with Olive at the moment. Content conflicts, on the structure of the tree, need to be resolved using the command line.'))
178
179
            return