/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: Szilveszter Farkas (Phanatic)
  • Date: 2007-04-16 22:14:51 UTC
  • mto: This revision was merged to the branch mainline in revision 193.
  • Revision ID: szilveszter.farkas@gmail.com-20070416221451-gv783dxh5sbbcuru
Display tag name on the remove dialog.

Show diffs side-by-side

added added

removed removed

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