Merge lp:~phill-ridout/openlp/1204629_2.0 into lp:openlp/2.0

Proposed by Phill
Status: Merged
Approved by: Andreas Preikschat
Approved revision: 2151
Merged at revision: 2150
Proposed branch: lp:~phill-ridout/openlp/1204629_2.0
Merge into: lp:openlp/2.0
Diff against target: 62 lines (+17/-10)
2 files modified
openlp/core/ui/themeform.py (+9/-1)
openlp/core/utils/__init__.py (+8/-9)
To merge this branch: bzr merge lp:~phill-ridout/openlp/1204629_2.0
Reviewer Review Type Date Requested Status
Andreas Preikschat (community) Approve
Tim Bentley Approve
Review via email: mp+177023@code.launchpad.net

This proposal supersedes a proposal from 2013-07-25.

Description of the change

Fixed #1204629 so that typing an image path actually changes the background.
Made the page validation more robust by including the fileDialog

To post a comment you must log in.
Revision history for this message
Tim Bentley (trb143) :
review: Approve
Revision history for this message
Andreas Preikschat (googol-deactivatedaccount) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openlp/core/ui/themeform.py'
2--- openlp/core/ui/themeform.py 2013-07-11 19:19:26 +0000
3+++ openlp/core/ui/themeform.py 2013-07-25 19:29:26 +0000
4@@ -78,6 +78,8 @@
5 QtCore.SIGNAL(u'clicked()'), self.onGradientEndButtonClicked)
6 QtCore.QObject.connect(self.imageBrowseButton,
7 QtCore.SIGNAL(u'clicked()'), self.onImageBrowseButtonClicked)
8+ QtCore.QObject.connect(self.imageFileEdit,
9+ QtCore.SIGNAL(u'editingFinished()'), self.onImageFileEditEditingFinished)
10 QtCore.QObject.connect(self.mainColorButton,
11 QtCore.SIGNAL(u'clicked()'), self.onMainColorButtonClicked)
12 QtCore.QObject.connect(self.outlineColorButton,
13@@ -233,7 +235,7 @@
14 background_image = BackgroundType.to_string(BackgroundType.Image)
15 if self.page(self.currentId()) == self.backgroundPage and \
16 self.theme.background_type == background_image and \
17- is_not_image_file(self.imageFileEdit.text()):
18+ is_not_image_file(self.theme.background_filename):
19 QtGui.QMessageBox.critical(self,
20 translate('OpenLP.ThemeWizard', 'Background Image Empty'),
21 translate('OpenLP.ThemeWizard', 'You have not selected a '
22@@ -545,6 +547,12 @@
23 self.theme.background_filename = unicode(filename)
24 self.setBackgroundPageValues()
25
26+ def onImageFileEditEditingFinished(self):
27+ """
28+ Background image path edited
29+ """
30+ self.theme.background_filename = unicode(self.imageFileEdit.text())
31+
32 def onMainColorButtonClicked(self):
33 self.theme.font_main_color = \
34 self._colorButton(self.theme.font_main_color)
35
36=== modified file 'openlp/core/utils/__init__.py'
37--- openlp/core/utils/__init__.py 2013-07-11 20:40:42 +0000
38+++ openlp/core/utils/__init__.py 2013-07-25 19:29:26 +0000
39@@ -371,15 +371,14 @@
40 ``file_name``
41 File name to be checked.
42 """
43- if file_name.isEmpty():
44- return True
45- else:
46- formats = [unicode(fmt).lower()
47- for fmt in QtGui.QImageReader.supportedImageFormats()]
48- file_part, file_extension = os.path.splitext(unicode(file_name))
49- if file_extension[1:].lower() in formats and os.path.exists(file_name):
50- return False
51- return True
52+ if not file_name:
53+ return True
54+ formats = [unicode(fmt).lower()
55+ for fmt in QtGui.QImageReader.supportedImageFormats()]
56+ file_part, file_extension = os.path.splitext(unicode(file_name))
57+ if file_extension[1:].lower() in formats and os.path.exists(file_name):
58+ return False
59+ return True
60
61 def join_url(base, *args):
62 """

Subscribers

People subscribed via source and target branches