From b79d535e04a3c6632a028213ed214b0e23c8221e Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 12 Nov 2009 23:49:35 +0000 Subject: [PATCH] Fix theme loading logic and missing item from cleaning --- openlp/core/ui/amendthemeform.py | 2 +- openlp/core/ui/thememanager.py | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/openlp/core/ui/amendthemeform.py b/openlp/core/ui/amendthemeform.py index 4e5b9cd9d..652b26284 100644 --- a/openlp/core/ui/amendthemeform.py +++ b/openlp/core/ui/amendthemeform.py @@ -184,7 +184,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): def loadTheme(self, theme): log.debug(u'LoadTheme %s', theme) - self.theme = self.thememanager.getThemeData(theme) + self.theme = theme # Stop the initial screen setup generating 1 preview per field! self.allowPreview = False self.paintUi(self.theme) diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 77e38ad20..0f333bf04 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -150,15 +150,17 @@ class ThemeManager(QtGui.QWidget): self.pushThemes() def onAddTheme(self): - self.amendThemeForm.loadTheme(None) + theme = self.createThemeFromXml(self.baseTheme(), self.path) + self.amendThemeForm.loadTheme(theme) self.saveThemeName = u'' self.amendThemeForm.exec_() def onEditTheme(self): item = self.ThemeListWidget.currentItem() if item: - self.amendThemeForm.loadTheme( + theme = self.getThemeData( unicode(item.data(QtCore.Qt.UserRole).toString())) + self.amendThemeForm.loadTheme(theme) self.saveThemeName = unicode( item.data(QtCore.Qt.UserRole).toString()) self.amendThemeForm.exec_() @@ -265,7 +267,7 @@ class ThemeManager(QtGui.QWidget): self.pushThemes() def pushThemes(self): - Receiver().send_message(u'update_themes', self.getThemes() ) + Receiver().send_message(u'update_themes', self.getThemes()) def getThemes(self): return self.themelist @@ -501,6 +503,8 @@ class ThemeManager(QtGui.QWidget): theme.display_wrapStyle = theme.display_wrapStyle.strip() theme.font_footer_color = theme.font_footer_color.strip() theme.font_footer_height = int(theme.font_footer_height.strip()) + theme.font_footer_indentation = \ + int(theme.font_footer_indentation.strip()) theme.font_footer_italics = str_to_bool(theme.font_footer_italics) theme.font_footer_name = theme.font_footer_name.strip() #theme.font_footer_override