forked from openlp/openlp
Fix theme loading logic and missing item from cleaning
This commit is contained in:
parent
b6eadecb46
commit
b79d535e04
@ -184,7 +184,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
|
|||||||
|
|
||||||
def loadTheme(self, theme):
|
def loadTheme(self, theme):
|
||||||
log.debug(u'LoadTheme %s', 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!
|
# Stop the initial screen setup generating 1 preview per field!
|
||||||
self.allowPreview = False
|
self.allowPreview = False
|
||||||
self.paintUi(self.theme)
|
self.paintUi(self.theme)
|
||||||
|
@ -150,15 +150,17 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
self.pushThemes()
|
self.pushThemes()
|
||||||
|
|
||||||
def onAddTheme(self):
|
def onAddTheme(self):
|
||||||
self.amendThemeForm.loadTheme(None)
|
theme = self.createThemeFromXml(self.baseTheme(), self.path)
|
||||||
|
self.amendThemeForm.loadTheme(theme)
|
||||||
self.saveThemeName = u''
|
self.saveThemeName = u''
|
||||||
self.amendThemeForm.exec_()
|
self.amendThemeForm.exec_()
|
||||||
|
|
||||||
def onEditTheme(self):
|
def onEditTheme(self):
|
||||||
item = self.ThemeListWidget.currentItem()
|
item = self.ThemeListWidget.currentItem()
|
||||||
if item:
|
if item:
|
||||||
self.amendThemeForm.loadTheme(
|
theme = self.getThemeData(
|
||||||
unicode(item.data(QtCore.Qt.UserRole).toString()))
|
unicode(item.data(QtCore.Qt.UserRole).toString()))
|
||||||
|
self.amendThemeForm.loadTheme(theme)
|
||||||
self.saveThemeName = unicode(
|
self.saveThemeName = unicode(
|
||||||
item.data(QtCore.Qt.UserRole).toString())
|
item.data(QtCore.Qt.UserRole).toString())
|
||||||
self.amendThemeForm.exec_()
|
self.amendThemeForm.exec_()
|
||||||
@ -265,7 +267,7 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
self.pushThemes()
|
self.pushThemes()
|
||||||
|
|
||||||
def pushThemes(self):
|
def pushThemes(self):
|
||||||
Receiver().send_message(u'update_themes', self.getThemes() )
|
Receiver().send_message(u'update_themes', self.getThemes())
|
||||||
|
|
||||||
def getThemes(self):
|
def getThemes(self):
|
||||||
return self.themelist
|
return self.themelist
|
||||||
@ -501,6 +503,8 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
theme.display_wrapStyle = theme.display_wrapStyle.strip()
|
theme.display_wrapStyle = theme.display_wrapStyle.strip()
|
||||||
theme.font_footer_color = theme.font_footer_color.strip()
|
theme.font_footer_color = theme.font_footer_color.strip()
|
||||||
theme.font_footer_height = int(theme.font_footer_height.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_italics = str_to_bool(theme.font_footer_italics)
|
||||||
theme.font_footer_name = theme.font_footer_name.strip()
|
theme.font_footer_name = theme.font_footer_name.strip()
|
||||||
#theme.font_footer_override
|
#theme.font_footer_override
|
||||||
|
Loading…
Reference in New Issue
Block a user