openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #21138
[Merge] lp:~phill-ridout/openlp/1204629_2.0 into lp:openlp/2.0
Phill has proposed merging lp:~phill-ridout/openlp/1204629_2.0 into lp:openlp/2.0.
Requested reviews:
OpenLP Core (openlp-core)
For more details, see:
https://code.launchpad.net/~phill-ridout/openlp/1204629_2.0/+merge/177023
Fixed #1204629 so that typing an image path actually changes the background.
Made the page validation more robust by including the fileDialog
--
https://code.launchpad.net/~phill-ridout/openlp/1204629_2.0/+merge/177023
Your team OpenLP Core is requested to review the proposed merge of lp:~phill-ridout/openlp/1204629_2.0 into lp:openlp/2.0.
=== modified file 'openlp/core/ui/themeform.py'
--- openlp/core/ui/themeform.py 2013-07-11 19:19:26 +0000
+++ openlp/core/ui/themeform.py 2013-07-25 19:29:26 +0000
@@ -78,6 +78,8 @@
QtCore.SIGNAL(u'clicked()'), self.onGradientEndButtonClicked)
QtCore.QObject.connect(self.imageBrowseButton,
QtCore.SIGNAL(u'clicked()'), self.onImageBrowseButtonClicked)
+ QtCore.QObject.connect(self.imageFileEdit,
+ QtCore.SIGNAL(u'editingFinished()'), self.onImageFileEditEditingFinished)
QtCore.QObject.connect(self.mainColorButton,
QtCore.SIGNAL(u'clicked()'), self.onMainColorButtonClicked)
QtCore.QObject.connect(self.outlineColorButton,
@@ -233,7 +235,7 @@
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()):
+ 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 '
@@ -545,6 +547,12 @@
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):
self.theme.font_main_color = \
self._colorButton(self.theme.font_main_color)
=== modified file 'openlp/core/utils/__init__.py'
--- openlp/core/utils/__init__.py 2013-07-11 20:40:42 +0000
+++ openlp/core/utils/__init__.py 2013-07-25 19:29:26 +0000
@@ -371,15 +371,14 @@
``file_name``
File name to be checked.
"""
- if file_name.isEmpty():
- return True
- else:
- formats = [unicode(fmt).lower()
- for fmt in QtGui.QImageReader.supportedImageFormats()]
- file_part, file_extension = os.path.splitext(unicode(file_name))
- if file_extension[1:].lower() in formats and os.path.exists(file_name):
- return False
- return True
+ if not file_name:
+ return True
+ formats = [unicode(fmt).lower()
+ for fmt in QtGui.QImageReader.supportedImageFormats()]
+ file_part, file_extension = os.path.splitext(unicode(file_name))
+ if file_extension[1:].lower() in formats and os.path.exists(file_name):
+ return False
+ return True
def join_url(base, *args):
"""
Follow ups