Merge lp://qastaging/~chris.2ndtheme/openlp/secondTheme into lp://qastaging/openlp

Proposed by Christian Wöhr
Status: Needs review
Proposed branch: lp://qastaging/~chris.2ndtheme/openlp/secondTheme
Merge into: lp://qastaging/openlp
Diff against target: 1665 lines (+1017/-47)
15 files modified
openlp/core/common/uistrings.py (+1/-0)
openlp/core/lib/formattingtags.py (+29/-2)
openlp/core/lib/json/theme.json (+20/-0)
openlp/core/lib/renderer.py (+11/-2)
openlp/core/lib/theme.py (+93/-0)
openlp/core/ui/themeform.py (+88/-0)
openlp/core/ui/thememanager.py (+8/-1)
openlp/core/ui/themewizard.py (+105/-0)
openlp/plugins/songs/forms/editversedialog.py (+4/-0)
openlp/plugins/songs/forms/editverseform.py (+67/-0)
resources/forms/editversedialog.ui (+29/-13)
resources/forms/themewizard.ui (+506/-28)
tests/functional/openlp_core_lib/test_theme.py (+2/-1)
tests/functional/openlp_plugins/songs/test_editverseform.py (+43/-0)
tests/resources/themes/Default/Default.xml (+11/-0)
To merge this branch: bzr merge lp://qastaging/~chris.2ndtheme/openlp/secondTheme
Reviewer Review Type Date Requested Status
Tim Bentley Needs Fixing
Raoul Snyman Needs Fixing
Review via email: mp+294047@code.qastaging.launchpad.net

Description of the change

This Branch has a Solution for dual language support of Songs.

It has an extension to the Themewizard and the Songedit (editverseform.py).

This way we are using a now reserved Tag secondTheme.
SecondTheme is using the CSS of a second Fontset that can be configured in the Theme via Themewizard.
This way you don't need to go through all songs in case you are changing the apparance of your service.

To post a comment you must log in.
Revision history for this message
Christian Wöhr (chris.2ndtheme) wrote :

For a more user friendly appearance to add the second Language style to the songs the editverseform.py has a Format button (please rename) that is encapsulating the current paragraph in the secondFont tag or will remove the existing secondFont tag.

Revision history for this message
Raoul Snyman (raoul-snyman) wrote :

Please see my comments.

Also, you need tests. http://wiki.openlp.org/Development:Unit_Tests

review: Needs Fixing
Revision history for this message
Tim Bentley (trb143) wrote :
Download full text (25.9 KiB)

Also this links themes and formatting tags together which they are not and
would fail to render correctly. Please can you describe the required
outcome so the correct design can be implemented
On 7 May 2016 17:43, "Raoul Snyman" <email address hidden> wrote:

> Review: Needs Fixing
>
> Please see my comments.
>
> Also, you need tests. http://wiki.openlp.org/Development:Unit_Tests
>
> Diff comments:
>
> >
> > === modified file 'openlp/core/lib/formattingtags.py'
> > --- openlp/core/lib/formattingtags.py 2015-12-31 22:46:06 +0000
> > +++ openlp/core/lib/formattingtags.py 2016-05-06 20:11:35 +0000
> > @@ -22,10 +22,10 @@
> > """
> > Provide HTML Tag management and Formatting Tag access class
> > """
> > -import json
> > +import json, os
>
> Please separate the imports. See
> http://wiki.openlp.org/Development:Coding_Standards#Imports
>
> >
> > -from openlp.core.common import Settings
> > -from openlp.core.lib import translate
> > +from openlp.core.common import Settings, AppLocation
> > +from openlp.core.lib import translate, theme, get_text_file_string
>
> Rather import objects than entire modules. See the last section in
> "Imports": http://wiki.openlp.org/Development:Coding_Standards#Imports
>
> Rather do this:
>
> from openlp.core.lib import translate, get_text_file_string
> from openlp.core.lib.theme import ThemeXML
>
> >
> >
> > class FormattingTags(object):
> >
> > === modified file 'openlp/core/lib/theme.py'
> > --- openlp/core/lib/theme.py 2015-12-31 22:46:06 +0000
> > +++ openlp/core/lib/theme.py 2016-05-06 20:11:35 +0000
> > @@ -318,6 +318,69 @@
> > element.appendChild(value)
> > background.appendChild(element)
> >
> > + def add_font2(self, name, color, size, override, fonttype='second',
> bold='False', italics='False',
>
> Ugh, please don't call things "blah2", make them more descriptive:
> "add_second_font"
>
> > + line_adjustment=0, xpos=0, ypos=0, width=0, height=0,
> outline='False', outline_color='#ffffff',
> > + outline_pixel=2, shadow='False',
> shadow_color='#ffffff', shadow_pixel=5):
> > + """
> > + Add a Font.
> > +
> > + :param name: The name of the font.
> > + :param color: The colour of the font.
> > + :param size: The size of the font.
> > + :param override: Whether or not to override the default
> positioning of the theme.
> > + :param fonttype: The type of font, ``main`` or ``footer``.
> Defaults to ``main``.
> > + :param bold:
> > + :param italics: The weight of then font Defaults to 50 Normal
> > + :param line_adjustment: Does the font render to italics
> Defaults to 0 Normal
> > + :param xpos: The X position of the text block.
> > + :param ypos: The Y position of the text block.
> > + :param width: The width of the text block.
> > + :param height: The height of the text block.
> > + :param outline: Whether or not to show an outline.
> > + :param outline_color: The colour of the outline.
> > + :param outline_pixel: How big the Shadow is
> > + :param shadow: Whether or not to show a shadow.
> > + :param shadow_color: The colour o...

Revision history for this message
Tim Bentley (trb143) wrote :

Reviewed the usibility of this and it does not fully work.
Formatting tags for things like color are broken.
The ability to change the font (shadow and outline) size for the second theme are ignored by the renderer. Change the font and text will not display.

Colours would be OK but things which change display size need to be managed correctly.
You need to consider how the screen is sized and rendered for this to work well.
A good idea.

review: Needs Fixing
2658. By Christian Wöhr

rename of variables

2659. By Christian Wöhr

unlinked formattingtags and theme again

Revision history for this message
Christian Wöhr (chris.2ndtheme) wrote :

renderer._paginate_slide seems to take care about display size including the size changes of the secondaryTheme CSS.

Changed most names to make the code readable (still working on whitespaces)
font color is working now. Changed the renderer Preview to show the css of the secondary Theme in the themewizard.

Currently Working on Tests and Whitespaces.

2660. By Christian Wöhr

Added Tests
removed unnecessary imports

Unmerged revisions

2660. By Christian Wöhr

Added Tests
removed unnecessary imports

2659. By Christian Wöhr

unlinked formattingtags and theme again

2658. By Christian Wöhr

rename of variables

2657. By Christian Wöhr

Init

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.