From 0f7c99721496e8ff3ce6b90a2ff2958afd640946 Mon Sep 17 00:00:00 2001 From: M2j Date: Sat, 19 Jun 2010 14:01:06 +0200 Subject: [PATCH] small fix for unicode Theme names --- openlp/core/lib/themexmlhandler.py | 5 ++--- openlp/core/ui/amendthemeform.py | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/openlp/core/lib/themexmlhandler.py b/openlp/core/lib/themexmlhandler.py index 3303b8d77..b2850d6ec 100644 --- a/openlp/core/lib/themexmlhandler.py +++ b/openlp/core/lib/themexmlhandler.py @@ -96,9 +96,8 @@ class ThemeXML(object): The path name to be added. """ if self.background_filename and path: - self.theme_name = self.theme_name.rstrip().lstrip() - self.background_filename = \ - self.background_filename.rstrip().lstrip() + self.theme_name = self.theme_name.strip() + self.background_filename = self.background_filename.strip() self.background_filename = os.path.join(path, self.theme_name, self.background_filename) diff --git a/openlp/core/ui/amendthemeform.py b/openlp/core/ui/amendthemeform.py index 5500e344a..20664c8e0 100644 --- a/openlp/core/ui/amendthemeform.py +++ b/openlp/core/ui/amendthemeform.py @@ -138,8 +138,8 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): def accept(self): new_theme = ThemeXML() - theme_name = unicode(self.ThemeNameEdit.displayText()) - new_theme.new_document(theme_name.encode('unicode-escape')) + theme_name = unicode(self.ThemeNameEdit.text()) + new_theme.new_document(theme_name) save_from = None save_to = None if self.theme.background_mode == u'transparent': @@ -209,8 +209,8 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): self.previewTheme() def onImageToolButtonClicked(self): - filename = QtGui.QFileDialog.getOpenFileName( - self, translate('AmendThemeForm', 'Open File')) + filename = unicode(QtGui.QFileDialog.getOpenFileName( + self, translate('AmendThemeForm', 'Open File'))) if filename: self.ImageLineEdit.setText(filename) self.theme.background_filename = filename