From 95acdbfde0d0f4343c13df7db26aec8cf523ad26 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 9 Nov 2009 00:11:01 +0000 Subject: [PATCH 1/3] Fix import --- openlp/core/ui/maindisplay.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 3195f8de9..9a001b0f2 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -28,7 +28,7 @@ import os from PyQt4 import QtCore, QtGui from PyQt4.phonon import Phonon -from openlp.core.lib import Receiver, str_to_bool +from openlp.core.lib import Receiver class DisplayWidget(QtGui.QWidget): """ From b100731dc4b2ff86c07932806d217c5143823fd0 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 12 Nov 2009 00:44:26 +0000 Subject: [PATCH 2/3] A unicode fix for songs --- openlp/core/lib/songxmlhandler.py | 6 ++++-- openlp/plugins/songs/lib/mediaitem.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/openlp/core/lib/songxmlhandler.py b/openlp/core/lib/songxmlhandler.py index 4543464bb..37bbe25e4 100644 --- a/openlp/core/lib/songxmlhandler.py +++ b/openlp/core/lib/songxmlhandler.py @@ -134,7 +134,8 @@ class SongXMLParser(object): The XML of the song to be parsed. """ try: - self.song_xml = ElementTree(element=XML(xml)) + self.song_xml = ElementTree( + element=XML(unicode(xml).encode('unicode-escape'))) except: log.exception(u'Invalid xml %s', xml) @@ -147,7 +148,8 @@ class SongXMLParser(object): verse_list = [] for element in iter: if element.tag == u'verse': - verse_list.append([element.attrib, element.text]) + verse_list.append([element.attrib, + unicode(element.text).decode('unicode-escape')]) return verse_list def dump_xml(self): diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 33ee028e2..f69faed8b 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -291,7 +291,7 @@ class SongMediaItem(MediaManagerItem): service_item.editId = item_id service_item.verse_order = song.verse_order if song.lyrics.startswith(u' Date: Thu, 12 Nov 2009 00:49:55 +0000 Subject: [PATCH 3/3] A unicode fix for themes --- openlp/core/lib/themexmlhandler.py | 3 ++- openlp/core/ui/amendthemeform.py | 4 ++-- openlp/core/ui/mainwindow.py | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/openlp/core/lib/themexmlhandler.py b/openlp/core/lib/themexmlhandler.py index 0501fb06f..1ffece78b 100644 --- a/openlp/core/lib/themexmlhandler.py +++ b/openlp/core/lib/themexmlhandler.py @@ -30,7 +30,7 @@ from xml.etree.ElementTree import ElementTree, XML from openlp.core.lib import str_to_bool blankthemexml=\ -''' +''' BlankStyle @@ -348,6 +348,7 @@ class ThemeXML(object): iter = theme_xml.getiterator() master = u'' for element in iter: + element.text = unicode(element.text).decode('unicode-escape') if len(element.getchildren()) > 0: master = element.tag + u'_' else: diff --git a/openlp/core/ui/amendthemeform.py b/openlp/core/ui/amendthemeform.py index 27197c5af..4e5b9cd9d 100644 --- a/openlp/core/ui/amendthemeform.py +++ b/openlp/core/ui/amendthemeform.py @@ -126,7 +126,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): def accept(self): new_theme = ThemeXML() theme_name = unicode(self.ThemeNameEdit.displayText()) - new_theme.new_document(theme_name) + new_theme.new_document(theme_name.encode('unicode-escape')) save_from = None save_to = None if self.theme.background_mode == u'transparent': @@ -144,7 +144,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): (path, filename) = \ os.path.split(unicode(self.theme.background_filename)) new_theme.add_background_image(filename) - save_to= os.path.join(self.path, theme_name, filename ) + save_to = os.path.join(self.path, theme_name, filename) save_from = self.theme.background_filename new_theme.add_font(unicode(self.theme.font_main_name), diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index c725948a7..22e2087bc 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -676,7 +676,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): self.setWindowTitle(title) def defaultThemeChanged(self, theme): - self.DefaultThemeLabel.setText(self.defaultThemeText + theme) + self.DefaultThemeLabel.setText( + u'%s %s' % (self.defaultThemeText, theme)) def toggleMediaManager(self, visible): if self.MediaManagerDock.isVisible() != visible: