Set plain text to prevent xml from being rendered
offlate/ui/editor.py
224 | 224 | def copy(self): | |
225 | 225 | if self.msgstr.__class__.__name__ == "SpellCheckEdit": | |
226 | 226 | text = self.msgid.document().toRawText() | |
227 | - | self.msgstr.setText(text) | |
227 | + | self.msgstr.setPlainText(text) | |
228 | 228 | else: | |
229 | 229 | text = self.msgid.currentWidget().document().toRawText() | |
230 | - | self.msgstr.currentWidget().setText(text) | |
230 | + | self.msgstr.currentWidget().setPlainText(text) | |
231 | 231 | ||
232 | 232 | def copyTag(self, tag): | |
233 | 233 | tag = tag.toDisplayString()[1:] | |
… | |||
263 | 263 | edit = TagClickEdit() | |
264 | 264 | edit.setFont(QFont(font)) | |
265 | 265 | edit.setReadOnly(True) | |
266 | - | edit.setText(data.msgids[k]) | |
266 | + | edit.setPlainText(data.msgids[k]) | |
267 | 267 | edit.createLinks() | |
268 | 268 | edit.anchorClicked.connect(self.copyTag) | |
269 | 269 | self.msgid.addTab(edit, self.tr(k)) | |
… | |||
271 | 271 | for k in data.msgstrs: | |
272 | 272 | form = SpellCheckEdit(self.project.lang) | |
273 | 273 | form.setFont(QFont(font)) | |
274 | - | form.setText(data.msgstrs[k]) | |
274 | + | form.setPlainText(data.msgstrs[k]) | |
275 | 275 | form.textChanged.connect(self.modify) | |
276 | 276 | self.msgstr.addTab(form, self.tr(k)) | |
277 | 277 | if i == 0: | |
… | |||
283 | 283 | singular = TagClickEdit() | |
284 | 284 | singular.setFont(QFont(font)) | |
285 | 285 | singular.setReadOnly(True) | |
286 | - | singular.setText(data.msgids[0]) | |
286 | + | singular.setPlainText(data.msgids[0]) | |
287 | 287 | singular.createLinks() | |
288 | 288 | singular.anchorClicked.connect(self.copyTag) | |
289 | 289 | plural = TagClickEdit() | |
290 | 290 | plural.setFont(QFont(font)) | |
291 | 291 | plural.setReadOnly(True) | |
292 | - | plural.setText(data.msgids[1]) | |
292 | + | plural.setPlainText(data.msgids[1]) | |
293 | 293 | plural.createLinks() | |
294 | 294 | plural.anchorClicked.connect(self.copyTag) | |
295 | 295 | self.msgid.addTab(singular, self.tr("Singular")) | |
… | |||
298 | 298 | for msgstr in data.msgstrs: | |
299 | 299 | form = SpellCheckEdit(self.project.lang) | |
300 | 300 | form.setFont(QFont(font)) | |
301 | - | form.setText(msgstr) | |
301 | + | form.setPlainText(msgstr) | |
302 | 302 | form.textChanged.connect(self.modify) | |
303 | 303 | self.msgstr.addTab(form, str(i)) | |
304 | 304 | if i == 0: | |
… | |||
312 | 312 | edit = TagClickEdit() | |
313 | 313 | edit.setFont(QFont(font)) | |
314 | 314 | edit.setReadOnly(True) | |
315 | - | edit.setText(msgid) | |
315 | + | edit.setPlainText(msgid) | |
316 | 316 | edit.createLinks() | |
317 | 317 | edit.anchorClicked.connect(self.copyTag) | |
318 | 318 | self.msgid.addTab(edit, str(i)) | |
… | |||
321 | 321 | for msgstr in data.msgstrs: | |
322 | 322 | form = SpellCheckEdit(self.project.lang) | |
323 | 323 | form.setFont(QFont(font)) | |
324 | - | form.setText(msgstr) | |
324 | + | form.setPlainText(msgstr) | |
325 | 325 | form.textChanged.connect(self.modify) | |
326 | 326 | self.msgstr.addTab(form, str(i)) | |
327 | 327 | if i == 0: | |
… | |||
331 | 331 | self.msgid = TagClickEdit() | |
332 | 332 | self.msgid.setFont(QFont(font)) | |
333 | 333 | self.msgid.setReadOnly(True) | |
334 | - | self.msgid.setText(data.msgids[0]) | |
334 | + | self.msgid.setPlainText(data.msgids[0]) | |
335 | 335 | self.msgid.createLinks() | |
336 | 336 | self.msgid.anchorClicked.connect(self.copyTag) | |
337 | 337 | self.msgstr = SpellCheckEdit(self.project.lang) | |
338 | 338 | self.msgstr.setFont(QFont(font)) | |
339 | - | self.msgstr.setText(data.msgstrs[0]) | |
339 | + | self.msgstr.setPlainText(data.msgstrs[0]) | |
340 | 340 | self.msgstr.textChanged.connect(self.modify) | |
341 | 341 | focuser = self.msgstr | |
342 | 342 | self.hbox.addWidget(self.msgid) |