[pitivi] title: Escape title text as needed by pango
- From: Thibault Saunier <tsaunier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] title: Escape title text as needed by pango
- Date: Sat, 19 Sep 2015 08:08:41 +0000 (UTC)
commit fec531b1119224a12bd1737b85aada50062b0da1
Author: Thibault Saunier <tsaunier gnome org>
Date: Sat Sep 19 10:06:32 2015 +0200
title: Escape title text as needed by pango
Fixes T3326
pitivi/titleeditor.py | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/pitivi/titleeditor.py b/pitivi/titleeditor.py
index 6df809f..b1f0d2d 100644
--- a/pitivi/titleeditor.py
+++ b/pitivi/titleeditor.py
@@ -29,6 +29,7 @@ from gi.repository import Gst
from gi.repository import GLib
from gettext import gettext as _
+from xml.sax.saxutils import escape, unescape
from pitivi.configure import get_ui_dir
from pitivi.utils.loggable import Loggable
@@ -147,9 +148,11 @@ class TitleEditor(Loggable):
def _setWidgetText(self):
res, source_text = self.source.get_child_property("text")
- text = self.textbuffer.get_text(self.textbuffer.get_start_iter(),
- self.textbuffer.get_end_iter(),
- True)
+ source_text = unescape(source_text)
+ text = unescape(self.textbuffer.get_text(
+ self.textbuffer.get_start_iter(), self.textbuffer.get_end_iter(),
+ True))
+
if text == source_text:
return False
@@ -196,7 +199,7 @@ class TitleEditor(Loggable):
self.textbuffer.get_end_iter(),
True)
self.log("Source text updated to %s", text)
- self._setChildProperty("text", text)
+ self._setChildProperty("text", escape(unescape(text)))
def _updateSource(self, updated_obj):
"""
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]