openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #17188
[Merge] lp:~raoul-snyman/openlp/bug-1051971 into lp:openlp
Raoul Snyman has proposed merging lp:~raoul-snyman/openlp/bug-1051971 into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
Related bugs:
Bug #1051971 in OpenLP: "Not adding an image to a new theme causes a traceback"
https://bugs.launchpad.net/openlp/+bug/1051971
For more details, see:
https://code.launchpad.net/~raoul-snyman/openlp/bug-1051971/+merge/124807
Fixed bug #1051971 where we weren't validating that a user had actually selected a file.
--
https://code.launchpad.net/~raoul-snyman/openlp/bug-1051971/+merge/124807
Your team OpenLP Core is requested to review the proposed merge of lp:~raoul-snyman/openlp/bug-1051971 into lp:openlp.
=== modified file 'openlp/core/ui/themeform.py'
--- openlp/core/ui/themeform.py 2012-07-08 08:23:56 +0000
+++ openlp/core/ui/themeform.py 2012-09-17 21:34:21 +0000
@@ -157,7 +157,8 @@
u'outlineColorButton', self.outlineColorButton)
self.mainAreaPage.registerField(
u'outlineSizeSpinBox', self.outlineSizeSpinBox)
- self.mainAreaPage.registerField(u'shadowCheckBox', self.shadowCheckBox)
+ self.mainAreaPage.registerField(
+ u'shadowCheckBox', self.shadowCheckBox)
self.mainAreaPage.registerField(
u'mainBoldCheckBox', self.mainBoldCheckBox)
self.mainAreaPage.registerField(
@@ -168,8 +169,10 @@
u'shadowSizeSpinBox', self.shadowSizeSpinBox)
self.mainAreaPage.registerField(
u'footerSizeSpinBox', self.footerSizeSpinBox)
- self.areaPositionPage.registerField(u'mainPositionX', self.mainXSpinBox)
- self.areaPositionPage.registerField(u'mainPositionY', self.mainYSpinBox)
+ self.areaPositionPage.registerField(
+ u'mainPositionX', self.mainXSpinBox)
+ self.areaPositionPage.registerField(
+ u'mainPositionY', self.mainYSpinBox)
self.areaPositionPage.registerField(
u'mainPositionWidth', self.mainWidthSpinBox)
self.areaPositionPage.registerField(
@@ -202,7 +205,8 @@
"""
Updates the lines on a page on the wizard
"""
- self.mainLineCountLabel.setText(unicode(translate('OpenLP.ThemeForm',
+ self.mainLineCountLabel.setText(unicode(translate(
+ 'OpenLP.ThemeWizard',
'(approximately %d lines per slide)')) % int(lines))
def resizeEvent(self, event=None):
@@ -224,6 +228,19 @@
self.previewBoxLabel.setFixedSize(pixmapWidth + 2 * frameWidth,
pixmapHeight + 2 * frameWidth)
+ def validateCurrentPage(self):
+ if self.page(self.currentId()) == self.backgroundPage and \
+ self.theme.background_type == \
+ BackgroundType.to_string(BackgroundType.Image) and \
+ unicode(self.imageFileEdit.text()) == u'':
+ QtGui.QMessageBox.critical(self,
+ translate('OpenLP.ThemeWizard', 'Background Image Empty'),
+ translate('OpenLP.ThemeWizard', 'You have not selected a '
+ 'background image. Please select one before continuing.'))
+ return False
+ else:
+ return True
+
def onCurrentIdChanged(self, pageId):
"""
Detects Page changes and updates as appropriate.
@@ -521,7 +538,7 @@
images_filter = u'%s;;%s (*.*) (*)' % (
images_filter, UiStrings().AllFiles)
filename = QtGui.QFileDialog.getOpenFileName(self,
- translate('OpenLP.ThemeForm', 'Select Image'), u'',
+ translate('OpenLP.ThemeWizard', 'Select Image'), u'',
images_filter)
if filename:
self.theme.background_filename = unicode(filename)
@@ -603,14 +620,14 @@
self.theme.theme_name = unicode(self.field(u'name').toString())
if not self.theme.theme_name:
critical_error_message_box(
- translate('OpenLP.ThemeForm', 'Theme Name Missing'),
- translate('OpenLP.ThemeForm',
+ translate('OpenLP.ThemeWizard', 'Theme Name Missing'),
+ translate('OpenLP.ThemeWizard',
'There is no name for this theme. Please enter one.'))
return
if self.theme.theme_name == u'-1' or self.theme.theme_name == u'None':
critical_error_message_box(
- translate('OpenLP.ThemeForm', 'Theme Name Invalid'),
- translate('OpenLP.ThemeForm',
+ translate('OpenLP.ThemeWizard', 'Theme Name Invalid'),
+ translate('OpenLP.ThemeWizard',
'Invalid theme name. Please enter one.'))
return
saveFrom = None
Follow ups