diff --git a/openlp/core/ui/amendthemeform.py b/openlp/core/ui/amendthemeform.py index 04e4417af..c16368e36 100644 --- a/openlp/core/ui/amendthemeform.py +++ b/openlp/core/ui/amendthemeform.py @@ -201,7 +201,8 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): #self.theme.background_mode self.theme.background_startColor = theme.background_startColor.strip() #self.theme.background_type - self.theme.display_display = theme.display_display.strip() + if theme.display_display: + self.theme.display_display = theme.display_display.strip() self.theme.display_horizontalAlign = \ theme.display_horizontalAlign.strip() self.theme.display_outline = str_to_bool(theme.display_outline) diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index ded7dcaca..9bfc236c9 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -33,9 +33,8 @@ from PyQt4 import QtCore, QtGui from openlp.core.ui import AmendThemeForm, ServiceManager from openlp.core.theme import Theme -from openlp.core.lib import PluginConfig, \ - OpenLPToolbar, ThemeXML, Renderer, translate, \ - file_to_xml, buildIcon, Receiver +from openlp.core.lib import PluginConfig, OpenLPToolbar, ThemeXML, Renderer, \ + translate, str_to_bool, file_to_xml, buildIcon, Receiver from openlp.core.utils import ConfigHelper class ThemeManager(QtGui.QWidget): @@ -140,9 +139,8 @@ class ThemeManager(QtGui.QWidget): def onEditTheme(self): item = self.ThemeListWidget.currentItem() if item is not None: - self.amendThemeForm.setTheme(self.getThemeData( - item.data(QtCore.Qt.UserRole).toString())) - self.amendThemeForm.loadTheme() + self.amendThemeForm.loadTheme( + unicode(item.data(QtCore.Qt.UserRole).toString())) self.amendThemeForm.exec_() def onDeleteTheme(self): @@ -230,21 +228,25 @@ class ThemeManager(QtGui.QWidget): def getThemeData(self, themename): log.debug(u'getthemedata for theme %s', themename) - xml_file = os.path.join(self.path, unicode(themename), unicode(themename) + u'.xml') + xml_file = os.path.join(self.path, unicode(themename), + unicode(themename) + u'.xml') try: xml = file_to_xml(xml_file) except: newtheme = ThemeXML() newtheme.new_document(u'New Theme') newtheme.add_background_solid(unicode(u'#000000')) - newtheme.add_font(unicode(QtGui.QFont().family()), unicode(u'#FFFFFF'), unicode(30), u'False') - newtheme.add_font(unicode(QtGui.QFont().family()), unicode(u'#FFFFFF'), unicode(12), u'False', u'footer') - newtheme.add_display(u'False', unicode(u'#FFFFFF'), u'False', unicode(u'#FFFFFF'), - unicode(0), unicode(0), unicode(0)) + newtheme.add_font(unicode(QtGui.QFont().family()), + unicode(u'#FFFFFF'), unicode(30), u'False') + newtheme.add_font(unicode(QtGui.QFont().family()), + unicode(u'#FFFFFF'), unicode(12), u'False', u'footer') + newtheme.add_display(u'False', unicode(u'#FFFFFF'), u'False', + unicode(u'#FFFFFF'), unicode(0), unicode(0), unicode(0)) xml = newtheme.extract_xml() theme = ThemeXML() theme.parse(xml) theme.extend_image_filename(self.path) + self.cleanTheme(theme) return theme def checkThemesExists(self, dir):