forked from openlp/openlp
reverted parent() change
This commit is contained in:
parent
3fc52181a5
commit
f74c16b03b
@ -54,6 +54,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
|
|||||||
The QWidget-derived parent of the wizard.
|
The QWidget-derived parent of the wizard.
|
||||||
"""
|
"""
|
||||||
QtGui.QWizard.__init__(self, parent)
|
QtGui.QWizard.__init__(self, parent)
|
||||||
|
self.thememanager = parent
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self.registerFields()
|
self.registerFields()
|
||||||
self.updateThemeAllowed = True
|
self.updateThemeAllowed = True
|
||||||
@ -194,7 +195,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
|
|||||||
# Do not trigger on start up
|
# Do not trigger on start up
|
||||||
if self.currentPage != self.welcomePage:
|
if self.currentPage != self.welcomePage:
|
||||||
self.updateTheme()
|
self.updateTheme()
|
||||||
self.parent().generateImage(self.theme, True)
|
self.thememanager.generateImage(self.theme, True)
|
||||||
|
|
||||||
def updateLinesText(self, lines):
|
def updateLinesText(self, lines):
|
||||||
"""
|
"""
|
||||||
@ -230,7 +231,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
|
|||||||
self.setOption(QtGui.QWizard.HaveCustomButton1, enabled)
|
self.setOption(QtGui.QWizard.HaveCustomButton1, enabled)
|
||||||
if self.page(pageId) == self.previewPage:
|
if self.page(pageId) == self.previewPage:
|
||||||
self.updateTheme()
|
self.updateTheme()
|
||||||
frame = self.parent().generateImage(self.theme)
|
frame = self.thememanager.generateImage(self.theme)
|
||||||
self.previewBoxLabel.setPixmap(frame)
|
self.previewBoxLabel.setPixmap(frame)
|
||||||
self.displayAspectRatio = float(frame.width()) / frame.height()
|
self.displayAspectRatio = float(frame.width()) / frame.height()
|
||||||
self.resizeEvent()
|
self.resizeEvent()
|
||||||
@ -240,16 +241,16 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
|
|||||||
Generate layout preview and display the form.
|
Generate layout preview and display the form.
|
||||||
"""
|
"""
|
||||||
self.updateTheme()
|
self.updateTheme()
|
||||||
width = self.parent().mainwindow.renderer.width
|
width = self.thememanager.mainwindow.renderer.width
|
||||||
height = self.parent().mainwindow.renderer.height
|
height = self.thememanager.mainwindow.renderer.height
|
||||||
pixmap = QtGui.QPixmap(width, height)
|
pixmap = QtGui.QPixmap(width, height)
|
||||||
pixmap.fill(QtCore.Qt.white)
|
pixmap.fill(QtCore.Qt.white)
|
||||||
paint = QtGui.QPainter(pixmap)
|
paint = QtGui.QPainter(pixmap)
|
||||||
paint.setPen(QtGui.QPen(QtCore.Qt.blue, 2))
|
paint.setPen(QtGui.QPen(QtCore.Qt.blue, 2))
|
||||||
paint.drawRect(self.parent().mainwindow.renderer.
|
paint.drawRect(self.thememanager.mainwindow.renderer.
|
||||||
get_main_rectangle(self.theme))
|
get_main_rectangle(self.theme))
|
||||||
paint.setPen(QtGui.QPen(QtCore.Qt.red, 2))
|
paint.setPen(QtGui.QPen(QtCore.Qt.red, 2))
|
||||||
paint.drawRect(self.parent().mainwindow.renderer.
|
paint.drawRect(self.thememanager.mainwindow.renderer.
|
||||||
get_footer_rectangle(self.theme))
|
get_footer_rectangle(self.theme))
|
||||||
paint.end()
|
paint.end()
|
||||||
self.themeLayoutForm.exec_(pixmap)
|
self.themeLayoutForm.exec_(pixmap)
|
||||||
@ -620,9 +621,9 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
|
|||||||
saveTo = os.path.join(self.path, self.theme.theme_name, filename)
|
saveTo = os.path.join(self.path, self.theme.theme_name, filename)
|
||||||
saveFrom = self.theme.background_filename
|
saveFrom = self.theme.background_filename
|
||||||
if not self.edit_mode and not \
|
if not self.edit_mode and not \
|
||||||
self.parent().checkIfThemeExists(self.theme.theme_name):
|
self.thememanager.checkIfThemeExists(self.theme.theme_name):
|
||||||
return
|
return
|
||||||
self.parent().saveTheme(self.theme, saveFrom, saveTo)
|
self.thememanager.saveTheme(self.theme, saveFrom, saveTo)
|
||||||
return QtGui.QDialog.accept(self)
|
return QtGui.QDialog.accept(self)
|
||||||
|
|
||||||
def _colorButton(self, field):
|
def _colorButton(self, field):
|
||||||
|
Loading…
Reference in New Issue
Block a user