From 3236af354c1da802bcf80ece1199d19316ea095a Mon Sep 17 00:00:00 2001 From: Philip Ridout Date: Thu, 25 Jul 2013 21:11:57 +0100 Subject: [PATCH 1/2] fixed #1204629 and made the validation more robust by checking the open dialog --- openlp/core/ui/themeform.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index 007932f6e..edb8f26b6 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -71,6 +71,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): self.gradientStartButton.clicked.connect(self.onGradientStartButtonClicked) self.gradientEndButton.clicked.connect(self.onGradientEndButtonClicked) self.imageBrowseButton.clicked.connect(self.onImageBrowseButtonClicked) + self.imageFileEdit.editingFinished.connect(self.onImageFileEditEditingFinished) self.mainColorButton.clicked.connect(self.onMainColorButtonClicked) self.outlineColorButton.clicked.connect(self.onOutlineColorButtonClicked) self.shadowColorButton.clicked.connect(self.onShadowColorButtonClicked) @@ -441,6 +442,12 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): self.theme.background_filename = unicode(filename) self.setBackgroundPageValues() + def onImageFileEditEditingFinished(self): + """ + Background image path edited + """ + self.theme.background_filename = unicode(self.imageFileEdit.text()) + def onMainColorButtonClicked(self): """ Set the main colour value From 57cf6d5445002ececdf2015b1a71d6669b7a4586 Mon Sep 17 00:00:00 2001 From: Philip Ridout Date: Fri, 26 Jul 2013 21:17:51 +0100 Subject: [PATCH 2/2] actually changed validation this time --- openlp/core/ui/themeform.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index edb8f26b6..9a38b1f5f 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -179,7 +179,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): """ background_image = BackgroundType.to_string(BackgroundType.Image) if self.page(self.currentId()) == self.backgroundPage and \ - self.theme.background_type == background_image and is_not_image_file(self.imageFileEdit.text()): + self.theme.background_type == background_image and is_not_image_file(self.theme.background_filename): 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.'))