Merge lp:~trb143/openlp/features-198 into lp:openlp

Proposed by Tim Bentley
Status: Merged
Approved by: Andreas Preikschat
Approved revision: 1557
Merged at revision: 1762
Proposed branch: lp:~trb143/openlp/features-198
Merge into: lp:openlp
Diff against target: 58 lines (+11/-4)
3 files modified
openlp/core/lib/htmlbuilder.py (+6/-2)
openlp/core/lib/theme.py (+2/-1)
openlp/core/ui/themewizard.py (+3/-1)
To merge this branch: bzr merge lp:~trb143/openlp/features-198
Reviewer Review Type Date Requested Status
Andreas Preikschat (community) Approve
Review via email: mp+76887@code.launchpad.net

Description of the change

Add the option to allow Justify from themes

To post a comment you must log in.
Revision history for this message
Andreas Preikschat (googol-deactivatedaccount) wrote :

Nice...
Do we need to increase any version number, because themes won't be compatible with older revisions.

review: Needs Information
Revision history for this message
Andreas Preikschat (googol-deactivatedaccount) wrote :

:-)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openlp/core/lib/htmlbuilder.py'
2--- openlp/core/lib/htmlbuilder.py 2011-07-20 13:05:30 +0000
3+++ openlp/core/lib/htmlbuilder.py 2011-09-25 06:43:52 +0000
4@@ -557,11 +557,15 @@
5 left_margin = int(theme.font_main_outline_size) * 2
6 else:
7 left_margin = 0
8- lyrics = u'white-space:pre-wrap; word-wrap: break-word; ' \
9+ justify = u'white-space:pre-wrap;'
10+ # fix tag incompatibilities
11+ if theme.display_horizontal_align == HorizontalType.Justify:
12+ justify = u''
13+ lyrics = u'%s word-wrap: break-word; ' \
14 'text-align: %s; vertical-align: %s; font-family: %s; ' \
15 'font-size: %spt; color: %s; line-height: %d%%; margin: 0;' \
16 'padding: 0; padding-left: %spx; width: %spx; height: %spx; ' % \
17- (align, valign, theme.font_main_name, theme.font_main_size,
18+ (justify, align, valign, theme.font_main_name, theme.font_main_size,
19 theme.font_main_color, 100 + int(theme.font_main_line_adjustment),
20 left_margin, width, height)
21 if theme.font_main_outline:
22
23=== modified file 'openlp/core/lib/theme.py'
24--- openlp/core/lib/theme.py 2011-08-20 11:45:06 +0000
25+++ openlp/core/lib/theme.py 2011-09-25 06:43:52 +0000
26@@ -176,8 +176,9 @@
27 Left = 0
28 Right = 1
29 Center = 2
30+ Justify = 3
31
32- Names = [u'left', u'right', u'center']
33+ Names = [u'left', u'right', u'center', u'justify']
34
35
36 class VerticalType(object):
37
38=== modified file 'openlp/core/ui/themewizard.py'
39--- openlp/core/ui/themewizard.py 2011-08-25 18:33:25 +0000
40+++ openlp/core/ui/themewizard.py 2011-09-25 06:43:52 +0000
41@@ -246,7 +246,7 @@
42 self.horizontalLabel = QtGui.QLabel(self.alignmentPage)
43 self.horizontalLabel.setObjectName(u'HorizontalLabel')
44 self.horizontalComboBox = QtGui.QComboBox(self.alignmentPage)
45- self.horizontalComboBox.addItems([u'', u'', u''])
46+ self.horizontalComboBox.addItems([u'', u'', u'', u''])
47 self.horizontalComboBox.setObjectName(u'HorizontalComboBox')
48 self.alignmentLayout.addRow(self.horizontalLabel,
49 self.horizontalComboBox)
50@@ -495,6 +495,8 @@
51 translate('OpenLP.ThemeWizard', 'Right'))
52 self.horizontalComboBox.setItemText(HorizontalType.Center,
53 translate('OpenLP.ThemeWizard', 'Center'))
54+ self.horizontalComboBox.setItemText(HorizontalType.Justify,
55+ translate('OpenLP.ThemeWizard', 'Justify'))
56 self.transitionsLabel.setText(
57 translate('OpenLP.ThemeWizard', 'Transitions:'))
58 self.areaPositionPage.setTitle(