From c2b822872993a6af3e652063c2b3ef26141eda3c Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Fri, 10 Dec 2010 07:09:03 +0200 Subject: [PATCH 001/243] Updates to documentation. --- documentation/api/source/core/theme.rst | 6 +- documentation/api/source/plugins/bibles.rst | 2 +- documentation/manual/source/dualmonitors.rst | 12 ++-- openlp/core/theme/theme.py | 74 ++++++++++++-------- openlp/core/utils/__init__.py | 2 +- 5 files changed, 55 insertions(+), 41 deletions(-) diff --git a/documentation/api/source/core/theme.rst b/documentation/api/source/core/theme.rst index 3dbc7a6ec..3621c6581 100644 --- a/documentation/api/source/core/theme.rst +++ b/documentation/api/source/core/theme.rst @@ -1,8 +1,10 @@ .. _core-theme: -:mod:`theme` Module -=================== +Theme Function Library +====================== .. automodule:: openlp.core.theme :members: +.. autoclass:: openlp.core.theme.theme.Theme + :members: diff --git a/documentation/api/source/plugins/bibles.rst b/documentation/api/source/plugins/bibles.rst index 67162d414..c89f9c6ae 100644 --- a/documentation/api/source/plugins/bibles.rst +++ b/documentation/api/source/plugins/bibles.rst @@ -18,7 +18,7 @@ Forms .. automodule:: openlp.plugins.bibles.forms :members: -.. autoclass:: openlp.plugins.bibles.forms.importwizardform.ImportWizardForm +.. autoclass:: openlp.plugins.bibles.forms.bibleimportform.BibleImportForm :members: Helper Classes & Functions diff --git a/documentation/manual/source/dualmonitors.rst b/documentation/manual/source/dualmonitors.rst index 7e5fdc19b..ee4bc90a2 100644 --- a/documentation/manual/source/dualmonitors.rst +++ b/documentation/manual/source/dualmonitors.rst @@ -149,15 +149,15 @@ Or, as root:: root@linux: # nividia-settings If you do not want to write the changes to your ``xorg.conf`` file simply run -the nVidia Settings program (``nvidia-settings``) from your desktop's menu, -usually in an administration or system menu, or from the terminal as a normal -user run:: +the nVidia Settings program (:command:`nvidia-settings`) from your desktop's +menu, usually in an administration or system menu, or from the terminal as a +normal user run:: user@linux:~ $ nvidia-settings -Once you have opened nVidia Settings, click on -:guilabel:`X Server Display Configuration`. Then select the monitor you are -wanting to use as your second monitor and click :guilabel:`Configure`. +Once you have opened nVidia Settings, click on :guilabel:`X Server Display +Configuration`. Then select the monitor you are wanting to use as your second +monitor and click :guilabel:`Configure`. .. image:: pics/nvlinux1.png diff --git a/openlp/core/theme/theme.py b/openlp/core/theme/theme.py index 52dda1631..6b6740b07 100644 --- a/openlp/core/theme/theme.py +++ b/openlp/core/theme/theme.py @@ -68,38 +68,45 @@ class Theme(object): Theme name ``BackgroundMode`` - The behaviour of the background. Valid modes are: - - 0 - Transparent - - 1 - Opaque + The behaviour of the background. Valid modes are: + + * ``0`` - Transparent + * ``1`` - Opaque ``BackgroundType`` - The content of the background. Valid types are: - - 0 - solid color - - 1 - gradient color - - 2 - image + The content of the background. Valid types are: + + * ``0`` - solid color + * ``1`` - gradient color + * ``2`` - image ``BackgroundParameter1`` - Extra information about the background. The contents of this attribute + Extra information about the background. The contents of this attribute depend on the BackgroundType: - - image: image filename - - gradient: start color - - solid: color + + * ``image`` - image filename + * ``gradient`` - start color + * ``solid`` - color ``BackgroundParameter2`` Extra information about the background. The contents of this attribute depend on the BackgroundType: - - image: border color - - gradient: end color - - solid: N/A + + * ``image`` - border color + * ``gradient`` - end color + * ``solid`` - N/A ``BackgroundParameter3`` Extra information about the background. The contents of this attribute depend on the BackgroundType: - - image: N/A - - gradient: The direction of the gradient. Valid entries are: - - 0 -> vertical - - 1 -> horizontal - - solid: N/A + + * ``image`` - N/A + * ``gradient`` - The direction of the gradient. Valid entries are: + + * ``0`` - vertical + * ``1`` - horizontal + + * ``solid`` - N/A ``FontName`` Name of the font to use for the main font. @@ -115,36 +122,41 @@ class Theme(object): ``Shadow`` The shadow type to apply to the main font. - - 0 - no shadow - - non-zero - use shadow + + * ``0`` - no shadow + * non-zero - use shadow ``ShadowColor`` Color for the shadow ``Outline`` The outline to apply to the main font - - 0 - no outline - - non-zero - use outline + + * ``0`` - no outline + * non-zero - use outline ``OutlineColor`` Color for the outline (or None if Outline is 0) ``HorizontalAlign`` The horizontal alignment to apply to text. Valid alignments are: - - 0 - left align - - 1 - right align - - 2 - centre align + + * ``0`` - left align + * ``1`` - right align + * ``2`` - centre align ``VerticalAlign`` The vertical alignment to apply to the text. Valid alignments are: - - 0 - top align - - 1 - bottom align - - 2 - centre align + + * ``0`` - top align + * ``1`` - bottom align + * ``2`` - centre align ``WrapStyle`` The wrap style to apply to the text. Valid styles are: - - 0 - normal - - 1 - lyrics + + * ``0`` - normal + * ``1`` - lyrics """ def __init__(self, xml): """ diff --git a/openlp/core/utils/__init__.py b/openlp/core/utils/__init__.py index 119bf6b55..f33d7ca04 100644 --- a/openlp/core/utils/__init__.py +++ b/openlp/core/utils/__init__.py @@ -24,7 +24,7 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### """ -The :mod:`utils` module provides the utility libraries for OpenLP +The :mod:`openlp.core.utils` module provides the utility libraries for OpenLP. """ import logging From 40ddcd1010e21638a7b057476bf514251bec6e3c Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Fri, 10 Dec 2010 14:52:43 +0200 Subject: [PATCH 002/243] Added a qthelp theme, updated the manual to work better as Qt help. --- documentation/manual/source/conf.py | 20 +- documentation/manual/source/index.rst | 7 - .../manual/themes/openlp_qthelp/layout.html | 68 ++++ .../openlp_qthelp/static/alert_info_32.png | Bin 0 -> 1168 bytes .../openlp_qthelp/static/alert_warning_32.png | Bin 0 -> 1060 bytes .../themes/openlp_qthelp/static/bg-page.png | Bin 0 -> 164 bytes .../openlp_qthelp/static/bullet_orange.png | Bin 0 -> 365 bytes .../openlp_qthelp/static/openlp_qthelp.css_t | 372 ++++++++++++++++++ .../manual/themes/openlp_qthelp/theme.conf | 12 + 9 files changed, 462 insertions(+), 17 deletions(-) create mode 100644 documentation/manual/themes/openlp_qthelp/layout.html create mode 100644 documentation/manual/themes/openlp_qthelp/static/alert_info_32.png create mode 100644 documentation/manual/themes/openlp_qthelp/static/alert_warning_32.png create mode 100644 documentation/manual/themes/openlp_qthelp/static/bg-page.png create mode 100644 documentation/manual/themes/openlp_qthelp/static/bullet_orange.png create mode 100644 documentation/manual/themes/openlp_qthelp/static/openlp_qthelp.css_t create mode 100644 documentation/manual/themes/openlp_qthelp/theme.conf diff --git a/documentation/manual/source/conf.py b/documentation/manual/source/conf.py index 517fc2f44..70b4fb2f6 100644 --- a/documentation/manual/source/conf.py +++ b/documentation/manual/source/conf.py @@ -92,22 +92,22 @@ pygments_style = 'sphinx' # The theme to use for HTML and HTML Help pages. Major themes that come with # Sphinx are currently 'default' and 'sphinxdoc'. -html_theme = 'default' +html_theme = 'openlp_qthelp' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. -html_theme_options = { - 'sidebarbgcolor': '#3a60a9', - 'relbarbgcolor': '#203b6f', - 'footerbgcolor': '#26437c', - 'headtextcolor': '#203b6f', - 'linkcolor': '#26437c', - 'sidebarlinkcolor': '#ceceff' -} +#html_theme_options = { +# 'sidebarbgcolor': '#3a60a9', +# 'relbarbgcolor': '#203b6f', +# 'footerbgcolor': '#26437c', +# 'headtextcolor': '#203b6f', +# 'linkcolor': '#26437c', +# 'sidebarlinkcolor': '#ceceff' +#} # Add any paths that contain custom themes here, relative to this directory. -#html_theme_path = [] +html_theme_path = [u'../themes'] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". diff --git a/documentation/manual/source/index.rst b/documentation/manual/source/index.rst index 5786af1ae..378cfe2a0 100644 --- a/documentation/manual/source/index.rst +++ b/documentation/manual/source/index.rst @@ -17,10 +17,3 @@ Contents: mediamanager songs -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` - diff --git a/documentation/manual/themes/openlp_qthelp/layout.html b/documentation/manual/themes/openlp_qthelp/layout.html new file mode 100644 index 000000000..d16116773 --- /dev/null +++ b/documentation/manual/themes/openlp_qthelp/layout.html @@ -0,0 +1,68 @@ +{# + openlp_qthelp/layout.html + ~~~~~~~~~~~~~~~~~ + + Sphinx layout template for the openlp_qthelp theme. + + :copyright: Copyright 2004-2010 Raoul Snyman. + :license: GPL +#} +{% extends "basic/layout.html" %} +{% set script_files = script_files + ['_static/theme_extras.js'] %} +{% set css_files = css_files + ['_static/print.css'] %} + +{# do not display relbars #} +{% block relbar1 %}{% endblock %} +{% block relbar2 %}{% endblock %} + +{% macro nav() %} +

+ {%- block openlp_qthelprel1 %} + {%- endblock %} + {%- if prev %} + «  {{ prev.title }} +   ::   + {%- endif %} + {{ _('Contents') }} + {%- if next %} +   ::   + {{ next.title }}  » + {%- endif %} + {%- block openlp_qthelprel2 %} + {%- endblock %} +

+{% endmacro %} + +{% block content %} + +
+ {{ nav() }} +
+
+ {#{%- if display_toc %} +
+

Table Of Contents

+ {{ toc }} +
+ {%- endif %}#} + {% block body %}{% endblock %} +
+
+ {{ nav() }} +
+{% endblock %} diff --git a/documentation/manual/themes/openlp_qthelp/static/alert_info_32.png b/documentation/manual/themes/openlp_qthelp/static/alert_info_32.png new file mode 100644 index 0000000000000000000000000000000000000000..05b4fe898c39c93ca6041650c49dcb67e6595432 GIT binary patch literal 1168 zcmV;B1aJF^P)KB1(GEo2OU5dU1MjixU?b4HlPyU1Z#btg*bwF1uutH8k9WJ2h0&wD~{( zq-o+GmX3s=tgtkx6sd&#N1|j3;?zy1&gP$OUftcd7w1f`OJdNyJ@D}3at=J7^L(D) z@0<(&9%FzO;23Zx%%eaiyjIkB8aP38t}OABtn!#B-zOp)1W5rW!h4DmV}O&y+vS@2 z<;@zBYwDM!&dcJz3U7yC(lA6(I*}ndPi}fv)oZ0Cd!*`hlAE5D)tnL~-wInJs8Xn- z;BnNdevvmjC_bcM^=3JVi=2-_f-A>c?c0J1jWPq`Vvli%yW49O;*6{X(`TPLhl zK(;sl6^CREJ#sUp$Q;Sdl&qmgmN+K-F9pkmEh-wo5u)2R>B4+r5#coof14;hDk8hWt`r!+Yq}!Wl9NC4uHs9xs$6|j@dZ69X}Y9HxwF+k)?t)1qT3l0i4`B zS-FO+EZr|l-ja>KE_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R%-vg1BV{7VjP$U7J+FdgVlS5p9OGr@rrw~xc*we)^#N+te3mbVE6nI!RHr%Mc z8g7=rvO+oj?W?d!Ra;*xb2KS{k=laGckLV}Uu4bBVJnhcB7PmHox#)9&t;ucLK6V3 Ci7X5N literal 0 HcmV?d00001 diff --git a/documentation/manual/themes/openlp_qthelp/static/bullet_orange.png b/documentation/manual/themes/openlp_qthelp/static/bullet_orange.png new file mode 100644 index 0000000000000000000000000000000000000000..ad5d02f341dfcd8fec482e500170bb711257f0b9 GIT binary patch literal 365 zcmeAS@N?(olHy`uVBq!ia0vp^Y#_|R3?#1$$yWiXgaDrq*9Uc4|IbYRzdQHA%KGnb zp8lU>{{P{#za{Vg>DGTApT26<`oGZT|IxPp5BL1v zU-JLUi^r?#|Ns9FG!HA7@@RewP=YbZ+ucQ;l~-Udki%Kv5m^kRJ;2!QWVRhhu&lr_ z9Y}+n$uRZe&q+XzzNd?02*-8SgPcqZ0vs#{O4}y1{I|c#qqlle!_6Z7fZ4}QmsI^> zTd~_#Zi!CI4@OlM##wA?*5`m)RZCnWN>UO_QmvAUQh^kMk%6Isu7RPhfq96bk(G(1 rm4TVIfuWUwfz`yy6DS&T^HVa@DsgM@K69`HsDZ)L)z4*}Q$iB}`ILMr literal 0 HcmV?d00001 diff --git a/documentation/manual/themes/openlp_qthelp/static/openlp_qthelp.css_t b/documentation/manual/themes/openlp_qthelp/static/openlp_qthelp.css_t new file mode 100644 index 000000000..918ed661b --- /dev/null +++ b/documentation/manual/themes/openlp_qthelp/static/openlp_qthelp.css_t @@ -0,0 +1,372 @@ +/* + * openlp_qthelp.css_t + * ~~~~~~~~~~~ + * + * Sphinx stylesheet -- openlp_qthelp theme. + * + * Adapted from http://openlp_qthelp-os.org/docs/Haiku-doc.css. + * Original copyright message: + * + * Copyright 2008-2009, Haiku. All rights reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Francois Revol + * Stephan Assmus + * Braden Ewing + * Humdinger + * + * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +@import url("basic.css"); + +html { + margin: 0px; + padding: 0px; + background-color: #fff; + background-image: none; +} + +body { + line-height: 1.5; + margin: auto; + padding: 0px; + font-family: "DejaVu Sans", Arial, Helvetica, sans-serif; + min-width: 59em; + max-width: 70em; + color: {{ theme_textcolor }}; +} + +div.footer { + padding: 8px; + font-size: 11px; + text-align: center; + letter-spacing: 0.5px; +} + +/* link colors and text decoration */ + +a:link { + font-weight: bold; + text-decoration: none; + color: {{ theme_linkcolor }}; +} + +a:visited { + font-weight: bold; + text-decoration: none; + color: {{ theme_visitedlinkcolor }}; +} + +a:hover, a:active { + text-decoration: underline; + color: {{ theme_hoverlinkcolor }}; +} + +/* Some headers act as anchors, don't give them a hover effect */ + +h1 a:hover, a:active { + text-decoration: none; + color: {{ theme_headingcolor }}; +} + +h2 a:hover, a:active { + text-decoration: none; + color: {{ theme_headingcolor }}; +} + +h3 a:hover, a:active { + text-decoration: none; + color: {{ theme_headingcolor }}; +} + +h4 a:hover, a:active { + text-decoration: none; + color: {{ theme_headingcolor }}; +} + +a.headerlink { + color: #a7ce38; + padding-left: 5px; +} + +a.headerlink:hover { + color: #a7ce38; +} + +/* basic text elements */ + +div.content { + margin-top: 20px; + margin-left: 40px; + margin-right: 40px; + margin-bottom: 50px; + font-size: 0.9em; +} + +/* heading and navigation */ + +div.header { + position: relative; + left: 0px; + top: 0px; + height: 85px; + /* background: #eeeeee; */ + padding: 0 40px; +} +div.header h1 { + font-size: 1.6em; + font-weight: normal; + letter-spacing: 1px; + color: {{ theme_headingcolor }}; + border: 0; + margin: 0; + padding-top: 15px; +} +div.header h1 a { + font-weight: normal; + color: {{ theme_headingcolor }}; +} +div.header h2 { + font-size: 1.3em; + font-weight: normal; + letter-spacing: 1px; + text-transform: uppercase; + color: #aaa; + border: 0; + margin-top: -3px; + padding: 0; +} + +div.header img.rightlogo { + float: right; +} + + +div.title { + font-size: 1.3em; + font-weight: bold; + color: {{ theme_headingcolor }}; + border-bottom: dotted thin #e0e0e0; + margin-bottom: 25px; +} +div.topnav { + /* background: #e0e0e0; */ +} +div.topnav p { + margin-top: 0; + margin-left: 40px; + margin-right: 40px; + margin-bottom: 0px; + text-align: right; + font-size: 0.8em; +} +div.bottomnav { + background: #eeeeee; +} +div.bottomnav p { + margin-right: 40px; + text-align: right; + font-size: 0.8em; +} + +a.uplink { + font-weight: normal; +} + + +/* contents box */ + +table.index { + margin: 0px 0px 30px 30px; + padding: 1px; + border-width: 1px; + border-style: dotted; + border-color: #e0e0e0; +} +table.index tr.heading { + background-color: #e0e0e0; + text-align: center; + font-weight: bold; + font-size: 1.1em; +} +table.index tr.index { + background-color: #eeeeee; +} +table.index td { + padding: 5px 20px; +} + +table.index a:link, table.index a:visited { + font-weight: normal; + text-decoration: none; + color: {{ theme_linkcolor }}; +} +table.index a:hover, table.index a:active { + text-decoration: underline; + color: {{ theme_hoverlinkcolor }}; +} + + +/* Haiku User Guide styles and layout */ + +/* Rounded corner boxes */ +/* Common declarations */ +div.admonition { + -webkit-border-radius: 10px; + -khtml-border-radius: 10px; + -moz-border-radius: 10px; + border-radius: 10px; + border-style: dotted; + border-width: thin; + border-color: #dcdcdc; + padding: 10px 15px 10px 15px; + margin-bottom: 15px; + margin-top: 15px; +} +div.note { + padding: 10px 15px 10px 80px; + background: #e4ffde url(alert_info_32.png) 15px 15px no-repeat; + min-height: 42px; +} +div.warning { + padding: 10px 15px 10px 80px; + background: #fffbc6 url(alert_warning_32.png) 15px 15px no-repeat; + min-height: 42px; +} +div.seealso { + background: #e4ffde; +} + +/* More layout and styles */ +h1 { + font-size: 1.3em; + font-weight: bold; + color: {{ theme_headingcolor }}; + border-bottom: dotted thin #e0e0e0; + margin-top: 30px; +} + +h2 { + font-size: 1.2em; + font-weight: normal; + color: {{ theme_headingcolor }}; + border-bottom: dotted thin #e0e0e0; + margin-top: 30px; +} + +h3 { + font-size: 1.1em; + font-weight: normal; + color: {{ theme_headingcolor }}; + margin-top: 30px; +} + +h4 { + font-size: 1.0em; + font-weight: normal; + color: {{ theme_headingcolor }}; + margin-top: 30px; +} + +p { + text-align: justify; +} + +p.last { + margin-bottom: 0; +} + +ol { + padding-left: 20px; +} + +ul { + padding-left: 5px; + margin-top: 3px; +} + +li { + line-height: 1.3; +} + +div.content ul > li { + -moz-background-clip:border; + -moz-background-inline-policy:continuous; + -moz-background-origin:padding; + background: transparent url(bullet_orange.png) no-repeat scroll left 0.45em; + list-style-image: none; + list-style-type: none; + padding: 0 0 0 1.666em; + margin-bottom: 3px; +} + +td { + vertical-align: top; +} + +tt { + background-color: #e2e2e2; + font-size: 1.0em; + font-family: monospace; +} + +pre { + border-color: #0c3762; + border-style: dotted; + border-width: thin; + margin: 0 0 12px 0; + padding: 0.8em; + background-color: #f0f0f0; +} + +hr { + border-top: 1px solid #ccc; + border-bottom: 0; + border-right: 0; + border-left: 0; + margin-bottom: 10px; + margin-top: 20px; +} + +/* printer only pretty stuff */ +@media print { + .noprint { + display: none; + } + /* for acronyms we want their definitions inlined at print time */ + acronym[title]:after { + font-size: small; + content: " (" attr(title) ")"; + font-style: italic; + } + /* and not have mozilla dotted underline */ + acronym { + border: none; + } + div.topnav, div.bottomnav, div.header, table.index { + display: none; + } + div.content { + margin: 0px; + padding: 0px; + } + html { + background: #FFF; + } +} + +.viewcode-back { + font-family: "DejaVu Sans", Arial, Helvetica, sans-serif; +} + +div.viewcode-block:target { + background-color: #f4debf; + border-top: 1px solid #ac9; + border-bottom: 1px solid #ac9; + margin: -1px -12px; + padding: 0 12px; +} diff --git a/documentation/manual/themes/openlp_qthelp/theme.conf b/documentation/manual/themes/openlp_qthelp/theme.conf new file mode 100644 index 000000000..0d44b0faa --- /dev/null +++ b/documentation/manual/themes/openlp_qthelp/theme.conf @@ -0,0 +1,12 @@ +[theme] +inherit = basic +stylesheet = openlp_qthelp.css +pygments_style = autumn + +[options] +full_logo = false +textcolor = #333333 +headingcolor = #203b6f +linkcolor = #26437c +visitedlinkcolor = #26437c +hoverlinkcolor = #26437c From a35b50e7277b77104f0764d604fe7b0ae82e4362 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Mon, 3 Jan 2011 22:14:56 +0100 Subject: [PATCH 003/243] reindex tool adds 'author unknown' if songs do not have any author --- openlp/plugins/songs/songsplugin.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 545497acb..63d104d24 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -32,7 +32,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import Plugin, StringContent, build_icon, translate from openlp.core.lib.db import Manager from openlp.plugins.songs.lib import SongMediaItem, SongsTab, SongXMLParser -from openlp.plugins.songs.lib.db import init_schema, Song +from openlp.plugins.songs.lib.db import Author, init_schema, Song from openlp.plugins.songs.lib.importer import SongFormat log = logging.getLogger(__name__) @@ -146,6 +146,15 @@ class SongsPlugin(Plugin): counter = 0 for song in songs: counter += 1 + # The song does not have any author, add one. + if not song.authors: + name = unicode(translate('SongsPlugin', 'Author unknown')) + author = self.manager.get_object_filtered(Author, + Author.display_name == name) + if author is None: + author = Author.populate(first_name=name.rsplit(u' ', 1)[0], + last_name=name.rsplit(u' ', 1)[1], display_name=name) + song.authors.append(author) if song.title is None: song.title = u'' if song.alternate_title is None: From b5982dec403d87c8efc7775813a08246966ee4ce Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sun, 23 Jan 2011 17:05:46 +0100 Subject: [PATCH 004/243] --- openlp/plugins/songs/forms/__init__.py | 4 +- openlp/plugins/songs/forms/songexportform.py | 229 +++++++++++++++++++ openlp/plugins/songs/lib/mediaitem.py | 8 +- openlp/plugins/songs/lib/openlyricsexport.py | 77 +++++++ openlp/plugins/songs/songsplugin.py | 17 +- 5 files changed, 331 insertions(+), 4 deletions(-) create mode 100644 openlp/plugins/songs/forms/songexportform.py create mode 100755 openlp/plugins/songs/lib/openlyricsexport.py diff --git a/openlp/plugins/songs/forms/__init__.py b/openlp/plugins/songs/forms/__init__.py index 160a014ac..e75f9fe04 100644 --- a/openlp/plugins/songs/forms/__init__.py +++ b/openlp/plugins/songs/forms/__init__.py @@ -57,4 +57,6 @@ from songbookform import SongBookForm from editverseform import EditVerseForm from editsongform import EditSongForm from songmaintenanceform import SongMaintenanceForm -from songimportform import SongImportForm \ No newline at end of file +from songimportform import SongImportForm +from songexportform import SongExportForm + diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py new file mode 100644 index 000000000..6868da4aa --- /dev/null +++ b/openlp/plugins/songs/forms/songexportform.py @@ -0,0 +1,229 @@ +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 + +############################################################################### +# OpenLP - Open Source Lyrics Projection # +# --------------------------------------------------------------------------- # +# Copyright (c) 2008-2011 Raoul Snyman # +# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # +# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # +# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # +# Carsten Tinggaard, Frode Woldsund # +# --------------------------------------------------------------------------- # +# This program is free software; you can redistribute it and/or modify it # +# under the terms of the GNU General Public License as published by the Free # +# Software Foundation; version 2 of the License. # +# # +# This program is distributed in the hope that it will be useful, but WITHOUT # +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # +# more details. # +# # +# You should have received a copy of the GNU General Public License along # +# with this program; if not, write to the Free Software Foundation, Inc., 59 # +# Temple Place, Suite 330, Boston, MA 02111-1307 USA # +############################################################################### +""" +The song export function for OpenLP. +""" +import logging +import os + +from PyQt4 import QtCore, QtGui + +from openlp.core.lib import Receiver, SettingsManager, translate +from openlp.core.ui import criticalErrorMessageBox +from openlp.core.ui.wizard import OpenLPWizard +from openlp.plugins.songs.lib.db import Song +from openlp.plugins.songs.lib.openlyricsexport import OpenLyricsExport + +log = logging.getLogger(__name__) + +class SongExportForm(OpenLPWizard): + """ + This is the Song Export Wizard, which allows easy exporting of Songs to + OpenLyrics. + """ + log.info(u'SongExportForm loaded') + + def __init__(self, parent, plugin): + """ + Instantiate the wizard, and run any extra setup we need to. + + ``parent`` + The QWidget-derived parent of the wizard. + + ``plugin`` + The songs plugin. + """ + self.plugin = plugin + OpenLPWizard.__init__(self, parent, plugin, u'songExportWizard', + u':/wizards/wizard_importsong.bmp') + + def setupUi(self, image): + """ + Set up the song wizard UI. + """ + OpenLPWizard.setupUi(self, image) + + def customInit(self): + """ + Song wizard specific initialisation. + """ + songs = self.plugin.manager.get_all_objects(Song) + for song in songs: + self.availableListWidget.addItem(unicode(song.id)) + + def customSignals(self): + """ + Song wizard specific signals. + """ + pass + + def addCustomPages(self): + """ + Add song wizard specific pages. + """ + # Source Page + self.sourcePage = QtGui.QWizardPage() + self.sourcePage.setObjectName(u'SourcePage') + self.sourceLayout = QtGui.QVBoxLayout(self.sourcePage) + self.sourceLayout.setObjectName(u'SourceLayout') + + self.songListsWidget = QtGui.QWidget(self.sourcePage) + self.songListsWidget.setGeometry(QtCore.QRect(8, 10, 541, 291)) + self.songListsWidget.setObjectName("songListsWidget") + self.SongListsLayout = QtGui.QHBoxLayout(self.songListsWidget) + self.SongListsLayout.setSpacing(0) + self.SongListsLayout.setMargin(0) + self.SongListsLayout.setObjectName("SongListsLayout") + self.availableGroupBox = QtGui.QGroupBox(self.songListsWidget) + self.availableGroupBox.setObjectName("availableGroupBox") + self.verticalLayout_5 = QtGui.QVBoxLayout(self.availableGroupBox) + self.verticalLayout_5.setObjectName("verticalLayout_5") + self.availableListWidget = QtGui.QListWidget(self.availableGroupBox) + self.availableListWidget.setObjectName("availableListWidget") + self.verticalLayout_5.addWidget(self.availableListWidget) + self.SongListsLayout.addWidget(self.availableGroupBox) + self.selectionWidget = QtGui.QWidget(self.songListsWidget) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.selectionWidget.sizePolicy().hasHeightForWidth()) + self.selectionWidget.setSizePolicy(sizePolicy) + self.selectionWidget.setMaximumSize(QtCore.QSize(30, 16777215)) + self.selectionWidget.setObjectName("selectionWidget") + self.SelectionLayout = QtGui.QVBoxLayout(self.selectionWidget) + self.SelectionLayout.setSpacing(0) + self.SelectionLayout.setSizeConstraint(QtGui.QLayout.SetMinimumSize) + self.SelectionLayout.setMargin(0) + self.SelectionLayout.setObjectName("SelectionLayout") + self.addSelected = QtGui.QToolButton(self.selectionWidget) + icon = QtGui.QIcon() + icon.addPixmap(QtGui.QPixmap(":/exports/export_move_to_list.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.addSelected.setIcon(icon) + self.addSelected.setIconSize(QtCore.QSize(20, 20)) + self.addSelected.setObjectName("addSelected") + self.SelectionLayout.addWidget(self.addSelected) + self.removeSelected = QtGui.QToolButton(self.selectionWidget) + icon1 = QtGui.QIcon() + icon1.addPixmap(QtGui.QPixmap(":/imports/import_remove.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.removeSelected.setIcon(icon1) + self.removeSelected.setIconSize(QtCore.QSize(20, 20)) + self.removeSelected.setObjectName("removeSelected") + self.SelectionLayout.addWidget(self.removeSelected) + self.SongListsLayout.addWidget(self.selectionWidget) + self.selectedGroupBox = QtGui.QGroupBox(self.songListsWidget) + self.selectedGroupBox.setObjectName("selectedGroupBox") + self.verticalLayout_6 = QtGui.QVBoxLayout(self.selectedGroupBox) + self.verticalLayout_6.setObjectName("verticalLayout_6") + self.selectedListWidget = QtGui.QListWidget(self.selectedGroupBox) + self.selectedListWidget.setObjectName("selectedListWidget") + self.verticalLayout_6.addWidget(self.selectedListWidget) + self.SongListsLayout.addWidget(self.selectedGroupBox) + + + self.formatStack = QtGui.QStackedLayout() + self.formatStack.setObjectName(u'FormatStack') + self.sourceLayout.addLayout(self.formatStack) + self.addPage(self.sourcePage) + + def retranslateUi(self): + """ + Song wizard localisation. + """ + self.setWindowTitle( + translate('SongsPlugin.ImportWizardForm', 'Song Import Wizard')) + self.titleLabel.setText( + u'%s' % \ + translate('SongsPlugin.ImportWizardForm', + 'Welcome to the Song Import Wizard')) + self.informationLabel.setText( + translate('SongsPlugin.ImportWizardForm', + 'This wizard will help you to export songs from a variety of ' + 'formats. Click the next button below to start the process by ' + 'selecting a format to export from.')) + self.sourcePage.setTitle( + translate('SongsPlugin.ImportWizardForm', 'Select Import Source')) + self.sourcePage.setSubTitle( + translate('SongsPlugin.ImportWizardForm', + 'Select the export format, and where to export from.')) + + self.progressPage.setTitle( + translate('SongsPlugin.ImportWizardForm', 'Importing')) + self.progressPage.setSubTitle( + translate('SongsPlugin.ImportWizardForm', + 'Please wait while your songs are exported.')) + self.progressLabel.setText( + translate('SongsPlugin.ImportWizardForm', 'Ready.')) + self.progressBar.setFormat( + translate('SongsPlugin.ImportWizardForm', '%p%')) + + def validateCurrentPage(self): + """ + Validate the current page before moving on to the next page. + """ + if self.currentPage() == self.welcomePage: + return True + elif self.currentPage() == self.sourcePage: + return True + elif self.currentPage() == self.progressPage: + return True + + def registerFields(self): + """ + Register song export wizard fields. + """ + pass + + def setDefaults(self): + """ + Set default form values for the song export wizard. + """ + self.restart() + self.finishButton.setVisible(False) + self.cancelButton.setVisible(True) + + def preWizard(self): + """ + Perform pre export tasks + """ + OpenLPWizard.preWizard(self) + self.progressLabel.setText( + translate('SongsPlugin.ImportWizardForm', 'Starting export...')) + Receiver.send_message(u'openlp_process_events') + + def performWizard(self): + """ + Perform the actual export. This method pulls in the correct exporter + class, and then runs the ``do_export`` method of the exporter to do + the actual exporting. + """ + exporter = OpenLyricsExport() + if exporter.do_export(): + self.progressLabel.setText( + translate('SongsPlugin.SongImportForm', 'Finished export.')) + else: + self.progressLabel.setText( + translate('SongsPlugin.SongImportForm', + 'Your song export failed.')) diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 625f99f18..0dd0df882 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -34,7 +34,7 @@ from sqlalchemy.sql import or_ from openlp.core.lib import MediaManagerItem, BaseListWithDnD, Receiver, \ ItemCapabilities, translate, check_item_selected from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm, \ - SongImportForm + SongImportForm, SongExportForm from openlp.plugins.songs.lib import OpenLyrics, SongXML from openlp.plugins.songs.lib.db import Author, Song from openlp.core.lib.searchedit import SearchEdit @@ -271,6 +271,12 @@ class SongMediaItem(MediaManagerItem): if self.import_wizard.exec_() == QtGui.QDialog.Accepted: Receiver.send_message(u'songs_load_list') + def onExportClick(self): + if not hasattr(self, u'export_wizard'): + self.export_wizard = SongExportForm(self, self.parent) + if self.export_wizard.exec_() == QtGui.QDialog.Accepted: + Receiver.send_message(u'songs_load_list') + def onNewClick(self): log.debug(u'onNewClick') self.edit_song_form.newSong() diff --git a/openlp/plugins/songs/lib/openlyricsexport.py b/openlp/plugins/songs/lib/openlyricsexport.py new file mode 100755 index 000000000..2615a7448 --- /dev/null +++ b/openlp/plugins/songs/lib/openlyricsexport.py @@ -0,0 +1,77 @@ +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 + +############################################################################### +# OpenLP - Open Source Lyrics Projection # +# --------------------------------------------------------------------------- # +# Copyright (c) 2008-2011 Raoul Snyman # +# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael # +# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # +# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # +# Carsten Tinggaard, Frode Woldsund # +# --------------------------------------------------------------------------- # +# This program is free software; you can redistribute it and/or modify it # +# under the terms of the GNU General Public License as published by the Free # +# Software Foundation; version 2 of the License. # +# # +# This program is distributed in the hope that it will be useful, but WITHOUT # +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # +# more details. # +# # +# You should have received a copy of the GNU General Public License along # +# with this program; if not, write to the Free Software Foundation, Inc., 59 # +# Temple Place, Suite 330, Boston, MA 02111-1307 USA # +############################################################################### +""" +The :mod:`openlyricsexport` module provides the functionality for exporting +songs from the database. +""" +import datetime +import logging +import os + +from lxml import etree + +from openlp.core.lib import translate +from openlp.plugins.songs.lib import OpenLyrics + +log = logging.getLogger(__name__) + +class OpenLyricsExport(object): + """ + This provides the Openlyrics export. + """ + def __init__(self, master_manager, song_ids, save_path): + """ + Initialise the export. + """ + log.debug(u'initialise OpenLyricsExport') + self.master_manager = master_manager + self.song_ids = song_ids + self.save_path = save_path + + def do_export(self): + """ + Export the songs. + """ + openLyrics = OpenLyrics(self.master_manager) + self.export_wizard.exportProgressBar.setMaximum(len(songs)) + for song in self.songs: + if self.stop_export_flag: + return False + self.export_wizard.incrementProgressBar(unicode(translate( + 'SongsPlugin.OpenLyricsExport', 'Exporting %s...')) % + song.title) + path = os.path.join(self.save_path, song.title + u'.xml') + xml = openLyrics.song_to_xml(song) + # Add "IMPLEMENTED_VERSION = u'0.7" to xml.py/OpenLyrics class! + xml.set(u'version', OpenLyrics.IMPLEMENTED_VERSION) + xml.set(u'createdIn', u'OpenLP 1.9.4') # Use variable + xml.set(u'modifiedIn', u'OpenLP 1.9.4') # Use variable + xml.set(u'modifiedDate', + datetime.datetime.now().strftime(u'%Y-%m-%dT%H:%M:%S')) + tree = etree.ElementTree(etree.fromstring(xml)) + tree.write(path, encoding=u'utf-8', xml_declaration=True, + pretty_print=True) + return True diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 7efe73db2..02ae6f2e7 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -106,8 +106,17 @@ class SongsPlugin(Plugin): The actual **Export** menu item, so that your actions can use it as their parent. """ - # No menu items for now. - pass + # Main song import menu item - will eventually be the only one + self.SongExportItem = QtGui.QAction(export_menu) + self.SongExportItem.setObjectName(u'SongExportItem') + self.SongExportItem.setText(translate( + 'SongsPlugin', '&Song')) + self.SongExportItem.setToolTip(translate('SongsPlugin', + 'Exports songs using the export wizard.')) + export_menu.addAction(self.SongExportItem) + # Signals and slots + QtCore.QObject.connect(self.SongExportItem, + QtCore.SIGNAL(u'triggered()'), self.onSongExportItemClicked) def addToolsMenuItem(self, tools_menu): """ @@ -172,6 +181,10 @@ class SongsPlugin(Plugin): if self.mediaItem: self.mediaItem.onImportClick() + def onSongExportItemClicked(self): + if self.mediaItem: + self.mediaItem.onExportClick() + def about(self): about_text = translate('SongsPlugin', 'Songs Plugin' '
The songs plugin provides the ability to display and ' From 6d1b2973108ca8d603ce972f414f62440b714f3b Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sun, 23 Jan 2011 17:15:05 +0100 Subject: [PATCH 005/243] --- openlp/plugins/songs/forms/songexportform.py | 75 +++++++++----------- 1 file changed, 33 insertions(+), 42 deletions(-) diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index 6868da4aa..9058b6a2c 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -87,65 +87,56 @@ class SongExportForm(OpenLPWizard): # Source Page self.sourcePage = QtGui.QWizardPage() self.sourcePage.setObjectName(u'SourcePage') - self.sourceLayout = QtGui.QVBoxLayout(self.sourcePage) + self.sourceLayout = QtGui.QHBoxLayout(self.sourcePage) self.sourceLayout.setObjectName(u'SourceLayout') - self.songListsWidget = QtGui.QWidget(self.sourcePage) - self.songListsWidget.setGeometry(QtCore.QRect(8, 10, 541, 291)) - self.songListsWidget.setObjectName("songListsWidget") - self.SongListsLayout = QtGui.QHBoxLayout(self.songListsWidget) - self.SongListsLayout.setSpacing(0) - self.SongListsLayout.setMargin(0) - self.SongListsLayout.setObjectName("SongListsLayout") - self.availableGroupBox = QtGui.QGroupBox(self.songListsWidget) - self.availableGroupBox.setObjectName("availableGroupBox") + self.availableGroupBox = QtGui.QGroupBox(self.sourcePage) + self.availableGroupBox.setObjectName(u'availableGroupBox') self.verticalLayout_5 = QtGui.QVBoxLayout(self.availableGroupBox) - self.verticalLayout_5.setObjectName("verticalLayout_5") + self.verticalLayout_5.setObjectName(u'verticalLayout_5') self.availableListWidget = QtGui.QListWidget(self.availableGroupBox) - self.availableListWidget.setObjectName("availableListWidget") + self.availableListWidget.setObjectName(u'availableListWidget') self.verticalLayout_5.addWidget(self.availableListWidget) - self.SongListsLayout.addWidget(self.availableGroupBox) - self.selectionWidget = QtGui.QWidget(self.songListsWidget) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.selectionWidget.sizePolicy().hasHeightForWidth()) - self.selectionWidget.setSizePolicy(sizePolicy) + self.sourceLayout.addWidget(self.availableGroupBox) + self.selectionWidget = QtGui.QWidget(self.sourcePage) self.selectionWidget.setMaximumSize(QtCore.QSize(30, 16777215)) - self.selectionWidget.setObjectName("selectionWidget") - self.SelectionLayout = QtGui.QVBoxLayout(self.selectionWidget) - self.SelectionLayout.setSpacing(0) - self.SelectionLayout.setSizeConstraint(QtGui.QLayout.SetMinimumSize) - self.SelectionLayout.setMargin(0) - self.SelectionLayout.setObjectName("SelectionLayout") + self.selectionWidget.setObjectName(u'selectionWidget') + self.selectionLayout = QtGui.QVBoxLayout(self.selectionWidget) + self.selectionLayout.setSpacing(0) + self.selectionLayout.setSizeConstraint(QtGui.QLayout.SetMinimumSize) + self.selectionLayout.setMargin(0) + self.selectionLayout.setObjectName(u'SelectionLayout') self.addSelected = QtGui.QToolButton(self.selectionWidget) icon = QtGui.QIcon() - icon.addPixmap(QtGui.QPixmap(":/exports/export_move_to_list.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) + icon.addPixmap(QtGui.QPixmap( + u':/exports/export_move_to_list.png'), + QtGui.QIcon.Normal, QtGui.QIcon.Off) self.addSelected.setIcon(icon) self.addSelected.setIconSize(QtCore.QSize(20, 20)) - self.addSelected.setObjectName("addSelected") - self.SelectionLayout.addWidget(self.addSelected) + self.addSelected.setObjectName(u'addSelected') + self.selectionLayout.addWidget(self.addSelected) self.removeSelected = QtGui.QToolButton(self.selectionWidget) - icon1 = QtGui.QIcon() - icon1.addPixmap(QtGui.QPixmap(":/imports/import_remove.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.removeSelected.setIcon(icon1) + icon = QtGui.QIcon() + icon.addPixmap(QtGui.QPixmap( + u':/imports/import_remove.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.removeSelected.setIcon(icon) self.removeSelected.setIconSize(QtCore.QSize(20, 20)) - self.removeSelected.setObjectName("removeSelected") - self.SelectionLayout.addWidget(self.removeSelected) - self.SongListsLayout.addWidget(self.selectionWidget) - self.selectedGroupBox = QtGui.QGroupBox(self.songListsWidget) - self.selectedGroupBox.setObjectName("selectedGroupBox") + self.removeSelected.setObjectName(u'removeSelected') + self.selectionLayout.addWidget(self.removeSelected) + self.sourceLayout.addWidget(self.selectionWidget) + self.selectedGroupBox = QtGui.QGroupBox(self.sourcePage) + self.selectedGroupBox.setObjectName(u'selectedGroupBox') self.verticalLayout_6 = QtGui.QVBoxLayout(self.selectedGroupBox) - self.verticalLayout_6.setObjectName("verticalLayout_6") + self.verticalLayout_6.setObjectName(u'verticalLayout_6') self.selectedListWidget = QtGui.QListWidget(self.selectedGroupBox) - self.selectedListWidget.setObjectName("selectedListWidget") + self.selectedListWidget.setObjectName(u'selectedListWidget') self.verticalLayout_6.addWidget(self.selectedListWidget) - self.SongListsLayout.addWidget(self.selectedGroupBox) + self.sourceLayout.addWidget(self.selectedGroupBox) - self.formatStack = QtGui.QStackedLayout() - self.formatStack.setObjectName(u'FormatStack') - self.sourceLayout.addLayout(self.formatStack) + #self.formatStack = QtGui.QStackedLayout() + #self.formatStack.setObjectName(u'FormatStack') + #self.sourceLayout.addLayout(self.formatStack) self.addPage(self.sourcePage) def retranslateUi(self): From 1e0b9cbdd4f517e32296f67b06362c01feb109e9 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Mon, 24 Jan 2011 20:27:59 +0100 Subject: [PATCH 006/243] --- openlp/plugins/songs/forms/songexportform.py | 131 +++++++++++++++---- openlp/plugins/songs/lib/openlyricsexport.py | 35 ++--- openlp/plugins/songs/lib/opensongimport.py | 7 +- openlp/plugins/songs/lib/xml.py | 18 ++- 4 files changed, 140 insertions(+), 51 deletions(-) diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index 18d1c85ba..6cf172087 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -27,11 +27,11 @@ The song export function for OpenLP. """ import logging -import os +#import os from PyQt4 import QtCore, QtGui -from openlp.core.lib import Receiver, SettingsManager, translate +from openlp.core.lib import Receiver, translate from openlp.core.ui import criticalErrorMessageBox from openlp.core.ui.wizard import OpenLPWizard from openlp.plugins.songs.lib.db import Song @@ -59,6 +59,16 @@ class SongExportForm(OpenLPWizard): self.plugin = plugin OpenLPWizard.__init__(self, parent, plugin, u'songExportWizard', u':/wizards/wizard_importsong.bmp') + self.stop_export_flag = False + QtCore.QObject.connect(Receiver.get_receiver(), + QtCore.SIGNAL(u'openlp_stop_wizard'), self.stop_export) + + def stop_export(self): + """ + Sets the flag for exporters to stop their export + """ + log.debug(u'Stopping songs export') + self.stop_export_flag = True def setupUi(self, image): """ @@ -70,25 +80,22 @@ class SongExportForm(OpenLPWizard): """ Song wizard specific initialisation. """ - songs = self.plugin.manager.get_all_objects(Song) - for song in songs: - author_list = u'' - for author in song.authors: - if author_list != u'': - author_list = author_list + u', ' - author_list = author_list + author.display_name - song_title = unicode(song.title) - song_detail = u'%s (%s)' % (song_title, author_list) - song_name = QtGui.QListWidgetItem(song_detail) - song_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(song)) - self.availableListWidget.addItem(song_name) - self.availableListWidget.selectAll() + pass def customSignals(self): """ Song wizard specific signals. """ - pass + QtCore.QObject.connect(self.addSelected, + QtCore.SIGNAL(u'clicked()'), self.onAddSelectedClicked) + QtCore.QObject.connect(self.removeSelected, + QtCore.SIGNAL(u'clicked()'), self.onRemoveSelectedClicked) + QtCore.QObject.connect(self.availableListWidget, + QtCore.SIGNAL(u'itemDoubleClicked(QListWidgetItem *)'), + self.onAvailableListItemDoubleClicked) + QtCore.QObject.connect(self.selectedListWidget, + QtCore.SIGNAL(u'itemDoubleClicked(QListWidgetItem *)'), + self.onSelectedListItemDoubleClicked) def addCustomPages(self): """ @@ -105,6 +112,11 @@ class SongExportForm(OpenLPWizard): self.verticalLayout.setObjectName(u'verticalLayout') self.availableListWidget = QtGui.QListWidget(self.availableGroupBox) self.availableListWidget.setObjectName(u'availableListWidget') + self.availableListWidget.setSelectionMode( + QtGui.QAbstractItemView.ExtendedSelection) + self.availableListWidget.setSizePolicy( + QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) + self.availableListWidget.setSortingEnabled(True) self.verticalLayout.addWidget(self.availableListWidget) self.sourceLayout.addWidget(self.availableGroupBox) self.selectionWidget = QtGui.QWidget(self.sourcePage) @@ -138,6 +150,11 @@ class SongExportForm(OpenLPWizard): self.verticalLayout.setObjectName(u'verticalLayout') self.selectedListWidget = QtGui.QListWidget(self.selectedGroupBox) self.selectedListWidget.setObjectName(u'selectedListWidget') + self.selectedListWidget.setSelectionMode( + QtGui.QAbstractItemView.ExtendedSelection) + self.selectedListWidget.setSizePolicy( + QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) + self.selectedListWidget.setSortingEnabled(True) self.verticalLayout.addWidget(self.selectedListWidget) self.sourceLayout.addWidget(self.selectedGroupBox) self.addPage(self.sourcePage) @@ -151,23 +168,23 @@ class SongExportForm(OpenLPWizard): self.titleLabel.setText( u'%s' % \ translate('SongsPlugin.ExportWizardForm', - 'Welcome to the Song Export Wizard')) + 'Welcome to the Song Export Wizard')) self.informationLabel.setText( translate('SongsPlugin.ExportWizardForm', 'This wizard will help to ' 'export your songs to the free and open OpenLyrics worship song ' 'format. You can import these songs in all lyrics projection ' 'software, which supports OpenLyrics.')) self.sourcePage.setTitle( - translate('SongsPlugin.ExportWizardForm', 'Select Emport Source')) + translate('SongsPlugin.ExportWizardForm', 'Select Songs')) self.sourcePage.setSubTitle( translate('SongsPlugin.ExportWizardForm', - 'Select the export format, and where to export from.')) + 'Select the songs, you want to export.')) self.progressPage.setTitle( translate('SongsPlugin.ExportWizardForm', 'Exporting')) self.progressPage.setSubTitle( translate('SongsPlugin.ExportWizardForm', - 'Please wait while your songs are exported.')) + 'Please wait while your songs are exported.')) self.progressLabel.setText( translate('SongsPlugin.ExportWizardForm', 'Ready.')) self.progressBar.setFormat( @@ -187,10 +204,35 @@ class SongExportForm(OpenLPWizard): Validate the current page before moving on to the next page. """ if self.currentPage() == self.welcomePage: + Receiver.send_message(u'cursor_busy') + songs = self.plugin.manager.get_all_objects(Song) + for song in songs: + author_list = u'' + for author in song.authors: + if author_list != u'': + author_list = author_list + u', ' + author_list = author_list + author.display_name + song_title = unicode(song.title) + song_detail = u'%s (%s)' % (song_title, author_list) + song_name = QtGui.QListWidgetItem(song_detail) + song_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(song)) + self.availableListWidget.addItem(song_name) + self.availableListWidget.selectAll() + Receiver.send_message(u'cursor_normal') return True elif self.currentPage() == self.sourcePage: + self.selectedListWidget.selectAll() + if not self.selectedListWidget.selectedItems(): + criticalErrorMessageBox( + translate('SongsPlugin.ExportWizardForm', + 'No Song Selected'), + translate('SongsPlugin.ImportWizardForm', + 'You need to add at least one Song to export.')) + return False return True elif self.currentPage() == self.progressPage: + self.availableListWidget.clear() + self.selectedListWidget.clear() return True def registerFields(self): @@ -222,8 +264,9 @@ class SongExportForm(OpenLPWizard): class, and then runs the ``do_export`` method of the exporter to do the actual exporting. """ - exporter = OpenLyricsExport(self.plugin.manager, - self.plugin.manager.get_all_objects(Song), u'/tmp/') + songs = [item.data(QtCore.Qt.UserRole).toPyObject() + for item in self.selectedListWidget.selectedItems()] + exporter = OpenLyricsExport(self, songs, u'/tmp/') if exporter.do_export(): self.progressLabel.setText( translate('SongsPlugin.SongExportForm', 'Finished export.')) @@ -231,3 +274,47 @@ class SongExportForm(OpenLPWizard): self.progressLabel.setText( translate('SongsPlugin.SongExportForm', 'Your song export failed.')) + + def onAddSelectedClicked(self): + """ + Removes the selected items from the list of available songs and add them + to the list of selected songs. + """ + items = self.availableListWidget.selectedItems() + # Save a list with tuples which consist of the item row, and the item. + items = [(self.availableListWidget.row(item), item) for item in items] + items.sort(reverse=True) + for item in items: + self.availableListWidget.takeItem(item[0]) + self.selectedListWidget.addItem(item[1]) + + def onRemoveSelectedClicked(self): + """ + Removes the selected items from the list of selected songs and add them + back to the list of available songs. + """ + items = self.selectedListWidget.selectedItems() + # Save a list with tuples which consist of the item row, and the item. + items = [(self.selectedListWidget.row(item), item) for item in items] + items.sort(reverse=True) + for item in items: + self.selectedListWidget.takeItem(item[0]) + self.availableListWidget.addItem(item[1]) + + def onAvailableListItemDoubleClicked(self, item): + """ + Adds the double clicked item to the list of selected songs and removes + it from the list of availables songs. + """ + row = self.availableListWidget.row(item) + self.availableListWidget.takeItem(row) + self.selectedListWidget.addItem(item) + + def onSelectedListItemDoubleClicked(self, item): + """ + Adds the double clicked item back to the list of available songs and + removes it from the list of selected songs. + """ + row = self.selectedListWidget.row(item) + self.selectedListWidget.takeItem(row) + self.availableListWidget.addItem(item) diff --git a/openlp/plugins/songs/lib/openlyricsexport.py b/openlp/plugins/songs/lib/openlyricsexport.py index 3a27b2e8a..0f8f679f5 100755 --- a/openlp/plugins/songs/lib/openlyricsexport.py +++ b/openlp/plugins/songs/lib/openlyricsexport.py @@ -27,13 +27,12 @@ The :mod:`openlyricsexport` module provides the functionality for exporting songs from the database. """ -import datetime import logging import os from lxml import etree, objectify -from openlp.core.lib import translate +from openlp.core.lib import Receiver, translate from openlp.plugins.songs.lib import OpenLyrics log = logging.getLogger(__name__) @@ -42,42 +41,34 @@ class OpenLyricsExport(object): """ This provides the Openlyrics export. """ - def __init__(self, master_manager, song_ids, save_path): + def __init__(self, parent, songs, save_path): """ Initialise the export. """ log.debug(u'initialise OpenLyricsExport') - self.master_manager = master_manager - self.songs = song_ids + self.parent = parent + self.manager = parent.plugin.manager + self.songs = songs self.save_path = save_path def do_export(self): """ Export the songs. """ - openLyrics = OpenLyrics(self.master_manager) -# self.export_wizard.exportProgressBar.setMaximum(len(songs)) + openLyrics = OpenLyrics(self.manager) + self.parent.progressBar.setMaximum(len(self.songs)) for song in self.songs: -# if self.stop_export_flag: -# return False -# self.export_wizard.incrementProgressBar(unicode(translate( -# 'SongsPlugin.OpenLyricsExport', 'Exporting %s...')) % -# song.title) + Receiver.send_message(u'openlp_process_events') + if self.parent.stop_export_flag: + return False + self.parent.incrementProgressBar(unicode(translate( + 'SongsPlugin.OpenLyricsExport', 'Exporting %s...')) % + song.title) # Check if path exists. If not, create the directories! # What do we do with songs with the same title? I do not want to # overwrite them! path = os.path.join(self.save_path, song.title + u'.xml') - # Convert the song object to an unicode string. xml = openLyrics.song_to_xml(song) - song_xml = objectify.fromstring(xml) - # Append the necessary meta data to the song. - # (Maybe move this to the xml module? - song_xml.set(u'version', OpenLyrics.IMPLEMENTED_VERSION) - song_xml.set(u'createdIn', u'OpenLP 1.9.4') # Use variable - song_xml.set(u'modifiedIn', u'OpenLP 1.9.4') # Use variable - song_xml.set(u'modifiedDate', - datetime.datetime.now().strftime(u'%Y-%m-%dT%H:%M:%S')) - xml = etree.tostring(song_xml) tree = etree.ElementTree(etree.fromstring(xml)) tree.write(path, encoding=u'utf-8', xml_declaration=True, pretty_print=True) diff --git a/openlp/plugins/songs/lib/opensongimport.py b/openlp/plugins/songs/lib/opensongimport.py index eb16f4ba4..b995b5def 100644 --- a/openlp/plugins/songs/lib/opensongimport.py +++ b/openlp/plugins/songs/lib/opensongimport.py @@ -39,6 +39,7 @@ log = logging.getLogger(__name__) class OpenSongImportError(Exception): pass +#TODO: Use lxml for parsing and make sure we use methods of "SongImport" . class OpenSongImport(SongImport): """ Import songs exported from OpenSong @@ -149,7 +150,7 @@ class OpenSongImport(SongImport): log.info(u'Zip importing %s', parts[-1]) self.import_wizard.incrementProgressBar( unicode(translate('SongsPlugin.ImportWizardForm', - 'Importing %s...')) % parts[-1]) + 'Importing %s...')) % parts[-1]) songfile = z.open(song) self.do_import_file(songfile) if self.commit: @@ -279,7 +280,7 @@ class OpenSongImport(SongImport): for num in versenums: versetag = u'%s%s' % (our_verse_type, num) lines = u'\n'.join(verses[versetype][num]) - self.verses.append([versetag, lines]) + self.add_verse(lines, versetag) # Keep track of what we have for error checking later versetags[versetag] = 1 # now figure out the presentation order @@ -295,6 +296,8 @@ class OpenSongImport(SongImport): else: log.warn(u'No verse order available for %s, skipping.', self.title) + # TODO: make sure that the default order list will be overwritten, if + # the songs provides its own order list. for tag in order: if tag[0].isdigit(): # Assume it's a verse if it has no prefix diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index 9694e7ce7..78028f637 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -60,6 +60,7 @@ The XML of `OpenLyrics `_ songs is of the format:: """ +import datetime import logging import re @@ -207,7 +208,8 @@ class OpenLyrics(object): This property is not supported. ** - The attribute *translit* is not supported. + The attribute *translit* is not supported. Note, the attribute *lang* is + considered, but there is not further functionality implemented yet. ** OpenLP supports this property. @@ -222,8 +224,14 @@ class OpenLyrics(object): """ sxml = SongXML() verse_list = sxml.get_verses(song.lyrics) - song_xml = objectify.fromstring( - u'') + song_xml = objectify.fromstring(u'') + # Append the necessary meta data to the song. + song_xml.set(u'xmlns', u'http://openlyrics.info/namespace/2009/song') + song_xml.set(u'version', OpenLyrics.IMPLEMENTED_VERSION) + song_xml.set(u'createdIn', u'OpenLP 1.9.4') # Use variable + song_xml.set(u'modifiedIn', u'OpenLP 1.9.4') # Use variable + song_xml.set(u'modifiedDate', + datetime.datetime.now().strftime(u'%Y-%m-%dT%H:%M:%S')) properties = etree.SubElement(song_xml, u'properties') titles = etree.SubElement(properties, u'titles') self._add_text_to_element(u'title', titles, song.title.strip()) @@ -237,7 +245,7 @@ class OpenLyrics(object): self._add_text_to_element(u'copyright', properties, song.copyright) if song.verse_order: self._add_text_to_element( - u'verseOrder', properties, song.verse_order) + u'verseOrder', properties, song.verse_order.lower()) if song.ccli_number: self._add_text_to_element(u'ccliNo', properties, song.ccli_number) if song.authors: @@ -450,7 +458,7 @@ class OpenLyrics(object): text += u'\n' text += u'\n'.join([unicode(line) for line in lines.line]) verse_name = self._get(verse, u'name') - verse_type = unicode(VerseType.to_string(verse_name[0]))[0] + verse_type = unicode(VerseType.to_string(verse_name[0])) verse_number = re.compile(u'[a-zA-Z]*').sub(u'', verse_name) verse_part = re.compile(u'[0-9]*').sub(u'', verse_name[1:]) # OpenLyrics allows e. g. "c", but we need "c1". From c6505d7e042f4a3ba3ca1cffb2ede441af5041ae Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Mon, 24 Jan 2011 20:31:31 +0100 Subject: [PATCH 007/243] --- openlp/plugins/songs/forms/songexportform.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index 6cf172087..e8e11d8b7 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -95,7 +95,7 @@ class SongExportForm(OpenLPWizard): self.onAvailableListItemDoubleClicked) QtCore.QObject.connect(self.selectedListWidget, QtCore.SIGNAL(u'itemDoubleClicked(QListWidgetItem *)'), - self.onSelectedListItemDoubleClicked) + self.onSelectedListItemDoubleClicked) def addCustomPages(self): """ @@ -189,7 +189,7 @@ class SongExportForm(OpenLPWizard): translate('SongsPlugin.ExportWizardForm', 'Ready.')) self.progressBar.setFormat( translate('SongsPlugin.ExportWizardForm', '%p%')) - + self.availableGroupBox.setTitle( translate('SongsPlugin.ExportWizardForm', 'Available Songs')) self.addSelected.setText( From d087bbb53ad4827be33c2927ad05993b5dcc0ea3 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Mon, 24 Jan 2011 21:01:09 +0100 Subject: [PATCH 008/243] verseOrder fix --- openlp/plugins/songs/forms/songexportform.py | 12 ++++++++---- openlp/plugins/songs/lib/openlyricsexport.py | 3 ++- openlp/plugins/songs/lib/xml.py | 4 ++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index f7cc0e616..b4bc2de42 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -305,16 +305,20 @@ class SongExportForm(OpenLPWizard): """ Adds the double clicked item to the list of selected songs and removes it from the list of availables songs. + + ``item`` + The *QListWidgetItem* which was double clicked. """ - row = self.availableListWidget.row(item) - self.availableListWidget.takeItem(row) + self.availableListWidget.takeItem(self.availableListWidget.row(item)) self.selectedListWidget.addItem(item) def onSelectedListItemDoubleClicked(self, item): """ Adds the double clicked item back to the list of available songs and removes it from the list of selected songs. + + ``ìtem`` + The *QListWidgetItem* which was double clicked. """ - row = self.selectedListWidget.row(item) - self.selectedListWidget.takeItem(row) + self.selectedListWidget.takeItem(self.selectedListWidget.row(item)) self.availableListWidget.addItem(item) diff --git a/openlp/plugins/songs/lib/openlyricsexport.py b/openlp/plugins/songs/lib/openlyricsexport.py index 0f8f679f5..b657f891f 100755 --- a/openlp/plugins/songs/lib/openlyricsexport.py +++ b/openlp/plugins/songs/lib/openlyricsexport.py @@ -30,7 +30,7 @@ songs from the database. import logging import os -from lxml import etree, objectify +from lxml import etree from openlp.core.lib import Receiver, translate from openlp.plugins.songs.lib import OpenLyrics @@ -55,6 +55,7 @@ class OpenLyricsExport(object): """ Export the songs. """ + log.debug(u'started OpenLyricsExport') openLyrics = OpenLyrics(self.manager) self.parent.progressBar.setMaximum(len(self.songs)) for song in self.songs: diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index 78028f637..cc2660874 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -486,9 +486,9 @@ class OpenLyrics(object): for name in temp_verse_order: if name[0] == previous_type: if name[1] != previous_number: - verse_order.append(u''.join((name[0], name[1]))) + verse_order.append(u''.join((name[0][0], name[1]))) else: - verse_order.append(u''.join((name[0], name[1]))) + verse_order.append(u''.join((name[0][0], name[1]))) previous_type = name[0] previous_number = name[1] previous_part = name[2] From 5b680b32f652825f00279cf005bb050634001a28 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Mon, 24 Jan 2011 22:00:36 +0100 Subject: [PATCH 009/243] --- openlp/plugins/songs/forms/songexportform.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index b4bc2de42..4ec6acc7c 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -157,7 +157,7 @@ class SongExportForm(OpenLPWizard): self.verticalLayout.addWidget(self.selectedListWidget) self.sourceLayout.addWidget(self.selectedGroupBox) self.addPage(self.sourcePage) - #TODO: Add save dialog + #TODO: Add save dialog and search box. def retranslateUi(self): """ From ea83bf26d7f6347352b061261be3d7b985dd4054 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Tue, 25 Jan 2011 19:34:17 +0100 Subject: [PATCH 010/243] --- openlp/plugins/songs/forms/songexportform.py | 45 +++++++++++++++++++- openlp/plugins/songs/lib/xml.py | 2 + 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index 3b9bf3ffd..e9904e0bb 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -30,7 +30,7 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import Receiver, translate +from openlp.core.lib import Receiver, SettingsManager, translate from openlp.core.ui import criticalErrorMessageBox from openlp.core.ui.wizard import OpenLPWizard from openlp.plugins.songs.lib.db import Song @@ -158,7 +158,43 @@ class SongExportForm(OpenLPWizard): self.selectedListWidget.setSortingEnabled(True) self.verticalLayout.addWidget(self.selectedListWidget) self.sourceLayout.addWidget(self.selectedGroupBox) + + """ + importLayout.setObjectName(obj_prefix + u'Layout') + filenameLabel = QtGui.QLabel(importWidget) + filenameLabel.setObjectName(obj_prefix + u'FilenameLabel') + fileLayout = QtGui.QHBoxLayout() + fileLayout.setObjectName(obj_prefix + u'FileLayout') + filenameEdit = QtGui.QLineEdit(importWidget) + filenameEdit.setObjectName(obj_prefix + u'FilenameEdit') + fileLayout.addWidget(filenameEdit) + browseButton = QtGui.QToolButton(importWidget) + browseButton.setIcon(self.openIcon) + browseButton.setObjectName(obj_prefix + u'BrowseButton') + fileLayout.addWidget(browseButton) + """ + + + self.horizontalLayout = QtGui.QHBoxLayout() + self.horizontalLayout.setObjectName(u'horizontalLayout') + + self.pathLabel = QtGui.QLabel() + self.pathLabel.setObjectName(u'pathLabel') + self.horizontalLayout.addWidget(self.pathLabel) + + self.pathEdit = QtGui.QLineEdit(self.sourcePage) + self.pathEdit.setObjectName(u'pathEdit') + + self.horizontalLayout.addWidget(self.pathEdit) + + self.browseButton = QtGui.QPushButton(self.sourcePage) + self.browseButton.setObjectName(u'browseButton') + self.horizontalLayout.addWidget(self.browseButton) + + self.sourceLayout.addLayout(self.horizontalLayout) self.addPage(self.sourcePage) + + #TODO: Add save dialog and maybe a search box. def retranslateUi(self): @@ -266,9 +302,14 @@ class SongExportForm(OpenLPWizard): class, and then runs the ``do_export`` method of the exporter to do the actual exporting. """ + path = unicode(QtGui.QFileDialog.getExistingDirectory(self, translate( + 'SongsPlugin.ExportWizardForm', 'Selecte to Folder'), + SettingsManager.get_last_dir(self.plugin.settingsSection, 1), + options=QtGui.QFileDialog.ShowDirsOnly)) + SettingsManager.set_last_dir(self.plugin.settingsSection, path, 1) songs = [item.data(QtCore.Qt.UserRole).toPyObject() for item in self.selectedListWidget.selectedItems()] - exporter = OpenLyricsExport(self, songs, u'/tmp/') + exporter = OpenLyricsExport(self, songs, path) if exporter.do_export(): self.progressLabel.setText( translate('SongsPlugin.SongExportForm', 'Finished export.')) diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index cc2660874..d9446ec12 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -271,6 +271,8 @@ class OpenLyrics(object): verse[0][u'type'][0].lower(), verse[0][u'label']) element = \ self._add_text_to_element(u'verse', lyrics, None, verse_tag) + if verse[0].has_key(u'lang'): + element.set(u'lang', verse[0][u'lang']) element = self._add_text_to_element(u'lines', element) for line in unicode(verse[1]).split(u'\n'): self._add_text_to_element(u'line', element, line) From 98084cbe2f012f992ba519eb5601ab5a0e7ce77a Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Tue, 25 Jan 2011 19:35:00 +0100 Subject: [PATCH 011/243] --- openlp/plugins/songs/forms/songexportform.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index e9904e0bb..cbf84115b 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -173,12 +173,11 @@ class SongExportForm(OpenLPWizard): browseButton.setObjectName(obj_prefix + u'BrowseButton') fileLayout.addWidget(browseButton) """ - self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout.setObjectName(u'horizontalLayout') - self.pathLabel = QtGui.QLabel() + self.pathLabel = QtGui.QLabel(self.sourcePage) self.pathLabel.setObjectName(u'pathLabel') self.horizontalLayout.addWidget(self.pathLabel) From 54e1b8d9b73efba228eff39602ea71125c918db1 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Wed, 26 Jan 2011 17:54:10 +0100 Subject: [PATCH 012/243] clean ups --- openlp/plugins/songs/forms/songexportform.py | 6 ++++++ openlp/plugins/songs/lib/mediaitem.py | 3 +-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index 71ba83c73..512d7ec90 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -125,6 +125,9 @@ class SongExportForm(OpenLPWizard): self.selectionLayout.setSpacing(0) self.selectionLayout.setMargin(0) self.selectionLayout.setObjectName(u'selectionLayout') + spacerItem = QtGui.QSpacerItem(20, 0, + QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.MinimumExpanding) + self.selectionLayout.addItem(spacerItem) self.addSelected = QtGui.QToolButton(self.selectionWidget) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap( @@ -143,6 +146,9 @@ class SongExportForm(OpenLPWizard): self.removeSelected.setIconSize(QtCore.QSize(20, 20)) self.removeSelected.setObjectName(u'removeSelected') self.selectionLayout.addWidget(self.removeSelected) + spacerItem = QtGui.QSpacerItem(20, 0, + QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.MinimumExpanding) + self.selectionLayout.addItem(spacerItem) self.sourceLayout.addWidget(self.selectionWidget) self.selectedGroupBox = QtGui.QGroupBox(self.sourcePage) self.selectedGroupBox.setObjectName(u'selectedGroupBox') diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 0dd0df882..6067442c0 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -274,8 +274,7 @@ class SongMediaItem(MediaManagerItem): def onExportClick(self): if not hasattr(self, u'export_wizard'): self.export_wizard = SongExportForm(self, self.parent) - if self.export_wizard.exec_() == QtGui.QDialog.Accepted: - Receiver.send_message(u'songs_load_list') + self.export_wizard.exec_() def onNewClick(self): log.debug(u'onNewClick') From e0b6107dd5c2dd09e57d20813403b811b3cf8dc3 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Wed, 26 Jan 2011 20:12:14 +0100 Subject: [PATCH 013/243] clean up --- openlp/plugins/songs/forms/songexportform.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index 512d7ec90..21adcc93f 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -64,7 +64,7 @@ class SongExportForm(OpenLPWizard): def stop_export(self): """ - Sets the flag for exporters to stop their export + Sets the flag for the exporter to stop the export. """ log.debug(u'Stopping songs export') self.stop_export_flag = True @@ -140,7 +140,7 @@ class SongExportForm(OpenLPWizard): self.removeSelected = QtGui.QToolButton(self.selectionWidget) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap( - u':/imports/import_remove.png'), + u':/exports/export_remove.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.removeSelected.setIcon(icon) self.removeSelected.setIconSize(QtCore.QSize(20, 20)) @@ -192,7 +192,7 @@ class SongExportForm(OpenLPWizard): 'Welcome to the Song Export Wizard')) self.informationLabel.setText( translate('SongsPlugin.ExportWizardForm', 'This wizard will help to ' - 'export your songs to the free and open OpenLyrics worship song ' + 'export your songs to the open and free OpenLyrics worship song ' 'format. You can import these songs in all lyrics projection ' 'software, which supports OpenLyrics.')) self.sourcePage.setTitle( @@ -213,10 +213,6 @@ class SongExportForm(OpenLPWizard): self.availableGroupBox.setTitle( translate('SongsPlugin.ExportWizardForm', 'Available Songs')) - self.addSelected.setText( - translate('SongsPlugin.ExportWizardForm', 'Select Songs')) - self.removeSelected.setText( - translate('SongsPlugin.ExportWizardForm', 'Select Songs')) self.selectedGroupBox.setTitle( translate('SongsPlugin.ExportWizardForm', 'Selected Songs')) From aa494c9ea32ded5b414cb5ceb4abd9cafc0b0210 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Thu, 27 Jan 2011 16:13:11 +0100 Subject: [PATCH 014/243] --- openlp/plugins/songs/forms/songexportform.py | 225 +++++++++-------- openlp/plugins/songs/lib/openlyricsexport.py | 12 +- resources/forms/songexport.ui | 241 ------------------- resources/forms/songexportform.ui | 128 ++++++++++ resources/images/openlp-2.qrc | 1 + resources/images/wizard_exportsong.bmp | Bin 0 -> 172254 bytes 6 files changed, 252 insertions(+), 355 deletions(-) delete mode 100644 resources/forms/songexport.ui create mode 100644 resources/forms/songexportform.ui create mode 100644 resources/images/wizard_exportsong.bmp diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index 21adcc93f..f3311596e 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -24,7 +24,8 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### """ -The song export function for OpenLP. +The :mod:`songexportform` module provides the wizard for exporting songs to the +OpenLyrics format. """ import logging @@ -40,8 +41,8 @@ log = logging.getLogger(__name__) class SongExportForm(OpenLPWizard): """ - This is the Song Export Wizard, which allows easy exporting of Songs to - OpenLyrics. + This is the Song Export Wizard, which allows easy exporting of Songs to the + OpenLyrics format. """ log.info(u'SongExportForm loaded') @@ -57,7 +58,7 @@ class SongExportForm(OpenLPWizard): """ self.plugin = plugin OpenLPWizard.__init__(self, parent, plugin, u'songExportWizard', - u':/wizards/wizard_importsong.bmp') + u':/wizards/wizard_exportsong.bmp') self.stop_export_flag = False QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'openlp_stop_wizard'), self.stop_export) @@ -85,9 +86,9 @@ class SongExportForm(OpenLPWizard): """ Song wizard specific signals. """ - QtCore.QObject.connect(self.addSelected, + QtCore.QObject.connect(self.addButton, QtCore.SIGNAL(u'clicked()'), self.onAddSelectedClicked) - QtCore.QObject.connect(self.removeSelected, + QtCore.QObject.connect(self.removeButton, QtCore.SIGNAL(u'clicked()'), self.onRemoveSelectedClicked) QtCore.QObject.connect(self.availableListWidget, QtCore.SIGNAL(u'itemDoubleClicked(QListWidgetItem *)'), @@ -95,6 +96,8 @@ class SongExportForm(OpenLPWizard): QtCore.QObject.connect(self.selectedListWidget, QtCore.SIGNAL(u'itemDoubleClicked(QListWidgetItem *)'), self.onSelectedListItemDoubleClicked) + QtCore.QObject.connect(self.directoryButton, + QtCore.SIGNAL(u'clicked()'), self.onDirectoryButtonClicked) def addCustomPages(self): """ @@ -103,82 +106,70 @@ class SongExportForm(OpenLPWizard): # Source Page self.sourcePage = QtGui.QWizardPage() self.sourcePage.setObjectName(u'sourcePage') - self.sourceLayout = QtGui.QHBoxLayout(self.sourcePage) - self.sourceLayout.setObjectName(u'sourceLayout') - self.availableGroupBox = QtGui.QGroupBox(self.sourcePage) - self.availableGroupBox.setObjectName(u'availableGroupBox') - self.verticalLayout = QtGui.QVBoxLayout(self.availableGroupBox) + self.horizontalLayout = QtGui.QHBoxLayout(self.sourcePage) + self.horizontalLayout.setObjectName(u'horizontalLayout') + self.verticalLayout = QtGui.QVBoxLayout() self.verticalLayout.setObjectName(u'verticalLayout') - self.verticalLayout.setContentsMargins(0, -1, 0, 0) - self.availableListWidget = QtGui.QListWidget(self.availableGroupBox) - self.availableListWidget.setObjectName(u'availableListWidget') - self.availableListWidget.setSelectionMode( - QtGui.QAbstractItemView.ExtendedSelection) - self.availableListWidget.setSizePolicy( - QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) - self.availableListWidget.setSortingEnabled(True) - self.verticalLayout.addWidget(self.availableListWidget) - self.sourceLayout.addWidget(self.availableGroupBox) - self.selectionWidget = QtGui.QWidget(self.sourcePage) - self.selectionWidget.setObjectName(u'selectionWidget') - self.selectionLayout = QtGui.QVBoxLayout(self.selectionWidget) - self.selectionLayout.setSpacing(0) - self.selectionLayout.setMargin(0) - self.selectionLayout.setObjectName(u'selectionLayout') - spacerItem = QtGui.QSpacerItem(20, 0, - QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.MinimumExpanding) - self.selectionLayout.addItem(spacerItem) - self.addSelected = QtGui.QToolButton(self.selectionWidget) - icon = QtGui.QIcon() - icon.addPixmap(QtGui.QPixmap( - u':/exports/export_move_to_list.png'), - QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.addSelected.setIcon(icon) - self.addSelected.setIconSize(QtCore.QSize(20, 20)) - self.addSelected.setObjectName(u'addSelected') - self.selectionLayout.addWidget(self.addSelected) - self.removeSelected = QtGui.QToolButton(self.selectionWidget) - icon = QtGui.QIcon() - icon.addPixmap(QtGui.QPixmap( - u':/exports/export_remove.png'), - QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.removeSelected.setIcon(icon) - self.removeSelected.setIconSize(QtCore.QSize(20, 20)) - self.removeSelected.setObjectName(u'removeSelected') - self.selectionLayout.addWidget(self.removeSelected) - spacerItem = QtGui.QSpacerItem(20, 0, - QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.MinimumExpanding) - self.selectionLayout.addItem(spacerItem) - self.sourceLayout.addWidget(self.selectionWidget) - self.selectedGroupBox = QtGui.QGroupBox(self.sourcePage) - self.selectedGroupBox.setObjectName(u'selectedGroupBox') - self.verticalLayout = QtGui.QVBoxLayout(self.selectedGroupBox) - self.verticalLayout.setObjectName(u'verticalLayout') - self.verticalLayout.setContentsMargins(0, -1, 0, 0) - self.selectedListWidget = QtGui.QListWidget(self.selectedGroupBox) + self.gridLayout = QtGui.QGridLayout() + self.gridLayout.setObjectName(u'gridLayout') + self.selectedListWidget = QtGui.QListWidget(self.sourcePage) self.selectedListWidget.setObjectName(u'selectedListWidget') self.selectedListWidget.setSelectionMode( QtGui.QAbstractItemView.ExtendedSelection) - self.selectedListWidget.setSizePolicy( - QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) self.selectedListWidget.setSortingEnabled(True) - self.verticalLayout.addWidget(self.selectedListWidget) - self.sourceLayout.addWidget(self.selectedGroupBox) - # - self.horizontalLayout = QtGui.QHBoxLayout() - self.horizontalLayout.setObjectName(u'horizontalLayout') - self.pathLabel = QtGui.QLabel() - self.pathLabel.setObjectName(u'pathLabel') - self.horizontalLayout.addWidget(self.pathLabel) - self.pathEdit = QtGui.QLineEdit() - self.pathEdit.setObjectName(u'pathEdit') - self.horizontalLayout.addWidget(self.pathEdit) - self.browseButton = QtGui.QToolButton() - self.browseButton.setObjectName(u'browseButton') - self.horizontalLayout.addWidget(self.browseButton) - # + self.gridLayout.addWidget(self.selectedListWidget, 1, 2, 1, 1) + self.gridLayout2 = QtGui.QGridLayout() + self.gridLayout2.setObjectName(u'gridLayout2') + self.addButton = QtGui.QToolButton(self.sourcePage) + icon = QtGui.QIcon() + icon.addPixmap(QtGui.QPixmap(u':/exports/export_move_to_list.png'), + QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.addButton.setIcon(icon) + self.addButton.setObjectName(u'addButton') + self.gridLayout2.addWidget(self.addButton, 1, 0, 1, 1) + self.removeButton = QtGui.QToolButton(self.sourcePage) + icon = QtGui.QIcon() + icon.addPixmap(QtGui.QPixmap(u':/exports/export_remove.png'), + QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.removeButton.setIcon(icon) + self.removeButton.setObjectName(u'removeButton') + self.gridLayout2.addWidget(self.removeButton, 2, 0, 1, 1) + spacerItem = QtGui.QSpacerItem(20, 40, + QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.gridLayout2.addItem(spacerItem, 0, 0, 1, 1) + self.gridLayout2.addItem(spacerItem, 3, 0, 1, 1) + self.gridLayout.addLayout(self.gridLayout2, 1, 1, 1, 1) + self.availableLabel = QtGui.QLabel(self.sourcePage) + self.availableLabel.setObjectName(u'availableLabel') + self.gridLayout.addWidget(self.availableLabel, 0, 0, 1, 1) + self.selectedLabel = QtGui.QLabel(self.sourcePage) + self.selectedLabel.setObjectName(u'selectedLabel') + self.gridLayout.addWidget(self.selectedLabel, 0, 2, 1, 1) + self.availableListWidget = QtGui.QListWidget(self.sourcePage) + self.availableListWidget.setObjectName(u'availableListWidget') + self.availableListWidget.setSelectionMode( + QtGui.QAbstractItemView.ExtendedSelection) + self.availableListWidget.setSortingEnabled(True) + self.gridLayout.addWidget(self.availableListWidget, 1, 0, 1, 1) + self.verticalLayout.addLayout(self.gridLayout) + self.gridLayout5 = QtGui.QGridLayout() + self.gridLayout5.setObjectName(u'gridLayout5') + self.directoryButton = QtGui.QToolButton(self.sourcePage) + icon = QtGui.QIcon() + icon.addPixmap(QtGui.QPixmap(u':/exports/export_load.png'), + QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.directoryButton.setIcon(icon) + self.directoryButton.setObjectName(u'directoryButton') + self.gridLayout5.addWidget(self.directoryButton, 0, 2, 1, 1) + self.directoryLineEdit = QtGui.QLineEdit(self.sourcePage) + self.directoryLineEdit.setObjectName(u'directoryLineEdit') + self.gridLayout5.addWidget(self.directoryLineEdit, 0, 1, 1, 1) + self.directoryLabel = QtGui.QLabel(self.sourcePage) + self.directoryLabel.setObjectName(u'directoryLabel') + self.gridLayout5.addWidget(self.directoryLabel, 0, 0, 1, 1) + self.verticalLayout.addLayout(self.gridLayout5) + self.horizontalLayout.addLayout(self.verticalLayout) self.addPage(self.sourcePage) - #TODO: Add save dialog and maybe a search box. def retranslateUi(self): """ @@ -193,13 +184,13 @@ class SongExportForm(OpenLPWizard): self.informationLabel.setText( translate('SongsPlugin.ExportWizardForm', 'This wizard will help to ' 'export your songs to the open and free OpenLyrics worship song ' - 'format. You can import these songs in all lyrics projection ' - 'software, which supports OpenLyrics.')) + 'format.')) self.sourcePage.setTitle( translate('SongsPlugin.ExportWizardForm', 'Select Songs')) self.sourcePage.setSubTitle( translate('SongsPlugin.ExportWizardForm', - 'Select the songs, you want to export.')) + 'Add the songs, you want to export to the list on the right hand ' + 'side. You can use the buttons below or double click them.')) self.progressPage.setTitle( translate('SongsPlugin.ExportWizardForm', 'Exporting')) @@ -211,37 +202,34 @@ class SongExportForm(OpenLPWizard): self.progressBar.setFormat( translate('SongsPlugin.ExportWizardForm', '%p%')) - self.availableGroupBox.setTitle( - translate('SongsPlugin.ExportWizardForm', 'Available Songs')) - self.selectedGroupBox.setTitle( - translate('SongsPlugin.ExportWizardForm', 'Selected Songs')) + self.directoryLabel.setText(translate('SongsPlugin.ExportWizardForm', + 'Directory:')) + self.availableLabel.setText( + translate('SongsPlugin.ExportWizardForm', 'Available Songs')) + self.selectedLabel.setText( + translate('SongsPlugin.ExportWizardForm', 'Selected Songs')) def validateCurrentPage(self): """ Validate the current page before moving on to the next page. """ if self.currentPage() == self.welcomePage: - Receiver.send_message(u'cursor_busy') - songs = self.plugin.manager.get_all_objects(Song) - for song in songs: - authors = u', '.join([author.display_name - for author in song.authors]) - song_detail = u'%s (%s)' % (unicode(song.title), authors) - song_name = QtGui.QListWidgetItem(song_detail) - song_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(song)) - self.availableListWidget.addItem(song_name) - self.availableListWidget.selectAll() - Receiver.send_message(u'cursor_normal') return True elif self.currentPage() == self.sourcePage: - self.selectedListWidget.selectAll() - if not self.selectedListWidget.selectedItems(): + if not self.selectedListWidget.count(): criticalErrorMessageBox( translate('SongsPlugin.ExportWizardForm', 'No Song Selected'), - translate('SongsPlugin.ImportWizardForm', + translate('SongsPlugin.ExportWizardForm', 'You need to add at least one Song to export.')) return False + elif not self.directoryLineEdit.text(): + criticalErrorMessageBox( + translate('SongsPlugin.ExportWizardForm', + 'No Save Location specified'), + translate('SongsPlugin.ExportWizardForm', + 'You need to specified a directory to save the songs in.')) + return False return True elif self.currentPage() == self.progressPage: self.availableListWidget.clear() @@ -261,10 +249,25 @@ class SongExportForm(OpenLPWizard): self.restart() self.finishButton.setVisible(False) self.cancelButton.setVisible(True) + self.availableListWidget.clear() + self.selectedListWidget.clear() + self.directoryLineEdit.clear() + # Load the list of songs. + Receiver.send_message(u'cursor_busy') + songs = self.plugin.manager.get_all_objects(Song) + for song in songs: + authors = u', '.join([author.display_name + for author in song.authors]) + song_detail = u'%s (%s)' % (unicode(song.title), authors) + song_name = QtGui.QListWidgetItem(song_detail) + song_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(song)) + self.availableListWidget.addItem(song_name) + self.availableListWidget.selectAll() + Receiver.send_message(u'cursor_normal') def preWizard(self): """ - Perform pre export tasks + Perform pre export tasks. """ OpenLPWizard.preWizard(self) self.progressLabel.setText( @@ -273,18 +276,14 @@ class SongExportForm(OpenLPWizard): def performWizard(self): """ - Perform the actual export. This method pulls in the correct exporter - class, and then runs the ``do_export`` method of the exporter to do - the actual exporting. + Perform the actual export. This creates an *openlyricsexport* instance + and calls the *do_export* method. """ - path = unicode(QtGui.QFileDialog.getExistingDirectory(self, translate( - 'SongsPlugin.ExportWizardForm', 'Selecte to Folder'), - SettingsManager.get_last_dir(self.plugin.settingsSection, 1), - options=QtGui.QFileDialog.ShowDirsOnly)) - SettingsManager.set_last_dir(self.plugin.settingsSection, path, 1) + self.selectedListWidget.selectAll() songs = [item.data(QtCore.Qt.UserRole).toPyObject() for item in self.selectedListWidget.selectedItems()] - exporter = OpenLyricsExport(self, songs, path) + exporter = OpenLyricsExport( + self, songs, unicode(self.directoryLineEdit.text())) if exporter.do_export(): self.progressLabel.setText( translate('SongsPlugin.SongExportForm', 'Finished export.')) @@ -340,3 +339,15 @@ class SongExportForm(OpenLPWizard): """ self.selectedListWidget.takeItem(self.selectedListWidget.row(item)) self.availableListWidget.addItem(item) + + def onDirectoryButtonClicked(self): + """ + Called when click on the *directoryButton*. Opens a dialog and writes + the path to *directoryLineEdit*. + """ + path = unicode(QtGui.QFileDialog.getExistingDirectory(self, + translate('SongsPlugin.ExportWizardForm', 'Selecte to Folder'), + SettingsManager.get_last_dir(self.plugin.settingsSection, 1), + options=QtGui.QFileDialog.ShowDirsOnly)) + SettingsManager.set_last_dir(self.plugin.settingsSection, path, 1) + self.directoryLineEdit.setText(path) diff --git a/openlp/plugins/songs/lib/openlyricsexport.py b/openlp/plugins/songs/lib/openlyricsexport.py index 68dfde93f..380db1932 100755 --- a/openlp/plugins/songs/lib/openlyricsexport.py +++ b/openlp/plugins/songs/lib/openlyricsexport.py @@ -25,7 +25,7 @@ ############################################################################### """ The :mod:`openlyricsexport` module provides the functionality for exporting -songs from the database. +songs from the database to the OpenLyrics format. """ import logging import os @@ -50,6 +50,8 @@ class OpenLyricsExport(object): self.manager = parent.plugin.manager self.songs = songs self.save_path = save_path + if not os.path.exists(self.save_path): + os.mkdir(self.save_path) def do_export(self): """ @@ -65,12 +67,8 @@ class OpenLyricsExport(object): self.parent.incrementProgressBar(unicode(translate( 'SongsPlugin.OpenLyricsExport', 'Exporting %s...')) % song.title) - # Check if path exists. If not, create the directories! - # What do we do with songs with the same title? I do not want to - # overwrite them! - path = os.path.join(self.save_path, song.title + u'.xml') xml = openLyrics.song_to_xml(song) tree = etree.ElementTree(etree.fromstring(xml)) - tree.write(path, encoding=u'utf-8', xml_declaration=True, - pretty_print=True) + tree.write(os.path.join(self.save_path, song.title + u'.xml'), + encoding=u'utf-8', xml_declaration=True, pretty_print=True) return True diff --git a/resources/forms/songexport.ui b/resources/forms/songexport.ui deleted file mode 100644 index 9830db3ef..000000000 --- a/resources/forms/songexport.ui +++ /dev/null @@ -1,241 +0,0 @@ - - SongExportDialog - - - - 0 - 0 - 641 - 607 - - - - Dialog - - - - 8 - - - 8 - - - - - - 8 - - - 0 - - - - - Available Songs - - - - - - - - - Select All - - - - - - - - - - - 0 - 0 - - - - - 30 - 16777215 - - - - - 8 - - - QLayout::SetMinimumSize - - - 0 - - - - - Qt::Vertical - - - QSizePolicy::MinimumExpanding - - - - 20 - 132 - - - - - - - - Select Songs - - - - :/exports/export_move_to_list.png:/exports/export_move_to_list.png - - - - 20 - 20 - - - - - - - - Deselect Songs - - - - :/exports/export_remove.png:/exports/export_remove.png - - - - 20 - 20 - - - - - - - - Qt::Vertical - - - QSizePolicy::MinimumExpanding - - - - 20 - 131 - - - - - - - - - - - Selected Songs - - - - - - - - - Select All - - - - - - - - - - - - - 0 - - - - OpenLyric Format - - - - - Text File - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - SongExportButtonBox - AvailableListWidget - AvailableAllToolButton - SelectToolButton - DeselectToolButton - SelectedListWidget - SelectedAllToolButton - ExportTabWidget - - - - - - - SongExportButtonBox - accepted() - SongExportDialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - SongExportButtonBox - rejected() - SongExportDialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - - diff --git a/resources/forms/songexportform.ui b/resources/forms/songexportform.ui new file mode 100644 index 000000000..f3d775a3a --- /dev/null +++ b/resources/forms/songexportform.ui @@ -0,0 +1,128 @@ + + + WizardPage + + + + 0 + 0 + 576 + 334 + + + + WizardPage + + + + + + + + + + + + + + + ... + + + + :/exports/export_move_to_list.png:/exports/export_move_to_list.png + + + + + + + ... + + + + :/exports/export_remove.png:/exports/export_remove.png + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + Available Songs + + + + + + + Selected Songs + + + + + + + + + + + + + + ... + + + + :/exports/export_load.png:/exports/export_load.png + + + + + + + + + + Directory: + + + + + + + + + + + + + + diff --git a/resources/images/openlp-2.qrc b/resources/images/openlp-2.qrc index 6b9d6dd54..41424cf53 100644 --- a/resources/images/openlp-2.qrc +++ b/resources/images/openlp-2.qrc @@ -84,6 +84,7 @@ export_move_to_list.png + wizard_exportsong.bmp wizard_importsong.bmp wizard_importbible.bmp wizard_createtheme.bmp diff --git a/resources/images/wizard_exportsong.bmp b/resources/images/wizard_exportsong.bmp new file mode 100644 index 0000000000000000000000000000000000000000..948422dcc4d845b05342bcd6dcf732a286aba486 GIT binary patch literal 172254 zcmX_}hg((G*6zyc*i@&m}Abp4UPG9;ETV>f8P9W&;N(`KlSf_ z``h3DHkrG>{p~oPkN@Z2)c@)MmxH_a9^Ad}(B1<_4;(za@8Hn`hmIcTJbviN$s@;3 z9X)>L`04JGXV0EE)6;eS{HgAqGd<@|pX)i*-FN0(Usrek*>jiA^;|yRbEE&#jsE_d zm#^Nsa&_qXjiGA;cdp+UxpDLEt=o5R-MV|@`h#1y@87t^m2&U;jo~X-FP}Jdbj$CZ zn}0pEXV=ZXzK26YkMG`lGIICXy}Qru-+l4$-pfb#Uq62E;=%pLH*btw=)2r`plAEm z?j2iioIUmU_RZIi9=&`1;@!)a?_a(7`1;MKSFitk^Y+iT@BV!I_Fr$`{p;=9f4_h8 z=bM**ynOcI(fyaVu0OhPZut1&TL<>v=sbAiaOa(_Tv~I=pY^u3t87YH4jNuQsg8 zDhP{NYB|gM>u<**`ES1d#@ov)b>+&kvhv!Ry5^>~)$MEBSFh{n*wC@&=k|_`E$!=? zTi3O;uWxQ$Q(kGzFD$KVY^iN%rWop)%B$)0tEKHqhYYv0-43uk*SoIOwJKi7M;@8Xr7zJUuDZ(Y7}z5nt}!TS2()oa7o zua8h}+_-=1*2CMk9}NyZygm4MXz1bK;DejD`18@w(33lN?p?cf@#x{sO&j)aSl_*G z@4%VUBiAlH8ocpjWa#O=VS)R}!#7VKzm@Xn-Qx$3uV1;{eY$7IuV;VT*x$K(sQ2uX z+qYgne)Rsuvrn&HetP@nk9TkX{qEhrKfM3Xr;q>n^x;1r-~Z>syZ?NA_g^XR|MULs zzh1xm^ZDad!Z5*Q<{&Uc7tu?DgZvFCIL2diUmJRDRG?+|9rR7Ug(meyh$4!~>#g|_p`H2%JM@L2H zWam~@R+}1|o0{8NT02&EtnXN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RuB*r^EXgk_ zD_*Dft4(Qv*ag+Vj?J_+UxFy!k6v6_gmFQdqjdOq7Kyi{{K<`Q|%|m**7K zH?&y9i6k7Y{R1XpYK_ z;m=d|Qb_|ZLXInclS^0Ti%|HY%|=Tfo~h#peiKQs*GBZpfU+#if>;>zrMcyB6HwYi^0|o0j&T*7g|RUDvv~w6?Xdygp}b z^~$1(<$0yca@OS*mX(y()zr6DZIE4Qt7|e8#llksuQ(k&I&+mQcMxr>mm1r9%j??< z%Nth|m4CP_e?@-DnzEX;)r|$^^{>6F+v|p)wpfDYK*qZ!+ZDZnML3qv0Lfm zgBBx>?K?QKZP$UOuD)f(RX=+5-S7P655M#0fA!t(eD}xSd$wR{j`F8Pdi#uD*tP#- zv&6Lwpc%vcz#zFkc5LQ^laPh-sZ(~Lp7VI(M69<~@RBoEEW>^e-_m@K)-E$ohYt^* zojG^ql723vBW#g48P*BzxCc(3I?LgQO;j#Vem&yE$VX%e0XG z43}Qr^UTaSvOja;%+-rm)y24cY>NBg>V>PY1|L!V7IC;g3}gMp<41;OJkHLe2OP7n zq3n5x!@93$>%Q28aTv-&M@CU;kuDA&q`;313>?|F?~ui&Dwyq^Jxruj#`0B#OP1$5 ztMk?suV+%5n_9Y|+|u5=u?;b7vu$WK8@np3SgL6$Dz9H%RIzAz(W>0_UcA1nmK9!K zR#U}rZ;X9;fX*b^@(x&cM2l|h>#>-rwymeEt}VZ;c5&W%9lL8P>r3lf3#*#m&na0_ zR8`Z&G26R)?_sJt3H9*a1NP{ReSBc-z@c#~8tgH**S@89dtqh$^KUNv-~a5d{=KNE+~Cv!l*j{GLB#EG%828M@eGBK|J literal 0 HcmV?d00001 From 3362fa9a84d32fd2443ac016b944e37059559924 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Thu, 27 Jan 2011 16:42:11 +0100 Subject: [PATCH 015/243] removed not needed code --- openlp/plugins/songs/forms/songexportform.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index 94abf54c8..908392b94 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -157,11 +157,6 @@ class SongExportForm(OpenLPWizard): self.gridLayout.addWidget(self.availableListWidget, 1, 0, 1, 1) # Button to select all songs in the "selectedListWidget". self.allSelectedButton = QtGui.QToolButton(self.sourcePage) -# sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) -# sizePolicy.setHorizontalStretch(0) -# sizePolicy.setVerticalStretch(0) -# sizePolicy.setHeightForWidth(self.allSelectedButton.sizePolicy().hasHeightForWidth()) -# self.allSelectedButton.setSizePolicy(sizePolicy) self.allSelectedButton.setObjectName(u'allSelectedButton') self.gridLayout.addWidget(self.allSelectedButton, 3, 2, 1, 1) # Button to select all songs in the "availableListWidget". From 74d20ae81b73c97718e4b49d769a561a03d1ffab Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Thu, 27 Jan 2011 19:14:55 +0100 Subject: [PATCH 016/243] removed blank lines --- openlp/plugins/songs/forms/songexportform.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index 908392b94..7e2ce7660 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -203,7 +203,6 @@ class SongExportForm(OpenLPWizard): translate('SongsPlugin.ExportWizardForm', 'Add the songs, you want to export to the list on the right hand ' 'side. You can use the buttons below or double click them.')) - self.progressPage.setTitle( translate('SongsPlugin.ExportWizardForm', 'Exporting')) self.progressPage.setSubTitle( @@ -213,7 +212,6 @@ class SongExportForm(OpenLPWizard): translate('SongsPlugin.ExportWizardForm', 'Ready.')) self.progressBar.setFormat( translate('SongsPlugin.ExportWizardForm', '%p%')) - self.directoryLabel.setText(translate('SongsPlugin.ExportWizardForm', 'Directory:')) self.availableLabel.setText( From eff7708e00dc805389014bb2154fde08a312a9d9 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Thu, 3 Feb 2011 14:41:42 +0100 Subject: [PATCH 017/243] fixed doc --- openlp/plugins/songs/forms/songexportform.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index 7e2ce7660..004fbdcf8 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -362,7 +362,7 @@ class SongExportForm(OpenLPWizard): def onDirectoryButtonClicked(self): """ - Called when click on the *directoryButton*. Opens a dialog and writes + Called when the *directoryButton* was clicked. Opens a dialog and writes the path to *directoryLineEdit*. """ path = unicode(QtGui.QFileDialog.getExistingDirectory(self, From aaba4c1b5e6c408a1e6a80efede63dbad9632de2 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Thu, 3 Feb 2011 16:57:36 +0100 Subject: [PATCH 018/243] fixed Receiver, fixed errorBox --- openlp/core/lib/ui.py | 2 +- openlp/core/ui/__init__.py | 2 +- openlp/plugins/songs/forms/songexportform.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 8cfffef45..bb8238bf0 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -30,7 +30,7 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import translate +from openlp.core.lib import Receiver, translate log = logging.getLogger(__name__) diff --git a/openlp/core/ui/__init__.py b/openlp/core/ui/__init__.py index eb0e89775..d820c9a5b 100644 --- a/openlp/core/ui/__init__.py +++ b/openlp/core/ui/__init__.py @@ -28,7 +28,7 @@ The :mod:`ui` module provides the core user interface for OpenLP """ from PyQt4 import QtGui -from openlp.core.lib import translate, Receiver +from openlp.core.lib import translate class HideMode(object): """ diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index 004fbdcf8..307d91570 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -32,7 +32,7 @@ import logging from PyQt4 import QtCore, QtGui from openlp.core.lib import Receiver, SettingsManager, translate -from openlp.core.ui import criticalErrorMessageBox +from openlp.core.lib.ui import critical_error_message_box from openlp.core.ui.wizard import OpenLPWizard from openlp.plugins.songs.lib.db import Song from openlp.plugins.songs.lib.openlyricsexport import OpenLyricsExport @@ -231,14 +231,14 @@ class SongExportForm(OpenLPWizard): return True elif self.currentPage() == self.sourcePage: if not self.selectedListWidget.count(): - criticalErrorMessageBox( + critical_error_message_box( translate('SongsPlugin.ExportWizardForm', 'No Song Selected'), translate('SongsPlugin.ExportWizardForm', 'You need to add at least one Song to export.')) return False elif not self.directoryLineEdit.text(): - criticalErrorMessageBox( + critical_error_message_box( translate('SongsPlugin.ExportWizardForm', 'No Save Location specified'), translate('SongsPlugin.ExportWizardForm', From 5d73211a9ff268f021bb012e91c2014928f147c4 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Thu, 3 Feb 2011 18:37:49 +0100 Subject: [PATCH 019/243] fixed doc --- openlp/plugins/songs/lib/xml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index d9446ec12..da2a7a08d 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -159,7 +159,7 @@ class OpenLyrics(object): to/from a song. As OpenLyrics has a rich set of different features, we cannot support them - all. The following features are supported by the :class:`OpenLyrics`:: + all. The following features are supported by the :class:`OpenLyrics`: ** OpenLP does not support the attribute *type* and *lang*. From 0047b8d1c105f969293f2fe8e7cd64ea7da1d4df Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Fri, 4 Feb 2011 13:57:48 +0100 Subject: [PATCH 020/243] --- openlp/core/ui/advancedtab.py | 39 ++++++++++++------ openlp/core/ui/servicemanager.py | 68 +++++++++++++++++++------------- 2 files changed, 67 insertions(+), 40 deletions(-) diff --git a/openlp/core/ui/advancedtab.py b/openlp/core/ui/advancedtab.py index f68131894..630cbc18c 100644 --- a/openlp/core/ui/advancedtab.py +++ b/openlp/core/ui/advancedtab.py @@ -84,11 +84,15 @@ class AdvancedTab(SettingsTab): self.serviceOrderGroupBox.setObjectName(u'serviceOrderGroupBox') self.serviceOrderLayout = QtGui.QVBoxLayout(self.serviceOrderGroupBox) self.serviceOrderLayout.setObjectName(u'serviceOrderLayout') - self.detailedServicePrintCheckBox = QtGui.QCheckBox( - self.serviceOrderGroupBox) - self.detailedServicePrintCheckBox.setObjectName( - u'detailedServicePrintCheckBox') - self.serviceOrderLayout.addWidget(self.detailedServicePrintCheckBox) + self.printSlideTextCheckBox = QtGui.QCheckBox(self.serviceOrderGroupBox) + self.printSlideTextCheckBox.setObjectName(u'printSlideTextCheckBox') + self.serviceOrderLayout.addWidget(self.printSlideTextCheckBox) + self.printMetaDataCheckBox = QtGui.QCheckBox(self.serviceOrderGroupBox) + self.printMetaDataCheckBox.setObjectName(u'printMetaDataCheckBox') + self.serviceOrderLayout.addWidget(self.printMetaDataCheckBox) + self.printNotesCheckBox = QtGui.QCheckBox(self.serviceOrderGroupBox) + self.printNotesCheckBox.setObjectName(u'printNotesCheckBox') + self.serviceOrderLayout.addWidget(self.printNotesCheckBox) self.leftLayout.addWidget(self.serviceOrderGroupBox) # self.sharedDirGroupBox = QtGui.QGroupBox(self.leftColumn) # self.sharedDirGroupBox.setObjectName(u'sharedDirGroupBox') @@ -141,9 +145,12 @@ class AdvancedTab(SettingsTab): 'Hide the mouse cursor when moved over the display window')) self.serviceOrderGroupBox.setTitle(translate('OpenLP.AdvancedTab', 'Service Order Print')) - self.detailedServicePrintCheckBox.setText( - translate('OpenLP.AdvancedTab', - 'Print slide texts and service item notes as well')) + self.printSlideTextCheckBox.setText( + translate('OpenLP.AdvancedTab', 'Include text slides if available')) + self.printMetaDataCheckBox.setText(translate( + 'OpenLP.AdvancedTab', 'Include playing time of media files')) + self.printNotesCheckBox.setText( + translate('OpenLP.AdvancedTab', 'Include service item notes')) # self.sharedDirGroupBox.setTitle( # translate('AdvancedTab', 'Central Data Store')) # self.sharedCheckBox.setText( @@ -179,8 +186,12 @@ class AdvancedTab(SettingsTab): QtCore.QVariant(True)).toBool()) self.hideMouseCheckBox.setChecked( settings.value(u'hide mouse', QtCore.QVariant(False)).toBool()) - self.detailedServicePrintCheckBox.setChecked(settings.value( - u'detailed service print', QtCore.QVariant(False)).toBool()) + self.printSlideTextCheckBox.setChecked(settings.value( + u'print slide text', QtCore.QVariant(False)).toBool()) + self.printMetaDataCheckBox.setChecked(settings.value( + u'print file meta data', QtCore.QVariant(False)).toBool()) + self.printNotesCheckBox.setChecked(settings.value( + u'print notes', QtCore.QVariant(False)).toBool()) settings.endGroup() def save(self): @@ -201,8 +212,12 @@ class AdvancedTab(SettingsTab): QtCore.QVariant(self.enableAutoCloseCheckBox.isChecked())) settings.setValue(u'hide mouse', QtCore.QVariant(self.hideMouseCheckBox.isChecked())) - settings.setValue(u'detailed service print', - QtCore.QVariant(self.detailedServicePrintCheckBox.isChecked())) + settings.setValue(u'print slide text', + QtCore.QVariant(self.printSlideTextCheckBox.isChecked())) + settings.setValue(u'print file meta data', + QtCore.QVariant(self.printMetaDataCheckBox.isChecked())) + settings.setValue(u'print notes', + QtCore.QVariant(self.printNotesCheckBox.isChecked())) settings.endGroup() # def onSharedCheckBoxChanged(self, checked): diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 4d36f4aec..3f38afe58 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -24,9 +24,11 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### -import os -import logging import cPickle +import datetime +import logging +import mutagen +import os import zipfile log = logging.getLogger(__name__) @@ -1188,11 +1190,6 @@ class ServiceManager(QtGui.QWidget): """ Print a Service Order Sheet. """ - if not self.serviceItems: - critical_error_message_box( - message=translate('OpenLP.ServiceManager', - 'There is no service item in this service.')) - return printDialog = QtGui.QPrintDialog() if not printDialog.exec_(): return @@ -1200,29 +1197,44 @@ class ServiceManager(QtGui.QWidget): 'Service Order Sheet') for item in self.serviceItems: item = item[u'service_item'] - # add the title + # Add the title of the service item. text += u'

%s

' % (item.icon, item.get_display_title()) - if not QtCore.QSettings().value(u'advanced' + - u'/detailed service print', QtCore.QVariant(True)).toBool(): - continue - if item.is_text(): - # Add the text of the service item. - for slide in item.get_frames(): - text += u'

' + slide[u'text'] + u'

' - elif item.is_image(): - # Add the image names of the service item. - text += u'
    ' - for slide in range(len(item.get_frames())): - text += u'
  1. %s

  2. ' % item.get_frame_title(slide) - text += u'
' - if item.foot_text: - # add footer - text += u'

%s

' % item.foot_text - if item.notes: - # add notes - text += u'

%s %s

' % (translate( - 'OpenLP.ServiceManager', 'Notes:'), item.notes) + # Add slide text of the service item. + if QtCore.QSettings().value(u'advanced' + + u'/print slide text', QtCore.QVariant(False)).toBool(): + if item.is_text(): + # Add the text of the service item. + for slide in item.get_frames(): + text += u'

' + slide[u'text'] + u'

' + elif item.is_image(): + # Add the image names of the service item. + text += u'
    ' + for slide in range(len(item.get_frames())): + text += u'
  1. %s

  2. ' % item.get_frame_title(slide) + text += u'
' + if item.foot_text: + # add footer + text += u'

%s

' % item.foot_text + # Add service items' notes. + if QtCore.QSettings().value(u'advanced' + + u'/print notes', QtCore.QVariant(False)).toBool(): + if item.notes: + text += u'

%s %s

' % (translate( + 'OpenLP.ServiceManager', 'Notes:'), item.notes) + # Add play length of media files. + if item.is_media() and QtCore.QSettings().value(u'advanced' + + u'/print file meta data', QtCore.QVariant(False)).toBool(): + path = os.path.join(item.get_frames()[0][u'path'], + item.get_frames()[0][u'title']) + if not os.path.isfile(path): + continue + file = mutagen.File(path) + if file is not None: + length = int(file.info.length) + text += u'

%s %s

' % (translate( + 'OpenLP.ServiceManager', u'Playing time:'), + unicode(datetime.timedelta(seconds=length))) serviceDocument = QtGui.QTextDocument() serviceDocument.setHtml(text) serviceDocument.print_(printDialog.printer()) From 7c69bad1120fef22071f5c42c86598d374fc949b Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Fri, 4 Feb 2011 14:35:55 +0100 Subject: [PATCH 021/243] fixed long line --- openlp/core/ui/servicemanager.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 3f38afe58..ec1025d45 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -1211,7 +1211,8 @@ class ServiceManager(QtGui.QWidget): # Add the image names of the service item. text += u'
    ' for slide in range(len(item.get_frames())): - text += u'
  1. %s

  2. ' % item.get_frame_title(slide) + text += u'
  3. %s

  4. ' % \ + item.get_frame_title(slide) text += u'
' if item.foot_text: # add footer From ce2640c80e8324580ea5379fa2f9a2532443801e Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Fri, 4 Feb 2011 16:46:16 +0100 Subject: [PATCH 022/243] --- openlp/core/ui/__init__.py | 1 + openlp/core/ui/servicemanager.py | 59 ++++---------------------------- 2 files changed, 8 insertions(+), 52 deletions(-) diff --git a/openlp/core/ui/__init__.py b/openlp/core/ui/__init__.py index eb0e89775..9de96e9b5 100644 --- a/openlp/core/ui/__init__.py +++ b/openlp/core/ui/__init__.py @@ -70,6 +70,7 @@ from shortcutlistform import ShortcutListForm from mediadockmanager import MediaDockManager from servicemanager import ServiceManager from thememanager import ThemeManager +from printserviceorderform import PrintServiceOrderForm __all__ = ['SplashScreen', 'AboutForm', 'SettingsForm', 'MainDisplay', 'SlideController', 'ServiceManager', 'ThemeManager', 'MediaDockManager', diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index ec1025d45..05171daf7 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -25,15 +25,13 @@ ############################################################################### import cPickle -import datetime import logging -import mutagen import os import zipfile log = logging.getLogger(__name__) -from PyQt4 import QtCore, QtGui +from PyQt4 import QtCore, QtGui, QtWebKit from openlp.core.lib import OpenLPToolbar, ServiceItem, context_menu_action, \ Receiver, build_icon, ItemCapabilities, SettingsManager, translate, \ @@ -1190,52 +1188,9 @@ class ServiceManager(QtGui.QWidget): """ Print a Service Order Sheet. """ - printDialog = QtGui.QPrintDialog() - if not printDialog.exec_(): - return - text = u'

%s

' % translate('OpenLP.ServiceManager', - 'Service Order Sheet') - for item in self.serviceItems: - item = item[u'service_item'] - # Add the title of the service item. - text += u'

%s

' % (item.icon, - item.get_display_title()) - # Add slide text of the service item. - if QtCore.QSettings().value(u'advanced' + - u'/print slide text', QtCore.QVariant(False)).toBool(): - if item.is_text(): - # Add the text of the service item. - for slide in item.get_frames(): - text += u'

' + slide[u'text'] + u'

' - elif item.is_image(): - # Add the image names of the service item. - text += u'
    ' - for slide in range(len(item.get_frames())): - text += u'
  1. %s

  2. ' % \ - item.get_frame_title(slide) - text += u'
' - if item.foot_text: - # add footer - text += u'

%s

' % item.foot_text - # Add service items' notes. - if QtCore.QSettings().value(u'advanced' + - u'/print notes', QtCore.QVariant(False)).toBool(): - if item.notes: - text += u'

%s %s

' % (translate( - 'OpenLP.ServiceManager', 'Notes:'), item.notes) - # Add play length of media files. - if item.is_media() and QtCore.QSettings().value(u'advanced' + - u'/print file meta data', QtCore.QVariant(False)).toBool(): - path = os.path.join(item.get_frames()[0][u'path'], - item.get_frames()[0][u'title']) - if not os.path.isfile(path): - continue - file = mutagen.File(path) - if file is not None: - length = int(file.info.length) - text += u'

%s %s

' % (translate( - 'OpenLP.ServiceManager', u'Playing time:'), - unicode(datetime.timedelta(seconds=length))) - serviceDocument = QtGui.QTextDocument() - serviceDocument.setHtml(text) - serviceDocument.print_(printDialog.printer()) + from openlp.core.ui import PrintServiceOrderForm + dialog = PrintServiceOrderForm(self) + dialog.exec_() +# printer = QtGui.QPrinter() +# serviceDocument = QtGui.QTextDocument() +# serviceDocument.setHtml(text) From 642011b379065bb31c08db2cc84bb26bbe892230 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Fri, 4 Feb 2011 19:00:59 +0100 Subject: [PATCH 023/243] --- openlp/core/ui/__init__.py | 3 +- openlp/core/ui/advancedtab.py | 34 ------ openlp/core/ui/printserviceorderform.py | 133 ++++++++++++++++++++++++ openlp/core/ui/servicemanager.py | 11 +- 4 files changed, 140 insertions(+), 41 deletions(-) create mode 100644 openlp/core/ui/printserviceorderform.py diff --git a/openlp/core/ui/__init__.py b/openlp/core/ui/__init__.py index 9de96e9b5..d6d1aa582 100644 --- a/openlp/core/ui/__init__.py +++ b/openlp/core/ui/__init__.py @@ -70,8 +70,7 @@ from shortcutlistform import ShortcutListForm from mediadockmanager import MediaDockManager from servicemanager import ServiceManager from thememanager import ThemeManager -from printserviceorderform import PrintServiceOrderForm __all__ = ['SplashScreen', 'AboutForm', 'SettingsForm', 'MainDisplay', 'SlideController', 'ServiceManager', 'ThemeManager', 'MediaDockManager', - 'ServiceItemEditForm'] + 'ServiceItemEditForm',] diff --git a/openlp/core/ui/advancedtab.py b/openlp/core/ui/advancedtab.py index 630cbc18c..58b637bc2 100644 --- a/openlp/core/ui/advancedtab.py +++ b/openlp/core/ui/advancedtab.py @@ -80,20 +80,6 @@ class AdvancedTab(SettingsTab): self.hideMouseCheckBox.setObjectName(u'hideMouseCheckBox') self.hideMouseLayout.addWidget(self.hideMouseCheckBox) self.leftLayout.addWidget(self.hideMouseGroupBox) - self.serviceOrderGroupBox = QtGui.QGroupBox(self.leftColumn) - self.serviceOrderGroupBox.setObjectName(u'serviceOrderGroupBox') - self.serviceOrderLayout = QtGui.QVBoxLayout(self.serviceOrderGroupBox) - self.serviceOrderLayout.setObjectName(u'serviceOrderLayout') - self.printSlideTextCheckBox = QtGui.QCheckBox(self.serviceOrderGroupBox) - self.printSlideTextCheckBox.setObjectName(u'printSlideTextCheckBox') - self.serviceOrderLayout.addWidget(self.printSlideTextCheckBox) - self.printMetaDataCheckBox = QtGui.QCheckBox(self.serviceOrderGroupBox) - self.printMetaDataCheckBox.setObjectName(u'printMetaDataCheckBox') - self.serviceOrderLayout.addWidget(self.printMetaDataCheckBox) - self.printNotesCheckBox = QtGui.QCheckBox(self.serviceOrderGroupBox) - self.printNotesCheckBox.setObjectName(u'printNotesCheckBox') - self.serviceOrderLayout.addWidget(self.printNotesCheckBox) - self.leftLayout.addWidget(self.serviceOrderGroupBox) # self.sharedDirGroupBox = QtGui.QGroupBox(self.leftColumn) # self.sharedDirGroupBox.setObjectName(u'sharedDirGroupBox') # self.sharedDirLayout = QtGui.QFormLayout(self.sharedDirGroupBox) @@ -143,14 +129,6 @@ class AdvancedTab(SettingsTab): 'Mouse Cursor')) self.hideMouseCheckBox.setText(translate('OpenLP.AdvancedTab', 'Hide the mouse cursor when moved over the display window')) - self.serviceOrderGroupBox.setTitle(translate('OpenLP.AdvancedTab', - 'Service Order Print')) - self.printSlideTextCheckBox.setText( - translate('OpenLP.AdvancedTab', 'Include text slides if available')) - self.printMetaDataCheckBox.setText(translate( - 'OpenLP.AdvancedTab', 'Include playing time of media files')) - self.printNotesCheckBox.setText( - translate('OpenLP.AdvancedTab', 'Include service item notes')) # self.sharedDirGroupBox.setTitle( # translate('AdvancedTab', 'Central Data Store')) # self.sharedCheckBox.setText( @@ -186,12 +164,6 @@ class AdvancedTab(SettingsTab): QtCore.QVariant(True)).toBool()) self.hideMouseCheckBox.setChecked( settings.value(u'hide mouse', QtCore.QVariant(False)).toBool()) - self.printSlideTextCheckBox.setChecked(settings.value( - u'print slide text', QtCore.QVariant(False)).toBool()) - self.printMetaDataCheckBox.setChecked(settings.value( - u'print file meta data', QtCore.QVariant(False)).toBool()) - self.printNotesCheckBox.setChecked(settings.value( - u'print notes', QtCore.QVariant(False)).toBool()) settings.endGroup() def save(self): @@ -212,12 +184,6 @@ class AdvancedTab(SettingsTab): QtCore.QVariant(self.enableAutoCloseCheckBox.isChecked())) settings.setValue(u'hide mouse', QtCore.QVariant(self.hideMouseCheckBox.isChecked())) - settings.setValue(u'print slide text', - QtCore.QVariant(self.printSlideTextCheckBox.isChecked())) - settings.setValue(u'print file meta data', - QtCore.QVariant(self.printMetaDataCheckBox.isChecked())) - settings.setValue(u'print notes', - QtCore.QVariant(self.printNotesCheckBox.isChecked())) settings.endGroup() # def onSharedCheckBoxChanged(self, checked): diff --git a/openlp/core/ui/printserviceorderform.py b/openlp/core/ui/printserviceorderform.py new file mode 100644 index 000000000..127cb95a8 --- /dev/null +++ b/openlp/core/ui/printserviceorderform.py @@ -0,0 +1,133 @@ +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 + +############################################################################### +# OpenLP - Open Source Lyrics Projection # +# --------------------------------------------------------------------------- # +# Copyright (c) 2008-2011 Raoul Snyman # +# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # +# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # +# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # +# Carsten Tinggaard, Frode Woldsund # +# --------------------------------------------------------------------------- # +# This program is free software; you can redistribute it and/or modify it # +# under the terms of the GNU General Public License as published by the Free # +# Software Foundation; version 2 of the License. # +# # +# This program is distributed in the hope that it will be useful, but WITHOUT # +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # +# more details. # +# # +# You should have received a copy of the GNU General Public License along # +# with this program; if not, write to the Free Software Foundation, Inc., 59 # +# Temple Place, Suite 330, Boston, MA 02111-1307 USA # +############################################################################### +import datetime +import mutagen +import os + +from PyQt4 import QtCore, QtGui + +from openlp.core.lib import translate +from openlp.core.lib.ui import save_cancel_button_box + + +class PrintServiceOrderForm(QtGui.QDialog): + def __init__(self, parent=None): + """ + Constructor + """ + self.serviceManager = parent + QtGui.QDialog.__init__(self, parent) + self.setupUi() + self.retranslateUi() + + def setupUi(self): + self.dialogLayout = QtGui.QHBoxLayout(self) + self.dialogLayout.setObjectName(u'dialogLayout') + self.verticalLayout = QtGui.QVBoxLayout() + self.verticalLayout.setObjectName(u'verticalLayout') + self.serviceTitleLayout = QtGui.QHBoxLayout() + self.serviceTitleLayout.setObjectName(u'serviceTitleLayout') + self.serviceTitleLabel = QtGui.QLabel(self) + self.serviceTitleLabel.setObjectName(u'serviceTitleLabel') + self.serviceTitleLayout.addWidget(self.serviceTitleLabel) + self.serviceTitleLineEdit = QtGui.QLineEdit(self) + self.serviceTitleLineEdit.setObjectName(u'serviceTitleLineEdit') + self.serviceTitleLayout.addWidget(self.serviceTitleLineEdit) + self.verticalLayout.addLayout(self.serviceTitleLayout) + self.printSlideTextCheckBox = QtGui.QCheckBox(self) + self.printSlideTextCheckBox.setObjectName(u'printSlideTextCheckBox') + self.verticalLayout.addWidget(self.printSlideTextCheckBox) + self.printNotesCheckBox = QtGui.QCheckBox(self) + self.printNotesCheckBox.setObjectName(u'printNotesCheckBox') + self.verticalLayout.addWidget(self.printNotesCheckBox) + self.metaDataCheckBox = QtGui.QCheckBox(self) + self.metaDataCheckBox.setObjectName(u'metaDataCheckBox') + self.verticalLayout.addWidget(self.metaDataCheckBox) + self.verticalLayout.addWidget(save_cancel_button_box(self)) + self.dialogLayout.addLayout(self.verticalLayout) + QtCore.QMetaObject.connectSlotsByName(self) + + def retranslateUi(self): + self.setWindowTitle( + translate('OpenLP.PrintServiceOrderForm', 'Print Service Order')) + self.printSlideTextCheckBox.setText(translate( + 'OpenLP.PrintServiceOrderForm', 'Include slide text if avaialbe')) + self.printNotesCheckBox.setText(translate( + 'OpenLP.PrintServiceOrderForm', 'Include service item notes')) + self.metaDataCheckBox.setText(translate('OpenLP.PrintServiceOrderForm', + 'Include play lenght of media items')) + self.serviceTitleLabel.setText(translate( + 'OpenLP.PrintServiceOrderForm', 'Service Order Title')) + + def serviceOrderText(self): + """ + """ + if self.serviceTitleLineEdit.text(): + text = u'

%s

' % unicode(self.serviceTitleLineEdit.text()) + else: + text = u'

%s

' % translate('OpenLP.ServiceManager', + 'Service Order Sheet') + for item in self.serviceManager.serviceItems: + item = item[u'service_item'] + # Add the title of the service item. + text += u'

%s

' % (item.icon, + item.get_display_title()) + # Add slide text of the service item. + if self.printSlideTextCheckBox.isChecked(): + if item.is_text(): + # Add the text of the service item. + for slide in item.get_frames(): + text += u'

' + slide[u'text'] + u'

' + elif item.is_image(): + # Add the image names of the service item. + text += u'
    ' + for slide in range(len(item.get_frames())): + text += u'
  1. %s

  2. ' % \ + item.get_frame_title(slide) + text += u'
' + if item.foot_text: + # add footer + text += u'

%s

' % item.foot_text + # Add service items' notes. + if self.printNotesCheckBox.isChecked(): + if item.notes: + text += u'

%s %s

' % (translate( + 'OpenLP.ServiceManager', 'Notes:'), item.notes) + # Add play length of media files. + if item.is_media() and self.metaDataCheckBox.isChecked(): + path = os.path.join(item.get_frames()[0][u'path'], + item.get_frames()[0][u'title']) + if not os.path.isfile(path): + continue + file = mutagen.File(path) + if file is not None: + length = int(file.info.length) + text += u'

%s %s

' % (translate( + 'OpenLP.ServiceManager', u'Playing time:'), + unicode(datetime.timedelta(seconds=length))) + return text + + diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index b97171a5b..3d6c8e861 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -38,6 +38,7 @@ from openlp.core.lib import OpenLPToolbar, ServiceItem, context_menu_action, \ ThemeLevel from openlp.core.lib.ui import critical_error_message_box from openlp.core.ui import ServiceNoteForm, ServiceItemEditForm +from openlp.core.ui.printserviceorderform import PrintServiceOrderForm from openlp.core.utils import AppLocation, delete_file, file_is_unicode, \ split_filename @@ -1188,11 +1189,11 @@ class ServiceManager(QtGui.QWidget): """ Print a Service Order Sheet. """ - from openlp.core.ui import PrintServiceOrderForm - dialog = PrintServiceOrderForm(self) - if dialog.exec_(): - serviceDocument = QtGui.QTextDocument() - serviceDocument.setHtml(dialog.printServiceOrder()) + settingDialog = PrintServiceOrderForm(self) + if not settingDialog.exec_(): + return + serviceDocument = QtGui.QTextDocument() + serviceDocument.setHtml(settingDialog.serviceOrderText()) printDialog = QtGui.QPrintDialog() if not printDialog.exec_(): return From 9659eb2a1cfe36227b1584aa1428f495e68480b8 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Fri, 4 Feb 2011 19:34:22 +0100 Subject: [PATCH 024/243] added print dialog --- openlp/core/ui/printserviceorderform.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/openlp/core/ui/printserviceorderform.py b/openlp/core/ui/printserviceorderform.py index 616159da6..b130f9470 100644 --- a/openlp/core/ui/printserviceorderform.py +++ b/openlp/core/ui/printserviceorderform.py @@ -80,17 +80,17 @@ class PrintServiceOrderForm(QtGui.QDialog): self.metaDataCheckBox.setText(translate('OpenLP.PrintServiceOrderForm', 'Include play lenght of media items')) self.serviceTitleLabel.setText(translate( - 'OpenLP.PrintServiceOrderForm', 'Service Order Title')) + 'OpenLP.PrintServiceOrderForm', 'Service Order Title:')) + self.serviceTitleLineEdit.setText(translate('OpenLP.ServiceManager', + 'Service Order Sheet')) def serviceOrderText(self): """ Creates the html text, to print the service items. """ + text = u'' if self.serviceTitleLineEdit.text(): - text = u'

%s

' % unicode(self.serviceTitleLineEdit.text()) - else: - text = u'

%s

' % translate('OpenLP.ServiceManager', - 'Service Order Sheet') + text += u'

%s

' % unicode(self.serviceTitleLineEdit.text()) for item in self.serviceManager.serviceItems: item = item[u'service_item'] # Add the title of the service item. From 860b1d376b59cde145664e01d3f797e02620968d Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Fri, 4 Feb 2011 21:10:32 +0100 Subject: [PATCH 025/243] --- openlp/core/ui/printserviceorderform.py | 31 +++++++-- resources/forms/printServiceOrder.ui | 91 +++++++++++++++++++++++++ 2 files changed, 117 insertions(+), 5 deletions(-) create mode 100644 resources/forms/printServiceOrder.ui diff --git a/openlp/core/ui/printserviceorderform.py b/openlp/core/ui/printserviceorderform.py index b130f9470..d24bfdf91 100644 --- a/openlp/core/ui/printserviceorderform.py +++ b/openlp/core/ui/printserviceorderform.py @@ -42,6 +42,16 @@ class PrintServiceOrderForm(QtGui.QDialog): QtGui.QDialog.__init__(self, parent) self.setupUi() self.retranslateUi() + # Load the settings for this dialog. + settings = QtCore.QSettings() + settings.beginGroup(u'advanced') + self.printSlideTextCheckBox.setChecked(settings.value( + u'print slide text', QtCore.QVariant(False)).toBool()) + self.printMetaDataCheckBox.setChecked(settings.value( + u'print file meta data', QtCore.QVariant(False)).toBool()) + self.printNotesCheckBox.setChecked(settings.value( + u'print notes', QtCore.QVariant(False)).toBool()) + settings.endGroup() def setupUi(self): self.dialogLayout = QtGui.QHBoxLayout(self) @@ -63,9 +73,9 @@ class PrintServiceOrderForm(QtGui.QDialog): self.printNotesCheckBox = QtGui.QCheckBox(self) self.printNotesCheckBox.setObjectName(u'printNotesCheckBox') self.verticalLayout.addWidget(self.printNotesCheckBox) - self.metaDataCheckBox = QtGui.QCheckBox(self) - self.metaDataCheckBox.setObjectName(u'metaDataCheckBox') - self.verticalLayout.addWidget(self.metaDataCheckBox) + self.printMetaDataCheckBox = QtGui.QCheckBox(self) + self.printMetaDataCheckBox.setObjectName(u'printMetaDataCheckBox') + self.verticalLayout.addWidget(self.printMetaDataCheckBox) self.verticalLayout.addWidget(save_cancel_button_box(self)) self.dialogLayout.addLayout(self.verticalLayout) QtCore.QMetaObject.connectSlotsByName(self) @@ -77,7 +87,8 @@ class PrintServiceOrderForm(QtGui.QDialog): 'OpenLP.PrintServiceOrderForm', 'Include slide text if avaialbe')) self.printNotesCheckBox.setText(translate( 'OpenLP.PrintServiceOrderForm', 'Include service item notes')) - self.metaDataCheckBox.setText(translate('OpenLP.PrintServiceOrderForm', + self.printMetaDataCheckBox.setText( + translate('OpenLP.PrintServiceOrderForm', 'Include play lenght of media items')) self.serviceTitleLabel.setText(translate( 'OpenLP.PrintServiceOrderForm', 'Service Order Title:')) @@ -118,7 +129,7 @@ class PrintServiceOrderForm(QtGui.QDialog): text += u'

%s %s

' % (translate( 'OpenLP.ServiceManager', 'Notes:'), item.notes) # Add play length of media files. - if item.is_media() and self.metaDataCheckBox.isChecked(): + if item.is_media() and self.printMetaDataCheckBox.isChecked(): path = os.path.join(item.get_frames()[0][u'path'], item.get_frames()[0][u'title']) if not os.path.isfile(path): @@ -129,4 +140,14 @@ class PrintServiceOrderForm(QtGui.QDialog): text += u'

%s %s

' % (translate( 'OpenLP.ServiceManager', u'Playing time:'), unicode(datetime.timedelta(seconds=length))) + # Save the settings for this dialog. + settings = QtCore.QSettings() + settings.beginGroup(u'advanced') + settings.setValue(u'print slide text', + QtCore.QVariant(self.printSlideTextCheckBox.isChecked())) + settings.setValue(u'print file meta data', + QtCore.QVariant(self.printMetaDataCheckBox.isChecked())) + settings.setValue(u'print notes', + QtCore.QVariant(self.printNotesCheckBox.isChecked())) + settings.endGroup() return text diff --git a/resources/forms/printServiceOrder.ui b/resources/forms/printServiceOrder.ui new file mode 100644 index 000000000..728e42d77 --- /dev/null +++ b/resources/forms/printServiceOrder.ui @@ -0,0 +1,91 @@ + + + Dialog + + + + 0 + 0 + 321 + 205 + + + + Dialog + + + + + + + + + + Service Title: + + + + + + + + + + + + Include slide text if avaialbe + + + + + + + Include service item notes + + + + + + + Include play lenght of media items + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Cancel + + + + + + + Print + + + + + + + + + + + + From d7b9cc93f97cd3e18f5e603df43fd2296905f90a Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sat, 5 Feb 2011 10:45:08 +0100 Subject: [PATCH 026/243] fixed Bug #677282 --- openlp/core/ui/maindisplay.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 3dfde8640..bae00c2da 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -72,7 +72,7 @@ class MainDisplay(DisplayWidget): self.setWindowIcon(mainIcon) self.retranslateUi() self.setStyleSheet(u'border: 0px; margin: 0px; padding: 0px;') - self.setWindowFlags(QtCore.Qt.FramelessWindowHint | + self.setWindowFlags(QtCore.Qt.FramelessWindowHint | QtCore.Qt.Tool | QtCore.Qt.WindowStaysOnTopHint) if self.isLive: QtCore.QObject.connect(Receiver.get_receiver(), From 229583e24121ee6a4f78807780c8027f058e5aaa Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sat, 5 Feb 2011 18:01:08 +0000 Subject: [PATCH 027/243] Fix typos --- openlp/core/lib/mediamanageritem.py | 2 +- openlp/core/lib/toolbar.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 683459825..cc80ad564 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -158,7 +158,7 @@ class MediaManagerItem(QtGui.QWidget): ``icon`` The icon of the button. This can be an instance of QIcon, or a - string cotaining either the absolute path to the image, or an + string containing either the absolute path to the image, or an internal resource path starting with ':/'. ``slot`` diff --git a/openlp/core/lib/toolbar.py b/openlp/core/lib/toolbar.py index b1aa3d96f..6ae80045e 100644 --- a/openlp/core/lib/toolbar.py +++ b/openlp/core/lib/toolbar.py @@ -61,7 +61,7 @@ class OpenLPToolbar(QtGui.QToolBar): ``icon`` The icon of the button. This can be an instance of QIcon, or a - string cotaining either the absolute path to the image, or an + string containing either the absolute path to the image, or an internal resource path starting with ':/'. ``tooltip`` From 668b5290247944a4c6ce14710963b7f46ca7b1e9 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sat, 5 Feb 2011 19:29:49 +0100 Subject: [PATCH 028/243] new bible search box --- openlp/plugins/bibles/lib/mediaitem.py | 30 +++++++++++--------------- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index c162447b2..99b8a0eaf 100644 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -30,6 +30,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, Receiver, BaseListWithDnD, \ ItemCapabilities, translate +from openlp.core.lib.searchedit import SearchEdit from openlp.core.lib.ui import add_widget_completer, media_item_combo_box, \ critical_error_message_box from openlp.plugins.bibles.forms import BibleImportForm @@ -93,18 +94,17 @@ class BibleMediaItem(MediaManagerItem): u'quickSecondComboBox') self.quickSecondLabel.setBuddy(self.quickSecondComboBox) self.quickLayout.addRow(self.quickSecondLabel, self.quickSecondComboBox) - self.quickSearchTypeLabel = QtGui.QLabel(self.quickTab) - self.quickSearchTypeLabel.setObjectName(u'quickSearchTypeLabel') - self.quickSearchComboBox = media_item_combo_box(self.quickTab, - u'quickSearchComboBox') - self.quickSearchTypeLabel.setBuddy(self.quickSearchComboBox) - self.quickLayout.addRow(self.quickSearchTypeLabel, - self.quickSearchComboBox) self.quickSearchLabel = QtGui.QLabel(self.quickTab) self.quickSearchLabel.setObjectName(u'quickSearchLabel') - self.quickSearchEdit = QtGui.QLineEdit(self.quickTab) + self.quickSearchEdit = SearchEdit(self.quickTab) self.quickSearchEdit.setObjectName(u'quickSearchEdit') self.quickSearchLabel.setBuddy(self.quickSearchEdit) + self.quickSearchEdit.setSearchTypes([ + (1, u':/songs/song_topic_edit.png', + translate('BiblesPlugin.MediaItem', 'Verse Search')), + (2, u':/songs/song_search_author.png', + translate('BiblesPlugin.MediaItem', 'Text Search')) + ]) self.quickLayout.addRow(self.quickSearchLabel, self.quickSearchEdit) self.quickClearLabel = QtGui.QLabel(self.quickTab) self.quickClearLabel.setObjectName(u'quickClearLabel') @@ -207,8 +207,8 @@ class BibleMediaItem(MediaManagerItem): QtCore.SIGNAL(u'activated(int)'), self.onAdvancedFromVerse) QtCore.QObject.connect(self.advancedToChapter, QtCore.SIGNAL(u'activated(int)'), self.onAdvancedToChapter) - QtCore.QObject.connect(self.quickSearchComboBox, - QtCore.SIGNAL(u'activated(int)'), self.updateAutoCompleter) + QtCore.QObject.connect(self.quickSearchEdit, + QtCore.SIGNAL(u'searchTypeChanged(int)'), self.updateAutoCompleter) QtCore.QObject.connect(self.quickVersionComboBox, QtCore.SIGNAL(u'activated(int)'), self.updateAutoCompleter) # Buttons @@ -242,8 +242,6 @@ class BibleMediaItem(MediaManagerItem): translate('BiblesPlugin.MediaItem', 'Version:')) self.quickSecondLabel.setText( translate('BiblesPlugin.MediaItem', 'Second:')) - self.quickSearchTypeLabel.setText( - translate('BiblesPlugin.MediaItem', 'Search type:')) self.quickSearchLabel.setText( translate('BiblesPlugin.MediaItem', 'Find:')) self.quickSearchButton.setText( @@ -268,10 +266,6 @@ class BibleMediaItem(MediaManagerItem): translate('BiblesPlugin.MediaItem', 'Results:')) self.advancedSearchButton.setText( translate('BiblesPlugin.MediaItem', 'Search')) - self.quickSearchComboBox.addItem( - translate('BiblesPlugin.MediaItem', 'Verse Search')) - self.quickSearchComboBox.addItem( - translate('BiblesPlugin.MediaItem', 'Text Search')) self.quickClearComboBox.addItem( translate('BiblesPlugin.MediaItem', 'Clear')) self.quickClearComboBox.addItem( @@ -373,7 +367,7 @@ class BibleMediaItem(MediaManagerItem): """ books = [] # We have to do a 'Verse Search'. - if self.quickSearchComboBox.currentIndex() == 0: + if self.quickSearchEdit.currentSearchType() == 1: bibles = self.parent.manager.get_bibles() bible = unicode(self.quickVersionComboBox.currentText()) if bible: @@ -510,7 +504,7 @@ class BibleMediaItem(MediaManagerItem): bible = unicode(self.quickVersionComboBox.currentText()) second_bible = unicode(self.quickSecondComboBox.currentText()) text = unicode(self.quickSearchEdit.text()) - if self.quickSearchComboBox.currentIndex() == 0: + if self.quickSearchEdit.currentSearchType() == 1: # We are doing a 'Verse Search'. self.search_results = self.parent.manager.get_verses(bible, text) if second_bible and self.search_results: From 1bae9b520f4a008a24d1ec3a9145110b4a570a4d Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sat, 5 Feb 2011 20:10:08 +0000 Subject: [PATCH 029/243] Fix typo --- openlp/core/ui/thememanager.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 7a4dda882..44bd57591 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -334,9 +334,8 @@ class ThemeManager(QtGui.QWidget): row = self.themeListWidget.row(item) self.themeListWidget.takeItem(row) self.deleteTheme(theme) - # As we do not reload the themes, push out the change - # Reaload the list as the internal lists and events need - # to be triggered + # As we do not reload the themes, push out the change. Reload the + # list as the internal lists and events need to be triggered. self._pushThemes() def deleteTheme(self, theme): From a120719884f6e8d654d74fe0afe52a70693f76e8 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sat, 5 Feb 2011 23:52:05 +0000 Subject: [PATCH 030/243] Fix song service load (Bug #696219) --- openlp/plugins/songs/lib/mediaitem.py | 82 +++++++++++++-------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 95337b29f..d5cd49cbb 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -32,7 +32,7 @@ from PyQt4 import QtCore, QtGui from sqlalchemy.sql import or_ from openlp.core.lib import MediaManagerItem, BaseListWithDnD, Receiver, \ - ItemCapabilities, translate, check_item_selected + ItemCapabilities, translate, check_item_selected, PluginStatus from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm, \ SongImportForm from openlp.plugins.songs.lib import OpenLyrics, SongXML @@ -396,46 +396,46 @@ class SongMediaItem(MediaManagerItem): Triggered by a song being loaded by the service item """ log.debug(u'serviceLoad') - if item.data_string: - search_results = self.parent.manager.get_all_objects(Song, - Song.search_title == re.compile(r'\W+', re.UNICODE).sub(u' ', - item.data_string[u'title'].split(u'@')[0].lower()).strip(), - Song.search_title.asc()) - author_list = item.data_string[u'authors'].split(u', ') - # The service item always has an author (at least it has u'' as - # author). However, songs saved in the database do not have to have - # an author. - if u'' in author_list: - author_list.remove(u'') - editId = 0 - add_song = True - if search_results: - for song in search_results: - same_authors = True - # If the author counts are different, we do not have to do - # any further checking. This is also important when a song - # does not have any author (because we can not loop over an - # empty list). - if len(song.authors) == len(author_list): - for author in song.authors: - if author.display_name not in author_list: - same_authors = False - else: - same_authors = False - # All authors are the same, so we can stop here and the song - # does not have to be saved. - if same_authors: - add_song = False - editId = song.id - break - if add_song: - if self.addSongFromService: - editId = self.openLyrics.xml_to_song(item.xml_version) - self.onSearchTextButtonClick() - # Update service with correct song id. - if editId: - Receiver.send_message(u'service_item_update', - u'%s:%s' % (editId, item._uuid)) + if self.plugin.status != PluginStatus.Active or not item.data_string: + return + search_results = self.parent.manager.get_all_objects(Song, + Song.search_title == re.compile(r'\W+', re.UNICODE).sub(u' ', + item.data_string[u'title'].split(u'@')[0].lower()).strip(), + Song.search_title.asc()) + author_list = item.data_string[u'authors'].split(u', ') + # The service item always has an author (at least it has u'' as + # author). However, songs saved in the database do not have to have + # an author. + if u'' in author_list: + author_list.remove(u'') + editId = 0 + add_song = True + if search_results: + for song in search_results: + same_authors = True + # If the author counts are different, we do not have to do any + # further checking. This is also important when a song does not + # have any author (because we can not loop over an empty list). + if len(song.authors) == len(author_list): + for author in song.authors: + if author.display_name not in author_list: + same_authors = False + else: + same_authors = False + # All authors are the same, so we can stop here and the song + # does not have to be saved. + if same_authors: + add_song = False + editId = song.id + break + if add_song: + if self.addSongFromService: + editId = self.openLyrics.xml_to_song(item.xml_version) + self.onSearchTextButtonClick() + # Update service with correct song id. + if editId: + Receiver.send_message(u'service_item_update', + u'%s:%s' % (editId, item._uuid)) def collateSongTitles(self, song_1, song_2): """ From 13f4fa033d002d640af6c861a9cd75cd74f8c6bc Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sat, 5 Feb 2011 23:56:34 +0000 Subject: [PATCH 031/243] Loading plugins can take time --- openlp/core/ui/pluginform.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openlp/core/ui/pluginform.py b/openlp/core/ui/pluginform.py index d6ffc69f0..926aaaa7e 100644 --- a/openlp/core/ui/pluginform.py +++ b/openlp/core/ui/pluginform.py @@ -129,7 +129,9 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog): if self.programaticChange: return if status == 0: + Receiver.send_message(u'cursor_busy') self.activePlugin.toggleStatus(PluginStatus.Active) + Receiver.send_message(u'cursor_normal') else: self.activePlugin.toggleStatus(PluginStatus.Inactive) status_text = unicode( From 6e5889a3cb02e0fdc2d34d76c173911ad6e20d7f Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sun, 6 Feb 2011 00:09:22 +0000 Subject: [PATCH 032/243] Fix missing import --- openlp/core/ui/pluginform.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/pluginform.py b/openlp/core/ui/pluginform.py index 926aaaa7e..3b41d76a3 100644 --- a/openlp/core/ui/pluginform.py +++ b/openlp/core/ui/pluginform.py @@ -28,7 +28,7 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import PluginStatus, StringContent, translate +from openlp.core.lib import PluginStatus, Receiver, StringContent, translate from plugindialog import Ui_PluginViewDialog log = logging.getLogger(__name__) From 1933144731741362bc516581469476174556f034 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sun, 6 Feb 2011 08:16:42 +0100 Subject: [PATCH 033/243] --- openlp/core/ui/printserviceorderform.py | 133 ++++++++++++++++++---- resources/forms/printServiceOrder.ui | 145 ++++++++++++++++-------- 2 files changed, 207 insertions(+), 71 deletions(-) diff --git a/openlp/core/ui/printserviceorderform.py b/openlp/core/ui/printserviceorderform.py index 7f09ceea2..34e1845d0 100644 --- a/openlp/core/ui/printserviceorderform.py +++ b/openlp/core/ui/printserviceorderform.py @@ -38,14 +38,13 @@ class PrintServiceOrderForm(QtGui.QDialog): """ Constructor """ - self.serviceManager = parent QtGui.QDialog.__init__(self, parent) - self.setupUi() - self.retranslateUi() - self.html = u'' + self.serviceManager = parent self.printer = QtGui.QPrinter() self.printDialog = QtGui.QPrintDialog(self.printer, self) self.document = QtGui.QTextDocument() + self.setupUi() + self.retranslateUi() # Load the settings for this dialog. settings = QtCore.QSettings() settings.beginGroup(u'advanced') @@ -56,37 +55,109 @@ class PrintServiceOrderForm(QtGui.QDialog): self.printNotesCheckBox.setChecked(settings.value( u'print notes', QtCore.QVariant(False)).toBool()) settings.endGroup() + # Signals + QtCore.QObject.connect(self.printButton, + QtCore.SIGNAL('clicked()'), self.printServiceOrder) + QtCore.QObject.connect(self.zoomOutButton, + QtCore.SIGNAL('clicked()'), self.zoomOut) + QtCore.QObject.connect(self.zoomInButton, + QtCore.SIGNAL('clicked()'), self.zoomIn) + QtCore.QObject.connect(self.previewWidget, + QtCore.SIGNAL('paintRequested(QPrinter *)'), self.paintRequested) + QtCore.QObject.connect(self.serviceTitleLineEdit, + QtCore.SIGNAL('textChanged(const QString)'), self.updatePreviewText) + QtCore.QObject.connect(self.printSlideTextCheckBox, + QtCore.SIGNAL('stateChanged(int)'), self.updatePreviewText) + QtCore.QObject.connect(self.printNotesCheckBox, + QtCore.SIGNAL('stateChanged(int)'), self.updatePreviewText) + QtCore.QObject.connect(self.printMetaDataCheckBox, + QtCore.SIGNAL('stateChanged(int)'), self.updatePreviewText) + self.updatePreviewText() def setupUi(self): self.dialogLayout = QtGui.QHBoxLayout(self) self.dialogLayout.setObjectName(u'dialogLayout') - self.verticalLayout = QtGui.QVBoxLayout() - self.verticalLayout.setObjectName(u'verticalLayout') + self.perviewLayout = QtGui.QVBoxLayout() + self.perviewLayout.setObjectName(u'perviewLayout') + self.previewLabel = QtGui.QLabel(self) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.previewLabel.sizePolicy().hasHeightForWidth()) + self.previewLabel.setSizePolicy(sizePolicy) + self.previewLabel.setObjectName(u'previewLabel') + self.perviewLayout.addWidget(self.previewLabel) + self.previewWidget = QtGui.QPrintPreviewWidget(self.printer, self, QtCore.Qt.Widget) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Expanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.previewWidget.sizePolicy().hasHeightForWidth()) + self.previewWidget.setSizePolicy(sizePolicy) + self.previewWidget.setObjectName(u'previewWidget') + self.previewWidget.fitToWidth() + self.perviewLayout.addWidget(self.previewWidget) + self.dialogLayout.addLayout(self.perviewLayout) + self.settingsLayout = QtGui.QVBoxLayout() + self.settingsLayout.setObjectName(u'settingsLayout') self.serviceTitleLayout = QtGui.QHBoxLayout() self.serviceTitleLayout.setObjectName(u'serviceTitleLayout') self.serviceTitleLabel = QtGui.QLabel(self) self.serviceTitleLabel.setObjectName(u'serviceTitleLabel') self.serviceTitleLayout.addWidget(self.serviceTitleLabel) self.serviceTitleLineEdit = QtGui.QLineEdit(self) + self.serviceTitleLineEdit.setSizePolicy( + QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) self.serviceTitleLineEdit.setObjectName(u'serviceTitleLineEdit') self.serviceTitleLayout.addWidget(self.serviceTitleLineEdit) - self.verticalLayout.addLayout(self.serviceTitleLayout) + self.settingsLayout.addLayout(self.serviceTitleLayout) self.printSlideTextCheckBox = QtGui.QCheckBox(self) self.printSlideTextCheckBox.setObjectName(u'printSlideTextCheckBox') - self.verticalLayout.addWidget(self.printSlideTextCheckBox) + self.settingsLayout.addWidget(self.printSlideTextCheckBox) self.printNotesCheckBox = QtGui.QCheckBox(self) self.printNotesCheckBox.setObjectName(u'printNotesCheckBox') - self.verticalLayout.addWidget(self.printNotesCheckBox) + self.settingsLayout.addWidget(self.printNotesCheckBox) self.printMetaDataCheckBox = QtGui.QCheckBox(self) self.printMetaDataCheckBox.setObjectName(u'printMetaDataCheckBox') - self.verticalLayout.addWidget(self.printMetaDataCheckBox) - self.verticalLayout.addWidget(save_cancel_button_box(self)) - self.dialogLayout.addLayout(self.verticalLayout) + self.settingsLayout.addWidget(self.printMetaDataCheckBox) + self.buttonLayout = QtGui.QHBoxLayout() + self.zoomOutButton = QtGui.QToolButton(self) + icon = QtGui.QIcon() + #icon.addPixmap(QtGui.QPixmap(u':/exports/export_move_to_list.png'), + icon.addPixmap(QtGui.QPixmap(u'/home/andreas/zoom-out.png'), + QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.zoomOutButton.setIcon(icon) + self.zoomOutButton.setObjectName(u'zoomOutButton') + self.buttonLayout.addWidget(self.zoomOutButton) + self.zoomInButton = QtGui.QToolButton(self) + icon = QtGui.QIcon() + #icon.addPixmap(QtGui.QPixmap(u':/exports/export_remove.png'), + icon.addPixmap(QtGui.QPixmap(u'/home/andreas/zoom-in.png'), + QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.zoomInButton.setIcon(icon) + self.zoomInButton.setObjectName(u'toolButton') + self.buttonLayout.addWidget(self.zoomInButton) + spacerItem = QtGui.QSpacerItem(20, 40, + QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.settingsLayout.addItem(spacerItem) + self.buttonLayout.setObjectName(u'buttonLayout') + spacerItem = QtGui.QSpacerItem(40, 20, + QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.buttonLayout.addItem(spacerItem) + self.cancelButton = QtGui.QPushButton(self) + self.cancelButton.setObjectName(u'cancelButton') + self.buttonLayout.addWidget(self.cancelButton) + self.printButton = QtGui.QPushButton(self) + self.printButton.setObjectName(u'printButton') + self.buttonLayout.addWidget(self.printButton) + self.settingsLayout.addLayout(self.buttonLayout) + self.dialogLayout.addLayout(self.settingsLayout) QtCore.QMetaObject.connectSlotsByName(self) def retranslateUi(self): self.setWindowTitle( translate('OpenLP.PrintServiceOrderForm', 'Print Service Order')) + self.previewLabel.setText( + translate('OpenLP.ServiceManager', 'Preview:')) self.printSlideTextCheckBox.setText(translate( 'OpenLP.PrintServiceOrderForm', 'Include slide text if avaialbe')) self.printNotesCheckBox.setText(translate( @@ -95,14 +166,17 @@ class PrintServiceOrderForm(QtGui.QDialog): translate('OpenLP.PrintServiceOrderForm', 'Include play lenght of media items')) self.serviceTitleLabel.setText(translate( - 'OpenLP.PrintServiceOrderForm', 'Service Order Title:')) + 'OpenLP.PrintServiceOrderForm', 'Title:')) self.serviceTitleLineEdit.setText(translate('OpenLP.ServiceManager', 'Service Order Sheet')) + self.printButton.setText(translate('OpenLP.ServiceManager', 'Print')) + self.cancelButton.setText(translate('OpenLP.ServiceManager', 'Cancel')) - def serviceOrderText(self): + def updatePreviewText(self): """ Creates the html text, to print the service items. """ + text = u'' if self.serviceTitleLineEdit.text(): text += u'

%s

' % unicode(self.serviceTitleLineEdit.text()) for item in self.serviceManager.serviceItems: @@ -129,8 +203,9 @@ class PrintServiceOrderForm(QtGui.QDialog): # Add service items' notes. if self.printNotesCheckBox.isChecked(): if item.notes: - text += u'

%s %s

' % (translate( - 'OpenLP.ServiceManager', 'Notes:'), item.notes) + text += u'

%s


%s' % (translate( + 'OpenLP.ServiceManager', 'Notes:'), + item.notes.replace(u'\n', u'
')) # Add play length of media files. if item.is_media() and self.printMetaDataCheckBox.isChecked(): path = os.path.join(item.get_frames()[0][u'path'], @@ -143,6 +218,19 @@ class PrintServiceOrderForm(QtGui.QDialog): text += u'

%s %s

' % (translate( 'OpenLP.ServiceManager', u'Playing time:'), unicode(datetime.timedelta(seconds=length))) + self.document.setHtml(text) + self.previewWidget.updatePreview() + + def paintRequested(self, printer): + """ + Paint the preview. + """ + self.document.print_(printer) + + def printServiceOrder(self): + if not self.printDialog.exec_(): + return + self.document.print_(self.printer) # Save the settings for this dialog. settings = QtCore.QSettings() settings.beginGroup(u'advanced') @@ -153,12 +241,9 @@ class PrintServiceOrderForm(QtGui.QDialog): settings.setValue(u'print notes', QtCore.QVariant(self.printNotesCheckBox.isChecked())) settings.endGroup() - self.document.setHtml(text) - def printServiceOrder(self): - serviceDocument = QtGui.QTextDocument() - serviceDocument.setHtml(settingDialog.serviceOrderText()) - printDialog = QtGui.QPrintDialog() - if not printDialog.exec_(): - return - serviceDocument.print_(printDialog.printer()) + def zoomIn(self): + self.previewWidget.zoomIn() + + def zoomOut(self): + self.previewWidget.zoomOut() diff --git a/resources/forms/printServiceOrder.ui b/resources/forms/printServiceOrder.ui index 84ec84bbe..b76bc012a 100644 --- a/resources/forms/printServiceOrder.ui +++ b/resources/forms/printServiceOrder.ui @@ -13,10 +13,10 @@ Dialog - + - - + + @@ -33,37 +33,47 @@ + + true + - + 0 0 + - + - - - - - Service Title: - - - - + + - + 0 0 + + + + + 0 + 0 + + + + Service Title: + + + @@ -81,14 +91,14 @@ - + Include play lenght of media items - + Qt::Vertical @@ -100,36 +110,75 @@ + + + + - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Cancel - - - - - - - Print - - - - + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Cancel + + + + + + + Print + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + ... + + + + ../../../../../zoom-out.png../../../../../zoom-out.png + + + + + + + ... + + + + ../../../../../zoom-in.png../../../../../zoom-in.png + + @@ -137,6 +186,8 @@ - + + + From ff8fb724e1f041fc7df8fb4a0d4ca0b95102410a Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sun, 6 Feb 2011 15:26:13 +0100 Subject: [PATCH 034/243] fixed line break --- openlp/core/ui/printserviceorderform.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/printserviceorderform.py b/openlp/core/ui/printserviceorderform.py index 3f130365a..40a3dede9 100644 --- a/openlp/core/ui/printserviceorderform.py +++ b/openlp/core/ui/printserviceorderform.py @@ -106,7 +106,7 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): # Add service items' notes. if self.printNotesCheckBox.isChecked(): if item.notes: - text += u'

%s


%s' % (translate( + text += u'

%s

%s' % (translate( 'OpenLP.ServiceManager', 'Notes:'), item.notes.replace(u'\n', u'
')) # Add play length of media files. From cdc188b2d5bd84d8df3948d7b7731dc97e0e48e7 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sun, 6 Feb 2011 18:21:32 +0100 Subject: [PATCH 035/243] --- openlp/plugins/songs/forms/songexportform.py | 245 ++++++------------- resources/forms/songexportform.ui | 148 ----------- resources/images/export_move_to_list.png | Bin 862 -> 0 bytes resources/images/export_remove.png | Bin 666 -> 0 bytes resources/images/openlp-2.qrc | 2 - 5 files changed, 79 insertions(+), 316 deletions(-) delete mode 100644 resources/forms/songexportform.ui delete mode 100644 resources/images/export_move_to_list.png delete mode 100644 resources/images/export_remove.png diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index 307d91570..e445db5f5 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -86,102 +86,61 @@ class SongExportForm(OpenLPWizard): """ Song wizard specific signals. """ - QtCore.QObject.connect(self.addButton, - QtCore.SIGNAL(u'clicked()'), self.onAddSelectedClicked) - QtCore.QObject.connect(self.removeButton, - QtCore.SIGNAL(u'clicked()'), self.onRemoveSelectedClicked) - QtCore.QObject.connect(self.availableListWidget, - QtCore.SIGNAL(u'itemDoubleClicked(QListWidgetItem *)'), - self.onAvailableListItemDoubleClicked) - QtCore.QObject.connect(self.selectedListWidget, - QtCore.SIGNAL(u'itemDoubleClicked(QListWidgetItem *)'), - self.onSelectedListItemDoubleClicked) QtCore.QObject.connect(self.directoryButton, QtCore.SIGNAL(u'clicked()'), self.onDirectoryButtonClicked) - QtCore.QObject.connect(self.allAvailableButton, - QtCore.SIGNAL(u'clicked()'), self.onAllAvailableButtonClicked) - QtCore.QObject.connect(self.allSelectedButton, - QtCore.SIGNAL(u'clicked()'), self.onAllSelectedButtonClicked) +# QtCore.QObject.connect(self.searchLineEdit, +# QtCore.SIGNAL(u'textEdited(const QString&)'), +# self.onSearchLineEditChanged) def addCustomPages(self): """ Add song wizard specific pages. """ - # Source Page - self.sourcePage = QtGui.QWizardPage() - self.sourcePage.setObjectName(u'sourcePage') - self.horizontalLayout = QtGui.QHBoxLayout(self.sourcePage) - self.horizontalLayout.setObjectName(u'horizontalLayout') - self.verticalLayout = QtGui.QVBoxLayout() - self.verticalLayout.setObjectName(u'verticalLayout') + # The page with all available songs. + self.availableSongsPage = QtGui.QWizardPage() + self.availableSongsPage.setObjectName(u'availableSongsPage') + self.availableSongsLayout = QtGui.QHBoxLayout(self.availableSongsPage) + self.availableSongsLayout.setObjectName(u'availableSongsLayout') +# self.gridLayout = QtGui.QGridLayout() +# self.gridLayout.setObjectName(u'gridLayout') + self.availableListWidget = QtGui.QListWidget(self.availableSongsPage) + self.availableListWidget.setObjectName(u'availableListWidget') +# self.gridLayout.addWidget(self.availableListWidget, 0, 0, 1, 1) +# self.searchLineEdit = QtGui.QLineEdit(self.availableSongsPage) +# self.searchLineEdit.setObjectName(u'searchLineEdit') +# self.gridLayout.addWidget(self.searchLineEdit, 1, 0, 1, 1) +# self.availableSongsLayout.addLayout(self.gridLayout) + self.availableSongsLayout.addWidget(self.availableListWidget) + self.addPage(self.availableSongsPage) + + # The page with the selected songs. + self.exportSongPage = QtGui.QWizardPage() + self.exportSongPage.setObjectName(u'availableSongsPage') + self.exportSongLayout = QtGui.QHBoxLayout(self.exportSongPage) + self.exportSongLayout.setObjectName(u'exportSongLayout') self.gridLayout = QtGui.QGridLayout() self.gridLayout.setObjectName(u'gridLayout') - self.selectedListWidget = QtGui.QListWidget(self.sourcePage) + self.selectedListWidget = QtGui.QListWidget(self.exportSongPage) self.selectedListWidget.setObjectName(u'selectedListWidget') - self.selectedListWidget.setSelectionMode( - QtGui.QAbstractItemView.ExtendedSelection) - self.selectedListWidget.setSortingEnabled(True) - self.gridLayout.addWidget(self.selectedListWidget, 1, 2, 1, 1) - self.gridLayout2 = QtGui.QGridLayout() - self.gridLayout2.setObjectName(u'gridLayout2') - self.addButton = QtGui.QToolButton(self.sourcePage) - icon = QtGui.QIcon() - icon.addPixmap(QtGui.QPixmap(u':/exports/export_move_to_list.png'), - QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.addButton.setIcon(icon) - self.addButton.setObjectName(u'addButton') - self.gridLayout2.addWidget(self.addButton, 1, 0, 1, 1) - self.removeButton = QtGui.QToolButton(self.sourcePage) - icon = QtGui.QIcon() - icon.addPixmap(QtGui.QPixmap(u':/exports/export_remove.png'), - QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.removeButton.setIcon(icon) - self.removeButton.setObjectName(u'removeButton') - self.gridLayout2.addWidget(self.removeButton, 2, 0, 1, 1) - spacerItem = QtGui.QSpacerItem(20, 40, - QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.gridLayout2.addItem(spacerItem, 0, 0, 1, 1) - self.gridLayout2.addItem(spacerItem, 3, 0, 1, 1) - self.gridLayout.addLayout(self.gridLayout2, 1, 1, 1, 1) - self.availableLabel = QtGui.QLabel(self.sourcePage) - self.availableLabel.setObjectName(u'availableLabel') - self.gridLayout.addWidget(self.availableLabel, 0, 0, 1, 1) - self.selectedLabel = QtGui.QLabel(self.sourcePage) - self.selectedLabel.setObjectName(u'selectedLabel') - self.gridLayout.addWidget(self.selectedLabel, 0, 2, 1, 1) - self.availableListWidget = QtGui.QListWidget(self.sourcePage) - self.availableListWidget.setObjectName(u'availableListWidget') - self.availableListWidget.setSelectionMode( - QtGui.QAbstractItemView.ExtendedSelection) - self.availableListWidget.setSortingEnabled(True) - self.gridLayout.addWidget(self.availableListWidget, 1, 0, 1, 1) - # Button to select all songs in the "selectedListWidget". - self.allSelectedButton = QtGui.QToolButton(self.sourcePage) - self.allSelectedButton.setObjectName(u'allSelectedButton') - self.gridLayout.addWidget(self.allSelectedButton, 3, 2, 1, 1) - # Button to select all songs in the "availableListWidget". - self.allAvailableButton = QtGui.QToolButton(self.sourcePage) - self.allAvailableButton.setObjectName(u'allAvailableButton') - self.gridLayout.addWidget(self.allAvailableButton, 3, 0, 1, 1) - self.verticalLayout.addLayout(self.gridLayout) - self.gridLayout3 = QtGui.QGridLayout() - self.gridLayout3.setObjectName(u'gridLayout3') - self.directoryButton = QtGui.QToolButton(self.sourcePage) + self.gridLayout.addWidget(self.selectedListWidget, 1, 0, 1, 1) + self.horizontalLayout = QtGui.QHBoxLayout() + self.horizontalLayout.setObjectName(u'horizontalLayout') + self.directoryLabel = QtGui.QLabel(self.exportSongPage) + self.directoryLabel.setObjectName(u'directoryLabel') + self.horizontalLayout.addWidget(self.directoryLabel) + self.directoryLineEdit = QtGui.QLineEdit(self.exportSongPage) + self.directoryLineEdit.setObjectName(u'directoryLineEdit') + self.horizontalLayout.addWidget(self.directoryLineEdit) + self.directoryButton = QtGui.QToolButton(self.exportSongPage) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap(u':/exports/export_load.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.directoryButton.setIcon(icon) self.directoryButton.setObjectName(u'directoryButton') - self.gridLayout3.addWidget(self.directoryButton, 0, 2, 1, 1) - self.directoryLineEdit = QtGui.QLineEdit(self.sourcePage) - self.directoryLineEdit.setObjectName(u'directoryLineEdit') - self.gridLayout3.addWidget(self.directoryLineEdit, 0, 1, 1, 1) - self.directoryLabel = QtGui.QLabel(self.sourcePage) - self.directoryLabel.setObjectName(u'directoryLabel') - self.gridLayout3.addWidget(self.directoryLabel, 0, 0, 1, 1) - self.verticalLayout.addLayout(self.gridLayout3) - self.horizontalLayout.addLayout(self.verticalLayout) - self.addPage(self.sourcePage) + self.horizontalLayout.addWidget(self.directoryButton) + self.gridLayout.addLayout(self.horizontalLayout, 0, 0, 1, 1) + self.exportSongLayout.addLayout(self.gridLayout) + self.addPage(self.exportSongPage) def retranslateUi(self): """ @@ -197,12 +156,18 @@ class SongExportForm(OpenLPWizard): translate('SongsPlugin.ExportWizardForm', 'This wizard will help to ' 'export your songs to the open and free OpenLyrics worship song ' 'format.')) - self.sourcePage.setTitle( + self.availableSongsPage.setTitle( translate('SongsPlugin.ExportWizardForm', 'Select Songs')) - self.sourcePage.setSubTitle( + self.availableSongsPage.setSubTitle( translate('SongsPlugin.ExportWizardForm', - 'Add the songs, you want to export to the list on the right hand ' - 'side. You can use the buttons below or double click them.')) + 'Check the songs, you want to export.')) + self.exportSongPage.setTitle( + translate('SongsPlugin.ExportWizardForm', 'Select Directory')) + self.exportSongPage.setSubTitle( + translate('SongsPlugin.ExportWizardForm', + 'Select the directory you want the songs to be saved.')) + self.directoryLabel.setText( + translate('SongsPlugin.ExportWizardForm', 'Directory:')) self.progressPage.setTitle( translate('SongsPlugin.ExportWizardForm', 'Exporting')) self.progressPage.setSubTitle( @@ -212,16 +177,6 @@ class SongExportForm(OpenLPWizard): translate('SongsPlugin.ExportWizardForm', 'Ready.')) self.progressBar.setFormat( translate('SongsPlugin.ExportWizardForm', '%p%')) - self.directoryLabel.setText(translate('SongsPlugin.ExportWizardForm', - 'Directory:')) - self.availableLabel.setText( - translate('SongsPlugin.ExportWizardForm', 'Available Songs')) - self.selectedLabel.setText( - translate('SongsPlugin.ExportWizardForm', 'Selected Songs')) - self.allSelectedButton.setText( - translate('SongsPlugin.ExportWizardForm', 'Select all')) - self.allAvailableButton.setText( - translate('SongsPlugin.ExportWizardForm', 'Select all')) def validateCurrentPage(self): """ @@ -229,15 +184,28 @@ class SongExportForm(OpenLPWizard): """ if self.currentPage() == self.welcomePage: return True - elif self.currentPage() == self.sourcePage: - if not self.selectedListWidget.count(): + elif self.currentPage() == self.availableSongsPage: + songs = [song for song in self.availableListWidget.findItems( + QtCore.QString(u''), QtCore.Qt.MatchContains) + if song.checkState() == QtCore.Qt.Checked] + if not songs: critical_error_message_box( translate('SongsPlugin.ExportWizardForm', 'No Song Selected'), translate('SongsPlugin.ExportWizardForm', 'You need to add at least one Song to export.')) return False - elif not self.directoryLineEdit.text(): + self.selectedListWidget.clear() + # Add the songs to the list of selectd songs. + for song in songs: + title = song.text() + new_song = QtGui.QListWidgetItem(title) + new_song.setData(QtCore.Qt.UserRole, QtCore.QVariant(song)) + new_song.setFlags(QtCore.Qt.ItemIsEnabled) + self.selectedListWidget.addItem(new_song) + return True + elif self.currentPage() == self.exportSongPage: + if not self.directoryLineEdit.text(): critical_error_message_box( translate('SongsPlugin.ExportWizardForm', 'No Save Location specified'), @@ -272,11 +240,13 @@ class SongExportForm(OpenLPWizard): for song in songs: authors = u', '.join([author.display_name for author in song.authors]) - song_detail = u'%s (%s)' % (unicode(song.title), authors) - song_name = QtGui.QListWidgetItem(song_detail) - song_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(song)) - self.availableListWidget.addItem(song_name) - self.availableListWidget.selectAll() + title = u'%s (%s)' % (unicode(song.title), authors) + song = QtGui.QListWidgetItem(title) + song.setData(QtCore.Qt.UserRole, QtCore.QVariant(song)) + song.setFlags(QtCore.Qt.ItemIsSelectable| + QtCore.Qt.ItemIsUserCheckable | QtCore.Qt.ItemIsEnabled) + song.setCheckState(QtCore.Qt.Checked) + self.availableListWidget.addItem(song) Receiver.send_message(u'cursor_normal') def preWizard(self): @@ -293,9 +263,9 @@ class SongExportForm(OpenLPWizard): Perform the actual export. This creates an *openlyricsexport* instance and calls the *do_export* method. """ - self.selectedListWidget.selectAll() - songs = [item.data(QtCore.Qt.UserRole).toPyObject() - for item in self.selectedListWidget.selectedItems()] + songs = [song.data(QtCore.Qt.UserRole).toPyObject() + for song in self.selectedListWidget.findItems( + QtCore.QString(u''), QtCore.Qt.MatchContains)] exporter = OpenLyricsExport( self, songs, unicode(self.directoryLineEdit.text())) if exporter.do_export(): @@ -305,60 +275,9 @@ class SongExportForm(OpenLPWizard): self.progressLabel.setText( translate('SongsPlugin.SongExportForm', 'Your song export failed.')) - - def onAddSelectedClicked(self): - """ - Removes the selected items from the list of available songs and add them - to the list of selected songs. - """ - items = self.availableListWidget.selectedItems() - # Save a list with tuples which consist of the item row, and the item. - items = [(self.availableListWidget.row(item), item) for item in items] - items.sort(reverse=True) - for item in items: - self.availableListWidget.takeItem(item[0]) - self.selectedListWidget.addItem(item[1]) - - def onRemoveSelectedClicked(self): - """ - Removes the selected items from the list of selected songs and add them - back to the list of available songs. - """ - items = self.selectedListWidget.selectedItems() - # Save a list with tuples which consist of the item row, and the item. - items = [(self.selectedListWidget.row(item), item) for item in items] - items.sort(reverse=True) - for item in items: - self.selectedListWidget.takeItem(item[0]) - self.availableListWidget.addItem(item[1]) - - def onAvailableListItemDoubleClicked(self, item): - """ - Adds the double clicked item to the list of selected songs and removes - it from the list of availables songs. - - ``item`` - The *QListWidgetItem* which was double clicked. - """ - self.availableListWidget.takeItem(self.availableListWidget.row(item)) - self.selectedListWidget.addItem(item) - - def onSelectedListItemDoubleClicked(self, item): - """ - Adds the double clicked item back to the list of available songs and - removes it from the list of selected songs. - - ``ìtem`` - The *QListWidgetItem* which was double clicked. - """ - self.selectedListWidget.takeItem(self.selectedListWidget.row(item)) - self.availableListWidget.addItem(item) - - def onAllAvailableButtonClicked(self): - """ - Selects all songs in the *availableListWidget*. - """ - self.availableListWidget.selectAll() + +# def onSearchLineEditChanged(self, text): +# pass def onDirectoryButtonClicked(self): """ @@ -371,9 +290,3 @@ class SongExportForm(OpenLPWizard): options=QtGui.QFileDialog.ShowDirsOnly)) SettingsManager.set_last_dir(self.plugin.settingsSection, path, 1) self.directoryLineEdit.setText(path) - - def onAllSelectedButtonClicked(self): - """ - Selects all songs in the *selectedListWidget*. - """ - self.selectedListWidget.selectAll() diff --git a/resources/forms/songexportform.ui b/resources/forms/songexportform.ui deleted file mode 100644 index ad3ada947..000000000 --- a/resources/forms/songexportform.ui +++ /dev/null @@ -1,148 +0,0 @@ - - - WizardPage - - - - 0 - 0 - 576 - 334 - - - - WizardPage - - - - - - - - - - - - - - - ... - - - - :/exports/export_move_to_list.png:/exports/export_move_to_list.png - - - - - - - ... - - - - :/exports/export_remove.png:/exports/export_remove.png - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - Available Songs - - - - - - - Selected Songs - - - - - - - - - - - 0 - 0 - - - - Select all - - - - - - - Select all - - - - - - - - - - - ... - - - - :/exports/export_load.png:/exports/export_load.png - - - - - - - - - - Directory: - - - - - - - - - - - - - - diff --git a/resources/images/export_move_to_list.png b/resources/images/export_move_to_list.png deleted file mode 100644 index 5c000585611b2a7eef251b16d157b7d3fbe343f1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 862 zcmV-k1EKthP))=>P)60+m=mEULo}(6DE|o@Zn-E{+#%FBN6by>iN&WA))_C@EKH8?PsO`9y;M64pgk+G zo4(KY^=oW**AUeLtBE#EEYk$bC)G`2e1dcXlWsAycerd)^&Wu9d5P0&wb^L>f^vQ! zG8UuNGFlnXkR*z3tmp&*ekWwL9Qe_)0)eZnJ=$f>#Hl0v@F7v zuf#Z2=f%-o!IdkQ^!ztB5_xqAkpb_8=v?E}e|GukQ7l#SRydGZXRdfqM3|k$=$f~p oro44E|HtiCRwA;~*#1|)1JnysG2#JYp8x;=07*qoM6N<$f~BjP$^ZZW diff --git a/resources/images/export_remove.png b/resources/images/export_remove.png deleted file mode 100644 index ef8e685e2edc2bd322bc20b3930b3b8a4a956692..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 666 zcmV;L0%iS)P)EpEu1Bn~z?SOH%W3`5?j4Qac4I15gKU`L5t>eN996dfGWy$GdT78e~1IEWxDihex7vOw4eG#$fZhali~XI|dwy2)5q7?kev-7Va?i{8#`0ED~iS znPE8+jBfgBF#tb?!0r|!;|Uxhh~`JWR^bpU8u7y9}-^q*}IfB~Nq%ySBz{^kAz z3q)BlA;{zV9S&*>ZND1?U{GxVemB-UgWbmGokGcyqSwMaQBF)n)gu5F4?Uh4@^Ycw-*5-~sCaop*i?$X&F0Mt&l~Qb zfY1*WGoB%i7sW@t*o-kS#!v>NY9h9$NM~6&ozmxk>*nk(P@GSvbVZtA)kJKs3`pjz z2QVQIGtrHEzzyrW3909E+g3AU>}ZYus}ujmzk3qv7);hk;Q#;t07*qoM6N<$f=kC8 Ao&W#< diff --git a/resources/images/openlp-2.qrc b/resources/images/openlp-2.qrc index 3d953995e..f647eb39d 100644 --- a/resources/images/openlp-2.qrc +++ b/resources/images/openlp-2.qrc @@ -78,9 +78,7 @@ import_load.png
- export_remove.png export_load.png - export_move_to_list.png wizard_exportsong.bmp From 57e489b75ab4651b3dd7c216b73de2c02fc2da1d Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sun, 6 Feb 2011 18:01:47 +0000 Subject: [PATCH 036/243] Dedupe presentation controllers --- .../presentations/lib/impresscontroller.py | 45 ++++++++++--------- .../presentations/lib/powerpointcontroller.py | 31 +++++++------ 2 files changed, 40 insertions(+), 36 deletions(-) diff --git a/openlp/plugins/presentations/lib/impresscontroller.py b/openlp/plugins/presentations/lib/impresscontroller.py index f12d36dc8..465f733c7 100644 --- a/openlp/plugins/presentations/lib/impresscontroller.py +++ b/openlp/plugins/presentations/lib/impresscontroller.py @@ -431,35 +431,36 @@ class ImpressDocument(PresentationDocument): def get_slide_text(self, slide_no): """ - Returns the text on the slide + Returns the text on the slide. ``slide_no`` - The slide the text is required for, starting at 1 + The slide the text is required for, starting at 1 + """ + return __get_text_from_slide(slide_no) + + def get_slide_notes(self, slide_no): + """ + Returns the text in the slide notes. + + ``slide_no`` + The slide the notes are required for, starting at 1 + """ + return __get_text_from_page(slide_no, True) + + def __get_text_from_page(self, slide_no, notes=False): + """ + Return any text extracted from the presentation page. + + ``notes`` + A boolean. If set the method searches the notes of the slide. """ - doc = self.document - pages = doc.getDrawPages() text = '' + pages = self.document.getDrawPages() page = pages.getByIndex(slide_no - 1) + if notes: + page = page.getNotesPage() for idx in range(page.getCount()): shape = page.getByIndex(idx) if shape.supportsService("com.sun.star.drawing.Text"): text += shape.getString() + '\n' return text - - def get_slide_notes(self, slide_no): - """ - Returns the text on the slide - - ``slide_no`` - The slide the notes are required for, starting at 1 - """ - doc = self.document - pages = doc.getDrawPages() - text = '' - page = pages.getByIndex(slide_no - 1) - notes = page.getNotesPage() - for idx in range(notes.getCount()): - shape = notes.getByIndex(idx) - if shape.supportsService("com.sun.star.drawing.Text"): - text += shape.getString() + '\n' - return text diff --git a/openlp/plugins/presentations/lib/powerpointcontroller.py b/openlp/plugins/presentations/lib/powerpointcontroller.py index 012f8534a..fcc8bfc47 100644 --- a/openlp/plugins/presentations/lib/powerpointcontroller.py +++ b/openlp/plugins/presentations/lib/powerpointcontroller.py @@ -291,13 +291,7 @@ class PowerpointDocument(PresentationDocument): ``slide_no`` The slide the text is required for, starting at 1. """ - text = '' - shapes = self.presentation.Slides(slide_no).Shapes - for idx in range(shapes.Count): - shape = shapes(idx + 1) - if shape.HasTextFrame: - text += shape.TextFrame.TextRange.Text + '\n' - return text + return _get_text_from_shapes(self.presentation.Slides(slide_no).Shapes) def get_slide_notes(self, slide_no): """ @@ -306,10 +300,19 @@ class PowerpointDocument(PresentationDocument): ``slide_no`` The slide the notes are required for, starting at 1. """ - text = '' - shapes = self.presentation.Slides(slide_no).NotesPage.Shapes - for idx in range(shapes.Count): - shape = shapes(idx + 1) - if shape.HasTextFrame: - text += shape.TextFrame.TextRange.Text + '\n' - return text \ No newline at end of file + return _get_text_from_shapes( + self.presentation.Slides(slide_no).NotesPage.Shapes) + +def _get_text_from_shapes(shapes): + """ + Returns any text extracted from the shapes on a presentation slide. + + ``shapes`` + A set of shapes to search for text. + """ + text = '' + for idx in range(shapes.Count): + shape = shapes(idx + 1) + if shape.HasTextFrame: + text += shape.TextFrame.TextRange.Text + '\n' + return text From 1824ac31c6d3d552cdf476f8dc28e2f1d1383bb6 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sun, 6 Feb 2011 19:37:35 +0000 Subject: [PATCH 037/243] Remove mediaitem duplicated calls --- openlp/plugins/images/lib/mediaitem.py | 2 -- openlp/plugins/media/lib/mediaitem.py | 2 -- 2 files changed, 4 deletions(-) diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index 71027881c..6e720fa0b 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -84,8 +84,6 @@ class ImageMediaItem(MediaManagerItem): def initialise(self): log.debug(u'initialise') self.listView.clear() - self.listView.setSelectionMode( - QtGui.QAbstractItemView.ExtendedSelection) self.listView.setIconSize(QtCore.QSize(88, 50)) self.servicePath = os.path.join( AppLocation.get_section_data_path(self.settingsSection), diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index ea1b679b4..f0549a960 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -151,8 +151,6 @@ class MediaMediaItem(MediaManagerItem): return False def initialise(self): - self.listView.setSelectionMode( - QtGui.QAbstractItemView.ExtendedSelection) self.listView.setIconSize(QtCore.QSize(88, 50)) self.loadList(SettingsManager.load_list(self.settingsSection, self.settingsSection)) From 8e36c7a7eccd4108d526c829e544434b6c4e0d6f Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sun, 6 Feb 2011 20:53:08 +0100 Subject: [PATCH 038/243] only show ccli number if present --- openlp/plugins/songs/lib/mediaitem.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index d5cd49cbb..66cff169f 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -378,10 +378,12 @@ class SongMediaItem(MediaManagerItem): raw_footer.append(song.title) raw_footer.append(author_list) raw_footer.append(song.copyright) - raw_footer.append(unicode( - translate('SongsPlugin.MediaItem', 'CCLI License: ') + - QtCore.QSettings().value(u'general/ccli number', - QtCore.QVariant(u'')).toString())) + if QtCore.QSettings().value(u'general/ccli number', + QtCore.QVariant(u'')).toString(): + raw_footer.append(unicode( + translate('SongsPlugin.MediaItem', 'CCLI License: ') + + QtCore.QSettings().value(u'general/ccli number', + QtCore.QVariant(u'')).toString())) service_item.raw_footer = raw_footer service_item.audit = [ song.title, author_audit, song.copyright, unicode(song.ccli_number) From 5504c541ad485d0d9b04ddf9cf8999d871b36604 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sun, 6 Feb 2011 21:21:18 +0100 Subject: [PATCH 039/243] removed not needed import, use build_icon --- openlp/core/ui/printserviceorderdialog.py | 15 ++++----------- openlp/core/ui/printserviceorderform.py | 1 - 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/openlp/core/ui/printserviceorderdialog.py b/openlp/core/ui/printserviceorderdialog.py index 5706034a7..70780291a 100644 --- a/openlp/core/ui/printserviceorderdialog.py +++ b/openlp/core/ui/printserviceorderdialog.py @@ -26,9 +26,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import translate -from openlp.core.lib.ui import save_cancel_button_box - +from openlp.core.lib import build_icon, translate class Ui_PrintServiceOrderDialog(object): def setupUi(self, printServiceOrderDialog): @@ -99,17 +97,12 @@ class Ui_PrintServiceOrderDialog(object): QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.zoomButtonLayout.addItem(spacerItem) self.zoomOutButton = QtGui.QToolButton(printServiceOrderDialog) - icon = QtGui.QIcon() - icon.addPixmap(QtGui.QPixmap(u':/general/general_zoom_out.png'), - QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.zoomOutButton.setIcon(icon) + self.zoomOutButton.setIcon( + build_icon(u':/general/general_zoom_out.png')) self.zoomOutButton.setObjectName(u'zoomOutButton') self.zoomButtonLayout.addWidget(self.zoomOutButton) self.zoomInButton = QtGui.QToolButton(printServiceOrderDialog) - icon = QtGui.QIcon() - icon.addPixmap(QtGui.QPixmap(u':/general/general_zoom_in.png'), - QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.zoomInButton.setIcon(icon) + self.zoomInButton.setIcon(build_icon(u':/general/general_zoom_in.png')) self.zoomInButton.setObjectName(u'zoomInButton') self.zoomButtonLayout.addWidget(self.zoomInButton) self.dialogLayout.addLayout(self.zoomButtonLayout, 1, 0, 1, 1) diff --git a/openlp/core/ui/printserviceorderform.py b/openlp/core/ui/printserviceorderform.py index 40a3dede9..d7cf87147 100644 --- a/openlp/core/ui/printserviceorderform.py +++ b/openlp/core/ui/printserviceorderform.py @@ -30,7 +30,6 @@ import os from PyQt4 import QtCore, QtGui from openlp.core.lib import translate -from openlp.core.lib.ui import save_cancel_button_box from openlp.core.ui.printserviceorderdialog import Ui_PrintServiceOrderDialog class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): From 1bcbb83144460e4292c96c5a3e3b8a647c09224f Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sun, 6 Feb 2011 21:26:32 +0100 Subject: [PATCH 040/243] fixed doc --- openlp/core/ui/servicemanager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index ea09797ba..83d7cbc3c 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -1185,7 +1185,7 @@ class ServiceManager(QtGui.QWidget): def printServiceOrder(self): """ - Open a Print a Service Order Sheet. + Print a Service Order Sheet. """ settingDialog = PrintServiceOrderForm(self.mainwindow, self) settingDialog.exec_() From c736d0f1f84019aab2a16f736d01444a380b98bd Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 7 Feb 2011 15:55:02 +0000 Subject: [PATCH 041/243] Cleanups --- openlp/core/lib/imagemanager.py | 2 +- openlp/core/lib/plugin.py | 3 +++ openlp/core/ui/displaytagtab.py | 18 +++++++++--------- openlp/core/ui/pluginform.py | 4 +++- openlp/plugins/songs/lib/db.py | 1 - openlp/plugins/songs/lib/opensongimport.py | 3 --- 6 files changed, 16 insertions(+), 15 deletions(-) diff --git a/openlp/core/lib/imagemanager.py b/openlp/core/lib/imagemanager.py index 02d7010be..fb242602a 100644 --- a/openlp/core/lib/imagemanager.py +++ b/openlp/core/lib/imagemanager.py @@ -61,10 +61,10 @@ class Image(object): image = None image_bytes = None + class ImageManager(QtCore.QObject): """ Image Manager handles the conversion and sizing of images. - """ log.info(u'Image Manager loaded') diff --git a/openlp/core/lib/plugin.py b/openlp/core/lib/plugin.py index fb31006b5..476df79b0 100644 --- a/openlp/core/lib/plugin.py +++ b/openlp/core/lib/plugin.py @@ -44,6 +44,9 @@ class PluginStatus(object): class StringContent(object): + """ + Provide standard strings for objects to use. + """ Name = u'name' Import = u'import' Load = u'load' diff --git a/openlp/core/ui/displaytagtab.py b/openlp/core/ui/displaytagtab.py index 983bc17a8..54d021913 100644 --- a/openlp/core/ui/displaytagtab.py +++ b/openlp/core/ui/displaytagtab.py @@ -23,27 +23,27 @@ # with this program; if not, write to the Free Software Foundation, Inc., 59 # # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### -''' +""" The :mod:`DisplayTagTab` provides an Tag Edit facility. The Base set are protected and included each time loaded. Custom tags can be defined and saved. The Custom Tag arrays are saved in a pickle so QSettings works on them. Base Tags cannot be changed. - -''' +""" import cPickle + from PyQt4 import QtCore, QtGui from openlp.core.lib import SettingsTab, translate, DisplayTags from openlp.core.lib.ui import critical_error_message_box class DisplayTagTab(SettingsTab): - ''' + """ The :class:`DisplayTagTab` manages the settings tab . - ''' + """ def __init__(self): - ''' + """ Initialise the settings tab - ''' + """ SettingsTab.__init__(self, u'Display Tags') def resizeEvent(self, event=None): @@ -67,9 +67,9 @@ class DisplayTagTab(SettingsTab): self.selected = -1 def setupUi(self): - ''' + """ Configure the UI elements for the tab. - ''' + """ self.setObjectName(u'DisplayTagTab') self.tabTitleVisible = \ translate(u'OpenLP.DisplayTagTab', 'Display Tags') diff --git a/openlp/core/ui/pluginform.py b/openlp/core/ui/pluginform.py index 3b41d76a3..6318a44a5 100644 --- a/openlp/core/ui/pluginform.py +++ b/openlp/core/ui/pluginform.py @@ -34,7 +34,9 @@ from plugindialog import Ui_PluginViewDialog log = logging.getLogger(__name__) class PluginForm(QtGui.QDialog, Ui_PluginViewDialog): - + """ + The plugin form provides user control over the plugins OpenLP uses. + """ def __init__(self, parent=None): QtGui.QDialog.__init__(self, parent) self.parent = parent diff --git a/openlp/plugins/songs/lib/db.py b/openlp/plugins/songs/lib/db.py index 2bbf818b3..d9a3202b5 100644 --- a/openlp/plugins/songs/lib/db.py +++ b/openlp/plugins/songs/lib/db.py @@ -71,7 +71,6 @@ class Topic(BaseModel): def init_schema(url): - """ Setup the songs database connection and initialise the database schema. diff --git a/openlp/plugins/songs/lib/opensongimport.py b/openlp/plugins/songs/lib/opensongimport.py index eb16f4ba4..e7557f952 100644 --- a/openlp/plugins/songs/lib/opensongimport.py +++ b/openlp/plugins/songs/lib/opensongimport.py @@ -36,9 +36,6 @@ from openlp.plugins.songs.lib.songimport import SongImport log = logging.getLogger(__name__) -class OpenSongImportError(Exception): - pass - class OpenSongImport(SongImport): """ Import songs exported from OpenSong From 9f63c43b5b7b189012be56e3091c6282ba28e904 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 7 Feb 2011 16:29:06 +0000 Subject: [PATCH 042/243] Missing function docstrings --- openlp/plugins/bibles/lib/__init__.py | 7 +++++++ openlp/plugins/songs/lib/__init__.py | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/openlp/plugins/bibles/lib/__init__.py b/openlp/plugins/bibles/lib/__init__.py index e6fff1cc8..7de4e82c3 100644 --- a/openlp/plugins/bibles/lib/__init__.py +++ b/openlp/plugins/bibles/lib/__init__.py @@ -33,6 +33,13 @@ import re log = logging.getLogger(__name__) def get_reference_match(match_type): + """ + Provides the regexes and matches to use while parsing strings for bible + references. + + ``match_type`` + The type of reference information trying to be extracted in this call. + """ local_separator = unicode(u':;;\s*[:vV]\s*;;-;;\s*-\s*;;,;;\s*,\s*;;end' ).split(u';;') # English # local_separator = unicode(u',;;\s*,\s*;;-;;\s*-\s*;;.;;\.;;[Ee]nde' diff --git a/openlp/plugins/songs/lib/__init__.py b/openlp/plugins/songs/lib/__init__.py index af8b71795..c763d70b9 100644 --- a/openlp/plugins/songs/lib/__init__.py +++ b/openlp/plugins/songs/lib/__init__.py @@ -104,6 +104,15 @@ class VerseType(object): def retrieve_windows_encoding(recommendation=None): + """ + Determines which encoding to use on an information source. The process uses + both automated detection, which is passed to this method as a + recommendation, and user confirmation to return an encoding. + + ``recommendation`` + A recommended encoding discovered programmatically for the user to + confirm. + """ # map chardet result to compatible windows standard code page codepage_mapping = {'IBM866': u'cp866', 'TIS-620': u'cp874', 'SHIFT_JIS': u'cp932', 'GB2312': u'cp936', 'HZ-GB-2312': u'cp936', From 5410d8dfd114694ed0169e548b83b4e12990b7bf Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Mon, 7 Feb 2011 18:19:54 +0100 Subject: [PATCH 043/243] added a field to enter custom service notes --- openlp/core/ui/printserviceorderdialog.py | 10 +++++++++- openlp/core/ui/printserviceorderform.py | 22 ++++++++++++++-------- resources/forms/printserviceorderdialog.ui | 10 ++++++++++ 3 files changed, 33 insertions(+), 9 deletions(-) diff --git a/openlp/core/ui/printserviceorderdialog.py b/openlp/core/ui/printserviceorderdialog.py index 70780291a..5e7b5a031 100644 --- a/openlp/core/ui/printserviceorderdialog.py +++ b/openlp/core/ui/printserviceorderdialog.py @@ -26,7 +26,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import build_icon, translate +from openlp.core.lib import build_icon, translate, SpellTextEdit class Ui_PrintServiceOrderDialog(object): def setupUi(self, printServiceOrderDialog): @@ -78,6 +78,12 @@ class Ui_PrintServiceOrderDialog(object): spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.settingsLayout.addItem(spacerItem) + self.customNotesLabel = QtGui.QLabel(self) + self.customNotesLabel.setObjectName(u'customNotesLabel') + self.settingsLayout.addWidget(self.customNotesLabel) + self.customNoteEdit = SpellTextEdit(self) + self.customNoteEdit.setObjectName(u'customNoteEdit') + self.settingsLayout.addWidget(self.customNoteEdit) self.dialogLayout.addLayout(self.settingsLayout, 0, 3, 1, 1) self.buttonLayout = QtGui.QHBoxLayout() self.buttonLayout.setObjectName(u'buttonLayout') @@ -127,3 +133,5 @@ class Ui_PrintServiceOrderDialog(object): 'Service Order Sheet')) self.printButton.setText(translate('OpenLP.ServiceManager', 'Print')) self.cancelButton.setText(translate('OpenLP.ServiceManager', 'Cancel')) + self.customNotesLabel.setText( + translate('OpenLP.ServiceManager', 'Custom Service Notes:')) diff --git a/openlp/core/ui/printserviceorderform.py b/openlp/core/ui/printserviceorderform.py index d7cf87147..546d52d55 100644 --- a/openlp/core/ui/printserviceorderform.py +++ b/openlp/core/ui/printserviceorderform.py @@ -55,21 +55,24 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): settings.endGroup() # Signals QtCore.QObject.connect(self.printButton, - QtCore.SIGNAL('clicked()'), self.printServiceOrder) + QtCore.SIGNAL(u'clicked()'), self.printServiceOrder) QtCore.QObject.connect(self.zoomOutButton, - QtCore.SIGNAL('clicked()'), self.zoomOut) + QtCore.SIGNAL(u'clicked()'), self.zoomOut) QtCore.QObject.connect(self.zoomInButton, - QtCore.SIGNAL('clicked()'), self.zoomIn) + QtCore.SIGNAL(u'clicked()'), self.zoomIn) QtCore.QObject.connect(self.previewWidget, - QtCore.SIGNAL('paintRequested(QPrinter *)'), self.paintRequested) + QtCore.SIGNAL(u'paintRequested(QPrinter *)'), self.paintRequested) QtCore.QObject.connect(self.serviceTitleLineEdit, - QtCore.SIGNAL('textChanged(const QString)'), self.updatePreviewText) + QtCore.SIGNAL(u'textChanged(const QString)'), + self.updatePreviewText) QtCore.QObject.connect(self.printSlideTextCheckBox, - QtCore.SIGNAL('stateChanged(int)'), self.updatePreviewText) + QtCore.SIGNAL(u'stateChanged(int)'), self.updatePreviewText) QtCore.QObject.connect(self.printNotesCheckBox, - QtCore.SIGNAL('stateChanged(int)'), self.updatePreviewText) + QtCore.SIGNAL(u'stateChanged(int)'), self.updatePreviewText) QtCore.QObject.connect(self.printMetaDataCheckBox, - QtCore.SIGNAL('stateChanged(int)'), self.updatePreviewText) + QtCore.SIGNAL(u'stateChanged(int)'), self.updatePreviewText) + QtCore.QObject.connect(self.customNoteEdit, + QtCore.SIGNAL(u'textChanged()'), self.updatePreviewText) QtCore.QObject.connect(self.cancelButton, QtCore.SIGNAL(u'clicked()'), self.reject) self.updatePreviewText() @@ -120,6 +123,9 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): text += u'

%s %s

' % (translate( 'OpenLP.ServiceManager', u'Playing time:'), unicode(datetime.timedelta(seconds=length))) + if self.customNoteEdit.toPlainText(): + text += u'

%s

%s' % (translate('OpenLP.ServiceManager', + u'Custom Service Notes:'), self.customNoteEdit.toPlainText()) self.document.setHtml(text) self.previewWidget.updatePreview() diff --git a/resources/forms/printserviceorderdialog.ui b/resources/forms/printserviceorderdialog.ui index 66f44384f..131979b65 100644 --- a/resources/forms/printserviceorderdialog.ui +++ b/resources/forms/printserviceorderdialog.ui @@ -79,6 +79,16 @@ + + + + <b>Custom Notes:</b> + + + + + + From 9dec924f9873550aaad58b8c422bb38b659e69fb Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Mon, 7 Feb 2011 18:27:38 +0100 Subject: [PATCH 044/243] added missing doc --- openlp/core/ui/printserviceorderform.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openlp/core/ui/printserviceorderform.py b/openlp/core/ui/printserviceorderform.py index 546d52d55..3b01f9ac7 100644 --- a/openlp/core/ui/printserviceorderform.py +++ b/openlp/core/ui/printserviceorderform.py @@ -132,6 +132,9 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): def paintRequested(self, printer): """ Paint the preview of the *self.document*. + + ``printer`` + A *QPrinter* object. """ self.document.print_(printer) From 91db60ad7febbfa17bf48f6d17b6bfa2e2c6a5f7 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Mon, 7 Feb 2011 19:02:13 +0100 Subject: [PATCH 045/243] fixed typos --- openlp/core/ui/printserviceorderdialog.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/core/ui/printserviceorderdialog.py b/openlp/core/ui/printserviceorderdialog.py index 5e7b5a031..f8db4d1c0 100644 --- a/openlp/core/ui/printserviceorderdialog.py +++ b/openlp/core/ui/printserviceorderdialog.py @@ -121,12 +121,12 @@ class Ui_PrintServiceOrderDialog(object): self.previewLabel.setText( translate('OpenLP.ServiceManager', 'Preview:')) self.printSlideTextCheckBox.setText(translate( - 'OpenLP.PrintServiceOrderForm', 'Include slide text if avaialbe')) + 'OpenLP.PrintServiceOrderForm', 'Include slide text if available')) self.printNotesCheckBox.setText(translate( 'OpenLP.PrintServiceOrderForm', 'Include service item notes')) self.printMetaDataCheckBox.setText( translate('OpenLP.PrintServiceOrderForm', - 'Include play lenght of media items')) + 'Include play length of media items')) self.serviceTitleLabel.setText(translate( 'OpenLP.PrintServiceOrderForm', 'Title:')) self.serviceTitleLineEdit.setText(translate('OpenLP.ServiceManager', From 975d9f6a1c78ca633a0cfd8b9ef67f47e9f75a58 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Mon, 7 Feb 2011 18:46:22 +0000 Subject: [PATCH 046/243] Fix Song previews when returning from blank screen --- openlp/core/ui/slidecontroller.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index bf0453e05..d86dba4b0 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -874,7 +874,8 @@ class SlideController(QtGui.QWidget): using *Blank to Theme*. """ log.debug(u'updatePreview %s ' % self.screens.current[u'primary']) - if not self.screens.current[u'primary']: + if not self.screens.current[u'primary'] and \ + self.serviceItem.is_capable(ItemCapabilities.ProvidesOwnDisplay): # Grab now, but try again in a couple of seconds if slide change # is slow QtCore.QTimer.singleShot(0.5, self.grabMainDisplay) From b6735065c0e35e9f20a63caecc2219b10d8f5e69 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 7 Feb 2011 19:37:07 +0000 Subject: [PATCH 047/243] Presentation dedupe --- .../presentations/lib/impresscontroller.py | 11 +- openlp/plugins/presentations/lib/mediaitem.py | 6 +- .../presentations/lib/messagelistener.py | 2 +- .../presentations/lib/powerpointcontroller.py | 11 +- .../presentations/lib/pptviewcontroller.py | 13 +- .../lib/presentationcontroller.py | 295 +++++++++--------- 6 files changed, 160 insertions(+), 178 deletions(-) diff --git a/openlp/plugins/presentations/lib/impresscontroller.py b/openlp/plugins/presentations/lib/impresscontroller.py index 465f733c7..79e7d0ea8 100644 --- a/openlp/plugins/presentations/lib/impresscontroller.py +++ b/openlp/plugins/presentations/lib/impresscontroller.py @@ -69,7 +69,8 @@ class ImpressController(PresentationController): Initialise the class """ log.debug(u'Initialising') - PresentationController.__init__(self, plugin, u'Impress') + PresentationController.__init__(self, plugin, u'Impress', + ImpressDocument) self.supports = [u'odp'] self.alsosupports = [u'ppt', u'pps', u'pptx', u'ppsx'] self.process = None @@ -183,14 +184,6 @@ class ImpressController(PresentationController): except: log.exception(u'Failed to terminate OpenOffice') - def add_doc(self, name): - """ - Called when a new Impress document is opened - """ - log.debug(u'Add Doc OpenOffice') - doc = ImpressDocument(self, name) - self.docs.append(doc) - return doc class ImpressDocument(PresentationDocument): """ diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index a0173cb27..09020692a 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -186,7 +186,7 @@ class PresentationMediaItem(MediaManagerItem): controller_name = self.findControllerByType(filename) if controller_name: controller = self.controllers[controller_name] - doc = controller.add_doc(unicode(file)) + doc = controller.add_document(unicode(file)) thumb = os.path.join(doc.get_thumbnail_folder(), u'icon.png') preview = doc.get_thumbnail_path(1, True) if not preview and not initialLoad: @@ -226,7 +226,7 @@ class PresentationMediaItem(MediaManagerItem): filepath = unicode(item.data( QtCore.Qt.UserRole).toString()) for cidx in self.controllers: - doc = self.controllers[cidx].add_doc(filepath) + doc = self.controllers[cidx].add_document(filepath) doc.presentation_deleted() doc.close_presentation() for row in row_list: @@ -260,7 +260,7 @@ class PresentationMediaItem(MediaManagerItem): return False controller = self.controllers[service_item.shortname] (path, name) = os.path.split(filename) - doc = controller.add_doc(filename) + doc = controller.add_document(filename) if doc.get_thumbnail_path(1, True) is None: doc.load_presentation() i = 1 diff --git a/openlp/plugins/presentations/lib/messagelistener.py b/openlp/plugins/presentations/lib/messagelistener.py index 4d926ad3d..b7c64ccee 100644 --- a/openlp/plugins/presentations/lib/messagelistener.py +++ b/openlp/plugins/presentations/lib/messagelistener.py @@ -59,7 +59,7 @@ class Controller(object): self.controller = controller if self.doc is not None: self.shutdown() - self.doc = self.controller.add_doc(file) + self.doc = self.controller.add_document(file) if not self.doc.load_presentation(): # Display error message to user # Inform slidecontroller that the action failed? diff --git a/openlp/plugins/presentations/lib/powerpointcontroller.py b/openlp/plugins/presentations/lib/powerpointcontroller.py index fcc8bfc47..65e9f35ff 100644 --- a/openlp/plugins/presentations/lib/powerpointcontroller.py +++ b/openlp/plugins/presentations/lib/powerpointcontroller.py @@ -53,7 +53,8 @@ class PowerpointController(PresentationController): Initialise the class """ log.debug(u'Initialising') - PresentationController.__init__(self, plugin, u'Powerpoint') + PresentationController.__init__(self, plugin, u'Powerpoint', + PowerpointDocument) self.supports = [u'ppt', u'pps', u'pptx', u'ppsx'] self.process = None @@ -97,14 +98,6 @@ class PowerpointController(PresentationController): pass self.process = None - def add_doc(self, name): - """ - Called when a new powerpoint document is opened - """ - log.debug(u'Add Doc PowerPoint') - doc = PowerpointDocument(self, name) - self.docs.append(doc) - return doc class PowerpointDocument(PresentationDocument): """ diff --git a/openlp/plugins/presentations/lib/pptviewcontroller.py b/openlp/plugins/presentations/lib/pptviewcontroller.py index 4c8e7bf95..a64cd31dd 100644 --- a/openlp/plugins/presentations/lib/pptviewcontroller.py +++ b/openlp/plugins/presentations/lib/pptviewcontroller.py @@ -49,7 +49,8 @@ class PptviewController(PresentationController): """ log.debug(u'Initialising') self.process = None - PresentationController.__init__(self, plugin, u'Powerpoint Viewer') + PresentationController.__init__(self, plugin, u'Powerpoint Viewer', + PptviewDocument) self.supports = [u'ppt', u'pps', u'pptx', u'ppsx'] def check_available(self): @@ -93,14 +94,6 @@ class PptviewController(PresentationController): while self.docs: self.docs[0].close_presentation() - def add_doc(self, name): - """ - Called when a new powerpoint document is opened - """ - log.debug(u'Add Doc PPTView') - doc = PptviewDocument(self, name) - self.docs.append(doc) - return doc class PptviewDocument(PresentationDocument): """ @@ -247,4 +240,4 @@ class PptviewDocument(PresentationDocument): """ Triggers the previous slide on the running presentation """ - self.controller.process.PrevStep(self.pptid) \ No newline at end of file + self.controller.process.PrevStep(self.pptid) diff --git a/openlp/plugins/presentations/lib/presentationcontroller.py b/openlp/plugins/presentations/lib/presentationcontroller.py index 42f7b654a..8b282e0f4 100644 --- a/openlp/plugins/presentations/lib/presentationcontroller.py +++ b/openlp/plugins/presentations/lib/presentationcontroller.py @@ -35,151 +35,6 @@ from openlp.core.utils import AppLocation log = logging.getLogger(__name__) -class PresentationController(object): - """ - This class is used to control interactions with presentation applications - by creating a runtime environment. This is a base class for presentation - controllers to inherit from. - - To create a new controller, take a copy of this file and name it so it ends - with ``controller.py``, i.e. ``foobarcontroller.py``. Make sure it inherits - :class:`~openlp.plugins.presentations.lib.presentationcontroller.PresentationController`, - and then fill in the blanks. If possible try to make sure it loads on all - platforms, usually by using :mod:``os.name`` checks, although - ``__init__``, ``check_available`` and ``presentation_deleted`` should - always be implemented. - - See :class:`~openlp.plugins.presentations.lib.impresscontroller.ImpressController`, - :class:`~openlp.plugins.presentations.lib.powerpointcontroller.PowerpointController` or - :class:`~openlp.plugins.presentations.lib.pptviewcontroller.PptviewController` - for examples. - - **Basic Attributes** - - ``name`` - The name that appears in the options and the media manager - - ``enabled`` - The controller is enabled - - ``available`` - The controller is available on this machine. Set by init via - call to check_available - - ``plugin`` - The presentationplugin object - - ``supports`` - The primary native file types this application supports - - ``alsosupports`` - Other file types the application can import, although not necessarily - the first choice due to potential incompatibilities - - **Hook Functions** - - ``kill()`` - Called at system exit to clean up any running presentations - - ``check_available()`` - Returns True if presentation application is installed/can run on this - machine - - ``presentation_deleted()`` - Deletes presentation specific files, e.g. thumbnails - - """ - log.info(u'PresentationController loaded') - - def __init__(self, plugin=None, name=u'PresentationController'): - """ - This is the constructor for the presentationcontroller object. This - provides an easy way for descendent plugins to populate common data. - This method *must* be overridden, like so:: - - class MyPresentationController(PresentationController): - def __init__(self, plugin): - PresentationController.__init( - self, plugin, u'My Presenter App') - - ``plugin`` - Defaults to *None*. The presentationplugin object - - ``name`` - Name of the application, to appear in the application - """ - self.supports = [] - self.alsosupports = [] - self.docs = [] - self.plugin = plugin - self.name = name - self.settings_section = self.plugin.settingsSection - self.available = self.check_available() - self.temp_folder = os.path.join( - AppLocation.get_section_data_path(self.settings_section), name) - self.thumbnail_folder = os.path.join( - AppLocation.get_section_data_path(self.settings_section), - u'thumbnails') - self.thumbnail_prefix = u'slide' - if not os.path.isdir(self.thumbnail_folder): - os.makedirs(self.thumbnail_folder) - if not os.path.isdir(self.temp_folder): - os.makedirs(self.temp_folder) - - def enabled(self): - """ - Return whether the controller is currently enabled - """ - if self.available: - return QtCore.QSettings().value( - self.settings_section + u'/' + self.name, - QtCore.QVariant(QtCore.Qt.Checked)).toInt()[0] == \ - QtCore.Qt.Checked - else: - return False - - def check_available(self): - """ - Presentation app is able to run on this machine - """ - return False - - def start_process(self): - """ - Loads a running version of the presentation application in the - background. - """ - pass - - def kill(self): - """ - Called at system exit to clean up any running presentations and - close the application - """ - log.debug(u'Kill') - self.close_presentation() - - def add_doc(self, name): - """ - Called when a new presentation document is opened - """ - doc = PresentationDocument(self, name) - self.docs.append(doc) - return doc - - def remove_doc(self, doc=None): - """ - Called to remove an open document from the collection - """ - log.debug(u'remove_doc Presentation') - if doc is None: - return - if doc in self.docs: - self.docs.remove(doc) - - def close_presentation(self): - pass - class PresentationDocument(object): """ Base class for presentation documents to inherit from. @@ -440,4 +295,152 @@ class PresentationDocument(object): ``slide_no`` The slide the notes are required for, starting at 1 """ - return '' \ No newline at end of file + return '' + + +class PresentationController(object): + """ + This class is used to control interactions with presentation applications + by creating a runtime environment. This is a base class for presentation + controllers to inherit from. + + To create a new controller, take a copy of this file and name it so it ends + with ``controller.py``, i.e. ``foobarcontroller.py``. Make sure it inherits + :class:`~openlp.plugins.presentations.lib.presentationcontroller.PresentationController`, + and then fill in the blanks. If possible try to make sure it loads on all + platforms, usually by using :mod:``os.name`` checks, although + ``__init__``, ``check_available`` and ``presentation_deleted`` should + always be implemented. + + See :class:`~openlp.plugins.presentations.lib.impresscontroller.ImpressController`, + :class:`~openlp.plugins.presentations.lib.powerpointcontroller.PowerpointController` or + :class:`~openlp.plugins.presentations.lib.pptviewcontroller.PptviewController` + for examples. + + **Basic Attributes** + + ``name`` + The name that appears in the options and the media manager + + ``enabled`` + The controller is enabled + + ``available`` + The controller is available on this machine. Set by init via + call to check_available + + ``plugin`` + The presentationplugin object + + ``supports`` + The primary native file types this application supports + + ``alsosupports`` + Other file types the application can import, although not necessarily + the first choice due to potential incompatibilities + + **Hook Functions** + + ``kill()`` + Called at system exit to clean up any running presentations + + ``check_available()`` + Returns True if presentation application is installed/can run on this + machine + + ``presentation_deleted()`` + Deletes presentation specific files, e.g. thumbnails + + """ + log.info(u'PresentationController loaded') + + def __init__(self, plugin=None, name=u'PresentationController', + document_class=PresentationDocument): + """ + This is the constructor for the presentationcontroller object. This + provides an easy way for descendent plugins to populate common data. + This method *must* be overridden, like so:: + + class MyPresentationController(PresentationController): + def __init__(self, plugin): + PresentationController.__init( + self, plugin, u'My Presenter App') + + ``plugin`` + Defaults to *None*. The presentationplugin object + + ``name`` + Name of the application, to appear in the application + """ + self.supports = [] + self.alsosupports = [] + self.docs = [] + self.plugin = plugin + self.name = name + self.document_class = document_class + self.settings_section = self.plugin.settingsSection + self.available = self.check_available() + self.temp_folder = os.path.join( + AppLocation.get_section_data_path(self.settings_section), name) + self.thumbnail_folder = os.path.join( + AppLocation.get_section_data_path(self.settings_section), + u'thumbnails') + self.thumbnail_prefix = u'slide' + if not os.path.isdir(self.thumbnail_folder): + os.makedirs(self.thumbnail_folder) + if not os.path.isdir(self.temp_folder): + os.makedirs(self.temp_folder) + + def enabled(self): + """ + Return whether the controller is currently enabled + """ + if self.available: + return QtCore.QSettings().value( + self.settings_section + u'/' + self.name, + QtCore.QVariant(QtCore.Qt.Checked)).toInt()[0] == \ + QtCore.Qt.Checked + else: + return False + + def check_available(self): + """ + Presentation app is able to run on this machine + """ + return False + + def start_process(self): + """ + Loads a running version of the presentation application in the + background. + """ + pass + + def kill(self): + """ + Called at system exit to clean up any running presentations and + close the application + """ + log.debug(u'Kill') + self.close_presentation() + + def add_document(self, name): + """ + Called when a new presentation document is opened + """ + document = self.document_class(self, name) + self.docs.append(document) + return document + + def remove_doc(self, doc=None): + """ + Called to remove an open document from the collection + """ + log.debug(u'remove_doc Presentation') + if doc is None: + return + if doc in self.docs: + self.docs.remove(doc) + + def close_presentation(self): + pass From 943dcf1ffc7c0b73e9adbe11b3d9a0ff3b081c46 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 7 Feb 2011 22:07:48 +0000 Subject: [PATCH 048/243] Naming cleanups --- openlp/core/lib/db.py | 6 +- openlp/core/lib/displaytags.py | 6 +- openlp/core/ui/mainwindow.py | 110 +++++++++++++++--------------- openlp/core/ui/slidecontroller.py | 6 +- 4 files changed, 64 insertions(+), 64 deletions(-) diff --git a/openlp/core/lib/db.py b/openlp/core/lib/db.py index 3171730ea..d9d094949 100644 --- a/openlp/core/lib/db.py +++ b/openlp/core/lib/db.py @@ -86,10 +86,10 @@ class BaseModel(object): """ Creates an instance of a class and populates it, returning the instance """ - me = cls() + instance = cls() for key in kwargs: - me.__setattr__(key, kwargs[key]) - return me + instance.__setattr__(key, kwargs[key]) + return instance class Manager(object): """ diff --git a/openlp/core/lib/displaytags.py b/openlp/core/lib/displaytags.py index dd7276a7d..d414f80bb 100644 --- a/openlp/core/lib/displaytags.py +++ b/openlp/core/lib/displaytags.py @@ -60,8 +60,8 @@ class DisplayTags(object): DisplayTags.html_expands.append(tag) @staticmethod - def remove_html_tag(id): + def remove_html_tag(tag_id): """ - Removes amd individual html_expands list. + Removes an individual html_expands tag. """ - DisplayTags.html_expands.pop(id) + DisplayTags.html_expands.pop(tag_id) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 9af4931fb..e489d7b5d 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -77,10 +77,10 @@ class Ui_MainWindow(object): self.MainContentLayout.setMargin(0) self.MainContentLayout.setObjectName(u'MainContentLayout') mainWindow.setCentralWidget(self.MainContent) - self.ControlSplitter = QtGui.QSplitter(self.MainContent) - self.ControlSplitter.setOrientation(QtCore.Qt.Horizontal) - self.ControlSplitter.setObjectName(u'ControlSplitter') - self.MainContentLayout.addWidget(self.ControlSplitter) + self.controlSplitter = QtGui.QSplitter(self.MainContent) + self.controlSplitter.setOrientation(QtCore.Qt.Horizontal) + self.controlSplitter.setObjectName(u'controlSplitter') + self.MainContentLayout.addWidget(self.controlSplitter) # Create slide controllers self.previewController = SlideController(self, self.settingsmanager, self.screens) @@ -102,9 +102,9 @@ class Ui_MainWindow(object): self.FileExportMenu = QtGui.QMenu(self.FileMenu) self.FileExportMenu.setObjectName(u'FileExportMenu') # View Menu - self.ViewMenu = QtGui.QMenu(self.MenuBar) - self.ViewMenu.setObjectName(u'ViewMenu') - self.ViewModeMenu = QtGui.QMenu(self.ViewMenu) + self.viewMenu = QtGui.QMenu(self.MenuBar) + self.viewMenu.setObjectName(u'viewMenu') + self.ViewModeMenu = QtGui.QMenu(self.viewMenu) self.ViewModeMenu.setObjectName(u'ViewModeMenu') # Tools Menu self.ToolsMenu = QtGui.QMenu(self.MenuBar) @@ -125,38 +125,38 @@ class Ui_MainWindow(object): self.DefaultThemeLabel.setObjectName(u'DefaultThemeLabel') self.StatusBar.addPermanentWidget(self.DefaultThemeLabel) # Create the MediaManager - self.MediaManagerDock = OpenLPDockWidget(mainWindow, - u'MediaManagerDock', u':/system/system_mediamanager.png') - self.MediaManagerDock.setStyleSheet(MEDIA_MANAGER_STYLE) - self.MediaManagerDock.setMinimumWidth( + self.mediaManagerDock = OpenLPDockWidget(mainWindow, + u'mediaManagerDock', u':/system/system_mediamanager.png') + self.mediaManagerDock.setStyleSheet(MEDIA_MANAGER_STYLE) + self.mediaManagerDock.setMinimumWidth( self.settingsmanager.mainwindow_left) # Create the media toolbox - self.MediaToolBox = QtGui.QToolBox(self.MediaManagerDock) + self.MediaToolBox = QtGui.QToolBox(self.mediaManagerDock) self.MediaToolBox.setObjectName(u'MediaToolBox') - self.MediaManagerDock.setWidget(self.MediaToolBox) + self.mediaManagerDock.setWidget(self.MediaToolBox) mainWindow.addDockWidget(QtCore.Qt.LeftDockWidgetArea, - self.MediaManagerDock) + self.mediaManagerDock) # Create the service manager - self.ServiceManagerDock = OpenLPDockWidget(mainWindow, - u'ServiceManagerDock', u':/system/system_servicemanager.png') - self.ServiceManagerDock.setMinimumWidth( + self.serviceManagerDock = OpenLPDockWidget(mainWindow, + u'serviceManagerDock', u':/system/system_servicemanager.png') + self.serviceManagerDock.setMinimumWidth( self.settingsmanager.mainwindow_right) self.ServiceManagerContents = ServiceManager(mainWindow, - self.ServiceManagerDock) - self.ServiceManagerDock.setWidget(self.ServiceManagerContents) + self.serviceManagerDock) + self.serviceManagerDock.setWidget(self.ServiceManagerContents) mainWindow.addDockWidget(QtCore.Qt.RightDockWidgetArea, - self.ServiceManagerDock) + self.serviceManagerDock) # Create the theme manager - self.ThemeManagerDock = OpenLPDockWidget(mainWindow, - u'ThemeManagerDock', u':/system/system_thememanager.png') - self.ThemeManagerDock.setMinimumWidth( + self.themeManagerDock = OpenLPDockWidget(mainWindow, + u'themeManagerDock', u':/system/system_thememanager.png') + self.themeManagerDock.setMinimumWidth( self.settingsmanager.mainwindow_right) self.ThemeManagerContents = ThemeManager(mainWindow, - self.ThemeManagerDock) + self.themeManagerDock) self.ThemeManagerContents.setObjectName(u'ThemeManagerContents') - self.ThemeManagerDock.setWidget(self.ThemeManagerContents) + self.themeManagerDock.setWidget(self.ThemeManagerContents) mainWindow.addDockWidget(QtCore.Qt.RightDockWidgetArea, - self.ThemeManagerDock) + self.themeManagerDock) # Create the menu items self.FileNewItem = icon_action(mainWindow, u'FileNewItem', u':/general/general_new.png') @@ -186,14 +186,14 @@ class Ui_MainWindow(object): mainWindow.actionList.add_action(self.ExportLanguageItem, u'Export') self.ViewMediaManagerItem = icon_action(mainWindow, u'ViewMediaManagerItem', u':/system/system_mediamanager.png', - self.MediaManagerDock.isVisible()) + self.mediaManagerDock.isVisible()) self.ViewThemeManagerItem = icon_action(mainWindow, u'ViewThemeManagerItem', u':/system/system_thememanager.png', - self.ThemeManagerDock.isVisible()) + self.themeManagerDock.isVisible()) mainWindow.actionList.add_action(self.ViewMediaManagerItem, u'View') self.ViewServiceManagerItem = icon_action(mainWindow, u'ViewServiceManagerItem', u':/system/system_servicemanager.png', - self.ServiceManagerDock.isVisible()) + self.serviceManagerDock.isVisible()) mainWindow.actionList.add_action(self.ViewServiceManagerItem, u'View') self.ViewPreviewPanel = checkable_action(mainWindow, u'ViewPreviewPanel', previewVisible) @@ -215,9 +215,9 @@ class Ui_MainWindow(object): self.ToolsAddToolItem = icon_action(mainWindow, u'ToolsAddToolItem', u':/tools/tools_add.png') mainWindow.actionList.add_action(self.ToolsAddToolItem, u'Tools') - self.SettingsPluginListItem = icon_action(mainWindow, - u'SettingsPluginListItem', u':/system/settings_plugin_list.png') - mainWindow.actionList.add_action(self.SettingsPluginListItem, + self.settingsPluginListItem = icon_action(mainWindow, + u'settingsPluginListItem', u':/system/settings_plugin_list.png') + mainWindow.actionList.add_action(self.settingsPluginListItem, u'Settings') # i18n Language Items self.AutoLanguageItem = checkable_action(mainWindow, @@ -264,14 +264,14 @@ class Ui_MainWindow(object): self.FileExportMenu.menuAction(), self.FileExitItem) add_actions(self.ViewModeMenu, (self.ModeDefaultItem, self.ModeSetupItem, self.ModeLiveItem)) - add_actions(self.ViewMenu, (self.ViewModeMenu.menuAction(), + add_actions(self.viewMenu, (self.ViewModeMenu.menuAction(), None, self.ViewMediaManagerItem, self.ViewServiceManagerItem, self.ViewThemeManagerItem, None, self.ViewPreviewPanel, self.ViewLivePanel)) # i18n add Language Actions add_actions(self.SettingsLanguageMenu, (self.AutoLanguageItem, None)) add_actions(self.SettingsLanguageMenu, self.LanguageGroup.actions()) - add_actions(self.SettingsMenu, (self.SettingsPluginListItem, + add_actions(self.SettingsMenu, (self.settingsPluginListItem, self.SettingsLanguageMenu.menuAction(), None, self.SettingsShortcutsItem, self.SettingsConfigureItem)) add_actions(self.ToolsMenu, (self.ToolsAddToolItem, None)) @@ -279,7 +279,7 @@ class Ui_MainWindow(object): self.HelpOnlineHelpItem, None, self.HelpWebSiteItem, self.HelpAboutItem)) add_actions(self.MenuBar, (self.FileMenu.menuAction(), - self.ViewMenu.menuAction(), self.ToolsMenu.menuAction(), + self.viewMenu.menuAction(), self.ToolsMenu.menuAction(), self.SettingsMenu.menuAction(), self.HelpMenu.menuAction())) # Initialise the translation self.retranslateUi(mainWindow) @@ -300,18 +300,18 @@ class Ui_MainWindow(object): self.FileMenu.setTitle(translate('OpenLP.MainWindow', '&File')) self.FileImportMenu.setTitle(translate('OpenLP.MainWindow', '&Import')) self.FileExportMenu.setTitle(translate('OpenLP.MainWindow', '&Export')) - self.ViewMenu.setTitle(translate('OpenLP.MainWindow', '&View')) + self.viewMenu.setTitle(translate('OpenLP.MainWindow', '&View')) self.ViewModeMenu.setTitle(translate('OpenLP.MainWindow', 'M&ode')) self.ToolsMenu.setTitle(translate('OpenLP.MainWindow', '&Tools')) self.SettingsMenu.setTitle(translate('OpenLP.MainWindow', '&Settings')) self.SettingsLanguageMenu.setTitle(translate('OpenLP.MainWindow', '&Language')) self.HelpMenu.setTitle(translate('OpenLP.MainWindow', '&Help')) - self.MediaManagerDock.setWindowTitle( + self.mediaManagerDock.setWindowTitle( translate('OpenLP.MainWindow', 'Media Manager')) - self.ServiceManagerDock.setWindowTitle( + self.serviceManagerDock.setWindowTitle( translate('OpenLP.MainWindow', 'Service Manager')) - self.ThemeManagerDock.setWindowTitle( + self.themeManagerDock.setWindowTitle( translate('OpenLP.MainWindow', 'Theme Manager')) self.FileNewItem.setText(translate('OpenLP.MainWindow', '&New')) self.FileNewItem.setToolTip( @@ -403,11 +403,11 @@ class Ui_MainWindow(object): 'Toggle the visibility of the live panel.')) self.ViewLivePanel.setShortcut( translate('OpenLP.MainWindow', 'F12')) - self.SettingsPluginListItem.setText(translate('OpenLP.MainWindow', + self.settingsPluginListItem.setText(translate('OpenLP.MainWindow', '&Plugin List')) - self.SettingsPluginListItem.setStatusTip( + self.settingsPluginListItem.setStatusTip( translate('OpenLP.MainWindow', 'List the Plugins')) - self.SettingsPluginListItem.setShortcut( + self.settingsPluginListItem.setShortcut( translate('OpenLP.MainWindow', 'Alt+F7')) self.HelpDocumentationItem.setText( translate('OpenLP.MainWindow', '&User Guide')) @@ -501,20 +501,20 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): QtCore.SIGNAL(u'toggled(bool)'), self.setPreviewPanelVisibility) QtCore.QObject.connect(self.ViewLivePanel, QtCore.SIGNAL(u'toggled(bool)'), self.setLivePanelVisibility) - QtCore.QObject.connect(self.MediaManagerDock, + QtCore.QObject.connect(self.mediaManagerDock, QtCore.SIGNAL(u'visibilityChanged(bool)'), self.ViewMediaManagerItem.setChecked) - QtCore.QObject.connect(self.ServiceManagerDock, + QtCore.QObject.connect(self.serviceManagerDock, QtCore.SIGNAL(u'visibilityChanged(bool)'), self.ViewServiceManagerItem.setChecked) - QtCore.QObject.connect(self.ThemeManagerDock, + QtCore.QObject.connect(self.themeManagerDock, QtCore.SIGNAL(u'visibilityChanged(bool)'), self.ViewThemeManagerItem.setChecked) QtCore.QObject.connect(self.HelpWebSiteItem, QtCore.SIGNAL(u'triggered()'), self.onHelpWebSiteClicked) QtCore.QObject.connect(self.HelpAboutItem, QtCore.SIGNAL(u'triggered()'), self.onHelpAboutItemClicked) - QtCore.QObject.connect(self.SettingsPluginListItem, + QtCore.QObject.connect(self.settingsPluginListItem, QtCore.SIGNAL(u'triggered()'), self.onPluginItemClicked) QtCore.QObject.connect(self.SettingsConfigureItem, QtCore.SIGNAL(u'triggered()'), self.onSettingsConfigureItemClicked) @@ -748,9 +748,9 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): settings = QtCore.QSettings() settings.setValue(u'%s/view mode' % self.generalSettingsSection, mode) - self.MediaManagerDock.setVisible(media) - self.ServiceManagerDock.setVisible(service) - self.ThemeManagerDock.setVisible(theme) + self.mediaManagerDock.setVisible(media) + self.serviceManagerDock.setVisible(service) + self.themeManagerDock.setVisible(theme) self.setPreviewPanelVisibility(preview) self.setLivePanelVisibility(live) @@ -867,16 +867,16 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): theme) def toggleMediaManager(self, visible): - if self.MediaManagerDock.isVisible() != visible: - self.MediaManagerDock.setVisible(visible) + if self.mediaManagerDock.isVisible() != visible: + self.mediaManagerDock.setVisible(visible) def toggleServiceManager(self, visible): - if self.ServiceManagerDock.isVisible() != visible: - self.ServiceManagerDock.setVisible(visible) + if self.serviceManagerDock.isVisible() != visible: + self.serviceManagerDock.setVisible(visible) def toggleThemeManager(self, visible): - if self.ThemeManagerDock.isVisible() != visible: - self.ThemeManagerDock.setVisible(visible) + if self.themeManagerDock.isVisible() != visible: + self.themeManagerDock.setVisible(visible) def setPreviewPanelVisibility(self, visible): """ diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index bf0453e05..3445c63a1 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -78,7 +78,7 @@ class SlideController(QtGui.QWidget): self.selectedRow = 0 self.serviceItem = None self.alertTab = None - self.panel = QtGui.QWidget(parent.ControlSplitter) + self.panel = QtGui.QWidget(parent.controlSplitter) self.slideList = {} # Layout for holding panel self.panelLayout = QtGui.QVBoxLayout(self.panel) @@ -455,7 +455,7 @@ class SlideController(QtGui.QWidget): self.previewListWidget.resizeRowsToContents() else: # Sort out image heights. - width = self.parent.ControlSplitter.sizes()[self.split] + width = self.parent.controlSplitter.sizes()[self.split] for framenumber in range(len(self.serviceItem.get_frames())): self.previewListWidget.setRowHeight( framenumber, width / self.ratio) @@ -584,7 +584,7 @@ class SlideController(QtGui.QWidget): Receiver.send_message(u'%s_start' % serviceItem.name.lower(), [serviceItem, self.isLive, blanked, slideno]) self.slideList = {} - width = self.parent.ControlSplitter.sizes()[self.split] + width = self.parent.controlSplitter.sizes()[self.split] self.serviceItem = serviceItem self.previewListWidget.clear() self.previewListWidget.setRowCount(0) From a97cd1bb9b42ab8bd91a9db8026b6d4c90a1bf77 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Tue, 8 Feb 2011 02:45:37 +0000 Subject: [PATCH 049/243] Unnecessary line breaks --- openlp/core/lib/theme.py | 3 +-- openlp/core/ui/maindisplay.py | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/openlp/core/lib/theme.py b/openlp/core/lib/theme.py index d119f19ff..dca226069 100644 --- a/openlp/core/lib/theme.py +++ b/openlp/core/lib/theme.py @@ -583,8 +583,7 @@ class ThemeXML(object): self.background_end_color, self.background_direction) else: - filename = \ - os.path.split(self.background_filename)[1] + filename = os.path.split(self.background_filename)[1] self.add_background_image(filename) self.add_font(self.font_main_name, self.font_main_color, diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index bae00c2da..c4ab75aac 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -326,8 +326,7 @@ class MainDisplay(DisplayWidget): vol = float(volume)/float(10) if isBackground or not self.usePhonon: js = u'show_video("init", "%s", %s, true); show_video("play");' % \ - (videoPath.replace(u'\\', u'\\\\'), \ - str(vol)) + (videoPath.replace(u'\\', u'\\\\'), str(vol)) self.frame.evaluateJavaScript(js) else: self.phononActive = True @@ -398,8 +397,7 @@ class MainDisplay(DisplayWidget): if u'video' in self.override: Receiver.send_message(u'video_background_replaced') self.override = {} - elif self.override[u'theme'] != \ - serviceItem.themedata.theme_name: + elif self.override[u'theme'] != serviceItem.themedata.theme_name: Receiver.send_message(u'live_theme_changed') self.override = {} else: From 0d6af789a00cc2604eb78ef076a658af7cc0b3c6 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Tue, 8 Feb 2011 03:25:50 +0000 Subject: [PATCH 050/243] Fix theme importing (Support 98) --- openlp/core/theme/theme.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/openlp/core/theme/theme.py b/openlp/core/theme/theme.py index e506fc2c2..8a57c3ae7 100644 --- a/openlp/core/theme/theme.py +++ b/openlp/core/theme/theme.py @@ -33,11 +33,14 @@ processing version 1 themes in OpenLP version 2. from xml.etree.ElementTree import ElementTree, XML from PyQt4 import QtGui -DELPHI_COLORS = {u'clRed': 0xFF0000, - u'clBlue': 0x0000FF, - u'clYellow': 0xFFFF00, - u'clBlack': 0x000000, - u'clWhite': 0xFFFFFF} +DELPHI_COLORS = { + u'clAqua': 0x00FFFF, u'clBlack': 0x000000, u'clBlue': 0x0000FF, + u'clFuchsia': 0xFF00FF, u'clGray': 0x808080, u'clGreen': 0x008000, + u'clLime': 0x00FF00, u'clMaroon': 0x800000, u'clNavy': 0x000080, + u'clOlive': 0x808000, u'clPurple': 0x800080, u'clRed': 0xFF0000, + u'clSilver': 0xC0C0C0, u'clTeal': 0x008080, u'clWhite': 0xFFFFFF, + u'clYellow': 0xFFFF00 +} BLANK_STYLE_XML = \ ''' @@ -184,7 +187,6 @@ class Theme(object): if element.tag != u'Theme': element_text = element.text val = 0 - # easy! if element_text is None: val = element_text # strings need special handling to sort the colours out From dc7486c3f87d43ced34ddff2b87230467d6acbec Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Tue, 8 Feb 2011 16:22:54 +0000 Subject: [PATCH 051/243] D'oh --- openlp/plugins/songs/lib/easislidesimport.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openlp/plugins/songs/lib/easislidesimport.py b/openlp/plugins/songs/lib/easislidesimport.py index 0b10ce428..5d56af8ce 100644 --- a/openlp/plugins/songs/lib/easislidesimport.py +++ b/openlp/plugins/songs/lib/easislidesimport.py @@ -81,14 +81,14 @@ class EasiSlidesImport(SongImport): def _parse_song(self, song): self._success = True - self._add_title(self.title, song.Title1, True) - self._add_alttitle(self.alternate_title, song.Title2) - self._add_number(self.song_number, song.SongNumber) + self._add_unicode_attribute(self.title, song.Title1, True) + self._add_unicode_attribute(self.alternate_title, song.Title2) + self._add_unicode_attribute(self.song_number, song.SongNumber) if self.song_number == u'0': self.song_number = u'' self._add_authors(song) self._add_copyright(song) - self._add_book(self.song_book_name, song.BookReference) + self._add_unicode_attribute(self.song_book_name, song.BookReference) self._parse_and_add_lyrics(song) return self._success From 9b1a19086965cfbf5bbbdd34f3921699b8df4955 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Tue, 8 Feb 2011 18:05:09 +0100 Subject: [PATCH 052/243] use build_icon, bug fix --- openlp/plugins/songs/forms/songexportform.py | 38 +++++++++----------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index a24aec3e2..4c918f66b 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -31,7 +31,7 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import Receiver, SettingsManager, translate +from openlp.core.lib import build_icon, Receiver, SettingsManager, translate from openlp.core.lib.ui import critical_error_message_box from openlp.core.ui.wizard import OpenLPWizard from openlp.plugins.songs.lib.db import Song @@ -112,7 +112,6 @@ class SongExportForm(OpenLPWizard): # self.availableSongsLayout.addLayout(self.gridLayout) self.availableSongsLayout.addWidget(self.availableListWidget) self.addPage(self.availableSongsPage) - # The page with the selected songs. self.exportSongPage = QtGui.QWizardPage() self.exportSongPage.setObjectName(u'availableSongsPage') @@ -132,10 +131,7 @@ class SongExportForm(OpenLPWizard): self.directoryLineEdit.setObjectName(u'directoryLineEdit') self.horizontalLayout.addWidget(self.directoryLineEdit) self.directoryButton = QtGui.QToolButton(self.exportSongPage) - icon = QtGui.QIcon() - icon.addPixmap(QtGui.QPixmap(u':/exports/export_load.png'), - QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.directoryButton.setIcon(icon) + self.directoryButton.setIcon(build_icon(u':/exports/export_load.png')) self.directoryButton.setObjectName(u'directoryButton') self.horizontalLayout.addWidget(self.directoryButton) self.gridLayout.addLayout(self.horizontalLayout, 0, 0, 1, 1) @@ -185,10 +181,10 @@ class SongExportForm(OpenLPWizard): if self.currentPage() == self.welcomePage: return True elif self.currentPage() == self.availableSongsPage: - songs = [song for song in self.availableListWidget.findItems( + items = [item for item in self.availableListWidget.findItems( QtCore.QString(u''), QtCore.Qt.MatchContains) - if song.checkState() == QtCore.Qt.Checked] - if not songs: + if item.checkState() == QtCore.Qt.Checked] + if not items: critical_error_message_box( translate('SongsPlugin.ExportWizardForm', 'No Song Selected'), @@ -196,13 +192,13 @@ class SongExportForm(OpenLPWizard): 'You need to add at least one Song to export.')) return False self.selectedListWidget.clear() - # Add the songs to the list of selectd songs. - for song in songs: - title = song.text() - new_song = QtGui.QListWidgetItem(title) - new_song.setData(QtCore.Qt.UserRole, QtCore.QVariant(song)) - new_song.setFlags(QtCore.Qt.ItemIsEnabled) - self.selectedListWidget.addItem(new_song) + # Add the songs to the list of selected songs. + for item in items: + song = QtGui.QListWidgetItem(item.text()) + song.setData(QtCore.Qt.UserRole, + QtCore.QVariant(item.data(QtCore.Qt.UserRole).toPyObject())) + song.setFlags(QtCore.Qt.ItemIsEnabled) + self.selectedListWidget.addItem(song) return True elif self.currentPage() == self.exportSongPage: if not self.directoryLineEdit.text(): @@ -241,12 +237,12 @@ class SongExportForm(OpenLPWizard): authors = u', '.join([author.display_name for author in song.authors]) title = u'%s (%s)' % (unicode(song.title), authors) - song = QtGui.QListWidgetItem(title) - song.setData(QtCore.Qt.UserRole, QtCore.QVariant(song)) - song.setFlags(QtCore.Qt.ItemIsSelectable| + item = QtGui.QListWidgetItem(title) + item.setData(QtCore.Qt.UserRole, QtCore.QVariant(song)) + item.setFlags(QtCore.Qt.ItemIsSelectable| QtCore.Qt.ItemIsUserCheckable | QtCore.Qt.ItemIsEnabled) - song.setCheckState(QtCore.Qt.Checked) - self.availableListWidget.addItem(song) + item.setCheckState(QtCore.Qt.Checked) + self.availableListWidget.addItem(item) Receiver.send_message(u'cursor_normal') def preWizard(self): From 2c0625a3923c8d113dd128e503dc98fa858ddf8c Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Tue, 8 Feb 2011 17:29:24 +0000 Subject: [PATCH 053/243] Dedupe, fix logic, fix names --- openlp/core/lib/ui.py | 22 +++++++++ openlp/core/ui/themewizard.py | 23 ++------- openlp/plugins/alerts/lib/alertstab.py | 67 ++++++++++---------------- 3 files changed, 51 insertions(+), 61 deletions(-) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 4a346b3e1..30f442012 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -219,3 +219,25 @@ def add_widget_completer(cache, widget): completer = QtGui.QCompleter(cache) completer.setCaseSensitivity(QtCore.Qt.CaseInsensitive) widget.setCompleter(completer) + +def create_valign_combo(parent, layout): + """ + Creates a standard label and combo box for asking users to select a + vertical alignment. + + ``parent`` + The parent object. This should be a ``QWidget`` descendant. + + ``layout`` + A layout object to add the label and combo widgets to. + """ + verticalLabel = QtGui.QLabel(parent) + verticalLabel.setObjectName(u'VerticalLabel') + verticalLabel.setText(translate('OpenLP.Ui', '&Vertical Align:')) + verticalComboBox = QtGui.QComboBox(parent) + verticalComboBox.setObjectName(u'VerticalComboBox') + verticalComboBox.addItem(translate('OpenLP.Ui', 'Top')) + verticalComboBox.addItem(translate('OpenLP.Ui', 'Middle')) + verticalComboBox.addItem(translate('OpenLP.Ui', 'Bottom')) + verticalLabel.setBuddy(verticalComboBox) + layout.addRow(verticalLabel, verticalComboBox) diff --git a/openlp/core/ui/themewizard.py b/openlp/core/ui/themewizard.py index 49522df70..e50ab0d45 100644 --- a/openlp/core/ui/themewizard.py +++ b/openlp/core/ui/themewizard.py @@ -27,7 +27,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate, build_icon -from openlp.core.lib.ui import add_welcome_page +from openlp.core.lib.ui import add_welcome_page, create_valign_combo class Ui_ThemeWizard(object): def setupUi(self, themeWizard): @@ -242,12 +242,7 @@ class Ui_ThemeWizard(object): self.horizontalComboBox.setObjectName(u'HorizontalComboBox') self.alignmentLayout.addRow(self.horizontalLabel, self.horizontalComboBox) - self.verticalLabel = QtGui.QLabel(self.alignmentPage) - self.verticalLabel.setObjectName(u'VerticalLabel') - self.verticalComboBox = QtGui.QComboBox(self.alignmentPage) - self.verticalComboBox.addItems([u'', u'', u'']) - self.verticalComboBox.setObjectName(u'VerticalComboBox') - self.alignmentLayout.addRow(self.verticalLabel, self.verticalComboBox) + create_valign_combo(self.alignmentPage, self.alignmentLayout) self.transitionsLabel = QtGui.QLabel(self.alignmentPage) self.transitionsLabel.setObjectName(u'TransitionsLabel') self.transitionsCheckBox = QtGui.QCheckBox(self.alignmentPage) @@ -450,8 +445,7 @@ class Ui_ThemeWizard(object): self.mainAreaPage.setSubTitle( translate('OpenLP.ThemeWizard', 'Define the font and display ' 'characteristics for the Display text')) - self.mainFontLabel.setText( - translate('OpenLP.ThemeWizard', 'Font:')) + self.mainFontLabel.setText(translate('OpenLP.ThemeWizard', 'Font:')) self.mainColorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:')) self.mainSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:')) self.mainSizeSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt')) @@ -465,8 +459,7 @@ class Ui_ThemeWizard(object): self.shadowCheckBox.setText(translate('OpenLP.ThemeWizard', '&Shadow:')) self.shadowSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:')) self.shadowSizeSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt')) - self.mainBoldCheckBox.setText( - translate('OpenLP.ThemeWizard', 'Bold')) + self.mainBoldCheckBox.setText(translate('OpenLP.ThemeWizard', 'Bold')) self.mainItalicsCheckBox.setText( translate('OpenLP.ThemeWizard', 'Italic')) self.footerAreaPage.setTitle( @@ -491,14 +484,6 @@ class Ui_ThemeWizard(object): translate('OpenLP.ThemeWizard', 'Right')) self.horizontalComboBox.setItemText(2, translate('OpenLP.ThemeWizard', 'Center')) - self.verticalLabel.setText( - translate('OpenLP.ThemeWizard', 'Vertical Align:')) - self.verticalComboBox.setItemText(0, - translate('OpenLP.ThemeWizard', 'Top')) - self.verticalComboBox.setItemText(1, - translate('OpenLP.ThemeWizard', 'Middle')) - self.verticalComboBox.setItemText(2, - translate('OpenLP.ThemeWizard', 'Bottom')) self.transitionsLabel.setText( translate('OpenLP.ThemeWizard', 'Transitions:')) self.areaPositionPage.setTitle( diff --git a/openlp/plugins/alerts/lib/alertstab.py b/openlp/plugins/alerts/lib/alertstab.py index 96870d94c..01dbc2f7e 100644 --- a/openlp/plugins/alerts/lib/alertstab.py +++ b/openlp/plugins/alerts/lib/alertstab.py @@ -27,6 +27,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import SettingsTab, translate +from openlp.core.lib.ui import create_valign_combo class AlertsTab(SettingsTab): """ @@ -40,48 +41,43 @@ class AlertsTab(SettingsTab): def setupUi(self): self.setObjectName(u'AlertsTab') SettingsTab.setupUi(self) - self.FontGroupBox = QtGui.QGroupBox(self.leftColumn) - self.FontGroupBox.setObjectName(u'FontGroupBox') - self.FontLayout = QtGui.QFormLayout(self.FontGroupBox) - self.FontLayout.setObjectName(u'FontLayout') - self.FontLabel = QtGui.QLabel(self.FontGroupBox) + self.fontGroupBox = QtGui.QGroupBox(self.leftColumn) + self.fontGroupBox.setObjectName(u'fontGroupBox') + self.fontLayout = QtGui.QFormLayout(self.fontGroupBox) + self.fontLayout.setObjectName(u'fontLayout') + self.FontLabel = QtGui.QLabel(self.fontGroupBox) self.FontLabel.setObjectName(u'FontLabel') - self.FontComboBox = QtGui.QFontComboBox(self.FontGroupBox) + self.FontComboBox = QtGui.QFontComboBox(self.fontGroupBox) self.FontComboBox.setObjectName(u'FontComboBox') - self.FontLayout.addRow(self.FontLabel, self.FontComboBox) - self.FontColorLabel = QtGui.QLabel(self.FontGroupBox) + self.fontLayout.addRow(self.FontLabel, self.FontComboBox) + self.FontColorLabel = QtGui.QLabel(self.fontGroupBox) self.FontColorLabel.setObjectName(u'FontColorLabel') self.ColorLayout = QtGui.QHBoxLayout() self.ColorLayout.setObjectName(u'ColorLayout') - self.FontColorButton = QtGui.QPushButton(self.FontGroupBox) + self.FontColorButton = QtGui.QPushButton(self.fontGroupBox) self.FontColorButton.setObjectName(u'FontColorButton') self.ColorLayout.addWidget(self.FontColorButton) self.ColorLayout.addSpacing(20) - self.BackgroundColorLabel = QtGui.QLabel(self.FontGroupBox) + self.BackgroundColorLabel = QtGui.QLabel(self.fontGroupBox) self.BackgroundColorLabel.setObjectName(u'BackgroundColorLabel') self.ColorLayout.addWidget(self.BackgroundColorLabel) - self.BackgroundColorButton = QtGui.QPushButton(self.FontGroupBox) + self.BackgroundColorButton = QtGui.QPushButton(self.fontGroupBox) self.BackgroundColorButton.setObjectName(u'BackgroundColorButton') self.ColorLayout.addWidget(self.BackgroundColorButton) - self.FontLayout.addRow(self.FontColorLabel, self.ColorLayout) - self.FontSizeLabel = QtGui.QLabel(self.FontGroupBox) + self.fontLayout.addRow(self.FontColorLabel, self.ColorLayout) + self.FontSizeLabel = QtGui.QLabel(self.fontGroupBox) self.FontSizeLabel.setObjectName(u'FontSizeLabel') - self.FontSizeSpinBox = QtGui.QSpinBox(self.FontGroupBox) + self.FontSizeSpinBox = QtGui.QSpinBox(self.fontGroupBox) self.FontSizeSpinBox.setObjectName(u'FontSizeSpinBox') - self.FontLayout.addRow(self.FontSizeLabel, self.FontSizeSpinBox) - self.TimeoutLabel = QtGui.QLabel(self.FontGroupBox) + self.fontLayout.addRow(self.FontSizeLabel, self.FontSizeSpinBox) + self.TimeoutLabel = QtGui.QLabel(self.fontGroupBox) self.TimeoutLabel.setObjectName(u'TimeoutLabel') - self.TimeoutSpinBox = QtGui.QSpinBox(self.FontGroupBox) + self.TimeoutSpinBox = QtGui.QSpinBox(self.fontGroupBox) self.TimeoutSpinBox.setMaximum(180) self.TimeoutSpinBox.setObjectName(u'TimeoutSpinBox') - self.FontLayout.addRow(self.TimeoutLabel, self.TimeoutSpinBox) - self.LocationLabel = QtGui.QLabel(self.FontGroupBox) - self.LocationLabel.setObjectName(u'LocationLabel') - self.LocationComboBox = QtGui.QComboBox(self.FontGroupBox) - self.LocationComboBox.addItems([u'', u'', u'']) - self.LocationComboBox.setObjectName(u'LocationComboBox') - self.FontLayout.addRow(self.LocationLabel, self.LocationComboBox) - self.leftLayout.addWidget(self.FontGroupBox) + self.fontLayout.addRow(self.TimeoutLabel, self.TimeoutSpinBox) + create_valign_combo(self.fontGroupBox, self.fontLayout) + self.leftLayout.addWidget(self.fontGroupBox) self.leftLayout.addStretch() self.PreviewGroupBox = QtGui.QGroupBox(self.rightColumn) self.PreviewGroupBox.setObjectName(u'PreviewGroupBox') @@ -99,15 +95,13 @@ class AlertsTab(SettingsTab): QtCore.SIGNAL(u'pressed()'), self.onFontColorButtonClicked) QtCore.QObject.connect(self.FontComboBox, QtCore.SIGNAL(u'activated(int)'), self.onFontComboBoxClicked) - QtCore.QObject.connect(self.LocationComboBox, - QtCore.SIGNAL(u'activated(int)'), self.onLocationComboBoxClicked) QtCore.QObject.connect(self.TimeoutSpinBox, QtCore.SIGNAL(u'valueChanged(int)'), self.onTimeoutSpinBoxChanged) QtCore.QObject.connect(self.FontSizeSpinBox, QtCore.SIGNAL(u'valueChanged(int)'), self.onFontSizeSpinBoxChanged) def retranslateUi(self): - self.FontGroupBox.setTitle( + self.fontGroupBox.setTitle( translate('AlertsPlugin.AlertsTab', 'Font')) self.FontLabel.setText( translate('AlertsPlugin.AlertsTab', 'Font name:')) @@ -123,18 +117,10 @@ class AlertsTab(SettingsTab): translate('AlertsPlugin.AlertsTab', 'Alert timeout:')) self.TimeoutSpinBox.setSuffix( translate('AlertsPlugin.AlertsTab', 's')) - self.LocationLabel.setText( - translate('AlertsPlugin.AlertsTab', 'Location:')) self.PreviewGroupBox.setTitle( translate('AlertsPlugin.AlertsTab', 'Preview')) self.FontPreview.setText( translate('AlertsPlugin.AlertsTab', 'OpenLP 2.0')) - self.LocationComboBox.setItemText(0, - translate('AlertsPlugin.AlertsTab', 'Top')) - self.LocationComboBox.setItemText(1, - translate('AlertsPlugin.AlertsTab', 'Middle')) - self.LocationComboBox.setItemText(2, - translate('AlertsPlugin.AlertsTab', 'Bottom')) def onBackgroundColorButtonClicked(self): new_color = QtGui.QColorDialog.getColor( @@ -148,9 +134,6 @@ class AlertsTab(SettingsTab): def onFontComboBoxClicked(self): self.updateDisplay() - def onLocationComboBoxClicked(self, location): - self.location = location - def onFontColorButtonClicked(self): new_color = QtGui.QColorDialog.getColor( QtGui.QColor(self.font_color), self) @@ -197,14 +180,14 @@ class AlertsTab(SettingsTab): def save(self): settings = QtCore.QSettings() settings.beginGroup(self.settingsSection) - self.font_face = self.FontComboBox.currentFont().family() settings.setValue(u'background color', QtCore.QVariant(self.bg_color)) settings.setValue(u'font color', QtCore.QVariant(self.font_color)) settings.setValue(u'font size', QtCore.QVariant(self.font_size)) + self.font_face = self.FontComboBox.currentFont().family() settings.setValue(u'font face', QtCore.QVariant(self.font_face)) settings.setValue(u'timeout', QtCore.QVariant(self.timeout)) - settings.setValue(u'location', - QtCore.QVariant(self.LocationComboBox.currentIndex())) + self.location = self.LocationComboBox.currentIndex() + settings.setValue(u'location', QtCore.QVariant(self.location)) settings.endGroup() def updateDisplay(self): From 261328d952a1d7cad22bab43cbc63fb6ce48b301 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Tue, 8 Feb 2011 19:31:55 +0000 Subject: [PATCH 054/243] Fix last commit --- openlp/core/lib/ui.py | 19 +++++++++++-------- openlp/core/ui/themewizard.py | 3 ++- openlp/plugins/alerts/lib/alertstab.py | 6 +++--- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 30f442012..843f4ef92 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -220,11 +220,14 @@ def add_widget_completer(cache, widget): completer.setCaseSensitivity(QtCore.Qt.CaseInsensitive) widget.setCompleter(completer) -def create_valign_combo(parent, layout): +def create_valign_combo(form, parent, layout): """ Creates a standard label and combo box for asking users to select a vertical alignment. + ``form`` + The UI screen that the label and combo will appear on. + ``parent`` The parent object. This should be a ``QWidget`` descendant. @@ -234,10 +237,10 @@ def create_valign_combo(parent, layout): verticalLabel = QtGui.QLabel(parent) verticalLabel.setObjectName(u'VerticalLabel') verticalLabel.setText(translate('OpenLP.Ui', '&Vertical Align:')) - verticalComboBox = QtGui.QComboBox(parent) - verticalComboBox.setObjectName(u'VerticalComboBox') - verticalComboBox.addItem(translate('OpenLP.Ui', 'Top')) - verticalComboBox.addItem(translate('OpenLP.Ui', 'Middle')) - verticalComboBox.addItem(translate('OpenLP.Ui', 'Bottom')) - verticalLabel.setBuddy(verticalComboBox) - layout.addRow(verticalLabel, verticalComboBox) + form.verticalComboBox = QtGui.QComboBox(parent) + form.verticalComboBox.setObjectName(u'VerticalComboBox') + form.verticalComboBox.addItem(translate('OpenLP.Ui', 'Top')) + form.verticalComboBox.addItem(translate('OpenLP.Ui', 'Middle')) + form.verticalComboBox.addItem(translate('OpenLP.Ui', 'Bottom')) + verticalLabel.setBuddy(form.verticalComboBox) + layout.addRow(verticalLabel, form.verticalComboBox) diff --git a/openlp/core/ui/themewizard.py b/openlp/core/ui/themewizard.py index e50ab0d45..38dd9f1dc 100644 --- a/openlp/core/ui/themewizard.py +++ b/openlp/core/ui/themewizard.py @@ -242,7 +242,8 @@ class Ui_ThemeWizard(object): self.horizontalComboBox.setObjectName(u'HorizontalComboBox') self.alignmentLayout.addRow(self.horizontalLabel, self.horizontalComboBox) - create_valign_combo(self.alignmentPage, self.alignmentLayout) + create_valign_combo(themeWizard, self.alignmentPage, + self.alignmentLayout) self.transitionsLabel = QtGui.QLabel(self.alignmentPage) self.transitionsLabel.setObjectName(u'TransitionsLabel') self.transitionsCheckBox = QtGui.QCheckBox(self.alignmentPage) diff --git a/openlp/plugins/alerts/lib/alertstab.py b/openlp/plugins/alerts/lib/alertstab.py index 01dbc2f7e..a350c13cc 100644 --- a/openlp/plugins/alerts/lib/alertstab.py +++ b/openlp/plugins/alerts/lib/alertstab.py @@ -76,7 +76,7 @@ class AlertsTab(SettingsTab): self.TimeoutSpinBox.setMaximum(180) self.TimeoutSpinBox.setObjectName(u'TimeoutSpinBox') self.fontLayout.addRow(self.TimeoutLabel, self.TimeoutSpinBox) - create_valign_combo(self.fontGroupBox, self.fontLayout) + create_valign_combo(self, self.fontGroupBox, self.fontLayout) self.leftLayout.addWidget(self.fontGroupBox) self.leftLayout.addStretch() self.PreviewGroupBox = QtGui.QGroupBox(self.rightColumn) @@ -171,7 +171,7 @@ class AlertsTab(SettingsTab): u'background-color: %s' % self.font_color) self.BackgroundColorButton.setStyleSheet( u'background-color: %s' % self.bg_color) - self.LocationComboBox.setCurrentIndex(self.location) + self.verticalComboBox.setCurrentIndex(self.location) font = QtGui.QFont() font.setFamily(self.font_face) self.FontComboBox.setCurrentFont(font) @@ -186,7 +186,7 @@ class AlertsTab(SettingsTab): self.font_face = self.FontComboBox.currentFont().family() settings.setValue(u'font face', QtCore.QVariant(self.font_face)) settings.setValue(u'timeout', QtCore.QVariant(self.timeout)) - self.location = self.LocationComboBox.currentIndex() + self.location = self.verticalComboBox.currentIndex() settings.setValue(u'location', QtCore.QVariant(self.location)) settings.endGroup() From 5607b09f0defe03b10d0e19976a8e4ba21f42cf7 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Wed, 9 Feb 2011 05:04:12 +0000 Subject: [PATCH 055/243] Dedupe translations --- openlp/core/lib/ui.py | 28 +++++++++++++++-- openlp/core/ui/displaytagtab.py | 5 ++-- openlp/core/ui/mainwindow.py | 5 ++-- openlp/core/ui/slidecontroller.py | 7 ++--- openlp/core/ui/themeform.py | 5 ++-- openlp/core/ui/themestab.py | 3 +- openlp/plugins/alerts/lib/alertstab.py | 8 ++--- openlp/plugins/bibles/bibleplugin.py | 15 +++++----- .../plugins/bibles/forms/bibleimportform.py | 5 ++-- openlp/plugins/custom/customplugin.py | 17 ++++++----- .../plugins/custom/forms/editcustomdialog.py | 8 ++--- openlp/plugins/images/imageplugin.py | 15 +++++----- openlp/plugins/images/lib/mediaitem.py | 4 +-- openlp/plugins/media/mediaplugin.py | 15 +++++----- .../presentations/presentationplugin.py | 11 +++---- openlp/plugins/songs/forms/editsongdialog.py | 17 ++++------- openlp/plugins/songs/forms/songimportform.py | 8 ++--- .../songs/forms/songmaintenancedialog.py | 30 +++++++------------ openlp/plugins/songs/lib/mediaitem.py | 7 ++--- openlp/plugins/songs/songsplugin.py | 13 ++++---- 20 files changed, 116 insertions(+), 110 deletions(-) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 843f4ef92..41e88b54b 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -34,6 +34,29 @@ from openlp.core.lib import build_icon, Receiver, translate log = logging.getLogger(__name__) +class UiStrings(object): + """ + Provide standard strings for objects to use. + """ + # These strings should need a good reason to be retranslated elsewhere. + # Should some/more/less of these have an & attached? + Add = translate('OpenLP.Ui', '&Add') + AllFiles = translate('OpenLP.Ui', 'All Files') + Authors = translate('OpenLP.Ui', 'Authors') + Delete = translate('OpenLP.Ui', '&Delete') + Edit = translate('OpenLP.Ui', '&Edit') + Error = translate('OpenLP.Ui', 'Error') + Import = translate('OpenLP.Ui', 'Import') + Live = translate('OpenLP.Ui', 'Live') + Load = translate('OpenLP.Ui', 'Load') + New = translate('OpenLP.Ui', 'New') + OLPV2 = translate('OpenLP.Ui', 'OpenLP 2.0') + Preview = translate('OpenLP.Ui', 'Preview') + Service = translate('OpenLP.Ui', 'Service') + Theme = translate('OpenLP.Ui', 'Theme') + Themes = translate('OpenLP.Ui', 'Themes') + + def add_welcome_page(parent, image): """ Generate an opening welcome page for a wizard using a provided image. @@ -98,13 +121,12 @@ def critical_error_message_box(title=None, message=None, parent=None, ``question`` Should this message box question the user. """ - error = translate('OpenLP.Ui', 'Error') if question: return QtGui.QMessageBox.critical(parent, error, message, QtGui.QMessageBox.StandardButtons( QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)) data = {u'message': message} - data[u'title'] = title if title else error + data[u'title'] = title if title else UiStrings.Error return Receiver.send_message(u'openlp_error_message', data) def media_item_combo_box(parent, name): @@ -134,7 +156,7 @@ def create_delete_push_button(parent, icon=None): delete_button.setObjectName(u'deleteButton') delete_icon = icon if icon else u':/general/general_delete.png' delete_button.setIcon(build_icon(delete_icon)) - delete_button.setText(translate('OpenLP.Ui', '&Delete')) + delete_button.setText(UiStrings.Delete) delete_button.setToolTip( translate('OpenLP.Ui', 'Delete the selected item.')) QtCore.QObject.connect(delete_button, diff --git a/openlp/core/ui/displaytagtab.py b/openlp/core/ui/displaytagtab.py index 54d021913..abf0ca44f 100644 --- a/openlp/core/ui/displaytagtab.py +++ b/openlp/core/ui/displaytagtab.py @@ -34,7 +34,7 @@ import cPickle from PyQt4 import QtCore, QtGui from openlp.core.lib import SettingsTab, translate, DisplayTags -from openlp.core.lib.ui import critical_error_message_box +from openlp.core.lib.ui import UiStrings, critical_error_message_box class DisplayTagTab(SettingsTab): """ @@ -164,8 +164,7 @@ class DisplayTagTab(SettingsTab): self.startTagLabel.setText( translate('OpenLP.DisplayTagTab', 'Start tag')) self.endTagLabel.setText(translate('OpenLP.DisplayTagTab', 'End tag')) - self.deletePushButton.setText( - translate('OpenLP.DisplayTagTab', 'Delete')) + self.deletePushButton.setText(UiStrings.Delete) self.defaultPushButton.setText( translate('OpenLP.DisplayTagTab', 'Default')) self.newPushButton.setText(translate('OpenLP.DisplayTagTab', 'New')) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index e489d7b5d..c87a9544a 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -30,7 +30,8 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import RenderManager, build_icon, OpenLPDockWidget, \ SettingsManager, PluginManager, Receiver, translate -from openlp.core.lib.ui import base_action, checkable_action, icon_action +from openlp.core.lib.ui import UiStrings, base_action, checkable_action, \ + icon_action from openlp.core.ui import AboutForm, SettingsForm, ServiceManager, \ ThemeManager, SlideController, PluginForm, MediaDockManager, \ ShortcutListForm @@ -295,7 +296,7 @@ class Ui_MainWindow(object): """ Set up the translation system """ - mainWindow.mainTitle = translate('OpenLP.MainWindow', 'OpenLP 2.0') + mainWindow.mainTitle = UiStrings.OLPV2 mainWindow.setWindowTitle(mainWindow.mainTitle) self.FileMenu.setTitle(translate('OpenLP.MainWindow', '&File')) self.FileImportMenu.setTitle(translate('OpenLP.MainWindow', '&Import')) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index cf2c0983b..1caf43dfd 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -32,7 +32,7 @@ from PyQt4.phonon import Phonon from openlp.core.lib import OpenLPToolbar, Receiver, resize_image, \ ItemCapabilities, translate -from openlp.core.lib.ui import shortcut_action +from openlp.core.lib.ui import UiStrings, shortcut_action from openlp.core.ui import HideMode, MainDisplay log = logging.getLogger(__name__) @@ -87,12 +87,11 @@ class SlideController(QtGui.QWidget): # Type label for the top of the slide controller self.typeLabel = QtGui.QLabel(self.panel) if self.isLive: - self.typeLabel.setText(translate('OpenLP.SlideController', 'Live')) + self.typeLabel.setText(UiStrings.Live) self.split = 1 self.typePrefix = u'live' else: - self.typeLabel.setText(translate('OpenLP.SlideController', - 'Preview')) + self.typeLabel.setText(UiStrings.Preview) self.split = 0 self.typePrefix = u'preview' self.typeLabel.setStyleSheet(u'font-weight: bold; font-size: 12pt;') diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index 018df7597..f86fa0143 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -31,7 +31,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate, BackgroundType, BackgroundGradientType, \ Receiver -from openlp.core.lib.ui import critical_error_message_box +from openlp.core.lib.ui import UiStrings, critical_error_message_box from openlp.core.utils import get_images_filter from themewizard import Ui_ThemeWizard @@ -483,8 +483,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): Background Image button pushed. """ images_filter = get_images_filter() - images_filter = '%s;;%s (*.*) (*)' % (images_filter, - translate('OpenLP.ThemeForm', 'All Files')) + images_filter = '%s;;%s (*.*) (*)' % (images_filter, UiStrings.AllFiles) filename = QtGui.QFileDialog.getOpenFileName(self, translate('OpenLP.ThemeForm', 'Select Image'), u'', images_filter) diff --git a/openlp/core/ui/themestab.py b/openlp/core/ui/themestab.py index 441b95155..ba4ce5acb 100644 --- a/openlp/core/ui/themestab.py +++ b/openlp/core/ui/themestab.py @@ -27,6 +27,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import SettingsTab, Receiver, ThemeLevel, translate +from openlp.core.lib.ui import UiStrings class ThemesTab(SettingsTab): """ @@ -98,7 +99,7 @@ class ThemesTab(SettingsTab): QtCore.SIGNAL(u'theme_update_list'), self.updateThemeList) def retranslateUi(self): - self.tabTitleVisible = translate('OpenLP.ThemesTab', 'Themes') + self.tabTitleVisible = UiStrings.Themes self.GlobalGroupBox.setTitle( translate('OpenLP.ThemesTab', 'Global Theme')) self.LevelGroupBox.setTitle( diff --git a/openlp/plugins/alerts/lib/alertstab.py b/openlp/plugins/alerts/lib/alertstab.py index a350c13cc..4090503db 100644 --- a/openlp/plugins/alerts/lib/alertstab.py +++ b/openlp/plugins/alerts/lib/alertstab.py @@ -27,7 +27,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import SettingsTab, translate -from openlp.core.lib.ui import create_valign_combo +from openlp.core.lib.ui import UiStrings, create_valign_combo class AlertsTab(SettingsTab): """ @@ -117,10 +117,8 @@ class AlertsTab(SettingsTab): translate('AlertsPlugin.AlertsTab', 'Alert timeout:')) self.TimeoutSpinBox.setSuffix( translate('AlertsPlugin.AlertsTab', 's')) - self.PreviewGroupBox.setTitle( - translate('AlertsPlugin.AlertsTab', 'Preview')) - self.FontPreview.setText( - translate('AlertsPlugin.AlertsTab', 'OpenLP 2.0')) + self.PreviewGroupBox.setTitle(UiStrings.Preview) + self.FontPreview.setText(UiStrings.OLPV2) def onBackgroundColorButtonClicked(self): new_color = QtGui.QColorDialog.getColor( diff --git a/openlp/plugins/bibles/bibleplugin.py b/openlp/plugins/bibles/bibleplugin.py index e3b2ad4aa..e1dadd4bf 100644 --- a/openlp/plugins/bibles/bibleplugin.py +++ b/openlp/plugins/bibles/bibleplugin.py @@ -29,6 +29,7 @@ import logging from PyQt4 import QtCore, QtGui from openlp.core.lib import Plugin, StringContent, build_icon, translate +from openlp.core.lib.ui import UiStrings from openlp.plugins.bibles.lib import BibleManager, BiblesTab, BibleMediaItem log = logging.getLogger(__name__) @@ -137,38 +138,38 @@ class BiblePlugin(Plugin): # Middle Header Bar ## Import Action ## self.textStrings[StringContent.Import] = { - u'title': translate('BiblesPlugin', '&Import'), + u'title': UiStrings.Import, u'tooltip': translate('BiblesPlugin', 'Import a Bible') } ## New Action ## self.textStrings[StringContent.New] = { - u'title': translate('BiblesPlugin', '&Add'), + u'title': UiStrings.Add, u'tooltip': translate('BiblesPlugin', 'Add a new Bible') } ## Edit Action ## self.textStrings[StringContent.Edit] = { - u'title': translate('BiblesPlugin', '&Edit'), + u'title': UiStrings.Edit, u'tooltip': translate('BiblesPlugin', 'Edit the selected Bible') } ## Delete Action ## self.textStrings[StringContent.Delete] = { - u'title': translate('BiblesPlugin', '&Delete'), + u'title': UiStrings.Delete, u'tooltip': translate('BiblesPlugin', 'Delete the selected Bible') } ## Preview Action ## self.textStrings[StringContent.Preview] = { - u'title': translate('BiblesPlugin', 'Preview'), + u'title': UiStrings.Preview, u'tooltip': translate('BiblesPlugin', 'Preview the selected Bible') } ## Send Live Action ## self.textStrings[StringContent.Live] = { - u'title': translate('BiblesPlugin', 'Live'), + u'title': UiStrings.Live, u'tooltip': translate('BiblesPlugin', 'Send the selected Bible live') } ## Add to Service Action ## self.textStrings[StringContent.Service] = { - u'title': translate('BiblesPlugin', 'Service'), + u'title': UiStrings.Service, u'tooltip': translate('BiblesPlugin', 'Add the selected Bible to the service') } diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index f21dd0e07..f528a4b1b 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -35,7 +35,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import Receiver, SettingsManager, translate from openlp.core.lib.db import delete_database -from openlp.core.lib.ui import critical_error_message_box +from openlp.core.lib.ui import UiStrings, critical_error_message_box from openlp.core.ui.wizard import OpenLPWizard from openlp.core.utils import AppLocation, string_is_unicode from openlp.plugins.bibles.lib.manager import BibleFormat @@ -745,8 +745,7 @@ class BibleImportForm(OpenLPWizard): """ if filters: filters += u';;' - filters += u'%s (*)' % translate('BiblesPlugin.ImportWizardForm', - 'All Files') + filters += u'%s (*)' % UiStrings.AllFiles filename = QtGui.QFileDialog.getOpenFileName(self, title, os.path.dirname(SettingsManager.get_last_dir( self.plugin.settingsSection, 1)), filters) diff --git a/openlp/plugins/custom/customplugin.py b/openlp/plugins/custom/customplugin.py index 54cb38501..210556ad8 100644 --- a/openlp/plugins/custom/customplugin.py +++ b/openlp/plugins/custom/customplugin.py @@ -30,6 +30,7 @@ from forms import EditCustomForm from openlp.core.lib import Plugin, StringContent, build_icon, translate from openlp.core.lib.db import Manager +from openlp.core.lib.ui import UiStrings from openlp.plugins.custom.lib import CustomMediaItem, CustomTab from openlp.plugins.custom.lib.db import CustomSlide, init_schema @@ -114,49 +115,49 @@ class CustomPlugin(Plugin): # Middle Header Bar ## Import Action ## self.textStrings[StringContent.Import] = { - u'title': translate('CustomsPlugin', 'Import'), + u'title': UiStrings.Import, u'tooltip': translate('CustomsPlugin', 'Import a Custom') } ## Load Action ## self.textStrings[StringContent.Load] = { - u'title': translate('CustomsPlugin', 'Load'), + u'title': UiStrings.Load, u'tooltip': translate('CustomsPlugin', 'Load a new Custom') } ## New Action ## self.textStrings[StringContent.New] = { - u'title': translate('CustomsPlugin', 'Add'), + u'title': UiStrings.Add, u'tooltip': translate('CustomsPlugin', 'Add a new Custom') } ## Edit Action ## self.textStrings[StringContent.Edit] = { - u'title': translate('CustomsPlugin', 'Edit'), + u'title': UiStrings.Edit, u'tooltip': translate('CustomsPlugin', 'Edit the selected Custom') } ## Delete Action ## self.textStrings[StringContent.Delete] = { - u'title': translate('CustomsPlugin', 'Delete'), + u'title': UiStrings.Delete, u'tooltip': translate('CustomsPlugin', 'Delete the selected Custom') } ## Preview Action ## self.textStrings[StringContent.Preview] = { - u'title': translate('CustomsPlugin', 'Preview'), + u'title': UiStrings.Preview, u'tooltip': translate('CustomsPlugin', 'Preview the selected Custom') } ## Send Live Action ## self.textStrings[StringContent.Live] = { - u'title': translate('CustomsPlugin', 'Live'), + u'title': UiStrings.Live, u'tooltip': translate('CustomsPlugin', 'Send the selected Custom live') } ## Add to Service Action ## self.textStrings[StringContent.Service] = { - u'title': translate('CustomsPlugin', 'Service'), + u'title': UiStrings.Service, u'tooltip': translate('CustomsPlugin', 'Add the selected Custom to the service') } diff --git a/openlp/plugins/custom/forms/editcustomdialog.py b/openlp/plugins/custom/forms/editcustomdialog.py index b7887aa90..1ca29732b 100644 --- a/openlp/plugins/custom/forms/editcustomdialog.py +++ b/openlp/plugins/custom/forms/editcustomdialog.py @@ -27,7 +27,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import build_icon, translate -from openlp.core.lib.ui import create_save_cancel_button_box, \ +from openlp.core.lib.ui import UiStrings, create_save_cancel_button_box, \ create_delete_push_button, create_up_down_push_button_set class Ui_CustomEditDialog(object): @@ -107,13 +107,11 @@ class Ui_CustomEditDialog(object): translate('CustomPlugin.EditCustomForm', 'Edit Custom Slides')) self.titleLabel.setText( translate('CustomPlugin.EditCustomForm', '&Title:')) - self.addButton.setText( - translate('CustomPlugin.EditCustomForm', '&Add')) + self.addButton.setText(UiStrings.Add) self.addButton.setToolTip( translate('CustomPlugin.EditCustomForm', 'Add a new slide at ' 'bottom.')) - self.editButton.setText( - translate('CustomPlugin.EditCustomForm', '&Edit')) + self.editButton.setText(UiStrings.Edit) self.editButton.setToolTip( translate('CustomPlugin.EditCustomForm', 'Edit the selected ' 'slide.')) diff --git a/openlp/plugins/images/imageplugin.py b/openlp/plugins/images/imageplugin.py index ea118d3ec..0af48bacd 100644 --- a/openlp/plugins/images/imageplugin.py +++ b/openlp/plugins/images/imageplugin.py @@ -27,6 +27,7 @@ import logging from openlp.core.lib import Plugin, StringContent, build_icon, translate +from openlp.core.lib.ui import UiStrings from openlp.plugins.images.lib import ImageMediaItem log = logging.getLogger(__name__) @@ -74,43 +75,43 @@ class ImagePlugin(Plugin): # Middle Header Bar ## Load Button ## self.textStrings[StringContent.Load] = { - u'title': translate('ImagePlugin', 'Load'), + u'title': UiStrings.Load, u'tooltip': translate('ImagePlugin', 'Load a new Image') } ## New Button ## self.textStrings[StringContent.New] = { - u'title': translate('ImagePlugin', 'Add'), + u'title': UiStrings.Add, u'tooltip': translate('ImagePlugin', 'Add a new Image') } ## Edit Button ## self.textStrings[StringContent.Edit] = { - u'title': translate('ImagePlugin', 'Edit'), + u'title': UiStrings.Edit, u'tooltip': translate('ImagePlugin', 'Edit the selected Image') } ## Delete Button ## self.textStrings[StringContent.Delete] = { - u'title': translate('ImagePlugin', 'Delete'), + u'title': UiStrings.Delete, u'tooltip': translate('ImagePlugin', 'Delete the selected Image') } ## Preview ## self.textStrings[StringContent.Preview] = { - u'title': translate('ImagePlugin', 'Preview'), + u'title': UiStrings.Preview, u'tooltip': translate('ImagePlugin', 'Preview the selected Image') } ## Live Button ## self.textStrings[StringContent.Live] = { - u'title': translate('ImagePlugin', 'Live'), + u'title': UiStrings.Live, u'tooltip': translate('ImagePlugin', 'Send the selected Image live') } ## Add to service Button ## self.textStrings[StringContent.Service] = { - u'title': translate('ImagePlugin', 'Service'), + u'title': UiStrings.Service, u'tooltip': translate('ImagePlugin', 'Add the selected Image to the service') } diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index 6e720fa0b..6ec4cf264 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -32,7 +32,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \ ItemCapabilities, SettingsManager, translate, check_item_selected, \ check_directory_exists, Receiver -from openlp.core.lib.ui import critical_error_message_box +from openlp.core.lib.ui import UiStrings, critical_error_message_box from openlp.core.utils import AppLocation, delete_file, get_images_filter log = logging.getLogger(__name__) @@ -64,7 +64,7 @@ class ImageMediaItem(MediaManagerItem): 'Select Image(s)') file_formats = get_images_filter() self.OnNewFileMasks = u'%s;;%s (*.*) (*)' % (file_formats, - unicode(translate('ImagePlugin.MediaItem', 'All Files'))) + unicode(UiStrings.AllFiles)) self.replaceAction.setText( translate('ImagePlugin.MediaItem', 'Replace Background')) self.replaceAction.setToolTip( diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index ad6087daf..42dcc321c 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -30,6 +30,7 @@ import mimetypes from PyQt4.phonon import Phonon from openlp.core.lib import Plugin, StringContent, build_icon, translate +from openlp.core.lib.ui import UiStrings from openlp.plugins.media.lib import MediaMediaItem, MediaTab log = logging.getLogger(__name__) @@ -103,43 +104,43 @@ class MediaPlugin(Plugin): # Middle Header Bar ## Load Action ## self.textStrings[StringContent.Load] = { - u'title': translate('MediaPlugin', 'Load'), + u'title': UiStrings.Load, u'tooltip': translate('MediaPlugin', 'Load a new Media') } ## New Action ## self.textStrings[StringContent.New] = { - u'title': translate('MediaPlugin', 'Add'), + u'title': UiStrings.Add, u'tooltip': translate('MediaPlugin', 'Add a new Media') } ## Edit Action ## self.textStrings[StringContent.Edit] = { - u'title': translate('MediaPlugin', 'Edit'), + u'title': UiStrings.Edit, u'tooltip': translate('MediaPlugin', 'Edit the selected Media') } ## Delete Action ## self.textStrings[StringContent.Delete] = { - u'title': translate('MediaPlugin', 'Delete'), + u'title': UiStrings.Delete, u'tooltip': translate('MediaPlugin', 'Delete the selected Media') } ## Preview Action ## self.textStrings[StringContent.Preview] = { - u'title': translate('MediaPlugin', 'Preview'), + u'title': UiStrings.Preview, u'tooltip': translate('MediaPlugin', 'Preview the selected Media') } ## Send Live Action ## self.textStrings[StringContent.Live] = { - u'title': translate('MediaPlugin', 'Live'), + u'title': UiStrings.Live, u'tooltip': translate('MediaPlugin', 'Send the selected Media live') } ## Add to Service Action ## self.textStrings[StringContent.Service] = { - u'title': translate('MediaPlugin', 'Service'), + u'title': UiStrings.Service, u'tooltip': translate('MediaPlugin', 'Add the selected Media to the service') } diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index 17417df58..213ff2927 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -31,6 +31,7 @@ import os import logging from openlp.core.lib import Plugin, StringContent, build_icon, translate +from openlp.core.lib.ui import UiStrings from openlp.core.utils import AppLocation from openlp.plugins.presentations.lib import PresentationController, \ PresentationMediaItem, PresentationTab @@ -169,31 +170,31 @@ class PresentationPlugin(Plugin): # Middle Header Bar ## Load Action ## self.textStrings[StringContent.Load] = { - u'title': translate('PresentationPlugin', 'Load'), + u'title': UiStrings.Load, u'tooltip': translate('PresentationPlugin', 'Load a new Presentation') } ## Delete Action ## self.textStrings[StringContent.Delete] = { - u'title': translate('PresentationPlugin', 'Delete'), + u'title': UiStrings.Delete, u'tooltip': translate('PresentationPlugin', 'Delete the selected Presentation') } ## Preview Action ## self.textStrings[StringContent.Preview] = { - u'title': translate('PresentationPlugin', 'Preview'), + u'title': UiStrings.Preview, u'tooltip': translate('PresentationPlugin', 'Preview the selected Presentation') } ## Send Live Action ## self.textStrings[StringContent.Live] = { - u'title': translate('PresentationPlugin', 'Live'), + u'title': UiStrings.Live, u'tooltip': translate('PresentationPlugin', 'Send the selected Presentation live') } ## Add to Service Action ## self.textStrings[StringContent.Service] = { - u'title': translate('PresentationPlugin', 'Service'), + u'title': UiStrings.Service, u'tooltip': translate('PresentationPlugin', 'Add the selected Presentation to the service') } diff --git a/openlp/plugins/songs/forms/editsongdialog.py b/openlp/plugins/songs/forms/editsongdialog.py index e9be62830..6854a17ae 100644 --- a/openlp/plugins/songs/forms/editsongdialog.py +++ b/openlp/plugins/songs/forms/editsongdialog.py @@ -27,7 +27,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import build_icon, translate -from openlp.core.lib.ui import create_save_cancel_button_box +from openlp.core.lib.ui import UiStrings, create_save_cancel_button_box class Ui_EditSongDialog(object): def setupUi(self, editSongDialog): @@ -257,19 +257,15 @@ class Ui_EditSongDialog(object): translate('SongsPlugin.EditSongForm', '&Lyrics:')) self.verseOrderLabel.setText( translate('SongsPlugin.EditSongForm', '&Verse order:')) - self.verseAddButton.setText( - translate('SongsPlugin.EditSongForm', '&Add')) - self.verseEditButton.setText( - translate('SongsPlugin.EditSongForm', '&Edit')) + self.verseAddButton.setText(UiStrings.Add) + self.verseEditButton.setText(UiStrings.Edit) self.verseEditAllButton.setText( translate('SongsPlugin.EditSongForm', 'Ed&it All')) - self.verseDeleteButton.setText( - translate('SongsPlugin.EditSongForm', '&Delete')) + self.verseDeleteButton.setText(UiStrings.Delete) self.songTabWidget.setTabText( self.songTabWidget.indexOf(self.lyricsTab), translate('SongsPlugin.EditSongForm', 'Title && Lyrics')) - self.authorsGroupBox.setTitle( - translate('SongsPlugin.EditSongForm', 'Authors')) + self.authorsGroupBox.setTitle(UiStrings.Authors) self.authorAddButton.setText( translate('SongsPlugin.EditSongForm', '&Add to Song')) self.authorRemoveButton.setText( @@ -292,8 +288,7 @@ class Ui_EditSongDialog(object): self.songTabWidget.indexOf(self.authorsTab), translate('SongsPlugin.EditSongForm', 'Authors, Topics && Song Book')) - self.themeGroupBox.setTitle( - translate('SongsPlugin.EditSongForm', 'Theme')) + self.themeGroupBox.setTitle(UiStrings.Theme) self.themeAddButton.setText( translate('SongsPlugin.EditSongForm', 'New &Theme')) self.rightsGroupBox.setTitle( diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index a9af7f6b2..8cd8c70fa 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -32,7 +32,7 @@ import os from PyQt4 import QtCore, QtGui from openlp.core.lib import Receiver, SettingsManager, translate -from openlp.core.lib.ui import critical_error_message_box +from openlp.core.lib.ui import UiStrings, critical_error_message_box from openlp.core.ui.wizard import OpenLPWizard from openlp.plugins.songs.lib.importer import SongFormat @@ -215,8 +215,7 @@ class SongImportForm(OpenLPWizard): 'Select the import format, and where to import from.')) self.formatLabel.setText( translate('SongsPlugin.ImportWizardForm', 'Format:')) - self.formatComboBox.setItemText(0, - translate('SongsPlugin.ImportWizardForm', 'OpenLP 2.0')) + self.formatComboBox.setItemText(0, UiStrings.OLPV2) self.formatComboBox.setItemText(1, translate('SongsPlugin.ImportWizardForm', 'openlp.org 1.x')) self.formatComboBox.setItemText(2, @@ -489,8 +488,7 @@ class SongImportForm(OpenLPWizard): """ if filters: filters += u';;' - filters += u'%s (*)' % translate('SongsPlugin.ImportWizardForm', - 'All Files') + filters += u'%s (*)' % UiStrings.AllFiles filenames = QtGui.QFileDialog.getOpenFileNames(self, title, SettingsManager.get_last_dir(self.plugin.settingsSection, 1), filters) diff --git a/openlp/plugins/songs/forms/songmaintenancedialog.py b/openlp/plugins/songs/forms/songmaintenancedialog.py index 51fafcc7a..0fa3335dc 100644 --- a/openlp/plugins/songs/forms/songmaintenancedialog.py +++ b/openlp/plugins/songs/forms/songmaintenancedialog.py @@ -27,6 +27,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import build_icon, translate +from openlp.core.lib.ui import UiStrings class Ui_SongMaintenanceDialog(object): def setupUi(self, songMaintenanceDialog): @@ -145,30 +146,21 @@ class Ui_SongMaintenanceDialog(object): def retranslateUi(self, songMaintenanceDialog): songMaintenanceDialog.setWindowTitle( translate('SongsPlugin.SongMaintenanceForm', 'Song Maintenance')) - authorsString = translate('SongsPlugin.SongMaintenanceForm', 'Authors') + authorsString = UiStrings.Authors topicsString = translate('SongsPlugin.SongMaintenanceForm', 'Topics') booksString = translate('SongsPlugin.SongMaintenanceForm', 'Song Books') self.listItemAuthors.setText(authorsString) self.listItemTopics.setText(topicsString) self.listItemBooks.setText(booksString) - self.authorsAddButton.setText( - translate('SongsPlugin.SongMaintenanceForm', '&Add')) - self.authorsEditButton.setText( - translate('SongsPlugin.SongMaintenanceForm', '&Edit')) - self.authorsDeleteButton.setText( - translate('SongsPlugin.SongMaintenanceForm', '&Delete')) - self.topicsAddButton.setText( - translate('SongsPlugin.SongMaintenanceForm', '&Add')) - self.topicsEditButton.setText( - translate('SongsPlugin.SongMaintenanceForm', '&Edit')) - self.topicsDeleteButton.setText( - translate('SongsPlugin.SongMaintenanceForm', '&Delete')) - self.booksAddButton.setText( - translate('SongsPlugin.SongMaintenanceForm', '&Add')) - self.booksEditButton.setText( - translate('SongsPlugin.SongMaintenanceForm', '&Edit')) - self.booksDeleteButton.setText( - translate('SongsPlugin.SongMaintenanceForm', '&Delete')) + self.authorsAddButton.setText(UiStrings.Add) + self.authorsEditButton.setText(UiStrings.Edit) + self.authorsDeleteButton.setText(UiStrings.Delete) + self.topicsAddButton.setText(UiStrings.Add) + self.topicsEditButton.setText(UiStrings.Edit) + self.topicsDeleteButton.setText(UiStrings.Delete) + self.booksAddButton.setText(UiStrings.Add) + self.booksEditButton.setText(UiStrings.Edit) + self.booksDeleteButton.setText(UiStrings.Delete) typeListWidth = max(self.fontMetrics().width(authorsString), self.fontMetrics().width(topicsString), self.fontMetrics().width(booksString)) diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 66cff169f..312d0d6e7 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -33,6 +33,7 @@ from sqlalchemy.sql import or_ from openlp.core.lib import MediaManagerItem, BaseListWithDnD, Receiver, \ ItemCapabilities, translate, check_item_selected, PluginStatus +from openlp.core.lib.ui import UiStrings from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm, \ SongImportForm from openlp.plugins.songs.lib import OpenLyrics, SongXML @@ -147,10 +148,8 @@ class SongMediaItem(MediaManagerItem): translate('SongsPlugin.MediaItem', 'Titles')), (3, u':/songs/song_search_lyrics.png', translate('SongsPlugin.MediaItem', 'Lyrics')), - (4, u':/songs/song_search_author.png', - translate('SongsPlugin.MediaItem', 'Authors')), - (5, u':/slides/slide_theme.png', - translate('SongsPlugin.MediaItem', 'Themes')) + (4, u':/songs/song_search_author.png', UiStrings.Authors), + (5, u':/slides/slide_theme.png', UiStrings.Themes) ]) self.configUpdated() diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 7efe73db2..6b9564af1 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -31,6 +31,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import Plugin, StringContent, build_icon, translate from openlp.core.lib.db import Manager +from openlp.core.lib.ui import UiStrings from openlp.plugins.songs.lib import SongMediaItem, SongsTab, SongXML from openlp.plugins.songs.lib.db import init_schema, Song from openlp.plugins.songs.lib.importer import SongFormat @@ -227,37 +228,37 @@ class SongsPlugin(Plugin): # Middle Header Bar ## New Action ## self.textStrings[StringContent.New] = { - u'title': translate('SongsPlugin', 'Add'), + u'title': UiStrings.Add, u'tooltip': translate('SongsPlugin', 'Add a new Song') } ## Edit Action ## self.textStrings[StringContent.Edit] = { - u'title': translate('SongsPlugin', 'Edit'), + u'title': UiStrings.Edit, u'tooltip': translate('SongsPlugin', 'Edit the selected Song') } ## Delete Action ## self.textStrings[StringContent.Delete] = { - u'title': translate('SongsPlugin', 'Delete'), + u'title': UiStrings.Delete, u'tooltip': translate('SongsPlugin', 'Delete the selected Song') } ## Preview Action ## self.textStrings[StringContent.Preview] = { - u'title': translate('SongsPlugin', 'Preview'), + u'title': UiStrings.Preview, u'tooltip': translate('SongsPlugin', 'Preview the selected Song') } ## Send Live Action ## self.textStrings[StringContent.Live] = { - u'title': translate('SongsPlugin', 'Live'), + u'title': UiStrings.Live, u'tooltip': translate('SongsPlugin', 'Send the selected Song live') } ## Add to Service Action ## self.textStrings[StringContent.Service] = { - u'title': translate('SongsPlugin', 'Service'), + u'title': UiStrings.Service, u'tooltip': translate('SongsPlugin', 'Add the selected Song to the service') } From 2ce4aeba9271085f9710b0d1350a6c0b70aff4fc Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Wed, 9 Feb 2011 14:04:50 +0000 Subject: [PATCH 056/243] Fixes --- openlp/core/lib/ui.py | 2 +- openlp/plugins/presentations/lib/impresscontroller.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 41e88b54b..5d1b722c5 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -122,7 +122,7 @@ def critical_error_message_box(title=None, message=None, parent=None, Should this message box question the user. """ if question: - return QtGui.QMessageBox.critical(parent, error, message, + return QtGui.QMessageBox.critical(parent, UiStrings.Error, message, QtGui.QMessageBox.StandardButtons( QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)) data = {u'message': message} diff --git a/openlp/plugins/presentations/lib/impresscontroller.py b/openlp/plugins/presentations/lib/impresscontroller.py index 79e7d0ea8..7de095d54 100644 --- a/openlp/plugins/presentations/lib/impresscontroller.py +++ b/openlp/plugins/presentations/lib/impresscontroller.py @@ -429,7 +429,7 @@ class ImpressDocument(PresentationDocument): ``slide_no`` The slide the text is required for, starting at 1 """ - return __get_text_from_slide(slide_no) + return self.__get_text_from_page(slide_no) def get_slide_notes(self, slide_no): """ @@ -438,7 +438,7 @@ class ImpressDocument(PresentationDocument): ``slide_no`` The slide the notes are required for, starting at 1 """ - return __get_text_from_page(slide_no, True) + return self.__get_text_from_page(slide_no, True) def __get_text_from_page(self, slide_no, notes=False): """ From 45f9fa8f2f7b582ed671de2c08b6e077b34f95da Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Wed, 9 Feb 2011 17:30:38 +0000 Subject: [PATCH 057/243] More translation refactors --- openlp/core/lib/plugin.py | 32 +++++++++++++- openlp/core/lib/ui.py | 14 ++++++ openlp/core/ui/slidecontroller.py | 4 ++ openlp/core/ui/thememanager.py | 12 +++--- openlp/plugins/bibles/bibleplugin.py | 33 +------------- openlp/plugins/custom/customplugin.py | 43 +------------------ openlp/plugins/images/imageplugin.py | 43 +------------------ openlp/plugins/media/mediaplugin.py | 43 +------------------ .../presentations/presentationplugin.py | 31 +------------ openlp/plugins/songs/songsplugin.py | 37 +--------------- 10 files changed, 61 insertions(+), 231 deletions(-) diff --git a/openlp/core/lib/plugin.py b/openlp/core/lib/plugin.py index 476df79b0..cfd3fb4c2 100644 --- a/openlp/core/lib/plugin.py +++ b/openlp/core/lib/plugin.py @@ -31,6 +31,7 @@ import logging from PyQt4 import QtCore from openlp.core.lib import Receiver +from openlp.core.lib.ui import UiStrings log = logging.getLogger(__name__) @@ -323,4 +324,33 @@ class Plugin(QtCore.QObject): """ Called to define all translatable texts of the plugin """ - pass + ## Load Action ## + self._setSingularTextString(StringContent.Load, + UiStrings.Load, UiStrings.LoadANew) + ## New Action ## + self._setSingularTextString(StringContent.New, + UiStrings.Add, UiStrings.AddANew) + ## Edit Action ## + self._setSingularTextString(StringContent.Edit, + UiStrings.Edit, UiStrings.EditSelect) + ## Delete Action ## + self._setSingularTextString(StringContent.Delete, + UiStrings.Delete, UiStrings.DeleteSelect) + ## Preview Action ## + self._setSingularTextString(StringContent.Preview, + UiStrings.Preview, UiStrings.PreviewSelect) + ## Send Live Action ## + self._setSingularTextString(StringContent.Live, + UiStrings.Live, UiStrings.SendSelectLive) + ## Add to Service Action ## + self._setSingularTextString(StringContent.Service, + UiStrings.Service, UiStrings.AddSelectService) + + def _setSingularTextString(self, name, title, tooltip): + """ + Utility method for creating a plugin's textStrings. This method makes + use of the singular name of the plugin object so must only be called + after this has been set. + """ + self.textStrings[name] = { u'title': title, u'tooltip': tooltip % + self.getString(StringContent.Name)[u'singular']} diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 5d1b722c5..ec1c324fe 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -41,17 +41,31 @@ class UiStrings(object): # These strings should need a good reason to be retranslated elsewhere. # Should some/more/less of these have an & attached? Add = translate('OpenLP.Ui', '&Add') + AddANew = unicode(translate('OpenLP.Ui', 'Add a new %s')) + AddSelectService = unicode(translate('OpenLP.Ui', + 'Add the selected %s to the service')) AllFiles = translate('OpenLP.Ui', 'All Files') Authors = translate('OpenLP.Ui', 'Authors') Delete = translate('OpenLP.Ui', '&Delete') + DeleteSelect = unicode(translate('OpenLP.Ui', 'Delete the selected %s')) + DeleteType = unicode(translate('OpenLP.Ui', 'Delete %s')) Edit = translate('OpenLP.Ui', '&Edit') + EditSelect = unicode(translate('OpenLP.Ui', 'Edit the selected %s')) + EditType = unicode(translate('OpenLP.Ui', 'Edit %s')) Error = translate('OpenLP.Ui', 'Error') + ExportType = unicode(translate('OpenLP.Ui', 'Export %s')) Import = translate('OpenLP.Ui', 'Import') + ImportType = unicode(translate('OpenLP.Ui', 'Import %s')) Live = translate('OpenLP.Ui', 'Live') Load = translate('OpenLP.Ui', 'Load') + LoadANew = unicode(translate('OpenLP.Ui', 'Load a new %s')) New = translate('OpenLP.Ui', 'New') + NewType = unicode(translate('OpenLP.Ui', 'New %s')) OLPV2 = translate('OpenLP.Ui', 'OpenLP 2.0') Preview = translate('OpenLP.Ui', 'Preview') + PreviewSelect = unicode(translate('OpenLP.Ui', 'Preview the selected %s')) + SendSelectLive = unicode(translate('OpenLP.Ui', + 'Send the selected %s live')) Service = translate('OpenLP.Ui', 'Service') Theme = translate('OpenLP.Ui', 'Theme') Themes = translate('OpenLP.Ui', 'Themes') diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 1caf43dfd..c6b58ac56 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -178,10 +178,12 @@ class SlideController(QtGui.QWidget): QtCore.SIGNAL(u'triggered(bool)'), self.onHideDisplay) self.toolbar.addToolbarSeparator(u'Loop Separator') self.toolbar.addToolbarButton( + # Does not need translating - control string. u'Start Loop', u':/media/media_time.png', translate('OpenLP.SlideController', 'Start continuous loop'), self.onStartLoop) self.toolbar.addToolbarButton( + # Does not need translating - control string. u'Stop Loop', u':/media/media_stop.png', translate('OpenLP.SlideController', 'Stop continuous loop'), self.onStopLoop) @@ -196,11 +198,13 @@ class SlideController(QtGui.QWidget): else: self.toolbar.addToolbarSeparator(u'Close Separator') self.toolbar.addToolbarButton( + # Does not need translating - control string. u'Go Live', u':/general/general_live.png', translate('OpenLP.SlideController', 'Move to live'), self.onGoLive) self.toolbar.addToolbarSeparator(u'Close Separator') self.toolbar.addToolbarButton( + # Does not need translating - control string. u'Edit Song', u':/general/general_edit.png', translate('OpenLP.SlideController', 'Edit and reload song preview'), diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 317065c6e..93a5ef187 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -35,7 +35,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import OpenLPToolbar, ThemeXML, get_text_file_string, \ build_icon, Receiver, SettingsManager, translate, check_item_selected, \ BackgroundType, BackgroundGradientType, check_directory_exists -from openlp.core.lib.ui import critical_error_message_box +from openlp.core.lib.ui import UiStrings, critical_error_message_box from openlp.core.theme import Theme from openlp.core.ui import FileRenameForm, ThemeForm from openlp.core.utils import AppLocation, delete_file, file_is_unicode, \ @@ -62,28 +62,28 @@ class ThemeManager(QtGui.QWidget): self.layout.setObjectName(u'layout') self.toolbar = OpenLPToolbar(self) self.toolbar.addToolbarButton( - translate('OpenLP.ThemeManager', 'New Theme'), + UiStrings.NewType % UiStrings.Theme, u':/themes/theme_new.png', translate('OpenLP.ThemeManager', 'Create a new theme.'), self.onAddTheme) self.toolbar.addToolbarButton( - translate('OpenLP.ThemeManager', 'Edit Theme'), + UiStrings.EditType % UiStrings.Theme, u':/themes/theme_edit.png', translate('OpenLP.ThemeManager', 'Edit a theme.'), self.onEditTheme) self.deleteToolbarAction = self.toolbar.addToolbarButton( - translate('OpenLP.ThemeManager', 'Delete Theme'), + UiStrings.DeleteType % UiStrings.Theme, u':/general/general_delete.png', translate('OpenLP.ThemeManager', 'Delete a theme.'), self.onDeleteTheme) self.toolbar.addSeparator() self.toolbar.addToolbarButton( - translate('OpenLP.ThemeManager', 'Import Theme'), + UiStrings.ImportType % UiStrings.Theme, u':/general/general_import.png', translate('OpenLP.ThemeManager', 'Import a theme.'), self.onImportTheme) self.toolbar.addToolbarButton( - translate('OpenLP.ThemeManager', 'Export Theme'), + UiStrings.ExportType % UiStrings.Theme, u':/general/general_export.png', translate('OpenLP.ThemeManager', 'Export a theme.'), self.onExportTheme) diff --git a/openlp/plugins/bibles/bibleplugin.py b/openlp/plugins/bibles/bibleplugin.py index e1dadd4bf..89102a8eb 100644 --- a/openlp/plugins/bibles/bibleplugin.py +++ b/openlp/plugins/bibles/bibleplugin.py @@ -141,35 +141,4 @@ class BiblePlugin(Plugin): u'title': UiStrings.Import, u'tooltip': translate('BiblesPlugin', 'Import a Bible') } - ## New Action ## - self.textStrings[StringContent.New] = { - u'title': UiStrings.Add, - u'tooltip': translate('BiblesPlugin', 'Add a new Bible') - } - ## Edit Action ## - self.textStrings[StringContent.Edit] = { - u'title': UiStrings.Edit, - u'tooltip': translate('BiblesPlugin', 'Edit the selected Bible') - } - ## Delete Action ## - self.textStrings[StringContent.Delete] = { - u'title': UiStrings.Delete, - u'tooltip': translate('BiblesPlugin', 'Delete the selected Bible') - } - ## Preview Action ## - self.textStrings[StringContent.Preview] = { - u'title': UiStrings.Preview, - u'tooltip': translate('BiblesPlugin', 'Preview the selected Bible') - } - ## Send Live Action ## - self.textStrings[StringContent.Live] = { - u'title': UiStrings.Live, - u'tooltip': translate('BiblesPlugin', - 'Send the selected Bible live') - } - ## Add to Service Action ## - self.textStrings[StringContent.Service] = { - u'title': UiStrings.Service, - u'tooltip': translate('BiblesPlugin', - 'Add the selected Bible to the service') - } + Plugin.setPluginTextStrings(self) diff --git a/openlp/plugins/custom/customplugin.py b/openlp/plugins/custom/customplugin.py index 210556ad8..f20fbc9cd 100644 --- a/openlp/plugins/custom/customplugin.py +++ b/openlp/plugins/custom/customplugin.py @@ -119,48 +119,7 @@ class CustomPlugin(Plugin): u'tooltip': translate('CustomsPlugin', 'Import a Custom') } - ## Load Action ## - self.textStrings[StringContent.Load] = { - u'title': UiStrings.Load, - u'tooltip': translate('CustomsPlugin', - 'Load a new Custom') - } - ## New Action ## - self.textStrings[StringContent.New] = { - u'title': UiStrings.Add, - u'tooltip': translate('CustomsPlugin', - 'Add a new Custom') - } - ## Edit Action ## - self.textStrings[StringContent.Edit] = { - u'title': UiStrings.Edit, - u'tooltip': translate('CustomsPlugin', - 'Edit the selected Custom') - } - ## Delete Action ## - self.textStrings[StringContent.Delete] = { - u'title': UiStrings.Delete, - u'tooltip': translate('CustomsPlugin', - 'Delete the selected Custom') - } - ## Preview Action ## - self.textStrings[StringContent.Preview] = { - u'title': UiStrings.Preview, - u'tooltip': translate('CustomsPlugin', - 'Preview the selected Custom') - } - ## Send Live Action ## - self.textStrings[StringContent.Live] = { - u'title': UiStrings.Live, - u'tooltip': translate('CustomsPlugin', - 'Send the selected Custom live') - } - ## Add to Service Action ## - self.textStrings[StringContent.Service] = { - u'title': UiStrings.Service, - u'tooltip': translate('CustomsPlugin', - 'Add the selected Custom to the service') - } + Plugin.setPluginTextStrings(self) def finalise(self): """ diff --git a/openlp/plugins/images/imageplugin.py b/openlp/plugins/images/imageplugin.py index 0af48bacd..51ef20960 100644 --- a/openlp/plugins/images/imageplugin.py +++ b/openlp/plugins/images/imageplugin.py @@ -73,45 +73,4 @@ class ImagePlugin(Plugin): u'title': translate('ImagePlugin', 'Images', 'container title') } # Middle Header Bar - ## Load Button ## - self.textStrings[StringContent.Load] = { - u'title': UiStrings.Load, - u'tooltip': translate('ImagePlugin', - 'Load a new Image') - } - ## New Button ## - self.textStrings[StringContent.New] = { - u'title': UiStrings.Add, - u'tooltip': translate('ImagePlugin', - 'Add a new Image') - } - ## Edit Button ## - self.textStrings[StringContent.Edit] = { - u'title': UiStrings.Edit, - u'tooltip': translate('ImagePlugin', - 'Edit the selected Image') - } - ## Delete Button ## - self.textStrings[StringContent.Delete] = { - u'title': UiStrings.Delete, - u'tooltip': translate('ImagePlugin', - 'Delete the selected Image') - } - ## Preview ## - self.textStrings[StringContent.Preview] = { - u'title': UiStrings.Preview, - u'tooltip': translate('ImagePlugin', - 'Preview the selected Image') - } - ## Live Button ## - self.textStrings[StringContent.Live] = { - u'title': UiStrings.Live, - u'tooltip': translate('ImagePlugin', - 'Send the selected Image live') - } - ## Add to service Button ## - self.textStrings[StringContent.Service] = { - u'title': UiStrings.Service, - u'tooltip': translate('ImagePlugin', - 'Add the selected Image to the service') - } + Plugin.setPluginTextStrings(self) diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index 42dcc321c..1619a07fe 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -102,45 +102,4 @@ class MediaPlugin(Plugin): u'title': translate('MediaPlugin', 'Media', 'container title') } # Middle Header Bar - ## Load Action ## - self.textStrings[StringContent.Load] = { - u'title': UiStrings.Load, - u'tooltip': translate('MediaPlugin', - 'Load a new Media') - } - ## New Action ## - self.textStrings[StringContent.New] = { - u'title': UiStrings.Add, - u'tooltip': translate('MediaPlugin', - 'Add a new Media') - } - ## Edit Action ## - self.textStrings[StringContent.Edit] = { - u'title': UiStrings.Edit, - u'tooltip': translate('MediaPlugin', - 'Edit the selected Media') - } - ## Delete Action ## - self.textStrings[StringContent.Delete] = { - u'title': UiStrings.Delete, - u'tooltip': translate('MediaPlugin', - 'Delete the selected Media') - } - ## Preview Action ## - self.textStrings[StringContent.Preview] = { - u'title': UiStrings.Preview, - u'tooltip': translate('MediaPlugin', - 'Preview the selected Media') - } - ## Send Live Action ## - self.textStrings[StringContent.Live] = { - u'title': UiStrings.Live, - u'tooltip': translate('MediaPlugin', - 'Send the selected Media live') - } - ## Add to Service Action ## - self.textStrings[StringContent.Service] = { - u'title': UiStrings.Service, - u'tooltip': translate('MediaPlugin', - 'Add the selected Media to the service') - } + Plugin.setPluginTextStrings(self) diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index 213ff2927..c4cf29aca 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -168,33 +168,4 @@ class PresentationPlugin(Plugin): 'container title') } # Middle Header Bar - ## Load Action ## - self.textStrings[StringContent.Load] = { - u'title': UiStrings.Load, - u'tooltip': translate('PresentationPlugin', - 'Load a new Presentation') - } - ## Delete Action ## - self.textStrings[StringContent.Delete] = { - u'title': UiStrings.Delete, - u'tooltip': translate('PresentationPlugin', - 'Delete the selected Presentation') - } - ## Preview Action ## - self.textStrings[StringContent.Preview] = { - u'title': UiStrings.Preview, - u'tooltip': translate('PresentationPlugin', - 'Preview the selected Presentation') - } - ## Send Live Action ## - self.textStrings[StringContent.Live] = { - u'title': UiStrings.Live, - u'tooltip': translate('PresentationPlugin', - 'Send the selected Presentation live') - } - ## Add to Service Action ## - self.textStrings[StringContent.Service] = { - u'title': UiStrings.Service, - u'tooltip': translate('PresentationPlugin', - 'Add the selected Presentation to the service') - } + Plugin.setPluginTextStrings(self) diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 6b9564af1..74991fe37 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -226,42 +226,7 @@ class SongsPlugin(Plugin): u'title': translate('SongsPlugin', 'Songs', 'container title') } # Middle Header Bar - ## New Action ## - self.textStrings[StringContent.New] = { - u'title': UiStrings.Add, - u'tooltip': translate('SongsPlugin', - 'Add a new Song') - } - ## Edit Action ## - self.textStrings[StringContent.Edit] = { - u'title': UiStrings.Edit, - u'tooltip': translate('SongsPlugin', - 'Edit the selected Song') - } - ## Delete Action ## - self.textStrings[StringContent.Delete] = { - u'title': UiStrings.Delete, - u'tooltip': translate('SongsPlugin', - 'Delete the selected Song') - } - ## Preview Action ## - self.textStrings[StringContent.Preview] = { - u'title': UiStrings.Preview, - u'tooltip': translate('SongsPlugin', - 'Preview the selected Song') - } - ## Send Live Action ## - self.textStrings[StringContent.Live] = { - u'title': UiStrings.Live, - u'tooltip': translate('SongsPlugin', - 'Send the selected Song live') - } - ## Add to Service Action ## - self.textStrings[StringContent.Service] = { - u'title': UiStrings.Service, - u'tooltip': translate('SongsPlugin', - 'Add the selected Song to the service') - } + Plugin.setPluginTextStrings(self) def finalise(self): """ From 6a409e89575efcba8d0b2c5f3a2bc3781beee9a2 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Wed, 9 Feb 2011 20:36:13 +0100 Subject: [PATCH 058/243] added search box, added buttons --- openlp/plugins/songs/forms/songexportform.py | 135 +++++++++++++++---- 1 file changed, 110 insertions(+), 25 deletions(-) diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index 4c918f66b..748bf3fdf 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -86,11 +86,17 @@ class SongExportForm(OpenLPWizard): """ Song wizard specific signals. """ + QtCore.QObject.connect(self.availableListWidget, + QtCore.SIGNAL(u'itemPressed(QListWidgetItem*)'), self.onItemPressed) + QtCore.QObject.connect(self.searchLineEdit, + QtCore.SIGNAL(u'textEdited(const QString&)'), + self.onSearchLineEditChanged) + QtCore.QObject.connect(self.uncheckButton, + QtCore.SIGNAL(u'clicked()'), self.onUncheckButtonClicked) + QtCore.QObject.connect(self.checkButton, + QtCore.SIGNAL(u'clicked()'), self.onCheckButtonClicked) QtCore.QObject.connect(self.directoryButton, QtCore.SIGNAL(u'clicked()'), self.onDirectoryButtonClicked) -# QtCore.QObject.connect(self.searchLineEdit, -# QtCore.SIGNAL(u'textEdited(const QString&)'), -# self.onSearchLineEditChanged) def addCustomPages(self): """ @@ -101,16 +107,30 @@ class SongExportForm(OpenLPWizard): self.availableSongsPage.setObjectName(u'availableSongsPage') self.availableSongsLayout = QtGui.QHBoxLayout(self.availableSongsPage) self.availableSongsLayout.setObjectName(u'availableSongsLayout') -# self.gridLayout = QtGui.QGridLayout() -# self.gridLayout.setObjectName(u'gridLayout') + self.verticalLayout = QtGui.QVBoxLayout() + self.verticalLayout.setObjectName(u'verticalLayout') self.availableListWidget = QtGui.QListWidget(self.availableSongsPage) self.availableListWidget.setObjectName(u'availableListWidget') -# self.gridLayout.addWidget(self.availableListWidget, 0, 0, 1, 1) -# self.searchLineEdit = QtGui.QLineEdit(self.availableSongsPage) -# self.searchLineEdit.setObjectName(u'searchLineEdit') -# self.gridLayout.addWidget(self.searchLineEdit, 1, 0, 1, 1) -# self.availableSongsLayout.addLayout(self.gridLayout) - self.availableSongsLayout.addWidget(self.availableListWidget) + self.verticalLayout.addWidget(self.availableListWidget) + self.horizontalLayout = QtGui.QHBoxLayout() + self.horizontalLayout.setObjectName(u'horizontalLayout') + self.searchLabel = QtGui.QLabel(self.availableSongsPage) + self.searchLabel.setObjectName(u'searchLabel') + self.horizontalLayout.addWidget(self.searchLabel) + self.searchLineEdit = QtGui.QLineEdit(self.availableSongsPage) + self.searchLineEdit.setObjectName(u'searchLineEdit') + self.horizontalLayout.addWidget(self.searchLineEdit) + spacerItem = QtGui.QSpacerItem(40, 20, + QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.horizontalLayout.addItem(spacerItem) + self.uncheckButton = QtGui.QPushButton(self.availableSongsPage) + self.uncheckButton.setObjectName(u'uncheckButton') + self.horizontalLayout.addWidget(self.uncheckButton) + self.checkButton = QtGui.QPushButton(self.availableSongsPage) + self.checkButton.setObjectName(u'selectButton') + self.horizontalLayout.addWidget(self.checkButton) + self.verticalLayout.addLayout(self.horizontalLayout) + self.availableSongsLayout.addLayout(self.verticalLayout) self.addPage(self.availableSongsPage) # The page with the selected songs. self.exportSongPage = QtGui.QWizardPage() @@ -145,23 +165,29 @@ class SongExportForm(OpenLPWizard): self.setWindowTitle( translate('SongsPlugin.ExportWizardForm', 'Song Export Wizard')) self.titleLabel.setText( - u'%s' % \ + u'%s' % translate('SongsPlugin.ExportWizardForm', 'Welcome to the Song Export Wizard')) self.informationLabel.setText( - translate('SongsPlugin.ExportWizardForm', 'This wizard will help to ' - 'export your songs to the open and free OpenLyrics worship song ' + translate('SongsPlugin.ExportWizardForm', 'This wizard will help to' + ' export your songs to the open and free OpenLyrics worship song ' 'format.')) self.availableSongsPage.setTitle( translate('SongsPlugin.ExportWizardForm', 'Select Songs')) self.availableSongsPage.setSubTitle( translate('SongsPlugin.ExportWizardForm', 'Check the songs, you want to export.')) + self.searchLabel.setText( + translate('SongsPlugin.ExportWizardForm', 'Search:')) + self.uncheckButton.setText( + translate('SongsPlugin.ExportWizardForm', 'Deselect All')) + self.checkButton.setText( + translate('SongsPlugin.ExportWizardForm', 'Select All')) self.exportSongPage.setTitle( translate('SongsPlugin.ExportWizardForm', 'Select Directory')) self.exportSongPage.setSubTitle( - translate('SongsPlugin.ExportWizardForm', - 'Select the directory you want the songs to be saved.')) + translate('SongsPlugin.ExportWizardForm', + 'Select the directory you want the songs to be saved.')) self.directoryLabel.setText( translate('SongsPlugin.ExportWizardForm', 'Directory:')) self.progressPage.setTitle( @@ -181,9 +207,10 @@ class SongExportForm(OpenLPWizard): if self.currentPage() == self.welcomePage: return True elif self.currentPage() == self.availableSongsPage: - items = [item for item in self.availableListWidget.findItems( - QtCore.QString(u''), QtCore.Qt.MatchContains) - if item.checkState() == QtCore.Qt.Checked] + items = [ + item for item in self._findListWidgetItems( + self.availableListWidget) if item.checkState() + ] if not items: critical_error_message_box( translate('SongsPlugin.ExportWizardForm', @@ -241,7 +268,7 @@ class SongExportForm(OpenLPWizard): item.setData(QtCore.Qt.UserRole, QtCore.QVariant(song)) item.setFlags(QtCore.Qt.ItemIsSelectable| QtCore.Qt.ItemIsUserCheckable | QtCore.Qt.ItemIsEnabled) - item.setCheckState(QtCore.Qt.Checked) + item.setCheckState(QtCore.Qt.Unchecked) self.availableListWidget.addItem(item) Receiver.send_message(u'cursor_normal') @@ -259,9 +286,10 @@ class SongExportForm(OpenLPWizard): Perform the actual export. This creates an *openlyricsexport* instance and calls the *do_export* method. """ - songs = [song.data(QtCore.Qt.UserRole).toPyObject() - for song in self.selectedListWidget.findItems( - QtCore.QString(u''), QtCore.Qt.MatchContains)] + songs = [ + song.data(QtCore.Qt.UserRole).toPyObject() + for song in self._findListWidgetItems(self.selectedListWidget) + ] exporter = OpenLyricsExport( self, songs, unicode(self.directoryLineEdit.text())) if exporter.do_export(): @@ -272,8 +300,65 @@ class SongExportForm(OpenLPWizard): translate('SongsPlugin.SongExportForm', 'Your song export failed.')) -# def onSearchLineEditChanged(self, text): -# pass + def _findListWidgetItems(self, listWidget, text=u''): + """ + Returns a list of *QListWidgetItem*s of the ``listWidget``. Note, that + hidden items are included. + + ``listWidget`` + The widget to get all items from. (QListWidget) + + ``text`` + The text to search for. (unicode string) + """ + return [item for item in listWidget.findItems( + QtCore.QString(unicode(text)), QtCore.Qt.MatchContains) + ] + + def onItemPressed(self, item): + """ + Called, when an item in the *availableListWidget* has been pressed. Thes + item is check if it was not checked, whereas it is unchecked when it was + checked. + + ``item`` + The *QListWidgetItem* which was pressed. + """ + return + item.setCheckState( + QtCore.Qt.Unchecked if item.checkState() else QtCore.Qt.Checked) + + def onSearchLineEditChanged(self, text): + """ + The *searchLineEdit*'s text has been changed. Update the list of + available songs. Note that any song, which does not match the ``text`` + will be hidden, but not unchecked! + + ``text`` + The text of the *searchLineEdit*. (QString) + """ + search_result = [ + song for song in self._findListWidgetItems( + self.availableListWidget, unicode(text)) + ] + for item in self._findListWidgetItems(self.availableListWidget): + item.setHidden(False if item in search_result else True) + + def onUncheckButtonClicked(self): + """ + The *uncheckButton* has been clicked. Set all songs unchecked. + """ + for row in range(self.availableListWidget.count()): + item = self.availableListWidget.item(row) + item.setCheckState(QtCore.Qt.Unchecked) + + def onCheckButtonClicked(self): + """ + The *checkButton* has been clicked. Set all songs checked. + """ + for row in range(self.availableListWidget.count()): + item = self.availableListWidget.item(row) + item.setCheckState(QtCore.Qt.Checked) def onDirectoryButtonClicked(self): """ From 73cf235b49063ed9426d2a7ee73cd2606c556a5c Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Wed, 9 Feb 2011 20:55:53 +0100 Subject: [PATCH 059/243] doc fix --- openlp/plugins/songs/lib/xml.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index da2a7a08d..75e03c855 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -90,8 +90,10 @@ class SongXML(object): Add a verse to the ** tag. ``type`` - A string denoting the type of verse. Possible values are "V", - "C", "B", "P", "I", "E" and "O". + A string denoting the type of verse. Possible values are *Verse*, + *Chorus*, *Bridge*, *Pre-Chorus*, *Intro*, *Ending* and *Other*. + Any other type is **not** allowed, this also includes translated + types. ``number`` An integer denoting the number of the item, for example: verse 1. @@ -127,8 +129,8 @@ class SongXML(object): The returned list has the following format:: - [[{'lang': 'en', 'type': 'V', 'label': '1'}, u"The English verse."], - [{'lang': 'en', 'type': 'C', 'label': '1'}, u"The English chorus."]] + [[{'lang': 'en', 'type': 'Verse', 'label': '1'}, u"English verse"], + [{'lang': 'en', 'type': 'Chorus', 'label': '1'}, u"English chorus"]] """ self.song_xml = None if xml[:5] == u' Date: Wed, 9 Feb 2011 21:05:44 +0100 Subject: [PATCH 060/243] enable checking the item when double clicking --- openlp/plugins/songs/forms/songexportform.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index 748bf3fdf..86d1b8681 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -87,7 +87,7 @@ class SongExportForm(OpenLPWizard): Song wizard specific signals. """ QtCore.QObject.connect(self.availableListWidget, - QtCore.SIGNAL(u'itemPressed(QListWidgetItem*)'), self.onItemPressed) + QtCore.SIGNAL(u'itemActivated(QListWidgetItem*)'), self.onItemPressed) QtCore.QObject.connect(self.searchLineEdit, QtCore.SIGNAL(u'textEdited(const QString&)'), self.onSearchLineEditChanged) @@ -324,7 +324,6 @@ class SongExportForm(OpenLPWizard): ``item`` The *QListWidgetItem* which was pressed. """ - return item.setCheckState( QtCore.Qt.Unchecked if item.checkState() else QtCore.Qt.Checked) From 000732db69151b40f5c14016815cf74aa860d7ab Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Wed, 9 Feb 2011 21:11:23 +0100 Subject: [PATCH 061/243] string fix --- openlp/plugins/songs/forms/songexportform.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index 86d1b8681..5d5b9a8b1 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -180,9 +180,9 @@ class SongExportForm(OpenLPWizard): self.searchLabel.setText( translate('SongsPlugin.ExportWizardForm', 'Search:')) self.uncheckButton.setText( - translate('SongsPlugin.ExportWizardForm', 'Deselect All')) + translate('SongsPlugin.ExportWizardForm', 'Uncheck All')) self.checkButton.setText( - translate('SongsPlugin.ExportWizardForm', 'Select All')) + translate('SongsPlugin.ExportWizardForm', 'Check All')) self.exportSongPage.setTitle( translate('SongsPlugin.ExportWizardForm', 'Select Directory')) self.exportSongPage.setSubTitle( From fb97816711c92143a640373b2c08dbbe7061898a Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Wed, 9 Feb 2011 21:30:41 +0000 Subject: [PATCH 062/243] Unused imports --- openlp/plugins/images/imageplugin.py | 1 - openlp/plugins/media/mediaplugin.py | 1 - openlp/plugins/presentations/presentationplugin.py | 1 - openlp/plugins/songs/songsplugin.py | 1 - 4 files changed, 4 deletions(-) diff --git a/openlp/plugins/images/imageplugin.py b/openlp/plugins/images/imageplugin.py index 51ef20960..2642e3055 100644 --- a/openlp/plugins/images/imageplugin.py +++ b/openlp/plugins/images/imageplugin.py @@ -27,7 +27,6 @@ import logging from openlp.core.lib import Plugin, StringContent, build_icon, translate -from openlp.core.lib.ui import UiStrings from openlp.plugins.images.lib import ImageMediaItem log = logging.getLogger(__name__) diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index 1619a07fe..3ebb77171 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -30,7 +30,6 @@ import mimetypes from PyQt4.phonon import Phonon from openlp.core.lib import Plugin, StringContent, build_icon, translate -from openlp.core.lib.ui import UiStrings from openlp.plugins.media.lib import MediaMediaItem, MediaTab log = logging.getLogger(__name__) diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index c4cf29aca..c81cdc028 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -31,7 +31,6 @@ import os import logging from openlp.core.lib import Plugin, StringContent, build_icon, translate -from openlp.core.lib.ui import UiStrings from openlp.core.utils import AppLocation from openlp.plugins.presentations.lib import PresentationController, \ PresentationMediaItem, PresentationTab diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 74991fe37..b6676140d 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -31,7 +31,6 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import Plugin, StringContent, build_icon, translate from openlp.core.lib.db import Manager -from openlp.core.lib.ui import UiStrings from openlp.plugins.songs.lib import SongMediaItem, SongsTab, SongXML from openlp.plugins.songs.lib.db import init_schema, Song from openlp.plugins.songs.lib.importer import SongFormat From 5ecb3ce8b8b592bfeadab5d2a0cd71c9849f3f0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Thu, 10 Feb 2011 00:53:35 +0200 Subject: [PATCH 063/243] works in gnome, menu icon missing --- openlp/core/ui/mainwindow.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index c87a9544a..c55787907 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -216,6 +216,9 @@ class Ui_MainWindow(object): self.ToolsAddToolItem = icon_action(mainWindow, u'ToolsAddToolItem', u':/tools/tools_add.png') mainWindow.actionList.add_action(self.ToolsAddToolItem, u'Tools') + self.ToolsOpenDataFolder = icon_action(mainWindow, u'ToolsOpenDataFolder', + u':/tools/tools_add.png') + mainWindow.actionList.add_action(self.ToolsOpenDataFolder, u'Tools') self.settingsPluginListItem = icon_action(mainWindow, u'settingsPluginListItem', u':/system/settings_plugin_list.png') mainWindow.actionList.add_action(self.settingsPluginListItem, @@ -276,6 +279,7 @@ class Ui_MainWindow(object): self.SettingsLanguageMenu.menuAction(), None, self.SettingsShortcutsItem, self.SettingsConfigureItem)) add_actions(self.ToolsMenu, (self.ToolsAddToolItem, None)) + add_actions(self.ToolsMenu, (self.ToolsOpenDataFolder, None)) add_actions(self.HelpMenu, (self.HelpDocumentationItem, self.HelpOnlineHelpItem, None, self.HelpWebSiteItem, self.HelpAboutItem)) @@ -433,6 +437,10 @@ class Ui_MainWindow(object): translate('OpenLP.MainWindow', 'Add &Tool...')) self.ToolsAddToolItem.setStatusTip(translate('OpenLP.MainWindow', 'Add an application to the list of tools.')) + self.ToolsOpenDataFolder.setText( + translate('OpenLP.MainWindow', 'Open &Data Folder...')) + self.ToolsOpenDataFolder.setStatusTip(translate('OpenLP.MainWindow', + 'Open the folder where songs, bibles and other data resides.')) self.ModeDefaultItem.setText( translate('OpenLP.MainWindow', '&Default')) self.ModeDefaultItem.setStatusTip(translate('OpenLP.MainWindow', @@ -515,6 +523,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): QtCore.SIGNAL(u'triggered()'), self.onHelpWebSiteClicked) QtCore.QObject.connect(self.HelpAboutItem, QtCore.SIGNAL(u'triggered()'), self.onHelpAboutItemClicked) + QtCore.QObject.connect(self.ToolsOpenDataFolder, + QtCore.SIGNAL(u'triggered()'), self.onToolsOpenDataFolderClicked) QtCore.QObject.connect(self.settingsPluginListItem, QtCore.SIGNAL(u'triggered()'), self.onPluginItemClicked) QtCore.QObject.connect(self.SettingsConfigureItem, @@ -703,6 +713,13 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): self.pluginForm.load() self.pluginForm.exec_() + def onToolsOpenDataFolderClicked(self): + """ + Open data folder + """ + path = AppLocation.get_data_path() + QtGui.QDesktopServices.openUrl(QtCore.QUrl("file:///" + path)) + def onSettingsConfigureItemClicked(self): """ Show the Settings dialog From 2495aa82fcc9ccefde26d66345abde11f04fe71d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Thu, 10 Feb 2011 02:11:05 +0200 Subject: [PATCH 064/243] better icon --- openlp/core/ui/mainwindow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index c55787907..b6584f4fc 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -217,7 +217,7 @@ class Ui_MainWindow(object): u':/tools/tools_add.png') mainWindow.actionList.add_action(self.ToolsAddToolItem, u'Tools') self.ToolsOpenDataFolder = icon_action(mainWindow, u'ToolsOpenDataFolder', - u':/tools/tools_add.png') + u':/general/general_open.png') mainWindow.actionList.add_action(self.ToolsOpenDataFolder, u'Tools') self.settingsPluginListItem = icon_action(mainWindow, u'settingsPluginListItem', u':/system/settings_plugin_list.png') From 660028fd1e9ab50a93b2a089d827581024153ad1 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 10 Feb 2011 00:36:00 +0000 Subject: [PATCH 065/243] More button boxes and translations --- openlp/core/lib/ui.py | 21 ++++++++++++---- openlp/core/ui/exceptionform.py | 3 +-- openlp/core/ui/filerenamedialog.py | 24 +++++++++---------- openlp/core/ui/filerenameform.py | 6 +---- openlp/core/ui/serviceitemeditdialog.py | 4 ++-- openlp/core/ui/servicenoteform.py | 4 ++-- openlp/core/ui/settingsdialog.py | 10 ++------ openlp/core/ui/thememanager.py | 2 +- .../plugins/custom/forms/editcustomdialog.py | 4 ++-- .../custom/forms/editcustomslidedialog.py | 4 ++-- openlp/plugins/images/lib/mediaitem.py | 14 ++++------- openlp/plugins/media/lib/mediaitem.py | 18 ++++++-------- openlp/plugins/songs/forms/authorsdialog.py | 4 ++-- openlp/plugins/songs/forms/editsongdialog.py | 4 ++-- openlp/plugins/songs/forms/editversedialog.py | 4 ++-- openlp/plugins/songs/forms/songbookdialog.py | 4 ++-- openlp/plugins/songs/forms/songimportform.py | 3 +-- openlp/plugins/songs/forms/topicsdialog.py | 4 ++-- .../songusage/forms/songusagedeletedialog.py | 16 ++++--------- .../songusage/forms/songusagedetaildialog.py | 12 +++------- 20 files changed, 71 insertions(+), 94 deletions(-) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index ec1c324fe..8f6f266e3 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -64,6 +64,10 @@ class UiStrings(object): OLPV2 = translate('OpenLP.Ui', 'OpenLP 2.0') Preview = translate('OpenLP.Ui', 'Preview') PreviewSelect = unicode(translate('OpenLP.Ui', 'Preview the selected %s')) + ReplaceBG = translate('OpenLP.Ui', 'Replace Background') + ReplaceLiveBG = translate('OpenLP.Ui', 'Replace Live Background') + ResetBG = translate('OpenLP.Ui', 'Reset Background') + ResetLiveBG = translate('OpenLP.Ui', 'Reset Live Background') SendSelectLive = unicode(translate('OpenLP.Ui', 'Send the selected %s live')) Service = translate('OpenLP.Ui', 'Service') @@ -98,18 +102,25 @@ def add_welcome_page(parent, image): parent.welcomeLayout.addStretch() parent.addPage(parent.welcomePage) -def create_save_cancel_button_box(parent): +def create_accept_reject_button_box(parent, okay=False): """ - Creates a standard dialog button box with save and cancel buttons. The - button box is connected to the parent's ``accept()`` and ``reject()`` + Creates a standard dialog button box with two buttons. The buttons default + to save and cancel but the ``okay`` parameter can be used to make the + buttons okay and cancel instead. + The button box is connected to the parent's ``accept()`` and ``reject()`` methods to handle the default ``accepted()`` and ``rejected()`` signals. ``parent`` The parent object. This should be a ``QWidget`` descendant. + + ``okay`` + If true creates an okay/cancel combination instead of save/cancel. """ button_box = QtGui.QDialogButtonBox(parent) - button_box.setStandardButtons( - QtGui.QDialogButtonBox.Save | QtGui.QDialogButtonBox.Cancel) + accept_button = QtGui.QDialogButtonBox.Save + if okay: + accept_button = QtGui.QDialogButtonBox.Ok + button_box.setStandardButtons(accept_button | QtGui.QDialogButtonBox.Cancel) button_box.setObjectName(u'%sButtonBox' % parent) QtCore.QObject.connect(button_box, QtCore.SIGNAL(u'accepted()'), parent.accept) diff --git a/openlp/core/ui/exceptionform.py b/openlp/core/ui/exceptionform.py index 7f9e23c61..69803003b 100644 --- a/openlp/core/ui/exceptionform.py +++ b/openlp/core/ui/exceptionform.py @@ -176,8 +176,7 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog): self,translate('ImagePlugin.ExceptionDialog', 'Select Attachment'), SettingsManager.get_last_dir(u'exceptions'), - u'%s (*.*) (*)' % - unicode(translate('ImagePlugin.MediaItem', 'All Files'))) + u'%s (*.*) (*)' % UiStrings.AllFiles) log.info(u'New files(s) %s', unicode(files)) if files: self.fileAttachment = unicode(files) diff --git a/openlp/core/ui/filerenamedialog.py b/openlp/core/ui/filerenamedialog.py index c9a8a7633..147207494 100644 --- a/openlp/core/ui/filerenamedialog.py +++ b/openlp/core/ui/filerenamedialog.py @@ -27,30 +27,28 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate +from openlp.core.lib.ui import create_accept_reject_button_box class Ui_FileRenameDialog(object): - def setupUi(self, FileRenameDialog): - FileRenameDialog.setObjectName(u'FileRenameDialog') - FileRenameDialog.resize(300, 10) - self.dialogLayout = QtGui.QGridLayout(FileRenameDialog) + def setupUi(self, fileRenameDialog): + fileRenameDialog.setObjectName(u'fileRenameDialog') + fileRenameDialog.resize(300, 10) + self.dialogLayout = QtGui.QGridLayout(fileRenameDialog) self.dialogLayout.setObjectName(u'dialogLayout') - self.fileNameLabel = QtGui.QLabel(FileRenameDialog) + self.fileNameLabel = QtGui.QLabel(fileRenameDialog) self.fileNameLabel.setObjectName(u'fileNameLabel') self.dialogLayout.addWidget(self.fileNameLabel, 0, 0) - self.fileNameEdit = QtGui.QLineEdit(FileRenameDialog) + self.fileNameEdit = QtGui.QLineEdit(fileRenameDialog) self.fileNameEdit.setValidator(QtGui.QRegExpValidator( QtCore.QRegExp(r'[^/\\?*|<>\[\]":<>+%]+'), self)) self.fileNameEdit.setObjectName(u'fileNameEdit') self.dialogLayout.addWidget(self.fileNameEdit, 0, 1) - self.buttonBox = QtGui.QDialogButtonBox(FileRenameDialog) - self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel | - QtGui.QDialogButtonBox.Ok) - self.buttonBox.setObjectName(u'buttonBox') + self.buttonBox = create_accept_reject_button_box(fileRenameDialog, True) self.dialogLayout.addWidget(self.buttonBox, 1, 0, 1, 2) - self.retranslateUi(FileRenameDialog) + self.retranslateUi(fileRenameDialog) self.setMaximumHeight(self.sizeHint().height()) - QtCore.QMetaObject.connectSlotsByName(FileRenameDialog) + QtCore.QMetaObject.connectSlotsByName(fileRenameDialog) - def retranslateUi(self, FileRenameDialog): + def retranslateUi(self, fileRenameDialog): self.fileNameLabel.setText(translate('OpenLP.FileRenameForm', 'New File Name:')) diff --git a/openlp/core/ui/filerenameform.py b/openlp/core/ui/filerenameform.py index 86634e3b1..60abe77da 100644 --- a/openlp/core/ui/filerenameform.py +++ b/openlp/core/ui/filerenameform.py @@ -37,10 +37,6 @@ class FileRenameForm(QtGui.QDialog, Ui_FileRenameDialog): def __init__(self, parent): QtGui.QDialog.__init__(self, parent) self.setupUi(self) - QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'accepted()'), - self.accept) - QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'rejected()'), - self.reject) def exec_(self, copy=False): """ @@ -51,5 +47,5 @@ class FileRenameForm(QtGui.QDialog, Ui_FileRenameDialog): 'File Copy')) else: self.setWindowTitle(translate('OpenLP.FileRenameForm', - 'File Rename')) + 'File Rename')) return QtGui.QDialog.exec_(self) diff --git a/openlp/core/ui/serviceitemeditdialog.py b/openlp/core/ui/serviceitemeditdialog.py index f22f3dcf5..ef7e99a5f 100644 --- a/openlp/core/ui/serviceitemeditdialog.py +++ b/openlp/core/ui/serviceitemeditdialog.py @@ -27,7 +27,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate -from openlp.core.lib.ui import create_save_cancel_button_box, \ +from openlp.core.lib.ui import create_accept_reject_button_box, \ create_delete_push_button, create_up_down_push_button_set class Ui_ServiceItemEditDialog(object): @@ -50,7 +50,7 @@ class Ui_ServiceItemEditDialog(object): self.buttonLayout.addWidget(self.downButton) self.dialogLayout.addLayout(self.buttonLayout, 0, 1) self.dialogLayout.addWidget( - create_save_cancel_button_box(serviceItemEditDialog), 1, 0, 1, 2) + create_accept_reject_button_box(serviceItemEditDialog), 1, 0, 1, 2) self.retranslateUi(serviceItemEditDialog) QtCore.QMetaObject.connectSlotsByName(serviceItemEditDialog) diff --git a/openlp/core/ui/servicenoteform.py b/openlp/core/ui/servicenoteform.py index 473cc1685..a12b693f8 100644 --- a/openlp/core/ui/servicenoteform.py +++ b/openlp/core/ui/servicenoteform.py @@ -27,7 +27,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate -from openlp.core.lib.ui import create_save_cancel_button_box +from openlp.core.lib.ui import create_accept_reject_button_box class ServiceNoteForm(QtGui.QDialog): """ @@ -48,7 +48,7 @@ class ServiceNoteForm(QtGui.QDialog): self.textEdit = QtGui.QTextEdit(self) self.textEdit.setObjectName(u'textEdit') self.dialogLayout.addWidget(self.textEdit) - self.dialogLayout.addWidget(create_save_cancel_button_box(self)) + self.dialogLayout.addWidget(create_accept_reject_button_box(self)) QtCore.QMetaObject.connectSlotsByName(self) def retranslateUi(self): diff --git a/openlp/core/ui/settingsdialog.py b/openlp/core/ui/settingsdialog.py index 61c73961c..99acadc14 100644 --- a/openlp/core/ui/settingsdialog.py +++ b/openlp/core/ui/settingsdialog.py @@ -27,6 +27,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate, build_icon +from openlp.core.lib.ui import create_accept_reject_button_box class Ui_SettingsDialog(object): def setupUi(self, settingsDialog): @@ -40,16 +41,9 @@ class Ui_SettingsDialog(object): self.settingsTabWidget = QtGui.QTabWidget(settingsDialog) self.settingsTabWidget.setObjectName(u'settingsTabWidget') self.settingsLayout.addWidget(self.settingsTabWidget) - self.buttonBox = QtGui.QDialogButtonBox(settingsDialog) - self.buttonBox.setStandardButtons( - QtGui.QDialogButtonBox.Cancel | QtGui.QDialogButtonBox.Ok) - self.buttonBox.setObjectName(u'buttonBox') + self.buttonBox = create_accept_reject_button_box(settingsDialog, True) self.settingsLayout.addWidget(self.buttonBox) self.retranslateUi(settingsDialog) - QtCore.QObject.connect(self.buttonBox, - QtCore.SIGNAL(u'accepted()'), settingsDialog.accept) - QtCore.QObject.connect(self.buttonBox, - QtCore.SIGNAL(u'rejected()'), settingsDialog.reject) QtCore.QMetaObject.connectSlotsByName(settingsDialog) def retranslateUi(self, settingsDialog): diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 93a5ef187..67f3ea120 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -406,7 +406,7 @@ class ThemeManager(QtGui.QWidget): translate('OpenLP.ThemeManager', 'Select Theme Import File'), SettingsManager.get_last_dir(self.settingsSection), translate('OpenLP.ThemeManager', 'Theme v1 (*.theme);;' - 'Theme v2 (*.otz);;All Files (*.*)')) + 'Theme v2 (*.otz);;%s (*.*)') % UiStrings.AllFiles) log.info(u'New Themes %s', unicode(files)) if files: for file in files: diff --git a/openlp/plugins/custom/forms/editcustomdialog.py b/openlp/plugins/custom/forms/editcustomdialog.py index 1ca29732b..2e8a64a9d 100644 --- a/openlp/plugins/custom/forms/editcustomdialog.py +++ b/openlp/plugins/custom/forms/editcustomdialog.py @@ -27,7 +27,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import build_icon, translate -from openlp.core.lib.ui import UiStrings, create_save_cancel_button_box, \ +from openlp.core.lib.ui import UiStrings, create_accept_reject_button_box, \ create_delete_push_button, create_up_down_push_button_set class Ui_CustomEditDialog(object): @@ -94,7 +94,7 @@ class Ui_CustomEditDialog(object): self.creditLabel.setBuddy(self.creditEdit) self.bottomFormLayout.addRow(self.creditLabel, self.creditEdit) self.dialogLayout.addLayout(self.bottomFormLayout) - self.buttonBox = create_save_cancel_button_box(customEditDialog) + self.buttonBox = create_accept_reject_button_box(customEditDialog) self.previewButton = QtGui.QPushButton() self.buttonBox.addButton( self.previewButton, QtGui.QDialogButtonBox.ActionRole) diff --git a/openlp/plugins/custom/forms/editcustomslidedialog.py b/openlp/plugins/custom/forms/editcustomslidedialog.py index 24c40d6e6..b70e2bf5e 100644 --- a/openlp/plugins/custom/forms/editcustomslidedialog.py +++ b/openlp/plugins/custom/forms/editcustomslidedialog.py @@ -27,7 +27,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate, SpellTextEdit -from openlp.core.lib.ui import create_save_cancel_button_box +from openlp.core.lib.ui import create_accept_reject_button_box class Ui_CustomSlideEditDialog(object): def setupUi(self, customSlideEditDialog): @@ -37,7 +37,7 @@ class Ui_CustomSlideEditDialog(object): self.slideTextEdit = SpellTextEdit(self) self.slideTextEdit.setObjectName(u'slideTextEdit') self.dialogLayout.addWidget(self.slideTextEdit) - self.buttonBox = create_save_cancel_button_box(customSlideEditDialog) + self.buttonBox = create_accept_reject_button_box(customSlideEditDialog) self.splitButton = QtGui.QPushButton(customSlideEditDialog) self.splitButton.setObjectName(u'splitButton') self.buttonBox.addButton(self.splitButton, diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index 6ec4cf264..9c739e9c1 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -64,15 +64,11 @@ class ImageMediaItem(MediaManagerItem): 'Select Image(s)') file_formats = get_images_filter() self.OnNewFileMasks = u'%s;;%s (*.*) (*)' % (file_formats, - unicode(UiStrings.AllFiles)) - self.replaceAction.setText( - translate('ImagePlugin.MediaItem', 'Replace Background')) - self.replaceAction.setToolTip( - translate('ImagePlugin.MediaItem', 'Replace Live Background')) - self.resetAction.setText( - translate('ImagePlugin.MediaItem', 'Reset Background')) - self.resetAction.setToolTip( - translate('ImagePlugin.MediaItem', 'Reset Live Background')) + UiStrings.AllFiles) + self.replaceAction.setText(UiStrings.ReplaceBG) + self.replaceAction.setToolTip(UiStrings.ReplaceLiveBG) + self.resetAction.setText(UiStrings.ResetBG) + self.resetAction.setToolTip(UiStrings.ResetLiveBG) def requiredIcons(self): MediaManagerItem.requiredIcons(self) diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index f0549a960..d88c8ff14 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -31,7 +31,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \ ItemCapabilities, SettingsManager, translate, check_item_selected, Receiver -from openlp.core.lib.ui import critical_error_message_box +from openlp.core.lib.ui import UiStrings, critical_error_message_box log = logging.getLogger(__name__) @@ -64,16 +64,12 @@ class MediaMediaItem(MediaManagerItem): def retranslateUi(self): self.OnNewPrompt = translate('MediaPlugin.MediaItem', 'Select Media') self.OnNewFileMasks = unicode(translate('MediaPlugin.MediaItem', - 'Videos (%s);;Audio (%s);;All files (*)')) % \ - (self.parent.video_list, self.parent.audio_list) - self.replaceAction.setText( - translate('MediaPlugin.MediaItem', 'Replace Background')) - self.replaceAction.setToolTip( - translate('MediaPlugin.MediaItem', 'Replace Live Background')) - self.resetAction.setText( - translate('MediaPlugin.MediaItem', 'Reset Background')) - self.resetAction.setToolTip( - translate('ImagePlugin.MediaItem', 'Reset Live Background')) + 'Videos (%s);;Audio (%s);;%s (*)')) % (self.parent.video_list, + self.parent.audio_list, UiStrings.AllFiles) + self.replaceAction.setText(UiStrings.ReplaceBG) + self.replaceAction.setToolTip(UiStrings.ReplaceLiveBG) + self.resetAction.setText(UiStrings.ResetBG) + self.resetAction.setToolTip(UiStrings.ResetLiveBG) def requiredIcons(self): MediaManagerItem.requiredIcons(self) diff --git a/openlp/plugins/songs/forms/authorsdialog.py b/openlp/plugins/songs/forms/authorsdialog.py index 0b3f791d1..09c723364 100644 --- a/openlp/plugins/songs/forms/authorsdialog.py +++ b/openlp/plugins/songs/forms/authorsdialog.py @@ -27,7 +27,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate -from openlp.core.lib.ui import create_save_cancel_button_box +from openlp.core.lib.ui import create_accept_reject_button_box class Ui_AuthorsDialog(object): def setupUi(self, authorsDialog): @@ -57,7 +57,7 @@ class Ui_AuthorsDialog(object): self.authorLayout.addRow(self.displayLabel, self.displayEdit) self.dialogLayout.addLayout(self.authorLayout) self.dialogLayout.addWidget( - create_save_cancel_button_box(authorsDialog)) + create_accept_reject_button_box(authorsDialog)) self.retranslateUi(authorsDialog) authorsDialog.setMaximumHeight(authorsDialog.sizeHint().height()) QtCore.QMetaObject.connectSlotsByName(authorsDialog) diff --git a/openlp/plugins/songs/forms/editsongdialog.py b/openlp/plugins/songs/forms/editsongdialog.py index 6854a17ae..234d92283 100644 --- a/openlp/plugins/songs/forms/editsongdialog.py +++ b/openlp/plugins/songs/forms/editsongdialog.py @@ -27,7 +27,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import build_icon, translate -from openlp.core.lib.ui import UiStrings, create_save_cancel_button_box +from openlp.core.lib.ui import UiStrings, create_accept_reject_button_box class Ui_EditSongDialog(object): def setupUi(self, editSongDialog): @@ -241,7 +241,7 @@ class Ui_EditSongDialog(object): self.themeTabLayout.addWidget(self.commentsGroupBox) self.songTabWidget.addTab(self.themeTab, u'') self.dialogLayout.addWidget(self.songTabWidget) - self.buttonBox = create_save_cancel_button_box(editSongDialog) + self.buttonBox = create_accept_reject_button_box(editSongDialog) self.dialogLayout.addWidget(self.buttonBox) self.retranslateUi(editSongDialog) QtCore.QMetaObject.connectSlotsByName(editSongDialog) diff --git a/openlp/plugins/songs/forms/editversedialog.py b/openlp/plugins/songs/forms/editversedialog.py index b4bc4551f..7caf782e6 100644 --- a/openlp/plugins/songs/forms/editversedialog.py +++ b/openlp/plugins/songs/forms/editversedialog.py @@ -27,7 +27,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import build_icon, translate, SpellTextEdit -from openlp.core.lib.ui import create_save_cancel_button_box +from openlp.core.lib.ui import create_accept_reject_button_box from openlp.plugins.songs.lib import VerseType class Ui_EditVerseDialog(object): @@ -61,7 +61,7 @@ class Ui_EditVerseDialog(object): self.verseTypeLayout.addStretch() self.dialogLayout.addLayout(self.verseTypeLayout) self.dialogLayout.addWidget( - create_save_cancel_button_box(editVerseDialog)) + create_accept_reject_button_box(editVerseDialog)) self.retranslateUi(editVerseDialog) QtCore.QMetaObject.connectSlotsByName(editVerseDialog) diff --git a/openlp/plugins/songs/forms/songbookdialog.py b/openlp/plugins/songs/forms/songbookdialog.py index 89b8941b5..f6dd3930c 100644 --- a/openlp/plugins/songs/forms/songbookdialog.py +++ b/openlp/plugins/songs/forms/songbookdialog.py @@ -27,7 +27,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate -from openlp.core.lib.ui import create_save_cancel_button_box +from openlp.core.lib.ui import create_accept_reject_button_box class Ui_SongBookDialog(object): def setupUi(self, songBookDialog): @@ -51,7 +51,7 @@ class Ui_SongBookDialog(object): self.bookLayout.addRow(self.publisherLabel, self.publisherEdit) self.dialogLayout.addLayout(self.bookLayout) self.dialogLayout.addWidget( - create_save_cancel_button_box(songBookDialog)) + create_accept_reject_button_box(songBookDialog)) self.retranslateUi(songBookDialog) songBookDialog.setMaximumHeight(songBookDialog.sizeHint().height()) QtCore.QMetaObject.connectSlotsByName(songBookDialog) diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index 8cd8c70fa..e85426a8f 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -460,8 +460,7 @@ class SongImportForm(OpenLPWizard): """ if filters: filters += u';;' - filters += u'%s (*)' % translate('SongsPlugin.ImportWizardForm', - 'All Files') + filters += u'%s (*)' % UiStrings.AllFiles filename = QtGui.QFileDialog.getOpenFileName(self, title, SettingsManager.get_last_dir(self.plugin.settingsSection, 1), filters) diff --git a/openlp/plugins/songs/forms/topicsdialog.py b/openlp/plugins/songs/forms/topicsdialog.py index 596597034..1e7bdb6a0 100644 --- a/openlp/plugins/songs/forms/topicsdialog.py +++ b/openlp/plugins/songs/forms/topicsdialog.py @@ -27,7 +27,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate -from openlp.core.lib.ui import create_save_cancel_button_box +from openlp.core.lib.ui import create_accept_reject_button_box class Ui_TopicsDialog(object): def setupUi(self, topicsDialog): @@ -45,7 +45,7 @@ class Ui_TopicsDialog(object): self.nameLayout.addRow(self.nameLabel, self.nameEdit) self.dialogLayout.addLayout(self.nameLayout) self.dialogLayout.addWidget( - create_save_cancel_button_box(topicsDialog)) + create_accept_reject_button_box(topicsDialog)) self.retranslateUi(topicsDialog) topicsDialog.setMaximumHeight(topicsDialog.sizeHint().height()) QtCore.QMetaObject.connectSlotsByName(topicsDialog) diff --git a/openlp/plugins/songusage/forms/songusagedeletedialog.py b/openlp/plugins/songusage/forms/songusagedeletedialog.py index af85ad5a9..9dc4219fc 100644 --- a/openlp/plugins/songusage/forms/songusagedeletedialog.py +++ b/openlp/plugins/songusage/forms/songusagedeletedialog.py @@ -25,7 +25,9 @@ ############################################################################### from PyQt4 import QtCore, QtGui + from openlp.core.lib import translate +from openlp.core.lib.ui import create_accept_reject_button_box class Ui_SongUsageDeleteDialog(object): def setupUi(self, songUsageDeleteDialog): @@ -43,22 +45,14 @@ class Ui_SongUsageDeleteDialog(object): QtGui.QCalendarWidget.NoVerticalHeader) self.deleteCalendar.setObjectName(u'deleteCalendar') self.verticalLayout.addWidget(self.deleteCalendar) - self.buttonBox = QtGui.QDialogButtonBox(songUsageDeleteDialog) + self.buttonBox = create_accept_reject_button_box( + songUsageDeleteDialog, True) self.buttonBox.setGeometry(QtCore.QRect(30, 210, 245, 25)) - self.buttonBox.setStandardButtons( - QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) self.buttonBox.setObjectName(u'buttonBox') - self.retranslateUi(songUsageDeleteDialog) - QtCore.QObject.connect( - self.buttonBox, QtCore.SIGNAL(u'accepted()'), - songUsageDeleteDialog.accept) - QtCore.QObject.connect( - self.buttonBox, QtCore.SIGNAL(u'rejected()'), - songUsageDeleteDialog.close) QtCore.QMetaObject.connectSlotsByName(songUsageDeleteDialog) def retranslateUi(self, songUsageDeleteDialog): songUsageDeleteDialog.setWindowTitle( translate('SongUsagePlugin.SongUsageDeleteForm', - 'Delete Song Usage Data')) \ No newline at end of file + 'Delete Song Usage Data')) diff --git a/openlp/plugins/songusage/forms/songusagedetaildialog.py b/openlp/plugins/songusage/forms/songusagedetaildialog.py index ec1f69d7e..322e3eb4b 100644 --- a/openlp/plugins/songusage/forms/songusagedetaildialog.py +++ b/openlp/plugins/songusage/forms/songusagedetaildialog.py @@ -27,6 +27,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import build_icon, translate +from openlp.core.lib.ui import create_accept_reject_button_box class Ui_SongUsageDetailDialog(object): def setupUi(self, songUsageDetailDialog): @@ -71,17 +72,10 @@ class Ui_SongUsageDetailDialog(object): self.verticalLayout4.addLayout(self.horizontalLayout) self.verticalLayout2.addWidget(self.fileGroupBox) self.verticalLayout.addWidget(self.dateRangeGroupBox) - self.buttonBox = QtGui.QDialogButtonBox(songUsageDetailDialog) - self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel | - QtGui.QDialogButtonBox.Ok) - self.buttonBox.setObjectName(u'buttonBox') + self.buttonBox = create_accept_reject_button_box( + songUsageDetailDialog, True) self.verticalLayout.addWidget(self.buttonBox) - self.retranslateUi(songUsageDetailDialog) - QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'accepted()'), - songUsageDetailDialog.accept) - QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'rejected()'), - songUsageDetailDialog.close) QtCore.QObject.connect(self.saveFilePushButton, QtCore.SIGNAL(u'pressed()'), songUsageDetailDialog.defineOutputLocation) From ae475df74b0fbec335cf6036fa6fb99e84eceb69 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 10 Feb 2011 00:37:04 +0000 Subject: [PATCH 066/243] Fix import --- openlp/core/ui/exceptionform.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openlp/core/ui/exceptionform.py b/openlp/core/ui/exceptionform.py index 69803003b..f0c1c9ab0 100644 --- a/openlp/core/ui/exceptionform.py +++ b/openlp/core/ui/exceptionform.py @@ -56,6 +56,7 @@ except ImportError: from openlp.core.lib import translate, SettingsManager from openlp.core.lib.mailto import mailto +from openlp.core.lib.ui import UiStrings from exceptiondialog import Ui_ExceptionDialog From 0b83c7180f3c83d0cd393b5efc3104d6fd3fa6de Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 10 Feb 2011 04:06:16 +0000 Subject: [PATCH 067/243] UiStrings updates --- openlp/core/lib/mediamanageritem.py | 2 +- openlp/core/lib/ui.py | 16 +++++++++------- openlp/core/ui/advancedtab.py | 3 ++- openlp/core/ui/mainwindow.py | 5 ++--- openlp/core/ui/servicemanager.py | 6 +++--- openlp/core/ui/thememanager.py | 2 +- openlp/plugins/bibles/lib/mediaitem.py | 7 +++---- .../plugins/presentations/lib/presentationtab.py | 5 ++--- 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index cc80ad564..65f6c955b 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -500,7 +500,7 @@ class MediaManagerItem(QtGui.QWidget): """ if not self.listView.selectedIndexes() and not self.remoteTriggered: QtGui.QMessageBox.information(self, - translate('OpenLP.MediaManagerItem', 'No items selected'), + translate('OpenLP.MediaManagerItem', 'No Items Selected'), translate('OpenLP.MediaManagerItem', 'You must select one or more items')) else: diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 8f6f266e3..2eb74c455 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -41,16 +41,18 @@ class UiStrings(object): # These strings should need a good reason to be retranslated elsewhere. # Should some/more/less of these have an & attached? Add = translate('OpenLP.Ui', '&Add') - AddANew = unicode(translate('OpenLP.Ui', 'Add a new %s')) + AddANew = unicode(translate('OpenLP.Ui', 'Add a new %s.')) AddSelectService = unicode(translate('OpenLP.Ui', - 'Add the selected %s to the service')) + 'Add the selected %s to the service.')) + Advanced = translate('OpenLP.Ui', 'Advanced') AllFiles = translate('OpenLP.Ui', 'All Files') Authors = translate('OpenLP.Ui', 'Authors') + CreateANew = unicode(translate('OpenLP.Ui', 'Create a new %s.')) Delete = translate('OpenLP.Ui', '&Delete') - DeleteSelect = unicode(translate('OpenLP.Ui', 'Delete the selected %s')) + DeleteSelect = unicode(translate('OpenLP.Ui', 'Delete the selected %s.')) DeleteType = unicode(translate('OpenLP.Ui', 'Delete %s')) Edit = translate('OpenLP.Ui', '&Edit') - EditSelect = unicode(translate('OpenLP.Ui', 'Edit the selected %s')) + EditSelect = unicode(translate('OpenLP.Ui', 'Edit the selected %s.')) EditType = unicode(translate('OpenLP.Ui', 'Edit %s')) Error = translate('OpenLP.Ui', 'Error') ExportType = unicode(translate('OpenLP.Ui', 'Export %s')) @@ -58,18 +60,18 @@ class UiStrings(object): ImportType = unicode(translate('OpenLP.Ui', 'Import %s')) Live = translate('OpenLP.Ui', 'Live') Load = translate('OpenLP.Ui', 'Load') - LoadANew = unicode(translate('OpenLP.Ui', 'Load a new %s')) + LoadANew = unicode(translate('OpenLP.Ui', 'Load a new %s.')) New = translate('OpenLP.Ui', 'New') NewType = unicode(translate('OpenLP.Ui', 'New %s')) OLPV2 = translate('OpenLP.Ui', 'OpenLP 2.0') Preview = translate('OpenLP.Ui', 'Preview') - PreviewSelect = unicode(translate('OpenLP.Ui', 'Preview the selected %s')) + PreviewSelect = unicode(translate('OpenLP.Ui', 'Preview the selected %s.')) ReplaceBG = translate('OpenLP.Ui', 'Replace Background') ReplaceLiveBG = translate('OpenLP.Ui', 'Replace Live Background') ResetBG = translate('OpenLP.Ui', 'Reset Background') ResetLiveBG = translate('OpenLP.Ui', 'Reset Live Background') SendSelectLive = unicode(translate('OpenLP.Ui', - 'Send the selected %s live')) + 'Send the selected %s live.')) Service = translate('OpenLP.Ui', 'Service') Theme = translate('OpenLP.Ui', 'Theme') Themes = translate('OpenLP.Ui', 'Themes') diff --git a/openlp/core/ui/advancedtab.py b/openlp/core/ui/advancedtab.py index 58b637bc2..918335b2e 100644 --- a/openlp/core/ui/advancedtab.py +++ b/openlp/core/ui/advancedtab.py @@ -29,6 +29,7 @@ The :mod:`advancedtab` provides an advanced settings facility. from PyQt4 import QtCore, QtGui from openlp.core.lib import SettingsTab, translate +from openlp.core.lib.ui import UiStrings class AdvancedTab(SettingsTab): """ @@ -112,7 +113,7 @@ class AdvancedTab(SettingsTab): """ Setup the interface translation strings. """ - self.tabTitleVisible = translate('OpenLP.AdvancedTab', 'Advanced') + self.tabTitleVisible = UiStrings.Advanced self.uiGroupBox.setTitle(translate('OpenLP.AdvancedTab', 'UI Settings')) self.recentLabel.setText( translate('OpenLP.AdvancedTab', diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index c87a9544a..c329abb7d 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -315,10 +315,9 @@ class Ui_MainWindow(object): self.themeManagerDock.setWindowTitle( translate('OpenLP.MainWindow', 'Theme Manager')) self.FileNewItem.setText(translate('OpenLP.MainWindow', '&New')) - self.FileNewItem.setToolTip( - translate('OpenLP.MainWindow', 'New Service')) + self.FileNewItem.setToolTip(UiStrings.NewType % UiStrings.Service) self.FileNewItem.setStatusTip( - translate('OpenLP.MainWindow', 'Create a new service.')) + UiStrings.CreateANew % UiStrings.Service.toLower()) self.FileNewItem.setShortcut(translate('OpenLP.MainWindow', 'Ctrl+N')) self.FileOpenItem.setText(translate('OpenLP.MainWindow', '&Open')) self.FileOpenItem.setToolTip( diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 83d7cbc3c..cebb119ed 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -35,7 +35,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import OpenLPToolbar, ServiceItem, context_menu_action, \ Receiver, build_icon, ItemCapabilities, SettingsManager, translate, \ ThemeLevel -from openlp.core.lib.ui import critical_error_message_box +from openlp.core.lib.ui import UiStrings, critical_error_message_box from openlp.core.ui import ServiceNoteForm, ServiceItemEditForm from openlp.core.ui.printserviceorderform import PrintServiceOrderForm from openlp.core.utils import AppLocation, delete_file, file_is_unicode, \ @@ -95,9 +95,9 @@ class ServiceManager(QtGui.QWidget): # Create the top toolbar self.toolbar = OpenLPToolbar(self) self.toolbar.addToolbarButton( - translate('OpenLP.ServiceManager', 'New Service'), + UiStrings.NewType % UiStrings.Service, u':/general/general_new.png', - translate('OpenLP.ServiceManager', 'Create a new service'), + UiStrings.CreateANew % UiStrings.Service.toLower(), self.onNewServiceClicked) self.toolbar.addToolbarButton( translate('OpenLP.ServiceManager', 'Open Service'), diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 67f3ea120..d3f8da56c 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -64,7 +64,7 @@ class ThemeManager(QtGui.QWidget): self.toolbar.addToolbarButton( UiStrings.NewType % UiStrings.Theme, u':/themes/theme_new.png', - translate('OpenLP.ThemeManager', 'Create a new theme.'), + UiStrings.CreateANew % UiStrings.Theme.toLower(), self.onAddTheme) self.toolbar.addToolbarButton( UiStrings.EditType % UiStrings.Theme, diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index c162447b2..788eaea3c 100644 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -30,8 +30,8 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, Receiver, BaseListWithDnD, \ ItemCapabilities, translate -from openlp.core.lib.ui import add_widget_completer, media_item_combo_box, \ - critical_error_message_box +from openlp.core.lib.ui import UiStrings, add_widget_completer, \ + media_item_combo_box, critical_error_message_box from openlp.plugins.bibles.forms import BibleImportForm from openlp.plugins.bibles.lib import get_reference_match @@ -192,8 +192,7 @@ class BibleMediaItem(MediaManagerItem): self.advancedSearchButtonLayout.addWidget(self.advancedSearchButton) self.advancedLayout.addLayout( self.advancedSearchButtonLayout, 7, 0, 1, 3) - self.searchTabWidget.addTab(self.advancedTab, - translate('BiblesPlugin.MediaItem', 'Advanced')) + self.searchTabWidget.addTab(self.advancedTab, UiStrings.Advanced) # Add the search tab widget to the page layout. self.pageLayout.addWidget(self.searchTabWidget) # Combo Boxes diff --git a/openlp/plugins/presentations/lib/presentationtab.py b/openlp/plugins/presentations/lib/presentationtab.py index fc82600df..fdb66c511 100644 --- a/openlp/plugins/presentations/lib/presentationtab.py +++ b/openlp/plugins/presentations/lib/presentationtab.py @@ -27,6 +27,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import Receiver, SettingsTab, translate +from openlp.core.lib.ui import UiStrings class PresentationTab(SettingsTab): """ @@ -85,9 +86,7 @@ class PresentationTab(SettingsTab): checkbox.setText( unicode(translate('PresentationPlugin.PresentationTab', '%s (unvailable)')) % controller.name) - self.AdvancedGroupBox.setTitle( - translate('PresentationPlugin.PresentationTab', - 'Advanced')) + self.AdvancedGroupBox.setTitle(UiStrings.Advanced) self.OverrideAppCheckBox.setText( translate('PresentationPlugin.PresentationTab', 'Allow presentation application to be overriden')) From 76fd92b01a02799abc35e89dfe164c40f7520906 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 10 Feb 2011 04:19:38 +0000 Subject: [PATCH 068/243] Handle Impress errors better --- .../presentations/lib/impresscontroller.py | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/openlp/plugins/presentations/lib/impresscontroller.py b/openlp/plugins/presentations/lib/impresscontroller.py index 7de095d54..38058f2c5 100644 --- a/openlp/plugins/presentations/lib/impresscontroller.py +++ b/openlp/plugins/presentations/lib/impresscontroller.py @@ -145,7 +145,12 @@ class ImpressController(PresentationController): log.debug(u'get COM Desktop OpenOffice') if not self.manager: return None - return self.manager.createInstance(u'com.sun.star.frame.Desktop') + desktop = None + try: + desktop = self.manager.createInstance(u'com.sun.star.frame.Desktop') + except AttributeError: + log.exception(u'Failure to find desktop - Impress may have closed') + return desktop if desktop else None def get_com_servicemanager(self): """ @@ -166,14 +171,17 @@ class ImpressController(PresentationController): log.debug(u'Kill OpenOffice') while self.docs: self.docs[0].close_presentation() - if os.name != u'nt': - desktop = self.get_uno_desktop() - else: - desktop = self.get_com_desktop() - #Sometimes we get a failure and desktop is None - if not desktop: + desktop = None + try: + if os.name != u'nt': + desktop = self.get_uno_desktop() + else: + desktop = self.get_com_desktop() + except: log.exception(u'Failed to find an OpenOffice desktop to terminate') - return + finally: + if not desktop: + return docs = desktop.getComponents() if docs.hasElements(): log.debug(u'OpenOffice not terminated as docs are still open') From 8abfd2ce14384a4f9e86112a26338f18fe897c80 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Thu, 10 Feb 2011 07:25:08 +0200 Subject: [PATCH 069/243] Fix docstrings and update documentation. --- documentation/api/source/openlp.rst | 7 - documentation/api/source/plugins/bibles.rst | 2 +- openlp/core/ui/servicemanager.py | 2 +- openlp/plugins/bibles/lib/__init__.py | 134 ++++++++++++-------- openlp/plugins/songs/lib/songimport.py | 4 +- openlp/plugins/songs/lib/xml.py | 43 ++++--- 6 files changed, 105 insertions(+), 87 deletions(-) delete mode 100644 documentation/api/source/openlp.rst diff --git a/documentation/api/source/openlp.rst b/documentation/api/source/openlp.rst deleted file mode 100644 index 76a1a2098..000000000 --- a/documentation/api/source/openlp.rst +++ /dev/null @@ -1,7 +0,0 @@ -.. _openlp: - -:mod:`openlp` Module -==================== - -.. automodule:: openlp - :members: diff --git a/documentation/api/source/plugins/bibles.rst b/documentation/api/source/plugins/bibles.rst index 67162d414..c89f9c6ae 100644 --- a/documentation/api/source/plugins/bibles.rst +++ b/documentation/api/source/plugins/bibles.rst @@ -18,7 +18,7 @@ Forms .. automodule:: openlp.plugins.bibles.forms :members: -.. autoclass:: openlp.plugins.bibles.forms.importwizardform.ImportWizardForm +.. autoclass:: openlp.plugins.bibles.forms.bibleimportform.BibleImportForm :members: Helper Classes & Functions diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 4d36f4aec..eb08be377 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -461,7 +461,7 @@ class ServiceManager(QtGui.QWidget): def saveFileAs(self): """ - Get a file name and then call :function:`ServiceManager.saveFile` to + Get a file name and then call :func:`ServiceManager.saveFile` to save the file. """ fileName = unicode(QtGui.QFileDialog.getSaveFileName(self.mainwindow, diff --git a/openlp/plugins/bibles/lib/__init__.py b/openlp/plugins/bibles/lib/__init__.py index e6fff1cc8..496535461 100644 --- a/openlp/plugins/bibles/lib/__init__.py +++ b/openlp/plugins/bibles/lib/__init__.py @@ -62,69 +62,90 @@ def get_reference_match(match_type): def parse_reference(reference): """ This is the next generation über-awesome function that takes a person's - typed in string and converts it to a reference list, a list of references to - be queried from the Bible database files. + typed in string and converts it to a list of references to be queried from + the Bible database files. - This is a user manual like description, how the references are working. + ``reference`` + A string. The Bible reference to parse. - - Each reference starts with the book name. A chapter name is manditory. - ``John 3`` refers to Gospel of John chapter 3 - - A reference range can be given after a range separator. - ``John 3-5`` refers to John chapters 3 to 5 - - Single verses can be addressed after a verse separator - ``John 3:16`` refers to John chapter 3 verse 16 - ``John 3:16-4:3`` refers to John chapter 3 verse 16 to chapter 4 verse 3 - - After a verse reference all further single values are treat as verse in - the last selected chapter. - ``John 3:16-18`` refers to John chapter 3 verses 16 to 18 - - After a list separator it is possible to refer to additional verses. They - are build analog to the first ones. This way it is possible to define each - number of verse references. It is not possible to refer to verses in - additional books. - ``John 3:16,18`` refers to John chapter 3 verses 16 and 18 - ``John 3:16-18,20`` refers to John chapter 3 verses 16 to 18 and 20 - ``John 3:16-18,4:1`` refers to John chapter 3 verses 16 to 18 and - chapter 3 verse 1 - - If there is a range separator without further verse declaration the last - refered chapter is addressed until the end. - - ``range_string`` is a regular expression which matches for verse range - declarations: - - 1. ``(?:(?P[0-9]+)%(sep_v)s)?`` - It starts with a optional chapter reference ``from_chapter`` followed by - a verse separator. - 2. ``(?P[0-9]+)`` - The verse reference ``from_verse`` is manditory - 3. ``(?P%(sep_r)s(?:`` ... ``|%(sep_e)s)?)?`` - A ``range_to`` declaration is optional. It starts with a range separator - and contains optional a chapter and verse declaration or a end - separator. - 4. ``(?:(?P[0-9]+)%(sep_v)s)?`` - The ``to_chapter`` reference with separator is equivalent to group 1. - 5. ``(?P[0-9]+)`` - The ``to_verse`` reference is equivalent to group 2. - - The full reference is matched against get_reference_match(u'full'). This - regular expression looks like this: - - 1. ``^\s*(?!\s)(?P[\d]*[^\d]+)(?(?:`` + range_string + ``(?:%(sep_l)s|(?=\s*$)))+)\s*$`` - The second group contains all ``ranges``. This can be multiple - declarations of a range_string separated by a list separator. + Returns ``None`` or a reference list. The reference list is a list of tuples, with each tuple structured like this:: (book, chapter, from_verse, to_verse) + + For example:: + + [(u'John', 3, 16, 18), (u'John', 4, 1, 1)] - ``reference`` - The bible reference to parse. + **Reference string details:** + + Each reference starts with the book name and a chapter number. These are + both mandatory. + + * ``John 3`` refers to Gospel of John chapter 3 + + A reference range can be given after a range separator. + + * ``John 3-5`` refers to John chapters 3 to 5 + + Single verses can be addressed after a verse separator. + + * ``John 3:16`` refers to John chapter 3 verse 16 + * ``John 3:16-4:3`` refers to John chapter 3 verse 16 to chapter 4 verse 3 + + After a verse reference all further single values are treat as verse in + the last selected chapter. + + * ``John 3:16-18`` refers to John chapter 3 verses 16 to 18 + + After a list separator it is possible to refer to additional verses. They + are build analog to the first ones. This way it is possible to define each + number of verse references. It is not possible to refer to verses in + additional books. + + * ``John 3:16,18`` refers to John chapter 3 verses 16 and 18 + * ``John 3:16-18,20`` refers to John chapter 3 verses 16 to 18 and 20 + * ``John 3:16-18,4:1`` refers to John chapter 3 verses 16 to 18 and + chapter 4 verse 1 + + If there is a range separator without further verse declaration the last + refered chapter is addressed until the end. + + ``range_string`` is a regular expression which matches for verse range + declarations: + + ``(?:(?P[0-9]+)%(sep_v)s)?`` + It starts with a optional chapter reference ``from_chapter`` followed by + a verse separator. + + ``(?P[0-9]+)`` + The verse reference ``from_verse`` is manditory + + ``(?P%(sep_r)s(?:`` ... ``|%(sep_e)s)?)?`` + A ``range_to`` declaration is optional. It starts with a range separator + and contains optional a chapter and verse declaration or a end + separator. + + ``(?:(?P[0-9]+)%(sep_v)s)?`` + The ``to_chapter`` reference with separator is equivalent to group 1. + + ``(?P[0-9]+)`` + The ``to_verse`` reference is equivalent to group 2. + + The full reference is matched against get_reference_match(u'full'). This + regular expression looks like this: + + ``^\s*(?!\s)(?P[\d]*[^\d]+)(?(?:`` + range_string + ``(?:%(sep_l)s|(?=\s*$)))+)\s*$`` + The second group contains all ``ranges``. This can be multiple + declarations of a range_string separated by a list separator. - Returns None or a reference list. """ log.debug(u'parse_reference("%s")', reference) match = get_reference_match(u'full').match(reference) @@ -194,7 +215,7 @@ def parse_reference(reference): class SearchResults(object): """ - Encapsulate a set of search results. This is Bible-type independent. + Encapsulate a set of search results. This is Bible-type independent. """ def __init__(self, book, chapter, verselist): """ @@ -207,7 +228,8 @@ class SearchResults(object): The chapter of the book. ``verselist`` - The list of verses for this reading + The list of verses for this reading. + """ self.book = book self.chapter = chapter diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index 592aa7ac1..da017d4f5 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -50,6 +50,7 @@ class SongImport(QtCore.QObject): ``manager`` An instance of a SongManager, through which all database access is performed. + """ self.manager = manager self.stop_import_flag = False @@ -199,7 +200,7 @@ class SongImport(QtCore.QObject): def add_verse(self, versetext, versetag=u'V', lang=None): """ - Add a verse. This is the whole verse, lines split by \n. It will also + Add a verse. This is the whole verse, lines split by \\n. It will also attempt to detect duplicates. In this case it will just add to the verse order. @@ -212,6 +213,7 @@ class SongImport(QtCore.QObject): ``lang`` The language code (ISO-639) of the verse, for example *en* or *de*. + """ for (oldversetag, oldverse, oldlang) in self.verses: if oldverse.strip() == versetext.strip(): diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index 91bfdb025..4bf11887a 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -26,7 +26,7 @@ """ The :mod:`xml` module provides the XML functionality. -The basic XML for storing the lyrics in the song database is of the format:: +The basic XML for storing the lyrics in the song database looks like this:: @@ -38,7 +38,7 @@ The basic XML for storing the lyrics in the song database is of the format:: -The XML of `OpenLyrics `_ songs is of the format:: +The XML of an `OpenLyrics `_ song looks like this:: * tag. + Add a verse to the ```` tag. ``type`` A string denoting the type of verse. Possible values are "V", @@ -158,59 +158,60 @@ class OpenLyrics(object): to/from a song. As OpenLyrics has a rich set of different features, we cannot support them - all. The following features are supported by the :class:`OpenLyrics`:: + all. The following features are supported by the :class:`OpenLyrics` class: - ** + ```` OpenLP does not support the attribute *type* and *lang*. - ** + ```` This property is not supported. - ** - The ** property is fully supported. But comments in lyrics + ```` + The ```` property is fully supported. But comments in lyrics are not supported. - ** + ```` This property is fully supported. - ** + ```` This property is not supported. - ** + ```` This property is not supported. - ** + ```` This property is not supported. - ** + ```` The attribute *part* is not supported. - ** + ```` This property is not supported. - ** + ```` As OpenLP does only support one songbook, we cannot consider more than one songbook. - ** + ```` This property is not supported. - ** + ```` Topics, as they are called in OpenLP, are fully supported, whereby only the topic text (e. g. Grace) is considered, but neither the *id* nor *lang*. - ** + ```` This property is not supported. - ** + ```` This property is not supported. - ** + ```` The attribute *translit* is not supported. - ** + ```` OpenLP supports this property. + """ def __init__(self, manager): self.manager = manager From e52cae13fd38e87a68dcfee357369a4c02761cd1 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Thu, 10 Feb 2011 08:36:41 +0200 Subject: [PATCH 070/243] Some conditional configuration. --- documentation/manual/source/conf.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/documentation/manual/source/conf.py b/documentation/manual/source/conf.py index 70b4fb2f6..f0d918c11 100644 --- a/documentation/manual/source/conf.py +++ b/documentation/manual/source/conf.py @@ -48,7 +48,7 @@ copyright = u'2004-2010 Raoul Snyman' # The short X.Y version. version = '2.0' # The full version, including alpha/beta/rc tags. -release = '1.9.3' +release = '1.9.5' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -92,19 +92,21 @@ pygments_style = 'sphinx' # The theme to use for HTML and HTML Help pages. Major themes that come with # Sphinx are currently 'default' and 'sphinxdoc'. -html_theme = 'openlp_qthelp' +#html_theme = 'openlp_qthelp' +html_theme = 'default' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. -#html_theme_options = { -# 'sidebarbgcolor': '#3a60a9', -# 'relbarbgcolor': '#203b6f', -# 'footerbgcolor': '#26437c', -# 'headtextcolor': '#203b6f', -# 'linkcolor': '#26437c', -# 'sidebarlinkcolor': '#ceceff' -#} +if html_theme == 'default': + html_theme_options = { + 'sidebarbgcolor': '#3a60a9', + 'relbarbgcolor': '#203b6f', + 'footerbgcolor': '#26437c', + 'headtextcolor': '#203b6f', + 'linkcolor': '#26437c', + 'sidebarlinkcolor': '#ceceff' + } # Add any paths that contain custom themes here, relative to this directory. html_theme_path = [u'../themes'] From 8498b3e2ae4380f3fbed7a965570331702c862ee Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Thu, 10 Feb 2011 18:11:14 +0100 Subject: [PATCH 071/243] --- openlp/plugins/songs/songsplugin.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 37f11582a..2bd636097 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -149,12 +149,14 @@ class SongsPlugin(Plugin): counter += 1 # The song does not have any author, add one. if not song.authors: - name = unicode(translate('SongsPlugin', 'Author unknown')) + name = unicode(translate('SongsPlugin', 'Author unknown', + 'Translation must contain a blank character!')) author = self.manager.get_object_filtered(Author, Author.display_name == name) if author is None: - author = Author.populate(first_name=name.rsplit(u' ', 1)[0], - last_name=name.rsplit(u' ', 1)[1], display_name=name) + author = Author.populate( + first_name=name.split(u' ', 1)[:-1], + last_name=name.split(u' ', 1)[-1], display_name=name) song.authors.append(author) if song.title is None: song.title = u'' From abc33c48111d9a1ab3bd49d8d1d3e5928e3d712b Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Thu, 10 Feb 2011 18:42:13 +0100 Subject: [PATCH 072/243] do not add empty 'entry' property --- openlp/plugins/songs/lib/xml.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index 73ac8120c..b96e79961 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -263,7 +263,8 @@ class OpenLyrics(object): songbooks = etree.SubElement(properties, u'songbooks') element = self._add_text_to_element( u'songbook', songbooks, None, book) - element.set(u'entry', song.song_number) + if song.song_number: + element.set(u'entry', song.song_number) if song.topics: themes = etree.SubElement(properties, u'themes') for topic in song.topics: From e4d317306cdb598f855c07422e5e65ff2040377b Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 10 Feb 2011 18:38:03 +0000 Subject: [PATCH 073/243] Refactor ListViews --- openlp/core/lib/__init__.py | 2 +- openlp/core/lib/baselistwithdnd.py | 11 ++++++----- openlp/core/lib/mediamanageritem.py | 9 ++------- openlp/plugins/bibles/lib/mediaitem.py | 14 ++------------ openlp/plugins/custom/lib/mediaitem.py | 12 ++---------- openlp/plugins/images/lib/mediaitem.py | 16 +++------------- openlp/plugins/media/lib/mediaitem.py | 13 ++----------- openlp/plugins/presentations/lib/mediaitem.py | 18 ++---------------- openlp/plugins/songs/lib/mediaitem.py | 11 ++--------- 9 files changed, 22 insertions(+), 84 deletions(-) diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index 33280f83b..644f0a4c6 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -319,6 +319,7 @@ def check_directory_exists(dir): if not os.path.exists(dir): os.makedirs(dir) +from baselistwithdnd import BaseListWithDnD from theme import ThemeLevel, ThemeXML, BackgroundGradientType, \ BackgroundType, HorizontalType, VerticalType from displaytags import DisplayTags @@ -339,4 +340,3 @@ from dockwidget import OpenLPDockWidget from renderer import Renderer from rendermanager import RenderManager from mediamanageritem import MediaManagerItem -from baselistwithdnd import BaseListWithDnD diff --git a/openlp/core/lib/baselistwithdnd.py b/openlp/core/lib/baselistwithdnd.py index 86535f6e7..3bc91d577 100644 --- a/openlp/core/lib/baselistwithdnd.py +++ b/openlp/core/lib/baselistwithdnd.py @@ -32,13 +32,13 @@ class BaseListWithDnD(QtGui.QListWidget): """ Provide a list widget to store objects and handle drag and drop events """ - def __init__(self, parent=None): + def __init__(self, parent=None, name=u''): """ Initialise the list widget """ QtGui.QListWidget.__init__(self, parent) - # this must be set by the class which is inheriting - assert(self.PluginName) + self.mimeDataText = name + assert(self.mimeDataText) def mouseMoveEvent(self, event): """ @@ -47,9 +47,10 @@ class BaseListWithDnD(QtGui.QListWidget): just tell it what plugin to call """ if event.buttons() != QtCore.Qt.LeftButton: + event.ignore() return drag = QtGui.QDrag(self) mimeData = QtCore.QMimeData() drag.setMimeData(mimeData) - mimeData.setText(self.PluginName) - drag.start(QtCore.Qt.CopyAction) \ No newline at end of file + mimeData.setText(self.mimeDataText) + drag.start(QtCore.Qt.CopyAction) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 65f6c955b..26e51737d 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -33,7 +33,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import context_menu_action, context_menu_separator, \ SettingsManager, OpenLPToolbar, ServiceItem, StringContent, build_icon, \ - translate, Receiver + translate, Receiver, BaseListWithDnD log = logging.getLogger(__name__) @@ -73,11 +73,6 @@ class MediaManagerItem(QtGui.QWidget): assumes that the new action is to load a file. If not, you need to override the ``OnNew`` method. - ``self.ListViewWithDnD_class`` - This must be a **class**, not an object, descended from - ``openlp.core.lib.BaseListWithDnD`` that is not used in any - other part of OpenLP. - ``self.PreviewFunction`` This must be a method which returns a QImage to represent the item (usually a preview). No scaling is required, that is @@ -263,7 +258,7 @@ class MediaManagerItem(QtGui.QWidget): Creates the main widget for listing items the media item is tracking """ # Add the List widget - self.listView = self.ListViewWithDnD_class(self) + self.listView = BaseListWithDnD(self, self.title) self.listView.uniformItemSizes = True self.listView.setSpacing(1) self.listView.setSelectionMode( diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index 788eaea3c..58dc11a6a 100644 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -28,8 +28,8 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import MediaManagerItem, Receiver, BaseListWithDnD, \ - ItemCapabilities, translate +from openlp.core.lib import MediaManagerItem, Receiver, ItemCapabilities, \ + translate from openlp.core.lib.ui import UiStrings, add_widget_completer, \ media_item_combo_box, critical_error_message_box from openlp.plugins.bibles.forms import BibleImportForm @@ -37,15 +37,6 @@ from openlp.plugins.bibles.lib import get_reference_match log = logging.getLogger(__name__) -class BibleListView(BaseListWithDnD): - """ - Custom list view descendant, required for drag and drop. - """ - def __init__(self, parent=None): - self.PluginName = u'Bibles' - BaseListWithDnD.__init__(self, parent) - - class BibleMediaItem(MediaManagerItem): """ This is the custom media manager item for Bibles. @@ -54,7 +45,6 @@ class BibleMediaItem(MediaManagerItem): def __init__(self, parent, plugin, icon): self.IconPath = u'songs/song' - self.ListViewWithDnD_class = BibleListView MediaManagerItem.__init__(self, parent, plugin, icon) # Place to store the search results for both bibles. self.search_results = {} diff --git a/openlp/plugins/custom/lib/mediaitem.py b/openlp/plugins/custom/lib/mediaitem.py index 908c4e18d..c1da5bdfa 100644 --- a/openlp/plugins/custom/lib/mediaitem.py +++ b/openlp/plugins/custom/lib/mediaitem.py @@ -28,18 +28,13 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import MediaManagerItem, BaseListWithDnD, \ - Receiver, ItemCapabilities, translate, check_item_selected +from openlp.core.lib import MediaManagerItem, Receiver, ItemCapabilities, \ + translate, check_item_selected from openlp.plugins.custom.lib import CustomXMLParser from openlp.plugins.custom.lib.db import CustomSlide log = logging.getLogger(__name__) -class CustomListView(BaseListWithDnD): - def __init__(self, parent=None): - self.PluginName = u'Custom' - BaseListWithDnD.__init__(self, parent) - class CustomMediaItem(MediaManagerItem): """ This is the custom media manager item for Custom Slides. @@ -48,9 +43,6 @@ class CustomMediaItem(MediaManagerItem): def __init__(self, parent, plugin, icon): self.IconPath = u'custom/custom' - # this next is a class, not an instance of a class - it will - # be instanced by the base MediaManagerItem - self.ListViewWithDnD_class = CustomListView MediaManagerItem.__init__(self, parent, self, icon) self.singleServiceItem = False # Holds information about whether the edit is remotly triggered and diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index 9c739e9c1..5f95a239c 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -29,21 +29,14 @@ import os from PyQt4 import QtCore, QtGui -from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \ - ItemCapabilities, SettingsManager, translate, check_item_selected, \ - check_directory_exists, Receiver +from openlp.core.lib import MediaManagerItem, build_icon, ItemCapabilities, \ + SettingsManager, translate, check_item_selected, check_directory_exists, \ + Receiver from openlp.core.lib.ui import UiStrings, critical_error_message_box from openlp.core.utils import AppLocation, delete_file, get_images_filter log = logging.getLogger(__name__) -# We have to explicitly create separate classes for each plugin -# in order for DnD to the Service manager to work correctly. -class ImageListView(BaseListWithDnD): - def __init__(self, parent=None): - self.PluginName = u'Images' - BaseListWithDnD.__init__(self, parent) - class ImageMediaItem(MediaManagerItem): """ This is the custom media manager item for images. @@ -52,9 +45,6 @@ class ImageMediaItem(MediaManagerItem): def __init__(self, parent, plugin, icon): self.IconPath = u'images/image' - # This next is a class, not an instance of a class - it will - # be instanced by the base MediaManagerItem. - self.ListViewWithDnD_class = ImageListView MediaManagerItem.__init__(self, parent, self, icon) QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'live_theme_changed'), self.liveThemeChanged) diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index d88c8ff14..800d6d051 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -29,18 +29,12 @@ import os from PyQt4 import QtCore, QtGui -from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \ - ItemCapabilities, SettingsManager, translate, check_item_selected, Receiver +from openlp.core.lib import MediaManagerItem, build_icon, ItemCapabilities, \ + SettingsManager, translate, check_item_selected, Receiver from openlp.core.lib.ui import UiStrings, critical_error_message_box log = logging.getLogger(__name__) -class MediaListView(BaseListWithDnD): - def __init__(self, parent=None): - self.PluginName = u'Media' - BaseListWithDnD.__init__(self, parent) - - class MediaMediaItem(MediaManagerItem): """ This is the custom media manager item for Media Slides. @@ -50,9 +44,6 @@ class MediaMediaItem(MediaManagerItem): def __init__(self, parent, plugin, icon): self.IconPath = u'images/image' self.background = False - # this next is a class, not an instance of a class - it will - # be instanced by the base MediaManagerItem - self.ListViewWithDnD_class = MediaListView self.PreviewFunction = QtGui.QPixmap( u':/media/media_video.png').toImage() MediaManagerItem.__init__(self, parent, self, icon) diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index 09020692a..0b6ab39cd 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -29,24 +29,13 @@ import os from PyQt4 import QtCore, QtGui -from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \ - SettingsManager, translate, check_item_selected, Receiver, ItemCapabilities +from openlp.core.lib import MediaManagerItem, build_icon, SettingsManager, \ + translate, check_item_selected, Receiver, ItemCapabilities from openlp.core.lib.ui import critical_error_message_box, media_item_combo_box from openlp.plugins.presentations.lib import MessageListener log = logging.getLogger(__name__) -class PresentationListView(BaseListWithDnD): - """ - Class for the list of Presentations - - We have to explicitly create separate classes for each plugin - in order for DnD to the Service manager to work correctly. - """ - def __init__(self, parent=None): - self.PluginName = u'Presentations' - BaseListWithDnD.__init__(self, parent) - class PresentationMediaItem(MediaManagerItem): """ This is the Presentation media manager item for Presentation Items. @@ -61,9 +50,6 @@ class PresentationMediaItem(MediaManagerItem): self.controllers = controllers self.IconPath = u'presentations/presentation' self.Automatic = u'' - # this next is a class, not an instance of a class - it will - # be instanced by the base MediaManagerItem - self.ListViewWithDnD_class = PresentationListView MediaManagerItem.__init__(self, parent, self, icon) self.message_listener = MessageListener(self) QtCore.QObject.connect(Receiver.get_receiver(), diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 312d0d6e7..cabb181fb 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -31,8 +31,8 @@ import re from PyQt4 import QtCore, QtGui from sqlalchemy.sql import or_ -from openlp.core.lib import MediaManagerItem, BaseListWithDnD, Receiver, \ - ItemCapabilities, translate, check_item_selected, PluginStatus +from openlp.core.lib import MediaManagerItem, Receiver, ItemCapabilities, \ + translate, check_item_selected, PluginStatus from openlp.core.lib.ui import UiStrings from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm, \ SongImportForm @@ -42,12 +42,6 @@ from openlp.core.lib.searchedit import SearchEdit log = logging.getLogger(__name__) -class SongListView(BaseListWithDnD): - def __init__(self, parent=None): - self.PluginName = u'Songs' - BaseListWithDnD.__init__(self, parent) - - class SongMediaItem(MediaManagerItem): """ This is the custom media manager item for Songs. @@ -56,7 +50,6 @@ class SongMediaItem(MediaManagerItem): def __init__(self, parent, plugin, icon): self.IconPath = u'songs/song' - self.ListViewWithDnD_class = SongListView MediaManagerItem.__init__(self, parent, self, icon) self.edit_song_form = EditSongForm(self, self.parent.manager) self.openLyrics = OpenLyrics(self.parent.manager) From 552e412769429e3c4b5c1a8ce36700a34e5a67a0 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 10 Feb 2011 18:59:59 +0000 Subject: [PATCH 074/243] Cleanups --- openlp/core/ui/filerenameform.py | 2 +- openlp/core/ui/mainwindow.py | 4 ++-- openlp/plugins/presentations/lib/impresscontroller.py | 5 ++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/openlp/core/ui/filerenameform.py b/openlp/core/ui/filerenameform.py index 60abe77da..8b37cbc86 100644 --- a/openlp/core/ui/filerenameform.py +++ b/openlp/core/ui/filerenameform.py @@ -24,7 +24,7 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### -from PyQt4 import QtCore, QtGui +from PyQt4 import QtGui from filerenamedialog import Ui_FileRenameDialog diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 4b99cc32b..1f2a05b95 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -216,8 +216,8 @@ class Ui_MainWindow(object): self.ToolsAddToolItem = icon_action(mainWindow, u'ToolsAddToolItem', u':/tools/tools_add.png') mainWindow.actionList.add_action(self.ToolsAddToolItem, u'Tools') - self.ToolsOpenDataFolder = icon_action(mainWindow, u'ToolsOpenDataFolder', - u':/general/general_open.png') + self.ToolsOpenDataFolder = icon_action(mainWindow, + u'ToolsOpenDataFolder', u':/general/general_open.png') mainWindow.actionList.add_action(self.ToolsOpenDataFolder, u'Tools') self.settingsPluginListItem = icon_action(mainWindow, u'settingsPluginListItem', u':/system/settings_plugin_list.png') diff --git a/openlp/plugins/presentations/lib/impresscontroller.py b/openlp/plugins/presentations/lib/impresscontroller.py index 38058f2c5..ad5faa2dd 100644 --- a/openlp/plugins/presentations/lib/impresscontroller.py +++ b/openlp/plugins/presentations/lib/impresscontroller.py @@ -179,9 +179,8 @@ class ImpressController(PresentationController): desktop = self.get_com_desktop() except: log.exception(u'Failed to find an OpenOffice desktop to terminate') - finally: - if not desktop: - return + if not desktop: + return docs = desktop.getComponents() if docs.hasElements(): log.debug(u'OpenOffice not terminated as docs are still open') From 281b24b8152cd6b33d5a6ce5ed4fb82b9110b3e9 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 10 Feb 2011 19:05:35 +0000 Subject: [PATCH 075/243] Rename list widget descendant --- documentation/api/source/core/lib.rst | 12 ++++++------ openlp/core/lib/__init__.py | 2 +- .../lib/{baselistwithdnd.py => listwidgetwithdnd.py} | 2 +- openlp/core/lib/mediamanageritem.py | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) rename openlp/core/lib/{baselistwithdnd.py => listwidgetwithdnd.py} (98%) diff --git a/documentation/api/source/core/lib.rst b/documentation/api/source/core/lib.rst index 6ca952d7d..fa894875d 100644 --- a/documentation/api/source/core/lib.rst +++ b/documentation/api/source/core/lib.rst @@ -6,18 +6,18 @@ Object Library .. automodule:: openlp.core.lib :members: -:mod:`BaseListWithDnD` ----------------------- - -.. autoclass:: openlp.core.lib.baselistwithdnd.BaseListWithDnD - :members: - :mod:`EventReceiver` -------------------- .. autoclass:: openlp.core.lib.eventreceiver.EventReceiver :members: +:mod:`ListWidgetWithDnD` +---------------------- + +.. autoclass:: openlp.core.lib.listwidgetwithdnd.ListWidgetWithDnD + :members: + :mod:`MediaManagerItem` ----------------------- diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index 644f0a4c6..5247ae938 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -319,7 +319,7 @@ def check_directory_exists(dir): if not os.path.exists(dir): os.makedirs(dir) -from baselistwithdnd import BaseListWithDnD +from listwidgetwithdnd import ListWidgetWithDnD from theme import ThemeLevel, ThemeXML, BackgroundGradientType, \ BackgroundType, HorizontalType, VerticalType from displaytags import DisplayTags diff --git a/openlp/core/lib/baselistwithdnd.py b/openlp/core/lib/listwidgetwithdnd.py similarity index 98% rename from openlp/core/lib/baselistwithdnd.py rename to openlp/core/lib/listwidgetwithdnd.py index 3bc91d577..a1a11217b 100644 --- a/openlp/core/lib/baselistwithdnd.py +++ b/openlp/core/lib/listwidgetwithdnd.py @@ -28,7 +28,7 @@ Extend QListWidget to handle drag and drop functionality """ from PyQt4 import QtCore, QtGui -class BaseListWithDnD(QtGui.QListWidget): +class ListWidgetWithDnD(QtGui.QListWidget): """ Provide a list widget to store objects and handle drag and drop events """ diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 26e51737d..06e80b7ca 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -33,7 +33,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import context_menu_action, context_menu_separator, \ SettingsManager, OpenLPToolbar, ServiceItem, StringContent, build_icon, \ - translate, Receiver, BaseListWithDnD + translate, Receiver, ListWidgetWithDnD log = logging.getLogger(__name__) @@ -258,7 +258,7 @@ class MediaManagerItem(QtGui.QWidget): Creates the main widget for listing items the media item is tracking """ # Add the List widget - self.listView = BaseListWithDnD(self, self.title) + self.listView = ListWidgetWithDnD(self, self.title) self.listView.uniformItemSizes = True self.listView.setSpacing(1) self.listView.setSelectionMode( From 565289cf7ea3bb337b7a130dbb27ab9ef121c970 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 10 Feb 2011 19:28:17 +0000 Subject: [PATCH 076/243] Small wizard refactor --- openlp/core/ui/wizard.py | 6 ++++++ openlp/plugins/songs/forms/songexportform.py | 9 ++------- openlp/plugins/songs/forms/songimportform.py | 6 ------ 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/openlp/core/ui/wizard.py b/openlp/core/ui/wizard.py index 2fa448db8..1ec348c1d 100644 --- a/openlp/core/ui/wizard.py +++ b/openlp/core/ui/wizard.py @@ -70,6 +70,12 @@ class OpenLPWizard(QtGui.QWizard): self.retranslateUi() QtCore.QMetaObject.connectSlotsByName(self) + def registerFields(self): + """ + Hook method for wizards to register any fields they need. + """ + pass + def addProgressPage(self): """ Add the progress page for the wizard. This page informs the user how diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index 5d5b9a8b1..849a1ad1e 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -87,7 +87,8 @@ class SongExportForm(OpenLPWizard): Song wizard specific signals. """ QtCore.QObject.connect(self.availableListWidget, - QtCore.SIGNAL(u'itemActivated(QListWidgetItem*)'), self.onItemPressed) + QtCore.SIGNAL(u'itemActivated(QListWidgetItem*)'), + self.onItemPressed) QtCore.QObject.connect(self.searchLineEdit, QtCore.SIGNAL(u'textEdited(const QString&)'), self.onSearchLineEditChanged) @@ -241,12 +242,6 @@ class SongExportForm(OpenLPWizard): self.selectedListWidget.clear() return True - def registerFields(self): - """ - Register song export wizard fields. - """ - pass - def setDefaults(self): """ Set default form values for the song export wizard. diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index e85426a8f..2ecf35429 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -671,12 +671,6 @@ class SongImportForm(OpenLPWizard): """ self.removeSelectedItems(self.songBeamerFileListWidget) - def registerFields(self): - """ - Register song import wizard fields. - """ - pass - def setDefaults(self): """ Set default form values for the song import wizard. From 79d93c515a48a443174f1e7ce24036568f21e83d Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 10 Feb 2011 19:37:02 +0000 Subject: [PATCH 077/243] Another wizard refactor --- openlp/core/ui/wizard.py | 27 +++++++++++++++++++ .../plugins/bibles/forms/bibleimportform.py | 27 ------------------- openlp/plugins/songs/forms/songimportform.py | 27 ------------------- 3 files changed, 27 insertions(+), 54 deletions(-) diff --git a/openlp/core/ui/wizard.py b/openlp/core/ui/wizard.py index 1ec348c1d..071972df5 100644 --- a/openlp/core/ui/wizard.py +++ b/openlp/core/ui/wizard.py @@ -152,3 +152,30 @@ class OpenLPWizard(QtGui.QWizard): self.finishButton.setVisible(True) self.cancelButton.setVisible(False) Receiver.send_message(u'openlp_process_events') + + def getFileName(self, title, editbox, filters=u''): + """ + Opens a QFileDialog and saves the filename to the given editbox. + + ``title`` + The title of the dialog (unicode). + + ``editbox`` + A editbox (QLineEdit). + + ``filters`` + The file extension filters. It should contain the file description + as well as the file extension. For example:: + + u'OpenLP 2.0 Databases (*.sqlite)' + """ + if filters: + filters += u';;' + filters += u'%s (*)' % UiStrings.AllFiles + filename = QtGui.QFileDialog.getOpenFileName(self, title, + os.path.dirname(SettingsManager.get_last_dir( + self.plugin.settingsSection, 1)), filters) + if filename: + editbox.setText(filename) + SettingsManager.set_last_dir(self.plugin.settingsSection, + filename, 1) diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index f528a4b1b..890c9a3a5 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -727,33 +727,6 @@ class BibleImportForm(OpenLPWizard): if books_file: books_file.close() - def getFileName(self, title, editbox, filters=u''): - """ - Opens a QFileDialog and saves the filename to the given editbox. - - ``title`` - The title of the dialog (unicode). - - ``editbox`` - A editbox (QLineEdit). - - ``filters`` - The file extension filters. It should contain the file description - as well as the file extension. For example:: - - u'openlp.org 1.x bible (*.bible)' - """ - if filters: - filters += u';;' - filters += u'%s (*)' % UiStrings.AllFiles - filename = QtGui.QFileDialog.getOpenFileName(self, title, - os.path.dirname(SettingsManager.get_last_dir( - self.plugin.settingsSection, 1)), filters) - if filename: - editbox.setText(filename) - SettingsManager.set_last_dir( - self.plugin.settingsSection, filename, 1) - def preWizard(self): """ Prepare the UI for the import. diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index 2ecf35429..b84af8dde 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -442,33 +442,6 @@ class SongImportForm(OpenLPWizard): elif self.currentPage() == self.progressPage: return True - def getFileName(self, title, editbox, filters=u''): - """ - Opens a QFileDialog and writes the filename to the given editbox. - - ``title`` - The title of the dialog (unicode). - - ``editbox`` - A editbox (QLineEdit). - - ``filters`` - The file extension filters. It should contain the file descriptions - as well as the file extensions. For example:: - - u'OpenLP 2.0 Databases (*.sqlite)' - """ - if filters: - filters += u';;' - filters += u'%s (*)' % UiStrings.AllFiles - filename = QtGui.QFileDialog.getOpenFileName(self, title, - SettingsManager.get_last_dir(self.plugin.settingsSection, 1), - filters) - if filename: - editbox.setText(filename) - SettingsManager.set_last_dir(self.plugin.settingsSection, - os.path.split(unicode(filename))[0], 1) - def getFiles(self, title, listbox, filters=u''): """ Opens a QFileDialog and writes the filenames to the given listbox. From a7f8d5ca847c68a032d7a4c4914896be99fd0f1f Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 10 Feb 2011 21:07:28 +0000 Subject: [PATCH 078/243] Fixes --- openlp/core/ui/wizard.py | 5 +++-- openlp/plugins/bibles/forms/bibleimportform.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/openlp/core/ui/wizard.py b/openlp/core/ui/wizard.py index 071972df5..d3410ded9 100644 --- a/openlp/core/ui/wizard.py +++ b/openlp/core/ui/wizard.py @@ -27,11 +27,12 @@ The :mod:``wizard`` module provides generic wizard tools for OpenLP. """ import logging +import os from PyQt4 import QtCore, QtGui -from openlp.core.lib import build_icon, Receiver -from openlp.core.lib.ui import add_welcome_page +from openlp.core.lib import build_icon, Receiver, SettingsManager +from openlp.core.lib.ui import UiStrings, add_welcome_page log = logging.getLogger(__name__) diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index 890c9a3a5..463c838c9 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -33,9 +33,9 @@ import os.path from PyQt4 import QtCore, QtGui -from openlp.core.lib import Receiver, SettingsManager, translate +from openlp.core.lib import Receiver, translate from openlp.core.lib.db import delete_database -from openlp.core.lib.ui import UiStrings, critical_error_message_box +from openlp.core.lib.ui import critical_error_message_box from openlp.core.ui.wizard import OpenLPWizard from openlp.core.utils import AppLocation, string_is_unicode from openlp.plugins.bibles.lib.manager import BibleFormat From 12607020be3778c26d447ae651e80f8ebd081e17 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 10 Feb 2011 22:49:30 +0000 Subject: [PATCH 079/243] Cleanup magic numbers and more UiStrings --- openlp/core/lib/htmlbuilder.py | 18 ++++-------------- openlp/core/lib/theme.py | 27 +++++++++++++++++++++++++++ openlp/core/lib/ui.py | 2 ++ openlp/core/ui/mainwindow.py | 6 ++---- openlp/core/ui/servicemanager.py | 6 +++--- openlp/core/ui/thememanager.py | 9 +++++---- 6 files changed, 43 insertions(+), 25 deletions(-) diff --git a/openlp/core/lib/htmlbuilder.py b/openlp/core/lib/htmlbuilder.py index ea830855c..34d583181 100644 --- a/openlp/core/lib/htmlbuilder.py +++ b/openlp/core/lib/htmlbuilder.py @@ -28,7 +28,8 @@ import logging from PyQt4 import QtWebKit -from openlp.core.lib import BackgroundType, BackgroundGradientType +from openlp.core.lib import BackgroundType, BackgroundGradientType, \ + VerticalType log = logging.getLogger(__name__) @@ -536,12 +537,7 @@ def build_lyrics_format_css(theme, width, height): align = u'right' else: align = u'left' - if theme.display_vertical_align == 2: - valign = u'bottom' - elif theme.display_vertical_align == 1: - valign = u'middle' - else: - valign = u'top' + valign = VerticalType.to_string(theme.display_vertical_align) if theme.font_main_outline: left_margin = int(theme.font_main_outline_size) * 2 else: @@ -634,13 +630,7 @@ def build_alert_css(alertTab, width): """ if not alertTab: return u'' - align = u'' - if alertTab.location == 2: - align = u'bottom' - elif alertTab.location == 1: - align = u'middle' - else: - align = u'top' + align = VerticalType.to_string(alertTab.location) alert = style % (width, align, alertTab.font_face, alertTab.font_size, alertTab.font_color, alertTab.bg_color) return alert diff --git a/openlp/core/lib/theme.py b/openlp/core/lib/theme.py index dca226069..1fcb623fb 100644 --- a/openlp/core/lib/theme.py +++ b/openlp/core/lib/theme.py @@ -164,6 +164,7 @@ class BackgroundGradientType(object): elif type_string == u'leftBottom': return BackgroundGradientType.LeftBottom + class HorizontalType(object): """ Type enumeration for horizontal alignment. @@ -172,6 +173,19 @@ class HorizontalType(object): Center = 1 Right = 2 + @staticmethod + def to_string(horizontal_type): + """ + Return a string representation of a horizontal type. + """ + If horizontal_type == Horizontal.Right: + return u'right' + elif horizontal_type == Horizontal.Center: + return u'center' + else + return u'left' + + class VerticalType(object): """ Type enumeration for vertical alignment. @@ -180,6 +194,19 @@ class VerticalType(object): Middle = 1 Bottom = 2 + @staticmethod + def to_string(vertical_type): + """ + Return a string representation of a vertical type. + """ + If vertical_type == VerticalType.Bottom: + return u'bottom' + elif vertical_type == VerticalType.Middle: + return u'middle' + else + return u'top' + + BOOLEAN_LIST = [u'bold', u'italics', u'override', u'outline', u'shadow', u'slide_transition'] diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 2eb74c455..a3b442801 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -64,12 +64,14 @@ class UiStrings(object): New = translate('OpenLP.Ui', 'New') NewType = unicode(translate('OpenLP.Ui', 'New %s')) OLPV2 = translate('OpenLP.Ui', 'OpenLP 2.0') + OpenType = unicode(translate('OpenLP.Ui', 'Open %s')) Preview = translate('OpenLP.Ui', 'Preview') PreviewSelect = unicode(translate('OpenLP.Ui', 'Preview the selected %s.')) ReplaceBG = translate('OpenLP.Ui', 'Replace Background') ReplaceLiveBG = translate('OpenLP.Ui', 'Replace Live Background') ResetBG = translate('OpenLP.Ui', 'Reset Background') ResetLiveBG = translate('OpenLP.Ui', 'Reset Live Background') + SaveType = unicode(translate('OpenLP.Ui', 'Save %s')) SendSelectLive = unicode(translate('OpenLP.Ui', 'Send the selected %s live.')) Service = translate('OpenLP.Ui', 'Service') diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 1f2a05b95..4840ef5da 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -324,14 +324,12 @@ class Ui_MainWindow(object): UiStrings.CreateANew % UiStrings.Service.toLower()) self.FileNewItem.setShortcut(translate('OpenLP.MainWindow', 'Ctrl+N')) self.FileOpenItem.setText(translate('OpenLP.MainWindow', '&Open')) - self.FileOpenItem.setToolTip( - translate('OpenLP.MainWindow', 'Open Service')) + self.FileOpenItem.setToolTip(UiStrings.OpenType % UiStrings.Service) self.FileOpenItem.setStatusTip( translate('OpenLP.MainWindow', 'Open an existing service.')) self.FileOpenItem.setShortcut(translate('OpenLP.MainWindow', 'Ctrl+O')) self.FileSaveItem.setText(translate('OpenLP.MainWindow', '&Save')) - self.FileSaveItem.setToolTip( - translate('OpenLP.MainWindow', 'Save Service')) + self.FileSaveItem.setToolTip(UiStrings.SaveType % UiStrings.Service) self.FileSaveItem.setStatusTip( translate('OpenLP.MainWindow', 'Save the current service to disk.')) self.FileSaveItem.setShortcut(translate('OpenLP.MainWindow', 'Ctrl+S')) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 5fc80b175..744da7b46 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -100,12 +100,12 @@ class ServiceManager(QtGui.QWidget): UiStrings.CreateANew % UiStrings.Service.toLower(), self.onNewServiceClicked) self.toolbar.addToolbarButton( - translate('OpenLP.ServiceManager', 'Open Service'), + UiStrings.OpenType % UiStrings.Service, u':/general/general_open.png', translate('OpenLP.ServiceManager', 'Load an existing service'), self.onLoadServiceClicked) self.toolbar.addToolbarButton( - translate('OpenLP.ServiceManager', 'Save Service'), + UiStrings.SaveType % UiStrings.Service, u':/general/general_save.png', translate('OpenLP.ServiceManager', 'Save this service'), self.saveFile) @@ -465,7 +465,7 @@ class ServiceManager(QtGui.QWidget): save the file. """ fileName = unicode(QtGui.QFileDialog.getSaveFileName(self.mainwindow, - translate('OpenLP.ServiceManager', 'Save Service'), + UiStrings.SaveType % UiStrings.Service, SettingsManager.get_last_dir( self.mainwindow.serviceSettingsSection), translate('OpenLP.ServiceManager', 'OpenLP Service Files (*.osz)'))) diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index d3f8da56c..36abb19c1 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -34,7 +34,8 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import OpenLPToolbar, ThemeXML, get_text_file_string, \ build_icon, Receiver, SettingsManager, translate, check_item_selected, \ - BackgroundType, BackgroundGradientType, check_directory_exists + BackgroundType, BackgroundGradientType, check_directory_exists, \ + VerticalType from openlp.core.lib.ui import UiStrings, critical_error_message_box from openlp.core.theme import Theme from openlp.core.ui import FileRenameForm, ThemeForm @@ -762,11 +763,11 @@ class ThemeManager(QtGui.QWidget): newtheme.font_main_outline = True newtheme.font_main_outline_color = \ unicode(theme.OutlineColor.name()) - vAlignCorrection = 0 + vAlignCorrection = VerticalType.Top if theme.VerticalAlign == 2: - vAlignCorrection = 1 + vAlignCorrection = VerticalType.Middle elif theme.VerticalAlign == 1: - vAlignCorrection = 2 + vAlignCorrection = VerticalType.Bottom newtheme.display_horizontal_align = theme.HorizontalAlign newtheme.display_vertical_align = vAlignCorrection return newtheme.extract_xml() From ae2b625d4f5b243a162f03b5758df72929b88bae Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 10 Feb 2011 23:00:15 +0000 Subject: [PATCH 080/243] Typos --- openlp/core/lib/theme.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openlp/core/lib/theme.py b/openlp/core/lib/theme.py index 1fcb623fb..06340c2eb 100644 --- a/openlp/core/lib/theme.py +++ b/openlp/core/lib/theme.py @@ -178,11 +178,11 @@ class HorizontalType(object): """ Return a string representation of a horizontal type. """ - If horizontal_type == Horizontal.Right: + if horizontal_type == Horizontal.Right: return u'right' elif horizontal_type == Horizontal.Center: return u'center' - else + else: return u'left' @@ -199,11 +199,11 @@ class VerticalType(object): """ Return a string representation of a vertical type. """ - If vertical_type == VerticalType.Bottom: + if vertical_type == VerticalType.Bottom: return u'bottom' elif vertical_type == VerticalType.Middle: return u'middle' - else + else: return u'top' From 12d08676236ec66b5637809f2fc79317e0c26e47 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Fri, 11 Feb 2011 04:04:05 +0000 Subject: [PATCH 081/243] Plugin refactor: icons, tabs, mediaitems --- openlp/core/lib/mediamanageritem.py | 62 ++++++++-------------- openlp/core/lib/plugin.py | 23 ++++++-- openlp/core/lib/rendermanager.py | 3 +- openlp/core/ui/maindisplay.py | 1 - openlp/core/ui/slidecontroller.py | 1 - openlp/plugins/alerts/alertsplugin.py | 13 ++--- openlp/plugins/alerts/lib/alertsmanager.py | 4 +- openlp/plugins/alerts/lib/alertstab.py | 6 +-- openlp/plugins/bibles/bibleplugin.py | 11 +--- openlp/plugins/custom/customplugin.py | 11 +--- openlp/plugins/images/imageplugin.py | 7 +-- openlp/plugins/media/lib/mediaitem.py | 1 + openlp/plugins/media/lib/mediatab.py | 9 ++-- openlp/plugins/media/mediaplugin.py | 10 +--- openlp/plugins/remotes/remoteplugin.py | 10 +--- openlp/plugins/songs/songsplugin.py | 14 +---- 16 files changed, 66 insertions(+), 120 deletions(-) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 06e80b7ca..f74ba63a9 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -197,61 +197,43 @@ class MediaManagerItem(QtGui.QWidget): """ Create buttons for the media item toolbar """ + toolbar_actions = [] ## Import Button ## if self.hasImportIcon: - import_string = self.plugin.getString(StringContent.Import) - self.addToolbarButton( - import_string[u'title'], - import_string[u'tooltip'], - u':/general/general_import.png', self.onImportClick) + toolbar_actions.append([StringContent.Import, + u':/general/general_import.png', self.onImportClick]) ## Load Button ## if self.hasFileIcon: - load_string = self.plugin.getString(StringContent.Load) - self.addToolbarButton( - load_string[u'title'], - load_string[u'tooltip'], - u':/general/general_open.png', self.onFileClick) + toolbar_actions.append([StringContent.Load, + u':/general/general_open.png', self.onFileClick]) ## New Button ## if self.hasNewIcon: - new_string = self.plugin.getString(StringContent.New) - self.addToolbarButton( - new_string[u'title'], - new_string[u'tooltip'], - u':/general/general_new.png', self.onNewClick) + toolbar_actions.append([StringContent.New, + u':/general/general_new.png', self.onNewClick]) ## Edit Button ## if self.hasEditIcon: - edit_string = self.plugin.getString(StringContent.Edit) - self.addToolbarButton( - edit_string[u'title'], - edit_string[u'tooltip'], - u':/general/general_edit.png', self.onEditClick) + toolbar_actions.append([StringContent.Edit, + u':/general/general_edit.png', self.onEditClick]) ## Delete Button ## if self.hasDeleteIcon: - delete_string = self.plugin.getString(StringContent.Delete) - self.addToolbarButton( - delete_string[u'title'], - delete_string[u'tooltip'], - u':/general/general_delete.png', self.onDeleteClick) + toolbar_actions.append([StringContent.Delete, + u':/general/general_delete.png', self.onDeleteClick]) ## Separator Line ## self.addToolbarSeparator() ## Preview ## - preview_string = self.plugin.getString(StringContent.Preview) - self.addToolbarButton( - preview_string[u'title'], - preview_string[u'tooltip'], - u':/general/general_preview.png', self.onPreviewClick) + toolbar_actions.append([StringContent.Preview, + u':/general/general_preview.png', self.onPreviewClick]) ## Live Button ## - live_string = self.plugin.getString(StringContent.Live) - self.addToolbarButton( - live_string[u'title'], - live_string[u'tooltip'], - u':/general/general_live.png', self.onLiveClick) + toolbar_actions.append([StringContent.Live, + u':/general/general_live.png', self.onLiveClick]) ## Add to service Button ## - service_string = self.plugin.getString(StringContent.Service) - self.addToolbarButton( - service_string[u'title'], - service_string[u'tooltip'], - u':/general/general_add.png', self.onAddClick) + toolbar_actions.append([StringContent.Service, + u':/general/general_add.png', self.onAddClick]) + for action in toolbar_actions: + self.addToolbarButton( + self.plugin.getString(action[0])[u'title'], + self.plugin.getString(action[0])[u'tooltip'], + action[1], action[2]) def addListViewToToolBar(self): """ diff --git a/openlp/core/lib/plugin.py b/openlp/core/lib/plugin.py index cfd3fb4c2..a073d31ea 100644 --- a/openlp/core/lib/plugin.py +++ b/openlp/core/lib/plugin.py @@ -114,7 +114,8 @@ class Plugin(QtCore.QObject): """ log.info(u'loaded') - def __init__(self, name, version=None, pluginHelpers=None): + def __init__(self, name, version=None, pluginHelpers=None, + mediaItemClass=None, settingsTabClass=None): """ This is the constructor for the plugin object. This provides an easy way for descendent plugins to populate common data. This method *must* @@ -132,6 +133,12 @@ class Plugin(QtCore.QObject): ``pluginHelpers`` Defaults to *None*. A list of helper objects. + + ``mediaItemClass`` + The class name of the plugin's media item. + + ``settingsTabClass`` + The class name of the plugin's settings tab. """ QtCore.QObject.__init__(self) self.name = name @@ -141,6 +148,8 @@ class Plugin(QtCore.QObject): self.version = version self.settingsSection = self.name.lower() self.icon = None + self.mediaItemClass = mediaItemClass + self.settingsTabClass = settingsTabClass self.weight = 0 self.status = PluginStatus.Inactive # Set up logging @@ -199,7 +208,9 @@ class Plugin(QtCore.QObject): Construct a MediaManagerItem object with all the buttons and things you need, and return it for integration into openlp.org. """ - pass + if self.mediaItemClass: + return self.mediaItemClass(self, self, self.icon) + return None def addImportMenuItem(self, importMenu): """ @@ -230,9 +241,13 @@ class Plugin(QtCore.QObject): def getSettingsTab(self): """ - Create a tab for the settings window. + Create a tab for the settings window to display the configurable + options for this plugin to the user. """ - pass + if self.settingsTabClass: + return self.settingsTabClass(self.name, + self.getString(StringContent.VisibleName)[u'title']) + return None def addToMenu(self, menubar): """ diff --git a/openlp/core/lib/rendermanager.py b/openlp/core/lib/rendermanager.py index 5896ca4e6..32a29915f 100644 --- a/openlp/core/lib/rendermanager.py +++ b/openlp/core/lib/rendermanager.py @@ -68,7 +68,6 @@ class RenderManager(object): self.theme_level = u'' self.override_background = None self.theme_data = None - self.alertTab = None self.force_page = False def update_display(self): @@ -261,4 +260,4 @@ class RenderManager(object): log.debug(u'calculate default %d, %d, %f', self.width, self.height, self.screen_ratio ) # 90% is start of footer - self.footer_start = int(self.height * 0.90) \ No newline at end of file + self.footer_start = int(self.height * 0.90) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index c4ab75aac..05a301bd7 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -65,7 +65,6 @@ class MainDisplay(DisplayWidget): self.parent = parent self.screens = screens self.isLive = live - self.alertTab = None self.hideMode = None self.override = {} mainIcon = build_icon(u':/icon/openlp-logo-16x16.png') diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index c6b58ac56..fc6cc04fa 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -415,7 +415,6 @@ class SlideController(QtGui.QWidget): # rebuild display as screen size changed self.display = MainDisplay(self, self.screens, self.isLive) self.display.imageManager = self.parent.renderManager.image_manager - self.display.alertTab = self.alertTab self.display.setup() if self.isLive: self.__addActionsToWidget(self.display) diff --git a/openlp/plugins/alerts/alertsplugin.py b/openlp/plugins/alerts/alertsplugin.py index 443ec1e84..136d775a5 100644 --- a/openlp/plugins/alerts/alertsplugin.py +++ b/openlp/plugins/alerts/alertsplugin.py @@ -40,21 +40,14 @@ class AlertsPlugin(Plugin): log.info(u'Alerts Plugin loaded') def __init__(self, plugin_helpers): - Plugin.__init__(self, u'Alerts', u'1.9.4', plugin_helpers) + Plugin.__init__(self, u'Alerts', u'1.9.4', plugin_helpers, + settingsTabClass=AlertsTab) self.weight = -3 self.icon = build_icon(u':/plugins/plugin_alerts.png') self.alertsmanager = AlertsManager(self) self.manager = Manager(u'alerts', init_schema) - self.visible_name = self.getString(StringContent.VisibleName) self.alertForm = AlertForm(self) - def getSettingsTab(self): - """ - Return the settings tab for the Alerts plugin - """ - self.alertsTab = AlertsTab(self, self.visible_name[u'title']) - return self.alertsTab - def addToolsMenuItem(self, tools_menu): """ Give the alerts plugin the opportunity to add items to the @@ -81,7 +74,7 @@ class AlertsPlugin(Plugin): log.info(u'Alerts Initialising') Plugin.initialise(self) self.toolsAlertItem.setVisible(True) - self.liveController.alertTab = self.alertsTab + self.liveController.alertTab = self.settings_tab def finalise(self): """ diff --git a/openlp/plugins/alerts/lib/alertsmanager.py b/openlp/plugins/alerts/lib/alertsmanager.py index 6fe0ae132..f69099bf1 100644 --- a/openlp/plugins/alerts/lib/alertsmanager.py +++ b/openlp/plugins/alerts/lib/alertsmanager.py @@ -84,7 +84,7 @@ class AlertsManager(QtCore.QObject): if len(self.alertList) == 0: return text = self.alertList.pop(0) - alertTab = self.parent.alertsTab + alertTab = self.parent.settings_tab self.parent.liveController.display.alert(text) # Check to see if we have a timer running. if self.timer_id == 0: @@ -103,4 +103,4 @@ class AlertsManager(QtCore.QObject): self.parent.liveController.display.alert(u'') self.killTimer(self.timer_id) self.timer_id = 0 - self.generateAlert() \ No newline at end of file + self.generateAlert() diff --git a/openlp/plugins/alerts/lib/alertstab.py b/openlp/plugins/alerts/lib/alertstab.py index 4090503db..48a4527ed 100644 --- a/openlp/plugins/alerts/lib/alertstab.py +++ b/openlp/plugins/alerts/lib/alertstab.py @@ -33,10 +33,8 @@ class AlertsTab(SettingsTab): """ AlertsTab is the alerts settings tab in the settings dialog. """ - def __init__(self, parent, visible_title): - self.parent = parent - self.manager = parent.manager - SettingsTab.__init__(self, parent.name, visible_title) + def __init__(self, name, visible_title): + SettingsTab.__init__(self, name, visible_title) def setupUi(self): self.setObjectName(u'AlertsTab') diff --git a/openlp/plugins/bibles/bibleplugin.py b/openlp/plugins/bibles/bibleplugin.py index 89102a8eb..e3447cfdd 100644 --- a/openlp/plugins/bibles/bibleplugin.py +++ b/openlp/plugins/bibles/bibleplugin.py @@ -38,7 +38,8 @@ class BiblePlugin(Plugin): log.info(u'Bible Plugin loaded') def __init__(self, plugin_helpers): - Plugin.__init__(self, u'Bibles', u'1.9.4', plugin_helpers) + Plugin.__init__(self, u'Bibles', u'1.9.4', plugin_helpers, + BibleMediaItem, BiblesTab) self.weight = -9 self.icon_path = u':/plugins/plugin_bibles.png' self.icon = build_icon(self.icon_path) @@ -62,14 +63,6 @@ class BiblePlugin(Plugin): self.importBibleItem.setVisible(False) self.exportBibleItem.setVisible(False) - def getSettingsTab(self): - visible_name = self.getString(StringContent.VisibleName) - return BiblesTab(self.name, visible_name[u'title']) - - def getMediaManagerItem(self): - # Create the BibleManagerItem object. - return BibleMediaItem(self, self, self.icon) - def addImportMenuItem(self, import_menu): self.importBibleItem = QtGui.QAction(import_menu) self.importBibleItem.setObjectName(u'importBibleItem') diff --git a/openlp/plugins/custom/customplugin.py b/openlp/plugins/custom/customplugin.py index f20fbc9cd..92546cd4f 100644 --- a/openlp/plugins/custom/customplugin.py +++ b/openlp/plugins/custom/customplugin.py @@ -48,21 +48,14 @@ class CustomPlugin(Plugin): log.info(u'Custom Plugin loaded') def __init__(self, plugin_helpers): - Plugin.__init__(self, u'Custom', u'1.9.4', plugin_helpers) + Plugin.__init__(self, u'Custom', u'1.9.4', plugin_helpers, + CustomMediaItem, CustomTab) self.weight = -5 self.manager = Manager(u'custom', init_schema) self.edit_custom_form = EditCustomForm(self.manager) self.icon_path = u':/plugins/plugin_custom.png' self.icon = build_icon(self.icon_path) - def getSettingsTab(self): - visible_name = self.getString(StringContent.VisibleName) - return CustomTab(self.name, visible_name[u'title']) - - def getMediaManagerItem(self): - # Create the ManagerItem object - return CustomMediaItem(self, self, self.icon) - def about(self): about_text = translate('CustomPlugin', 'Custom Plugin' '
The custom plugin provides the ability to set up custom ' diff --git a/openlp/plugins/images/imageplugin.py b/openlp/plugins/images/imageplugin.py index 2642e3055..6b64598fc 100644 --- a/openlp/plugins/images/imageplugin.py +++ b/openlp/plugins/images/imageplugin.py @@ -35,15 +35,12 @@ class ImagePlugin(Plugin): log.info(u'Image Plugin loaded') def __init__(self, plugin_helpers): - Plugin.__init__(self, u'Images', u'1.9.4', plugin_helpers) + Plugin.__init__(self, u'Images', u'1.9.4', plugin_helpers, + ImageMediaItem) self.weight = -7 self.icon_path = u':/plugins/plugin_images.png' self.icon = build_icon(self.icon_path) - def getMediaManagerItem(self): - # Create the MediaManagerItem object. - return ImageMediaItem(self, self, self.icon) - def about(self): about_text = translate('ImagePlugin', 'Image Plugin' '
The image plugin provides displaying of images.
One ' diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index 800d6d051..7fb0ed0c1 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -138,6 +138,7 @@ class MediaMediaItem(MediaManagerItem): return False def initialise(self): + self.listView.clear() self.listView.setIconSize(QtCore.QSize(88, 50)) self.loadList(SettingsManager.load_list(self.settingsSection, self.settingsSection)) diff --git a/openlp/plugins/media/lib/mediatab.py b/openlp/plugins/media/lib/mediatab.py index 461fbf4ae..c51b53a9a 100644 --- a/openlp/plugins/media/lib/mediatab.py +++ b/openlp/plugins/media/lib/mediatab.py @@ -32,8 +32,8 @@ class MediaTab(SettingsTab): """ MediaTab is the Media settings tab in the settings dialog. """ - def __init__(self, title): - SettingsTab.__init__(self, title) + def __init__(self, title, visible_title): + SettingsTab.__init__(self, title, visible_title) def setupUi(self): self.setObjectName(u'MediaTab') @@ -53,9 +53,8 @@ class MediaTab(SettingsTab): self.onUsePhononCheckBoxChanged) def retranslateUi(self): - self.tabTitleVisible = translate('MediaPlugin.MediaTab', 'Media') - self.mediaModeGroupBox.setTitle(translate('MediaPlugin.MediaTab', - 'Media Display')) + self.mediaModeGroupBox.setTitle( + translate('MediaPlugin.MediaTab', 'Media Display')) self.usePhononCheckBox.setText( translate('MediaPlugin.MediaTab', 'Use Phonon for video playback')) diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index 3ebb77171..b9db9b8c1 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -38,7 +38,8 @@ class MediaPlugin(Plugin): log.info(u'%s MediaPlugin loaded', __name__) def __init__(self, plugin_helpers): - Plugin.__init__(self, u'Media', u'1.9.4', plugin_helpers) + Plugin.__init__(self, u'Media', u'1.9.4', plugin_helpers, + MediaMediaItem, MediaTab) self.weight = -6 self.icon_path = u':/plugins/plugin_media.png' self.icon = build_icon(self.icon_path) @@ -75,13 +76,6 @@ class MediaPlugin(Plugin): mimetype = u'' return list, mimetype - def getSettingsTab(self): - return MediaTab(self.name) - - def getMediaManagerItem(self): - # Create the MediaManagerItem object. - return MediaMediaItem(self, self, self.icon) - def about(self): about_text = translate('MediaPlugin', 'Media Plugin' '
The media plugin provides playback of audio and video.') diff --git a/openlp/plugins/remotes/remoteplugin.py b/openlp/plugins/remotes/remoteplugin.py index dbc56a61c..b513d4ff7 100644 --- a/openlp/plugins/remotes/remoteplugin.py +++ b/openlp/plugins/remotes/remoteplugin.py @@ -38,7 +38,8 @@ class RemotesPlugin(Plugin): """ remotes constructor """ - Plugin.__init__(self, u'Remotes', u'1.9.4', plugin_helpers) + Plugin.__init__(self, u'Remotes', u'1.9.4', plugin_helpers, + settingsTabClass=RemoteTab) self.icon = build_icon(u':/plugins/plugin_remote.png') self.weight = -1 self.server = None @@ -61,13 +62,6 @@ class RemotesPlugin(Plugin): if self.server: self.server.close() - def getSettingsTab(self): - """ - Create the settings Tab - """ - visible_name = self.getString(StringContent.VisibleName) - return RemoteTab(self.name, visible_name[u'title']) - def about(self): """ Information about this plugin diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index ef20d15ae..646e8e86e 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -51,17 +51,14 @@ class SongsPlugin(Plugin): """ Create and set up the Songs plugin. """ - Plugin.__init__(self, u'Songs', u'1.9.4', plugin_helpers) + Plugin.__init__(self, u'Songs', u'1.9.4', plugin_helpers, + SongMediaItem, SongsTab) self.weight = -10 self.manager = Manager(u'songs', init_schema) self.icon_path = u':/plugins/plugin_songs.png' self.icon = build_icon(self.icon_path) self.whitespace = re.compile(r'\W+', re.UNICODE) - def getSettingsTab(self): - visible_name = self.getString(StringContent.VisibleName) - return SongsTab(self.name, visible_name[u'title']) - def initialise(self): log.info(u'Songs Initialising') Plugin.initialise(self) @@ -69,13 +66,6 @@ class SongsPlugin(Plugin): self.mediaItem.displayResultsSong( self.manager.get_all_objects(Song, order_by_ref=Song.search_title)) - def getMediaManagerItem(self): - """ - Create the MediaManagerItem object, which is displaed in the - Media Manager. - """ - return SongMediaItem(self, self, self.icon) - def addImportMenuItem(self, import_menu): """ Give the Songs plugin the opportunity to add items to the From 4a4f7d7ef477d846012a3397fa8b992834247199 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Fri, 11 Feb 2011 17:28:14 +0000 Subject: [PATCH 082/243] Fix crash on blank of single display screen Fixes: https://launchpad.net/bugs/716843 --- openlp/core/ui/slidecontroller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index fc6cc04fa..cd43cddb4 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -876,7 +876,7 @@ class SlideController(QtGui.QWidget): using *Blank to Theme*. """ log.debug(u'updatePreview %s ' % self.screens.current[u'primary']) - if not self.screens.current[u'primary'] and \ + if not self.screens.current[u'primary'] and self.serviceItem and \ self.serviceItem.is_capable(ItemCapabilities.ProvidesOwnDisplay): # Grab now, but try again in a couple of seconds if slide change # is slow From dd620456788e7cdb25e0f24ae205e18eb8940f7e Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Fri, 11 Feb 2011 17:50:34 +0000 Subject: [PATCH 083/243] Fix Windows data dir --- openlp/core/utils/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openlp/core/utils/__init__.py b/openlp/core/utils/__init__.py index 2862afef4..161b55897 100644 --- a/openlp/core/utils/__init__.py +++ b/openlp/core/utils/__init__.py @@ -165,6 +165,8 @@ def _get_os_dir_path(dir_type): Return a path based on which OS and environment we are running in. """ if sys.platform == u'win32': + if dir_type == AppLocation.DataDir: + return os.path.join(os.getenv(u'APPDATA'), u'openlp', u'data') return os.path.join(os.getenv(u'APPDATA'), u'openlp') elif sys.platform == u'darwin': if dir_type == AppLocation.DataDir: @@ -180,8 +182,7 @@ def _get_os_dir_path(dir_type): return os.path.join(BaseDirectory.xdg_data_home, u'openlp') elif dir_type == AppLocation.CacheDir: return os.path.join(BaseDirectory.xdg_cache_home, u'openlp') - else: - return os.path.join(os.getenv(u'HOME'), u'.openlp') + return os.path.join(os.getenv(u'HOME'), u'.openlp') def _get_frozen_path(frozen_option, non_frozen_option): """ @@ -189,8 +190,7 @@ def _get_frozen_path(frozen_option, non_frozen_option): """ if hasattr(sys, u'frozen') and sys.frozen == 1: return frozen_option - else: - return non_frozen_option + return non_frozen_option def check_latest_version(current_version): """ From 98a28d85801195d0630c05ee08a3431468579f73 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Fri, 11 Feb 2011 17:55:41 +0000 Subject: [PATCH 084/243] Fix the other data dirs --- openlp/core/utils/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openlp/core/utils/__init__.py b/openlp/core/utils/__init__.py index 161b55897..a589c7309 100644 --- a/openlp/core/utils/__init__.py +++ b/openlp/core/utils/__init__.py @@ -179,9 +179,12 @@ def _get_os_dir_path(dir_type): if dir_type == AppLocation.ConfigDir: return os.path.join(BaseDirectory.xdg_config_home, u'openlp') elif dir_type == AppLocation.DataDir: - return os.path.join(BaseDirectory.xdg_data_home, u'openlp') + return os.path.join(BaseDirectory.xdg_data_home, u'openlp', + u'data') elif dir_type == AppLocation.CacheDir: return os.path.join(BaseDirectory.xdg_cache_home, u'openlp') + if dir_type == AppLocation.DataDir: + return os.path.join(os.getenv(u'HOME'), u'openlp', u'data') return os.path.join(os.getenv(u'HOME'), u'.openlp') def _get_frozen_path(frozen_option, non_frozen_option): From 42b1b72ff99fc078b5181b9cdb7152eddad77104 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Fri, 11 Feb 2011 19:35:25 +0100 Subject: [PATCH 085/243] fixed buttons --- openlp/core/ui/serviceitemeditform.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/openlp/core/ui/serviceitemeditform.py b/openlp/core/ui/serviceitemeditform.py index 70518f30c..ae09cb0b2 100644 --- a/openlp/core/ui/serviceitemeditform.py +++ b/openlp/core/ui/serviceitemeditform.py @@ -110,11 +110,12 @@ class ServiceItemEditForm(QtGui.QDialog, Ui_ServiceItemEditDialog): temp = self.itemList[row] self.itemList.remove(self.itemList[row]) if direction == u'up': - self.itemList.insert(row - 1, temp) + row -= 1 else: - self.itemList.insert(row + 1, temp) + row += 1 + self.itemList.insert(row, temp) self.loadData() - self.listWidget.setCurrentRow(row + 1) + self.listWidget.setCurrentRow(row) def onCurrentRowChanged(self, row): """ From 9366155924284ee2403279674a6325aa2352e224 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Fri, 11 Feb 2011 21:17:56 +0000 Subject: [PATCH 086/243] UiStrings and SongStrings --- openlp/core/lib/mediamanageritem.py | 10 ++-- openlp/core/lib/theme.py | 4 +- openlp/core/lib/ui.py | 15 +++--- openlp/core/ui/serviceitemeditdialog.py | 5 +- openlp/plugins/alerts/forms/alertdialog.py | 5 +- .../plugins/bibles/forms/bibleimportform.py | 33 ++++--------- openlp/plugins/custom/customplugin.py | 2 +- .../plugins/custom/forms/editcustomdialog.py | 6 ++- openlp/plugins/custom/forms/editcustomform.py | 7 +-- openlp/plugins/songs/forms/authorsdialog.py | 3 +- openlp/plugins/songs/forms/editsongdialog.py | 9 ++-- openlp/plugins/songs/forms/songbookdialog.py | 3 +- openlp/plugins/songs/forms/songimportform.py | 46 +++++-------------- .../songs/forms/songmaintenancedialog.py | 18 ++++---- openlp/plugins/songs/forms/topicsdialog.py | 3 +- openlp/plugins/songs/lib/mediaitem.py | 5 +- openlp/plugins/songs/lib/ui.py | 43 +++++++++++++++++ 17 files changed, 114 insertions(+), 103 deletions(-) create mode 100644 openlp/plugins/songs/lib/ui.py diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index f74ba63a9..52b4f560b 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -449,8 +449,7 @@ class MediaManagerItem(QtGui.QWidget): Add a selected item to the current service """ if not self.listView.selectedIndexes() and not self.remoteTriggered: - QtGui.QMessageBox.information(self, - translate('OpenLP.MediaManagerItem', 'No Items Selected'), + QtGui.QMessageBox.information(self, UiStrings.NISp, translate('OpenLP.MediaManagerItem', 'You must select one or more items.')) else: @@ -476,17 +475,14 @@ class MediaManagerItem(QtGui.QWidget): Add a selected item to an existing item in the current service. """ if not self.listView.selectedIndexes() and not self.remoteTriggered: - QtGui.QMessageBox.information(self, - translate('OpenLP.MediaManagerItem', 'No Items Selected'), + QtGui.QMessageBox.information(self, UiStrings.NISp, translate('OpenLP.MediaManagerItem', 'You must select one or more items')) else: log.debug(u'%s Add requested', self.plugin.name) serviceItem = self.parent.serviceManager.getServiceItem() if not serviceItem: - QtGui.QMessageBox.information(self, - translate('OpenLP.MediaManagerItem', - 'No Service Item Selected'), + QtGui.QMessageBox.information(self, UiStrings.NISs, translate('OpenLP.MediaManagerItem', 'You must select an existing service item to add to.')) elif self.plugin.name.lower() == serviceItem.name.lower(): diff --git a/openlp/core/lib/theme.py b/openlp/core/lib/theme.py index 06340c2eb..67ce33ca4 100644 --- a/openlp/core/lib/theme.py +++ b/openlp/core/lib/theme.py @@ -178,9 +178,9 @@ class HorizontalType(object): """ Return a string representation of a horizontal type. """ - if horizontal_type == Horizontal.Right: + if horizontal_type == HorizontalType.Right: return u'right' - elif horizontal_type == Horizontal.Center: + elif horizontal_type == HorizontalType.Center: return u'center' else: return u'left' diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index a3b442801..0c5fe2bf9 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -46,7 +46,6 @@ class UiStrings(object): 'Add the selected %s to the service.')) Advanced = translate('OpenLP.Ui', 'Advanced') AllFiles = translate('OpenLP.Ui', 'All Files') - Authors = translate('OpenLP.Ui', 'Authors') CreateANew = unicode(translate('OpenLP.Ui', 'Create a new %s.')) Delete = translate('OpenLP.Ui', '&Delete') DeleteSelect = unicode(translate('OpenLP.Ui', 'Delete the selected %s.')) @@ -54,6 +53,7 @@ class UiStrings(object): Edit = translate('OpenLP.Ui', '&Edit') EditSelect = unicode(translate('OpenLP.Ui', 'Edit the selected %s.')) EditType = unicode(translate('OpenLP.Ui', 'Edit %s')) + EmptyField = translate('OpenLP.Ui', 'Empty Field') Error = translate('OpenLP.Ui', 'Error') ExportType = unicode(translate('OpenLP.Ui', 'Export %s')) Import = translate('OpenLP.Ui', 'Import') @@ -63,6 +63,10 @@ class UiStrings(object): LoadANew = unicode(translate('OpenLP.Ui', 'Load a new %s.')) New = translate('OpenLP.Ui', 'New') NewType = unicode(translate('OpenLP.Ui', 'New %s')) + NFSs = translate('OpenLP.Ui', 'No File Selected', 'Singular') + NFSp = translate('OpenLP.Ui', 'No Files Selected', 'Plural') + NISs = translate('OpenLP.Ui', 'No Item Selected', 'Singular') + NISp = translate('OpenLP.Ui', 'No Items Selected', 'Plural') OLPV2 = translate('OpenLP.Ui', 'OpenLP 2.0') OpenType = unicode(translate('OpenLP.Ui', 'Open %s')) Preview = translate('OpenLP.Ui', 'Preview') @@ -75,8 +79,8 @@ class UiStrings(object): SendSelectLive = unicode(translate('OpenLP.Ui', 'Send the selected %s live.')) Service = translate('OpenLP.Ui', 'Service') - Theme = translate('OpenLP.Ui', 'Theme') - Themes = translate('OpenLP.Ui', 'Themes') + Theme = translate('OpenLP.Ui', 'Theme', 'Singular') + Themes = translate('OpenLP.Ui', 'Themes', 'Plural') def add_welcome_page(parent, image): @@ -168,7 +172,7 @@ def media_item_combo_box(parent, name): combo.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed) return combo -def create_delete_push_button(parent, icon=None): +def create_delete_push_button(parent, item_name, icon=None): """ Creates a standard push button with a delete label and optional icon. The button is connected to the parent's ``onDeleteButtonClicked()`` method to @@ -186,8 +190,7 @@ def create_delete_push_button(parent, icon=None): delete_icon = icon if icon else u':/general/general_delete.png' delete_button.setIcon(build_icon(delete_icon)) delete_button.setText(UiStrings.Delete) - delete_button.setToolTip( - translate('OpenLP.Ui', 'Delete the selected item.')) + delete_button.setToolTip(UiStrings.DeleteSelect % item_name) QtCore.QObject.connect(delete_button, QtCore.SIGNAL(u'clicked()'), parent.onDeleteButtonClicked) return delete_button diff --git a/openlp/core/ui/serviceitemeditdialog.py b/openlp/core/ui/serviceitemeditdialog.py index ef7e99a5f..0f9ddb4ac 100644 --- a/openlp/core/ui/serviceitemeditdialog.py +++ b/openlp/core/ui/serviceitemeditdialog.py @@ -27,7 +27,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate -from openlp.core.lib.ui import create_accept_reject_button_box, \ +from openlp.core.lib.ui import UiStrings, create_accept_reject_button_box, \ create_delete_push_button, create_up_down_push_button_set class Ui_ServiceItemEditDialog(object): @@ -41,7 +41,8 @@ class Ui_ServiceItemEditDialog(object): self.dialogLayout.addWidget(self.listWidget, 0, 0) self.buttonLayout = QtGui.QVBoxLayout() self.buttonLayout.setObjectName(u'buttonLayout') - self.deleteButton = create_delete_push_button(serviceItemEditDialog) + self.deleteButton = create_delete_push_button( + serviceItemEditDialog, UiStrings.Service.toLower()) self.buttonLayout.addWidget(self.deleteButton) self.buttonLayout.addStretch() self.upButton, self.downButton = create_up_down_push_button_set( diff --git a/openlp/plugins/alerts/forms/alertdialog.py b/openlp/plugins/alerts/forms/alertdialog.py index 93f7ead06..12f5c04be 100644 --- a/openlp/plugins/alerts/forms/alertdialog.py +++ b/openlp/plugins/alerts/forms/alertdialog.py @@ -26,7 +26,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import build_icon, translate +from openlp.core.lib import StringContent, build_icon, translate from openlp.core.lib.ui import create_delete_push_button class Ui_AlertDialog(object): @@ -66,7 +66,8 @@ class Ui_AlertDialog(object): self.saveButton.setIcon(build_icon(u':/general/general_save.png')) self.saveButton.setObjectName(u'saveButton') self.manageButtonLayout.addWidget(self.saveButton) - self.deleteButton = create_delete_push_button(alertDialog) + self.deleteButton = create_delete_push_button(alertDialog, + self.parent.getString(StringContent.Name)[u'singular'].toLower()) self.deleteButton.setEnabled(False) self.manageButtonLayout.addWidget(self.deleteButton) self.manageButtonLayout.addStretch() diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index 463c838c9..0e21b7496 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -35,7 +35,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import Receiver, translate from openlp.core.lib.db import delete_database -from openlp.core.lib.ui import critical_error_message_box +from openlp.core.lib.ui import UiStrings, critical_error_message_box from openlp.core.ui.wizard import OpenLPWizard from openlp.core.utils import AppLocation, string_is_unicode from openlp.plugins.bibles.lib.manager import BibleFormat @@ -468,9 +468,7 @@ class BibleImportForm(OpenLPWizard): elif self.currentPage() == self.selectPage: if self.field(u'source_format').toInt()[0] == BibleFormat.OSIS: if not self.field(u'osis_location').toString(): - critical_error_message_box( - translate('BiblesPlugin.ImportWizardForm', - 'Invalid Bible Location'), + critical_error_message_box(UiStrings.NFSs, translate('BiblesPlugin.ImportWizardForm', 'You need to specify a file to import your ' 'Bible from.')) @@ -478,8 +476,7 @@ class BibleImportForm(OpenLPWizard): return False elif self.field(u'source_format').toInt()[0] == BibleFormat.CSV: if not self.field(u'csv_testamentsfile').toString(): - answer = critical_error_message_box(translate( - 'BiblesPlugin.ImportWizardForm', 'No Testaments File'), + answer = critical_error_message_box(UiStrings.NFSs, translate('BiblesPlugin.ImportWizardForm', 'You have not specified a testaments file. Do you ' 'want to proceed with the import?'), question=True) @@ -487,18 +484,14 @@ class BibleImportForm(OpenLPWizard): self.csvTestamentsEdit.setFocus() return False elif not self.field(u'csv_booksfile').toString(): - critical_error_message_box( - translate('BiblesPlugin.ImportWizardForm', - 'Invalid Books File'), + critical_error_message_box(UiStrings.NFSs, translate('BiblesPlugin.ImportWizardForm', 'You need to specify a file with books of ' 'the Bible to use in the import.')) self.csvBooksEdit.setFocus() return False elif not self.field(u'csv_versefile').toString(): - critical_error_message_box( - translate('BiblesPlugin.ImportWizardForm', - 'Invalid Verse File'), + critical_error_message_box(UiStrings.NFSs, translate('BiblesPlugin.ImportWizardForm', 'You need to specify a file of Bible ' 'verses to import.')) @@ -507,9 +500,7 @@ class BibleImportForm(OpenLPWizard): elif self.field(u'source_format').toInt()[0] == \ BibleFormat.OpenSong: if not self.field(u'opensong_file').toString(): - critical_error_message_box( - translate('BiblesPlugin.ImportWizardForm', - 'Invalid OpenSong Bible'), + critical_error_message_box(UiStrings.NFSs, translate('BiblesPlugin.ImportWizardForm', 'You need to specify an OpenSong Bible ' 'file to import.')) @@ -517,9 +508,7 @@ class BibleImportForm(OpenLPWizard): return False elif self.field(u'source_format').toInt()[0] == BibleFormat.OpenLP1: if not self.field(u'openlp1_location').toString(): - critical_error_message_box( - translate('BiblesPlugin.ImportWizardForm', - 'Invalid Bible Location'), + critical_error_message_box(UiStrings.NFSs, translate('BiblesPlugin.ImportWizardForm', 'You need to specify a file to import your ' 'Bible from.')) @@ -531,17 +520,13 @@ class BibleImportForm(OpenLPWizard): license_copyright = \ unicode(self.field(u'license_copyright').toString()) if not license_version: - critical_error_message_box( - translate('BiblesPlugin.ImportWizardForm', - 'Empty Version Name'), + critical_error_message_box(UiStrings.EmptyField, translate('BiblesPlugin.ImportWizardForm', 'You need to specify a version name for your Bible.')) self.versionNameEdit.setFocus() return False elif not license_copyright: - critical_error_message_box( - translate('BiblesPlugin.ImportWizardForm', - 'Empty Copyright'), + critical_error_message_box(UiStrings.EmptyField, translate('BiblesPlugin.ImportWizardForm', 'You need to set a copyright for your Bible. ' 'Bibles in the Public Domain need to be marked as such.')) diff --git a/openlp/plugins/custom/customplugin.py b/openlp/plugins/custom/customplugin.py index 92546cd4f..13f5c5696 100644 --- a/openlp/plugins/custom/customplugin.py +++ b/openlp/plugins/custom/customplugin.py @@ -52,7 +52,7 @@ class CustomPlugin(Plugin): CustomMediaItem, CustomTab) self.weight = -5 self.manager = Manager(u'custom', init_schema) - self.edit_custom_form = EditCustomForm(self.manager) + self.edit_custom_form = EditCustomForm(self) self.icon_path = u':/plugins/plugin_custom.png' self.icon = build_icon(self.icon_path) diff --git a/openlp/plugins/custom/forms/editcustomdialog.py b/openlp/plugins/custom/forms/editcustomdialog.py index 2e8a64a9d..e63c057d0 100644 --- a/openlp/plugins/custom/forms/editcustomdialog.py +++ b/openlp/plugins/custom/forms/editcustomdialog.py @@ -26,7 +26,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import build_icon, translate +from openlp.core.lib import StringContent, build_icon, translate from openlp.core.lib.ui import UiStrings, create_accept_reject_button_box, \ create_delete_push_button, create_up_down_push_button_set @@ -66,7 +66,9 @@ class Ui_CustomEditDialog(object): self.editAllButton = QtGui.QPushButton(customEditDialog) self.editAllButton.setObjectName(u'editAllButton') self.buttonLayout.addWidget(self.editAllButton) - self.deleteButton = create_delete_push_button(customEditDialog) + self.deleteButton = create_delete_push_button(customEditDialog, + customEditDialog.parent.getString( + StringContent.Name)[u'singular'].toLower()) self.deleteButton.setEnabled(False) self.buttonLayout.addWidget(self.deleteButton) self.buttonLayout.addStretch() diff --git a/openlp/plugins/custom/forms/editcustomform.py b/openlp/plugins/custom/forms/editcustomform.py index b667cd529..a86b28489 100644 --- a/openlp/plugins/custom/forms/editcustomform.py +++ b/openlp/plugins/custom/forms/editcustomform.py @@ -42,14 +42,15 @@ class EditCustomForm(QtGui.QDialog, Ui_CustomEditDialog): Class documentation goes here. """ log.info(u'Custom Editor loaded') - def __init__(self, manager, parent=None): + def __init__(self, parent): """ Constructor """ - QtGui.QDialog.__init__(self, parent) + QtGui.QDialog.__init__(self) + self.parent = parent + self.manager = self.parent.manager self.setupUi(self) # Create other objects and forms. - self.manager = manager self.editSlideForm = EditCustomSlideForm(self) # Connecting signals and slots QtCore.QObject.connect(self.previewButton, diff --git a/openlp/plugins/songs/forms/authorsdialog.py b/openlp/plugins/songs/forms/authorsdialog.py index 09c723364..6cfe83e67 100644 --- a/openlp/plugins/songs/forms/authorsdialog.py +++ b/openlp/plugins/songs/forms/authorsdialog.py @@ -28,6 +28,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate from openlp.core.lib.ui import create_accept_reject_button_box +from openlp.plugins.songs.lib.ui import SongStrings class Ui_AuthorsDialog(object): def setupUi(self, authorsDialog): @@ -64,7 +65,7 @@ class Ui_AuthorsDialog(object): def retranslateUi(self, authorsDialog): authorsDialog.setWindowTitle( - translate('SongsPlugin.AuthorsForm', 'Author Maintenance')) + SongStrings.TypeMaintenance % SongStrings.Author) self.displayLabel.setText( translate('SongsPlugin.AuthorsForm', 'Display name:')) self.firstNameLabel.setText( diff --git a/openlp/plugins/songs/forms/editsongdialog.py b/openlp/plugins/songs/forms/editsongdialog.py index 234d92283..491f4fa74 100644 --- a/openlp/plugins/songs/forms/editsongdialog.py +++ b/openlp/plugins/songs/forms/editsongdialog.py @@ -28,6 +28,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import build_icon, translate from openlp.core.lib.ui import UiStrings, create_accept_reject_button_box +from openlp.plugins.songs.lib.ui import SongStrings class Ui_EditSongDialog(object): def setupUi(self, editSongDialog): @@ -265,21 +266,19 @@ class Ui_EditSongDialog(object): self.songTabWidget.setTabText( self.songTabWidget.indexOf(self.lyricsTab), translate('SongsPlugin.EditSongForm', 'Title && Lyrics')) - self.authorsGroupBox.setTitle(UiStrings.Authors) + self.authorsGroupBox.setTitle(SongStrings.Authors) self.authorAddButton.setText( translate('SongsPlugin.EditSongForm', '&Add to Song')) self.authorRemoveButton.setText( translate('SongsPlugin.EditSongForm', '&Remove')) self.maintenanceButton.setText(translate('SongsPlugin.EditSongForm', '&Manage Authors, Topics, Song Books')) - self.topicsGroupBox.setTitle( - translate('SongsPlugin.EditSongForm', 'Topic')) + self.topicsGroupBox.setTitle(SongStrings.Topic) self.topicAddButton.setText( translate('SongsPlugin.EditSongForm', 'A&dd to Song')) self.topicRemoveButton.setText( translate('SongsPlugin.EditSongForm', 'R&emove')) - self.songBookGroupBox.setTitle( - translate('SongsPlugin.EditSongForm', 'Song Book')) + self.songBookGroupBox.setTitle(SongStrings.SongBook) self.songBookNameLabel.setText(translate('SongsPlugin.EditSongForm', 'Book:')) self.songBookNumberLabel.setText(translate('SongsPlugin.EditSongForm', diff --git a/openlp/plugins/songs/forms/songbookdialog.py b/openlp/plugins/songs/forms/songbookdialog.py index f6dd3930c..d185a9e1e 100644 --- a/openlp/plugins/songs/forms/songbookdialog.py +++ b/openlp/plugins/songs/forms/songbookdialog.py @@ -28,6 +28,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate from openlp.core.lib.ui import create_accept_reject_button_box +from openlp.plugins.songs.lib.ui import SongStrings class Ui_SongBookDialog(object): def setupUi(self, songBookDialog): @@ -58,7 +59,7 @@ class Ui_SongBookDialog(object): def retranslateUi(self, songBookDialog): songBookDialog.setWindowTitle( - translate('SongsPlugin.SongBookForm', 'Song Book Maintenance')) + SongStrings.TypeMaintenance % SongStrings.SongBook) self.nameLabel.setText(translate('SongsPlugin.SongBookForm', '&Name:')) self.publisherLabel.setText( translate('SongsPlugin.SongBookForm', '&Publisher:')) diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index b84af8dde..cb9d67b6a 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -330,9 +330,7 @@ class SongImportForm(OpenLPWizard): source_format = self.formatComboBox.currentIndex() if source_format == SongFormat.OpenLP2: if self.openLP2FilenameEdit.text().isEmpty(): - critical_error_message_box( - translate('SongsPlugin.ImportWizardForm', - 'No OpenLP 2.0 Song Database Selected'), + critical_error_message_box(UiStrings.NFSs, translate('SongsPlugin.ImportWizardForm', 'You need to select an OpenLP 2.0 song database ' 'file to import from.')) @@ -340,9 +338,7 @@ class SongImportForm(OpenLPWizard): return False elif source_format == SongFormat.OpenLP1: if self.openLP1FilenameEdit.text().isEmpty(): - critical_error_message_box( - translate('SongsPlugin.ImportWizardForm', - 'No openlp.org 1.x Song Database Selected'), + critical_error_message_box(UiStrings.NFSs, translate('SongsPlugin.ImportWizardForm', 'You need to select an openlp.org 1.x song ' 'database file to import from.')) @@ -350,9 +346,7 @@ class SongImportForm(OpenLPWizard): return False elif source_format == SongFormat.OpenLyrics: if self.openLyricsFileListWidget.count() == 0: - critical_error_message_box( - translate('SongsPlugin.ImportWizardForm', - 'No OpenLyrics Files Selected'), + critical_error_message_box(UiStrings.NFSp, translate('SongsPlugin.ImportWizardForm', 'You need to add at least one OpenLyrics ' 'song file to import from.')) @@ -360,9 +354,7 @@ class SongImportForm(OpenLPWizard): return False elif source_format == SongFormat.OpenSong: if self.openSongFileListWidget.count() == 0: - critical_error_message_box( - translate('SongsPlugin.ImportWizardForm', - 'No OpenSong Files Selected'), + critical_error_message_box(UiStrings.NFSp, translate('SongsPlugin.ImportWizardForm', 'You need to add at least one OpenSong ' 'song file to import from.')) @@ -370,9 +362,7 @@ class SongImportForm(OpenLPWizard): return False elif source_format == SongFormat.WordsOfWorship: if self.wordsOfWorshipFileListWidget.count() == 0: - critical_error_message_box( - translate('SongsPlugin.ImportWizardForm', - 'No Words of Worship Files Selected'), + critical_error_message_box(UiStrings.NFSp, translate('SongsPlugin.ImportWizardForm', 'You need to add at least one Words of Worship ' 'file to import from.')) @@ -380,9 +370,7 @@ class SongImportForm(OpenLPWizard): return False elif source_format == SongFormat.CCLI: if self.ccliFileListWidget.count() == 0: - critical_error_message_box( - translate('SongsPlugin.ImportWizardForm', - 'No CCLI Files Selected'), + critical_error_message_box(UiStrings.NFSp, translate('SongsPlugin.ImportWizardForm', 'You need to add at least one CCLI file ' 'to import from.')) @@ -390,9 +378,7 @@ class SongImportForm(OpenLPWizard): return False elif source_format == SongFormat.SongsOfFellowship: if self.songsOfFellowshipFileListWidget.count() == 0: - critical_error_message_box( - translate('SongsPlugin.ImportWizardForm', - 'No Songs of Fellowship File Selected'), + critical_error_message_box(UiStrings.NFSp, translate('SongsPlugin.ImportWizardForm', 'You need to add at least one Songs of Fellowship ' 'file to import from.')) @@ -400,9 +386,7 @@ class SongImportForm(OpenLPWizard): return False elif source_format == SongFormat.Generic: if self.genericFileListWidget.count() == 0: - critical_error_message_box( - translate('SongsPlugin.ImportWizardForm', - 'No Document/Presentation Selected'), + critical_error_message_box(UiStrings.NFSp, translate('SongsPlugin.ImportWizardForm', 'You need to add at least one document or ' 'presentation file to import from.')) @@ -410,9 +394,7 @@ class SongImportForm(OpenLPWizard): return False elif source_format == SongFormat.EasiSlides: if self.easiSlidesFilenameEdit.text().isEmpty(): - critical_error_message_box( - translate('SongsPlugin.ImportWizardForm', - 'No Easislides Songs file selected'), + critical_error_message_box(UiStrings.NFSp, translate('SongsPlugin.ImportWizardForm', 'You need to select an xml song file exported from ' 'EasiSlides, to import from.')) @@ -420,9 +402,7 @@ class SongImportForm(OpenLPWizard): return False elif source_format == SongFormat.EasyWorship: if self.ewFilenameEdit.text().isEmpty(): - critical_error_message_box( - translate('SongsPlugin.ImportWizardForm', - 'No EasyWorship Song Database Selected'), + critical_error_message_box(UiStrings.NFSs, translate('SongsPlugin.ImportWizardForm', 'You need to select an EasyWorship song database ' 'file to import from.')) @@ -430,9 +410,7 @@ class SongImportForm(OpenLPWizard): return False elif source_format == SongFormat.SongBeamer: if self.songBeamerFileListWidget.count() == 0: - critical_error_message_box( - translate('SongsPlugin.ImportWizardForm', - 'No SongBeamer File Selected'), + critical_error_message_box(UiStrings.NFSp, translate('SongsPlugin.ImportWizardForm', 'You need to add at least one SongBeamer ' 'file to import from.')) @@ -585,7 +563,7 @@ class SongImportForm(OpenLPWizard): 'Select Songs of Fellowship Files'), self.songsOfFellowshipFileListWidget, u'%s (*.rtf)' % translate('SongsPlugin.ImportWizardForm', - 'Songs Of Felloship Song Files') + 'Songs Of Fellowship Song Files') ) def onSongsOfFellowshipRemoveButtonClicked(self): diff --git a/openlp/plugins/songs/forms/songmaintenancedialog.py b/openlp/plugins/songs/forms/songmaintenancedialog.py index 0fa3335dc..10827868c 100644 --- a/openlp/plugins/songs/forms/songmaintenancedialog.py +++ b/openlp/plugins/songs/forms/songmaintenancedialog.py @@ -28,6 +28,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import build_icon, translate from openlp.core.lib.ui import UiStrings +from openlp.plugins.songs.lib.ui import SongStrings class Ui_SongMaintenanceDialog(object): def setupUi(self, songMaintenanceDialog): @@ -145,13 +146,10 @@ class Ui_SongMaintenanceDialog(object): def retranslateUi(self, songMaintenanceDialog): songMaintenanceDialog.setWindowTitle( - translate('SongsPlugin.SongMaintenanceForm', 'Song Maintenance')) - authorsString = UiStrings.Authors - topicsString = translate('SongsPlugin.SongMaintenanceForm', 'Topics') - booksString = translate('SongsPlugin.SongMaintenanceForm', 'Song Books') - self.listItemAuthors.setText(authorsString) - self.listItemTopics.setText(topicsString) - self.listItemBooks.setText(booksString) + SongStrings.TypeMaintenance % SongStrings.Song) + self.listItemAuthors.setText(SongStrings.Authors) + self.listItemTopics.setText(SongStrings.Topics) + self.listItemBooks.setText(SongStrings.SongBooks) self.authorsAddButton.setText(UiStrings.Add) self.authorsEditButton.setText(UiStrings.Edit) self.authorsDeleteButton.setText(UiStrings.Delete) @@ -161,8 +159,8 @@ class Ui_SongMaintenanceDialog(object): self.booksAddButton.setText(UiStrings.Add) self.booksEditButton.setText(UiStrings.Edit) self.booksDeleteButton.setText(UiStrings.Delete) - typeListWidth = max(self.fontMetrics().width(authorsString), - self.fontMetrics().width(topicsString), - self.fontMetrics().width(booksString)) + typeListWidth = max(self.fontMetrics().width(SongStrings.Authors), + self.fontMetrics().width(SongStrings.Topics), + self.fontMetrics().width(SongStrings.SongBooks)) self.typeListWidget.setFixedWidth(typeListWidth + self.typeListWidget.iconSize().width() + 32) diff --git a/openlp/plugins/songs/forms/topicsdialog.py b/openlp/plugins/songs/forms/topicsdialog.py index 1e7bdb6a0..4e2349019 100644 --- a/openlp/plugins/songs/forms/topicsdialog.py +++ b/openlp/plugins/songs/forms/topicsdialog.py @@ -28,6 +28,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate from openlp.core.lib.ui import create_accept_reject_button_box +from openlp.plugins.songs.lib.ui import SongStrings class Ui_TopicsDialog(object): def setupUi(self, topicsDialog): @@ -52,6 +53,6 @@ class Ui_TopicsDialog(object): def retranslateUi(self, topicsDialog): topicsDialog.setWindowTitle( - translate('SongsPlugin.TopicsForm', 'Topic Maintenance')) + SongStrings.TypeMaintenance % SongStrings.Topic) self.nameLabel.setText( translate('SongsPlugin.TopicsForm', 'Topic name:')) diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 283aa6c03..8d704d51d 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -38,6 +38,7 @@ from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm, \ SongImportForm, SongExportForm from openlp.plugins.songs.lib import OpenLyrics, SongXML from openlp.plugins.songs.lib.db import Author, Song +from openlp.plugins.songs.lib.ui import SongStrings from openlp.core.lib.searchedit import SearchEdit log = logging.getLogger(__name__) @@ -129,7 +130,7 @@ class SongMediaItem(MediaManagerItem): self.searchTextButton.setText( translate('SongsPlugin.MediaItem', 'Search')) self.maintenanceAction.setText( - translate('SongsPlugin.MediaItem', 'Song Maintenance')) + SongStrings.TypeMaintenance % SongString.Song) self.maintenanceAction.setToolTip(translate('SongsPlugin.MediaItem', 'Maintain the lists of authors, topics and books')) @@ -141,7 +142,7 @@ class SongMediaItem(MediaManagerItem): translate('SongsPlugin.MediaItem', 'Titles')), (3, u':/songs/song_search_lyrics.png', translate('SongsPlugin.MediaItem', 'Lyrics')), - (4, u':/songs/song_search_author.png', UiStrings.Authors), + (4, u':/songs/song_search_author.png', SongStrings.Authors), (5, u':/slides/slide_theme.png', UiStrings.Themes) ]) self.configUpdated() diff --git a/openlp/plugins/songs/lib/ui.py b/openlp/plugins/songs/lib/ui.py new file mode 100644 index 000000000..2a67fce55 --- /dev/null +++ b/openlp/plugins/songs/lib/ui.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 + +############################################################################### +# OpenLP - Open Source Lyrics Projection # +# --------------------------------------------------------------------------- # +# Copyright (c) 2008-2011 Raoul Snyman # +# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # +# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # +# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # +# Carsten Tinggaard, Frode Woldsund # +# --------------------------------------------------------------------------- # +# This program is free software; you can redistribute it and/or modify it # +# under the terms of the GNU General Public License as published by the Free # +# Software Foundation; version 2 of the License. # +# # +# This program is distributed in the hope that it will be useful, but WITHOUT # +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # +# more details. # +# # +# You should have received a copy of the GNU General Public License along # +# with this program; if not, write to the Free Software Foundation, Inc., 59 # +# Temple Place, Suite 330, Boston, MA 02111-1307 USA # +############################################################################### +""" +The :mod:`openlp.plugins.songs.lib.ui` module provides standard UI components +for the songs plugin. +""" +from openlp.core.lib import translate + +class SongStrings(object): + """ + Provide standard strings for use throughout the songs plugin. + """ + # These strings should need a good reason to be retranslated elsewhere. + Author = translate('OpenLP.Ui', 'Author', 'Singular') + Authors = translate('OpenLP.Ui', 'Authors', 'Plural') + SongBook = translate('OpenLP.Ui', 'Song Book', 'Singular') + SongBooks = translate('OpenLP.Ui', 'Song Books', 'Plural') + Topic = translate('OpenLP.Ui', 'Topic', 'Singular') + Topics = translate('OpenLP.Ui', 'Topics', 'Plural') + TypeMaintenance = unicode(translate('OpenLP.Ui', '%s Maintenance')) From 23eb12be1a6ee2ca015f90a630bd6d942e078d61 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Fri, 11 Feb 2011 21:40:43 +0000 Subject: [PATCH 087/243] Fixes --- openlp/core/lib/mediamanageritem.py | 1 + openlp/plugins/songs/forms/songmaintenancedialog.py | 2 +- openlp/plugins/songs/lib/mediaitem.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 52b4f560b..74dbf7fe1 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -34,6 +34,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import context_menu_action, context_menu_separator, \ SettingsManager, OpenLPToolbar, ServiceItem, StringContent, build_icon, \ translate, Receiver, ListWidgetWithDnD +from openlp.core.lib.ui import UiStrings log = logging.getLogger(__name__) diff --git a/openlp/plugins/songs/forms/songmaintenancedialog.py b/openlp/plugins/songs/forms/songmaintenancedialog.py index 10827868c..f6454fcb0 100644 --- a/openlp/plugins/songs/forms/songmaintenancedialog.py +++ b/openlp/plugins/songs/forms/songmaintenancedialog.py @@ -26,7 +26,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import build_icon, translate +from openlp.core.lib import build_icon from openlp.core.lib.ui import UiStrings from openlp.plugins.songs.lib.ui import SongStrings diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 8d704d51d..b59d0a7b8 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -130,7 +130,7 @@ class SongMediaItem(MediaManagerItem): self.searchTextButton.setText( translate('SongsPlugin.MediaItem', 'Search')) self.maintenanceAction.setText( - SongStrings.TypeMaintenance % SongString.Song) + SongStrings.TypeMaintenance % SongStrings.Song) self.maintenanceAction.setToolTip(translate('SongsPlugin.MediaItem', 'Maintain the lists of authors, topics and books')) From 65cdc31a88228a8c0a14d43f67aab3d7c4b1f5dc Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Fri, 11 Feb 2011 22:15:13 +0000 Subject: [PATCH 088/243] UiStrings --- openlp/core/lib/ui.py | 8 ++++++++ openlp/core/ui/mainwindow.py | 39 +++++++++++++++++------------------- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 0c5fe2bf9..1c4137371 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -59,8 +59,10 @@ class UiStrings(object): Import = translate('OpenLP.Ui', 'Import') ImportType = unicode(translate('OpenLP.Ui', 'Import %s')) Live = translate('OpenLP.Ui', 'Live') + LivePanel = translate('OpenLP.Ui', 'Live Panel') Load = translate('OpenLP.Ui', 'Load') LoadANew = unicode(translate('OpenLP.Ui', 'Load a new %s.')) + MediaManager = translate('OpenLP.Ui', 'Media Manager') New = translate('OpenLP.Ui', 'New') NewType = unicode(translate('OpenLP.Ui', 'New %s')) NFSs = translate('OpenLP.Ui', 'No File Selected', 'Singular') @@ -70,6 +72,7 @@ class UiStrings(object): OLPV2 = translate('OpenLP.Ui', 'OpenLP 2.0') OpenType = unicode(translate('OpenLP.Ui', 'Open %s')) Preview = translate('OpenLP.Ui', 'Preview') + PreviewPanel = translate('OpenLP.Ui', 'Preview Panel') PreviewSelect = unicode(translate('OpenLP.Ui', 'Preview the selected %s.')) ReplaceBG = translate('OpenLP.Ui', 'Replace Background') ReplaceLiveBG = translate('OpenLP.Ui', 'Replace Live Background') @@ -79,8 +82,13 @@ class UiStrings(object): SendSelectLive = unicode(translate('OpenLP.Ui', 'Send the selected %s live.')) Service = translate('OpenLP.Ui', 'Service') + ServiceManager = translate('OpenLP.Ui', 'Service Manager') Theme = translate('OpenLP.Ui', 'Theme', 'Singular') Themes = translate('OpenLP.Ui', 'Themes', 'Plural') + ThemeManager = translate('OpenLP.Ui', 'Theme Manager') + ToggleType = unicode(translate('OpenLP.Ui', 'Toggle %s')) + ToggleVisibility = unicode(translate('OpenLP.Ui', + 'Toggle the visibility of the %s.')) def add_welcome_page(parent, image): diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 4840ef5da..91c5da716 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -312,12 +312,9 @@ class Ui_MainWindow(object): self.SettingsLanguageMenu.setTitle(translate('OpenLP.MainWindow', '&Language')) self.HelpMenu.setTitle(translate('OpenLP.MainWindow', '&Help')) - self.mediaManagerDock.setWindowTitle( - translate('OpenLP.MainWindow', 'Media Manager')) - self.serviceManagerDock.setWindowTitle( - translate('OpenLP.MainWindow', 'Service Manager')) - self.themeManagerDock.setWindowTitle( - translate('OpenLP.MainWindow', 'Theme Manager')) + self.mediaManagerDock.setWindowTitle(UiStrings.MediaManager) + self.serviceManagerDock.setWindowTitle(UiStrings.ServiceManager) + self.themeManagerDock.setWindowTitle(UiStrings.ThemeManager) self.FileNewItem.setText(translate('OpenLP.MainWindow', '&New')) self.FileNewItem.setToolTip(UiStrings.NewType % UiStrings.Service) self.FileNewItem.setStatusTip( @@ -368,41 +365,41 @@ class Ui_MainWindow(object): self.ViewMediaManagerItem.setText( translate('OpenLP.MainWindow', '&Media Manager')) self.ViewMediaManagerItem.setToolTip( - translate('OpenLP.MainWindow', 'Toggle Media Manager')) - self.ViewMediaManagerItem.setStatusTip(translate('OpenLP.MainWindow', - 'Toggle the visibility of the media manager.')) + UiStrings.Toggle % UiStrings.MediaManager) + self.ViewMediaManagerItem.setStatusTip( + UiStrings.ToggleVisibility % UiStrings.MediaManager.toLower()) self.ViewMediaManagerItem.setShortcut( translate('OpenLP.MainWindow', 'F8')) self.ViewThemeManagerItem.setText( translate('OpenLP.MainWindow', '&Theme Manager')) self.ViewThemeManagerItem.setToolTip( - translate('OpenLP.MainWindow', 'Toggle Theme Manager')) - self.ViewThemeManagerItem.setStatusTip(translate('OpenLP.MainWindow', - 'Toggle the visibility of the theme manager.')) + UiStrings.Toggle % UiStrings.ThemeManager) + self.ViewThemeManagerItem.setStatusTip( + UiStrings.ToggleVisibility % UiStrings.ThemeManager.toLower()) self.ViewThemeManagerItem.setShortcut( translate('OpenLP.MainWindow', 'F10')) self.ViewServiceManagerItem.setText( translate('OpenLP.MainWindow', '&Service Manager')) self.ViewServiceManagerItem.setToolTip( - translate('OpenLP.MainWindow', 'Toggle Service Manager')) - self.ViewServiceManagerItem.setStatusTip(translate('OpenLP.MainWindow', - 'Toggle the visibility of the service manager.')) + UiStrings.Toggle % UiStrings.ServiceManager) + self.ViewServiceManagerItem.setStatusTip( + UiStrings.ToggleVisibility % UiStrings.ServiceManager.toLower()) self.ViewServiceManagerItem.setShortcut( translate('OpenLP.MainWindow', 'F9')) self.ViewPreviewPanel.setText( translate('OpenLP.MainWindow', '&Preview Panel')) self.ViewPreviewPanel.setToolTip( - translate('OpenLP.MainWindow', 'Toggle Preview Panel')) - self.ViewPreviewPanel.setStatusTip(translate('OpenLP.MainWindow', - 'Toggle the visibility of the preview panel.')) + UiStrings.Toggle % UiStrings.PreviewPanel) + self.ViewPreviewPanel.setStatusTip( + UiStrings.ToggleVisibility % UiStrings.PreviewPanel.toLower()) self.ViewPreviewPanel.setShortcut( translate('OpenLP.MainWindow', 'F11')) self.ViewLivePanel.setText( translate('OpenLP.MainWindow', '&Live Panel')) self.ViewLivePanel.setToolTip( - translate('OpenLP.MainWindow', 'Toggle Live Panel')) - self.ViewLivePanel.setStatusTip(translate('OpenLP.MainWindow', - 'Toggle the visibility of the live panel.')) + UiStrings.Toggle % UiStrings.LivePanel) + self.ViewLivePanel.setStatusTip( + UiStrings.ToggleVisibility % UiStrings.LivePanel.toLower()) self.ViewLivePanel.setShortcut( translate('OpenLP.MainWindow', 'F12')) self.settingsPluginListItem.setText(translate('OpenLP.MainWindow', From 314697427dad27a12bcaf80a67602c5736c7595d Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sat, 12 Feb 2011 00:41:09 +0000 Subject: [PATCH 089/243] Fixes --- openlp/core/ui/mainwindow.py | 10 +++++----- openlp/plugins/songs/forms/songmaintenancedialog.py | 7 ++++--- openlp/plugins/songs/lib/mediaitem.py | 6 +++--- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 91c5da716..3891c22b1 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -365,7 +365,7 @@ class Ui_MainWindow(object): self.ViewMediaManagerItem.setText( translate('OpenLP.MainWindow', '&Media Manager')) self.ViewMediaManagerItem.setToolTip( - UiStrings.Toggle % UiStrings.MediaManager) + UiStrings.ToggleType % UiStrings.MediaManager) self.ViewMediaManagerItem.setStatusTip( UiStrings.ToggleVisibility % UiStrings.MediaManager.toLower()) self.ViewMediaManagerItem.setShortcut( @@ -373,7 +373,7 @@ class Ui_MainWindow(object): self.ViewThemeManagerItem.setText( translate('OpenLP.MainWindow', '&Theme Manager')) self.ViewThemeManagerItem.setToolTip( - UiStrings.Toggle % UiStrings.ThemeManager) + UiStrings.ToggleType % UiStrings.ThemeManager) self.ViewThemeManagerItem.setStatusTip( UiStrings.ToggleVisibility % UiStrings.ThemeManager.toLower()) self.ViewThemeManagerItem.setShortcut( @@ -381,7 +381,7 @@ class Ui_MainWindow(object): self.ViewServiceManagerItem.setText( translate('OpenLP.MainWindow', '&Service Manager')) self.ViewServiceManagerItem.setToolTip( - UiStrings.Toggle % UiStrings.ServiceManager) + UiStrings.ToggleType % UiStrings.ServiceManager) self.ViewServiceManagerItem.setStatusTip( UiStrings.ToggleVisibility % UiStrings.ServiceManager.toLower()) self.ViewServiceManagerItem.setShortcut( @@ -389,7 +389,7 @@ class Ui_MainWindow(object): self.ViewPreviewPanel.setText( translate('OpenLP.MainWindow', '&Preview Panel')) self.ViewPreviewPanel.setToolTip( - UiStrings.Toggle % UiStrings.PreviewPanel) + UiStrings.ToggleType % UiStrings.PreviewPanel) self.ViewPreviewPanel.setStatusTip( UiStrings.ToggleVisibility % UiStrings.PreviewPanel.toLower()) self.ViewPreviewPanel.setShortcut( @@ -397,7 +397,7 @@ class Ui_MainWindow(object): self.ViewLivePanel.setText( translate('OpenLP.MainWindow', '&Live Panel')) self.ViewLivePanel.setToolTip( - UiStrings.Toggle % UiStrings.LivePanel) + UiStrings.ToggleType % UiStrings.LivePanel) self.ViewLivePanel.setStatusTip( UiStrings.ToggleVisibility % UiStrings.LivePanel.toLower()) self.ViewLivePanel.setShortcut( diff --git a/openlp/plugins/songs/forms/songmaintenancedialog.py b/openlp/plugins/songs/forms/songmaintenancedialog.py index f6454fcb0..14ad1132d 100644 --- a/openlp/plugins/songs/forms/songmaintenancedialog.py +++ b/openlp/plugins/songs/forms/songmaintenancedialog.py @@ -26,7 +26,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import build_icon +from openlp.core.lib import build_icon, StringContent from openlp.core.lib.ui import UiStrings from openlp.plugins.songs.lib.ui import SongStrings @@ -145,8 +145,9 @@ class Ui_SongMaintenanceDialog(object): QtCore.QMetaObject.connectSlotsByName(songMaintenanceDialog) def retranslateUi(self, songMaintenanceDialog): - songMaintenanceDialog.setWindowTitle( - SongStrings.TypeMaintenance % SongStrings.Song) + songMaintenanceDialog.setWindowTitle(SongStrings.TypeMaintenance % + songMaintenanceDialog.parent().plugin.getString( + StringContent.Name)[u'singular']) self.listItemAuthors.setText(SongStrings.Authors) self.listItemTopics.setText(SongStrings.Topics) self.listItemBooks.setText(SongStrings.SongBooks) diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index b59d0a7b8..99a827a4e 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -32,7 +32,7 @@ from PyQt4 import QtCore, QtGui from sqlalchemy.sql import or_ from openlp.core.lib import MediaManagerItem, Receiver, ItemCapabilities, \ - translate, check_item_selected, PluginStatus + translate, check_item_selected, PluginStatus, StringContent from openlp.core.lib.ui import UiStrings from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm, \ SongImportForm, SongExportForm @@ -129,8 +129,8 @@ class SongMediaItem(MediaManagerItem): translate('SongsPlugin.MediaItem', 'Search:')) self.searchTextButton.setText( translate('SongsPlugin.MediaItem', 'Search')) - self.maintenanceAction.setText( - SongStrings.TypeMaintenance % SongStrings.Song) + self.maintenanceAction.setText(SongStrings.TypeMaintenance % + self.plugin.getString(StringContent.Name)[u'singular']) self.maintenanceAction.setToolTip(translate('SongsPlugin.MediaItem', 'Maintain the lists of authors, topics and books')) From 8d18a51f09eda9d48a7c58c214642bb11faee6df Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sat, 12 Feb 2011 02:43:13 +0000 Subject: [PATCH 090/243] WizardStrings --- openlp/core/lib/ui.py | 1 + openlp/core/ui/wizard.py | 23 +++++++++++-- .../plugins/bibles/forms/bibleimportform.py | 34 ++++++++----------- openlp/plugins/songs/forms/songexportform.py | 10 +++--- openlp/plugins/songs/forms/songimportform.py | 32 +++++++---------- 5 files changed, 53 insertions(+), 47 deletions(-) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 1c4137371..99b266e6e 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -55,6 +55,7 @@ class UiStrings(object): EditType = unicode(translate('OpenLP.Ui', 'Edit %s')) EmptyField = translate('OpenLP.Ui', 'Empty Field') Error = translate('OpenLP.Ui', 'Error') + Export = translate('OpenLP.Ui', 'Export') ExportType = unicode(translate('OpenLP.Ui', 'Export %s')) Import = translate('OpenLP.Ui', 'Import') ImportType = unicode(translate('OpenLP.Ui', 'Import %s')) diff --git a/openlp/core/ui/wizard.py b/openlp/core/ui/wizard.py index d3410ded9..fff1e2552 100644 --- a/openlp/core/ui/wizard.py +++ b/openlp/core/ui/wizard.py @@ -31,11 +31,30 @@ import os from PyQt4 import QtCore, QtGui -from openlp.core.lib import build_icon, Receiver, SettingsManager +from openlp.core.lib import build_icon, Receiver, SettingsManager, translate from openlp.core.lib.ui import UiStrings, add_welcome_page log = logging.getLogger(__name__) +class WizardStrings(object): + """ + Provide standard strings for wizards to use. + """ + # These strings should need a good reason to be retranslated elsewhere. + Description = unicode(translate('OpenLP.Ui', 'This wizard will help you ' + 'to %s %s from a variety of formats. Click the next button ' + 'below to start the process by selecting a format to %s from.', + 'Variable 1 & 3 are import/export. Variable 2 is a type like Bibles')) + FinishedType = unicode(translate('OpenLP.Ui', 'Finished %s.')) + FormatLabel = translate('OpenLP.Ui', 'Format:') + ImportSelect = translate('OpenLP.Ui', 'Select Import Source') + ImportSelectLong = unicode(translate('OpenLP.Ui', + 'Select the import format and the location to import from.')) + Welcome = u'%s' % \ + translate('OpenLP.Ui', 'Welcome to the %s %s Wizard', + 'Variable 1 is the type e.g. Bible and variable 2 is import/export') + + class OpenLPWizard(QtGui.QWizard): """ Generic OpenLP wizard to provide generic functionality and a unified look @@ -43,6 +62,7 @@ class OpenLPWizard(QtGui.QWizard): """ def __init__(self, parent, plugin, name, image): QtGui.QWizard.__init__(self, parent) + self.plugin = plugin self.setObjectName(name) self.openIcon = build_icon(u':/general/general_open.png') self.deleteIcon = build_icon(u':/general/general_delete.png') @@ -50,7 +70,6 @@ class OpenLPWizard(QtGui.QWizard): self.cancelButton = self.button(QtGui.QWizard.CancelButton) self.setupUi(image) self.registerFields() - self.plugin = plugin self.customInit() self.customSignals() QtCore.QObject.connect(self, QtCore.SIGNAL(u'currentIdChanged(int)'), diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index 0e21b7496..d97299a42 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -33,10 +33,10 @@ import os.path from PyQt4 import QtCore, QtGui -from openlp.core.lib import Receiver, translate +from openlp.core.lib import Receiver, StringContent, translate from openlp.core.lib.db import delete_database from openlp.core.lib.ui import UiStrings, critical_error_message_box -from openlp.core.ui.wizard import OpenLPWizard +from openlp.core.ui.wizard import OpenLPWizard, WizardStrings from openlp.core.utils import AppLocation, string_is_unicode from openlp.plugins.bibles.lib.manager import BibleFormat @@ -363,22 +363,16 @@ class BibleImportForm(OpenLPWizard): """ self.setWindowTitle( translate('BiblesPlugin.ImportWizardForm', 'Bible Import Wizard')) - self.titleLabel.setText( - u'%s' % \ - translate('BiblesPlugin.ImportWizardForm', - 'Welcome to the Bible Import Wizard')) - self.informationLabel.setText( - translate('BiblesPlugin.ImportWizardForm', - 'This wizard will help you to import Bibles from a ' - 'variety of formats. Click the next button below to start the ' - 'process by selecting a format to import from.')) - self.selectPage.setTitle(translate('BiblesPlugin.ImportWizardForm', - 'Select Import Source')) - self.selectPage.setSubTitle( - translate('BiblesPlugin.ImportWizardForm', - 'Select the import format, and where to import from.')) - self.formatLabel.setText( - translate('BiblesPlugin.ImportWizardForm', 'Format:')) + self.titleLabel.setText(WizardStrings.Welcome % ( + self.plugin.getString(StringContent.Name)[u'singular'], + UiStrings.Import)) + self.informationLabel.setText(WizardStrings.Description % ( + UiStrings.Import.toLower(), + self.plugin.getString(StringContent.Name)[u'plural'], + UiStrings.Import.toLower())) + self.selectPage.setTitle(WizardStrings.ImportSelect) + self.selectPage.setSubTitle(WizardStrings.ImportSelectLong) + self.formatLabel.setText(WizardStrings.FormatLabel) self.formatComboBox.setItemText(0, translate('BiblesPlugin.ImportWizardForm', 'OSIS')) self.formatComboBox.setItemText(1, @@ -796,8 +790,8 @@ class BibleImportForm(OpenLPWizard): 'bible. Please note, that verses will be downloaded on\n' 'demand and thus an internet connection is required.')) else: - self.progressLabel.setText(translate( - 'BiblesPlugin.ImportWizardForm', 'Finished import.')) + self.progressLabel.setText( + WizardStrings.FinishedType % UiStrings.Import.toLower()) else: self.progressLabel.setText(translate( 'BiblesPlugin.ImportWizardForm', 'Your Bible import failed.')) diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index 849a1ad1e..9e528a969 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -32,8 +32,8 @@ import logging from PyQt4 import QtCore, QtGui from openlp.core.lib import build_icon, Receiver, SettingsManager, translate -from openlp.core.lib.ui import critical_error_message_box -from openlp.core.ui.wizard import OpenLPWizard +from openlp.core.lib.ui import UiStrings, critical_error_message_box +from openlp.core.ui.wizard import OpenLPWizard, WizardStrings from openlp.plugins.songs.lib.db import Song from openlp.plugins.songs.lib.openlyricsexport import OpenLyricsExport @@ -213,9 +213,7 @@ class SongExportForm(OpenLPWizard): self.availableListWidget) if item.checkState() ] if not items: - critical_error_message_box( - translate('SongsPlugin.ExportWizardForm', - 'No Song Selected'), + critical_error_message_box(UiStrings.NISp, translate('SongsPlugin.ExportWizardForm', 'You need to add at least one Song to export.')) return False @@ -289,7 +287,7 @@ class SongExportForm(OpenLPWizard): self, songs, unicode(self.directoryLineEdit.text())) if exporter.do_export(): self.progressLabel.setText( - translate('SongsPlugin.SongExportForm', 'Finished export.')) + WizardStrings.FinishedType % UiStrings.Export.toLower()) else: self.progressLabel.setText( translate('SongsPlugin.SongExportForm', diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index cb9d67b6a..b8dd2975a 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -31,9 +31,9 @@ import os from PyQt4 import QtCore, QtGui -from openlp.core.lib import Receiver, SettingsManager, translate +from openlp.core.lib import Receiver, SettingsManager, StringContent, translate from openlp.core.lib.ui import UiStrings, critical_error_message_box -from openlp.core.ui.wizard import OpenLPWizard +from openlp.core.ui.wizard import OpenLPWizard, WizardStrings from openlp.plugins.songs.lib.importer import SongFormat log = logging.getLogger(__name__) @@ -199,22 +199,16 @@ class SongImportForm(OpenLPWizard): """ self.setWindowTitle( translate('SongsPlugin.ImportWizardForm', 'Song Import Wizard')) - self.titleLabel.setText( - u'%s' % \ - translate('SongsPlugin.ImportWizardForm', - 'Welcome to the Song Import Wizard')) - self.informationLabel.setText( - translate('SongsPlugin.ImportWizardForm', - 'This wizard will help you to import songs from a variety of ' - 'formats. Click the next button below to start the process by ' - 'selecting a format to import from.')) - self.sourcePage.setTitle( - translate('SongsPlugin.ImportWizardForm', 'Select Import Source')) - self.sourcePage.setSubTitle( - translate('SongsPlugin.ImportWizardForm', - 'Select the import format, and where to import from.')) - self.formatLabel.setText( - translate('SongsPlugin.ImportWizardForm', 'Format:')) + self.titleLabel.setText(WizardStrings.Welcome % ( + self.plugin.getString(StringContent.Name)[u'singular'], + UiStrings.Import)) + self.informationLabel.setText(WizardStrings.Description % ( + UiStrings.Import.toLower(), + self.plugin.getString(StringContent.Name)[u'plural'], + UiStrings.Import.toLower())) + self.sourcePage.setTitle(WizardStrings.ImportSelect) + self.sourcePage.setSubTitle(WizardStrings.ImportSelectLong) + self.formatLabel.setText(WizardStrings.FormatLabel) self.formatComboBox.setItemText(0, UiStrings.OLPV2) self.formatComboBox.setItemText(1, translate('SongsPlugin.ImportWizardForm', 'openlp.org 1.x')) @@ -719,7 +713,7 @@ class SongImportForm(OpenLPWizard): ) if importer.do_import(): self.progressLabel.setText( - translate('SongsPlugin.SongImportForm', 'Finished import.')) + WizardStrings.FinishedType % UiStrings.Import.toLower()) else: self.progressLabel.setText( translate('SongsPlugin.SongImportForm', From a8f16262fc7ae4b6e2e77b1df17a7d0663aa1c9c Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sat, 12 Feb 2011 04:09:03 +0000 Subject: [PATCH 091/243] More string refactoring --- openlp/core/lib/ui.py | 5 ++++ openlp/core/ui/aboutdialog.py | 7 +++-- openlp/core/ui/advancedtab.py | 2 +- openlp/core/ui/plugindialog.py | 8 +++--- openlp/core/ui/servicemanager.py | 3 +-- openlp/core/ui/themewizard.py | 7 +++-- openlp/core/ui/wizard.py | 14 ++++++++-- .../plugins/bibles/forms/bibleimportform.py | 11 +++----- openlp/plugins/bibles/lib/mediaitem.py | 12 +++------ openlp/plugins/images/lib/mediaitem.py | 2 +- openlp/plugins/songs/forms/songexportform.py | 15 ++++------- openlp/plugins/songs/forms/songimportform.py | 26 +++++++------------ openlp/plugins/songs/lib/mediaitem.py | 6 ++--- 13 files changed, 54 insertions(+), 64 deletions(-) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 99b266e6e..6ce04af75 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -40,12 +40,14 @@ class UiStrings(object): """ # These strings should need a good reason to be retranslated elsewhere. # Should some/more/less of these have an & attached? + About = translate('OpenLP.Ui', 'About') Add = translate('OpenLP.Ui', '&Add') AddANew = unicode(translate('OpenLP.Ui', 'Add a new %s.')) AddSelectService = unicode(translate('OpenLP.Ui', 'Add the selected %s to the service.')) Advanced = translate('OpenLP.Ui', 'Advanced') AllFiles = translate('OpenLP.Ui', 'All Files') + Browse = translate('OpenLP.Ui', 'Browse...') CreateANew = unicode(translate('OpenLP.Ui', 'Create a new %s.')) Delete = translate('OpenLP.Ui', '&Delete') DeleteSelect = unicode(translate('OpenLP.Ui', 'Delete the selected %s.')) @@ -57,6 +59,7 @@ class UiStrings(object): Error = translate('OpenLP.Ui', 'Error') Export = translate('OpenLP.Ui', 'Export') ExportType = unicode(translate('OpenLP.Ui', 'Export %s')) + Image = translate('OpenLP.Ui', 'Image') Import = translate('OpenLP.Ui', 'Import') ImportType = unicode(translate('OpenLP.Ui', 'Import %s')) Live = translate('OpenLP.Ui', 'Live') @@ -80,6 +83,7 @@ class UiStrings(object): ResetBG = translate('OpenLP.Ui', 'Reset Background') ResetLiveBG = translate('OpenLP.Ui', 'Reset Live Background') SaveType = unicode(translate('OpenLP.Ui', 'Save %s')) + Search = translate('OpenLP.Ui', 'Search') SendSelectLive = unicode(translate('OpenLP.Ui', 'Send the selected %s live.')) Service = translate('OpenLP.Ui', 'Service') @@ -90,6 +94,7 @@ class UiStrings(object): ToggleType = unicode(translate('OpenLP.Ui', 'Toggle %s')) ToggleVisibility = unicode(translate('OpenLP.Ui', 'Toggle the visibility of the %s.')) + Version = translate('OpenLP.Ui', 'Version') def add_welcome_page(parent, image): diff --git a/openlp/core/ui/aboutdialog.py b/openlp/core/ui/aboutdialog.py index bb09ab91f..19a61b3f8 100644 --- a/openlp/core/ui/aboutdialog.py +++ b/openlp/core/ui/aboutdialog.py @@ -27,6 +27,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import build_icon, translate +from openlp.core.lib.ui import UiStrings class Ui_AboutDialog(object): def setupUi(self, aboutDialog): @@ -86,8 +87,7 @@ class Ui_AboutDialog(object): QtCore.QMetaObject.connectSlotsByName(aboutDialog) def retranslateUi(self, aboutDialog): - aboutDialog.setWindowTitle(translate('OpenLP.AboutForm', - 'About OpenLP')) + aboutDialog.setWindowTitle(u'%s OpenLP' % UiStrings.About) self.aboutTextEdit.setPlainText(translate('OpenLP.AboutForm', 'OpenLP - Open Source Lyrics ' 'Projection\n' @@ -105,8 +105,7 @@ class Ui_AboutDialog(object): 'consider contributing by using the button below.' )) self.aboutNotebook.setTabText( - self.aboutNotebook.indexOf(self.aboutTab), - translate('OpenLP.AboutForm', 'About')) + self.aboutNotebook.indexOf(self.aboutTab), UiStrings.About) self.creditsTextEdit.setPlainText(translate('OpenLP.AboutForm', 'Project Lead\n' ' Raoul "superfly" Snyman\n' diff --git a/openlp/core/ui/advancedtab.py b/openlp/core/ui/advancedtab.py index 918335b2e..39fec1f9d 100644 --- a/openlp/core/ui/advancedtab.py +++ b/openlp/core/ui/advancedtab.py @@ -135,7 +135,7 @@ class AdvancedTab(SettingsTab): # self.sharedCheckBox.setText( # translate('AdvancedTab', 'Enable a shared data location')) # self.sharedLabel.setText(translate('AdvancedTab', 'Store location:')) -# self.sharedPushButton.setText(translate('AdvancedTab', 'Browse...')) +# self.sharedPushButton.setText(UiStrings.Browse) # self.databaseGroupBox.setTitle(translate('AdvancedTab', 'Databases')) def load(self): diff --git a/openlp/core/ui/plugindialog.py b/openlp/core/ui/plugindialog.py index 74b2d36c0..84f897a65 100644 --- a/openlp/core/ui/plugindialog.py +++ b/openlp/core/ui/plugindialog.py @@ -25,7 +25,9 @@ ############################################################################### from PyQt4 import QtCore, QtGui + from openlp.core.lib import translate +from openlp.core.lib.ui import UiStrings class Ui_PluginViewDialog(object): def setupUi(self, pluginViewDialog): @@ -76,10 +78,8 @@ class Ui_PluginViewDialog(object): translate('OpenLP.PluginForm', 'Plugin List')) self.pluginInfoGroupBox.setTitle( translate('OpenLP.PluginForm', 'Plugin Details')) - self.versionLabel.setText( - translate('OpenLP.PluginForm', 'Version:')) - self.aboutLabel.setText( - translate('OpenLP.PluginForm', 'About:')) + self.versionLabel.setText(u'%s:' % UiStrings.Version) + self.aboutLabel.setText(u'%s:' % UiStrings.About) self.statusLabel.setText( translate('OpenLP.PluginForm', 'Status:')) self.statusComboBox.setItemText(0, diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 744da7b46..9041b47a7 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -110,8 +110,7 @@ class ServiceManager(QtGui.QWidget): translate('OpenLP.ServiceManager', 'Save this service'), self.saveFile) self.toolbar.addSeparator() - self.themeLabel = QtGui.QLabel(translate('OpenLP.ServiceManager', - 'Theme:'), self) + self.themeLabel = QtGui.QLabel(u'%s:' % UiStrings.Theme, self) self.themeLabel.setMargin(3) self.themeLabel.setObjectName(u'themeLabel') self.toolbar.addToolbarWidget(u'ThemeLabel', self.themeLabel) diff --git a/openlp/core/ui/themewizard.py b/openlp/core/ui/themewizard.py index 38dd9f1dc..281e216d3 100644 --- a/openlp/core/ui/themewizard.py +++ b/openlp/core/ui/themewizard.py @@ -27,7 +27,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate, build_icon -from openlp.core.lib.ui import add_welcome_page, create_valign_combo +from openlp.core.lib.ui import UiStrings, add_welcome_page, create_valign_combo class Ui_ThemeWizard(object): def setupUi(self, themeWizard): @@ -421,8 +421,7 @@ class Ui_ThemeWizard(object): translate('OpenLP.ThemeWizard', 'Solid Color')) self.backgroundComboBox.setItemText(1, translate('OpenLP.ThemeWizard', 'Gradient')) - self.backgroundComboBox.setItemText(2, - translate('OpenLP.ThemeWizard', 'Image')) + self.backgroundComboBox.setItemText(2, UiStrings.Image) self.colorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:')) self.gradientStartLabel.setText( translate(u'OpenLP.ThemeWizard', 'Starting color:')) @@ -440,7 +439,7 @@ class Ui_ThemeWizard(object): translate('OpenLP.ThemeWizard', 'Top Left - Bottom Right')) self.gradientComboBox.setItemText(4, translate('OpenLP.ThemeWizard', 'Bottom Left - Top Right')) - self.imageLabel.setText(translate('OpenLP.ThemeWizard', 'Image:')) + self.imageLabel.setText(u'%s:' % UiStrings.Image) self.mainAreaPage.setTitle( translate('OpenLP.ThemeWizard', 'Main Area Font Details')) self.mainAreaPage.setSubTitle( diff --git a/openlp/core/ui/wizard.py b/openlp/core/ui/wizard.py index fff1e2552..1599b4738 100644 --- a/openlp/core/ui/wizard.py +++ b/openlp/core/ui/wizard.py @@ -31,7 +31,8 @@ import os from PyQt4 import QtCore, QtGui -from openlp.core.lib import build_icon, Receiver, SettingsManager, translate +from openlp.core.lib import build_icon, Receiver, SettingsManager, translate, \ + StringContent from openlp.core.lib.ui import UiStrings, add_welcome_page log = logging.getLogger(__name__) @@ -60,10 +61,12 @@ class OpenLPWizard(QtGui.QWizard): Generic OpenLP wizard to provide generic functionality and a unified look and feel. """ - def __init__(self, parent, plugin, name, image): + def __init__(self, parent, plugin, name, image, direction): QtGui.QWizard.__init__(self, parent) self.plugin = plugin self.setObjectName(name) + self.itemType = self.plugin.getString(StringContent.Name) + self.direction = direction self.openIcon = build_icon(u':/general/general_open.png') self.deleteIcon = build_icon(u':/general/general_delete.png') self.finishButton = self.button(QtGui.QWizard.FinishButton) @@ -90,6 +93,13 @@ class OpenLPWizard(QtGui.QWizard): self.retranslateUi() QtCore.QMetaObject.connectSlotsByName(self) + def retranslateUi(self): + """ + Provides generic wizard localisation + """ + self.titleLabel.setText(WizardStrings.Welcome % + (self.itemType[u'singular'], self.direction)) + def registerFields(self): """ Hook method for wizards to register any fields they need. diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index d97299a42..115d30bfe 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -88,7 +88,7 @@ class BibleImportForm(OpenLPWizard): self.manager = manager self.web_bible_list = {} OpenLPWizard.__init__(self, parent, bibleplugin, u'bibleImportWizard', - u':/wizards/wizard_importbible.bmp') + u':/wizards/wizard_importbible.bmp', UiStrings.Import) def setupUi(self, image): """ @@ -361,15 +361,12 @@ class BibleImportForm(OpenLPWizard): """ Allow for localisation of the bible import wizard. """ + OpenLPWizard.retranslateUi(self) self.setWindowTitle( translate('BiblesPlugin.ImportWizardForm', 'Bible Import Wizard')) - self.titleLabel.setText(WizardStrings.Welcome % ( - self.plugin.getString(StringContent.Name)[u'singular'], - UiStrings.Import)) self.informationLabel.setText(WizardStrings.Description % ( - UiStrings.Import.toLower(), - self.plugin.getString(StringContent.Name)[u'plural'], - UiStrings.Import.toLower())) + self.direction.toLower(), self.itemType[u'plural'], + self.direction.toLower())) self.selectPage.setTitle(WizardStrings.ImportSelect) self.selectPage.setSubTitle(WizardStrings.ImportSelectLong) self.formatLabel.setText(WizardStrings.FormatLabel) diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index 58dc11a6a..a0fdc801a 100644 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -227,20 +227,17 @@ class BibleMediaItem(MediaManagerItem): def retranslateUi(self): log.debug(u'retranslateUi') - self.quickVersionLabel.setText( - translate('BiblesPlugin.MediaItem', 'Version:')) + self.quickVersionLabel.setText(u'%s:' % UiStrings.Version) self.quickSecondLabel.setText( translate('BiblesPlugin.MediaItem', 'Second:')) self.quickSearchTypeLabel.setText( translate('BiblesPlugin.MediaItem', 'Search type:')) self.quickSearchLabel.setText( translate('BiblesPlugin.MediaItem', 'Find:')) - self.quickSearchButton.setText( - translate('BiblesPlugin.MediaItem', 'Search')) + self.quickSearchButton.setText(UiStrings.Search) self.quickClearLabel.setText( translate('BiblesPlugin.MediaItem', 'Results:')) - self.advancedVersionLabel.setText( - translate('BiblesPlugin.MediaItem', 'Version:')) + self.advancedVersionLabel.setText(u'%s:' % UiStrings.Version) self.advancedSecondLabel.setText( translate('BiblesPlugin.MediaItem', 'Second:')) self.advancedBookLabel.setText( @@ -255,8 +252,7 @@ class BibleMediaItem(MediaManagerItem): translate('BiblesPlugin.MediaItem', 'To:')) self.advancedClearLabel.setText( translate('BiblesPlugin.MediaItem', 'Results:')) - self.advancedSearchButton.setText( - translate('BiblesPlugin.MediaItem', 'Search')) + self.advancedSearchButton.setText(UiStrings.Search) self.quickSearchComboBox.addItem( translate('BiblesPlugin.MediaItem', 'Verse Search')) self.quickSearchComboBox.addItem( diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index 5f95a239c..2a66038ef 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -126,7 +126,7 @@ class ImageMediaItem(MediaManagerItem): items = self.listView.selectedIndexes() if items: service_item.title = unicode( - translate('ImagePlugin.MediaItem', 'Images')) + self.plugin.getString(StringContent.Name)[u'plural']) service_item.add_capability(ItemCapabilities.AllowsMaintain) service_item.add_capability(ItemCapabilities.AllowsPreview) service_item.add_capability(ItemCapabilities.AllowsLoop) diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index 9e528a969..86b4e448c 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -56,9 +56,8 @@ class SongExportForm(OpenLPWizard): ``plugin`` The songs plugin. """ - self.plugin = plugin OpenLPWizard.__init__(self, parent, plugin, u'songExportWizard', - u':/wizards/wizard_exportsong.bmp') + u':/wizards/wizard_exportsong.bmp', UiStrings.Export) self.stop_export_flag = False QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'openlp_stop_wizard'), self.stop_export) @@ -163,12 +162,9 @@ class SongExportForm(OpenLPWizard): """ Song wizard localisation. """ + OpenLPWizard.retranslateUi(self) self.setWindowTitle( translate('SongsPlugin.ExportWizardForm', 'Song Export Wizard')) - self.titleLabel.setText( - u'%s' % - translate('SongsPlugin.ExportWizardForm', - 'Welcome to the Song Export Wizard')) self.informationLabel.setText( translate('SongsPlugin.ExportWizardForm', 'This wizard will help to' ' export your songs to the open and free OpenLyrics worship song ' @@ -177,15 +173,14 @@ class SongExportForm(OpenLPWizard): translate('SongsPlugin.ExportWizardForm', 'Select Songs')) self.availableSongsPage.setSubTitle( translate('SongsPlugin.ExportWizardForm', - 'Check the songs, you want to export.')) - self.searchLabel.setText( - translate('SongsPlugin.ExportWizardForm', 'Search:')) + 'Check the songs you want to export.')) + self.searchLabel.setText(u'%s:' % UiStrings.Search) self.uncheckButton.setText( translate('SongsPlugin.ExportWizardForm', 'Uncheck All')) self.checkButton.setText( translate('SongsPlugin.ExportWizardForm', 'Check All')) self.exportSongPage.setTitle( - translate('SongsPlugin.ExportWizardForm', 'Select Directory')) + translate('SongsPlugin.ExportWizardForm', 'Select Directory')) self.exportSongPage.setSubTitle( translate('SongsPlugin.ExportWizardForm', 'Select the directory you want the songs to be saved.')) diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index b8dd2975a..99ff63b3d 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -56,7 +56,7 @@ class SongImportForm(OpenLPWizard): The songs plugin. """ OpenLPWizard.__init__(self, parent, plugin, u'songImportWizard', - u':/wizards/wizard_importsong.bmp') + u':/wizards/wizard_importsong.bmp', UiStrings.Import) def setupUi(self, image): """ @@ -197,15 +197,12 @@ class SongImportForm(OpenLPWizard): """ Song wizard localisation. """ + OpenLPWizard.retranslateUi(self) self.setWindowTitle( translate('SongsPlugin.ImportWizardForm', 'Song Import Wizard')) - self.titleLabel.setText(WizardStrings.Welcome % ( - self.plugin.getString(StringContent.Name)[u'singular'], - UiStrings.Import)) self.informationLabel.setText(WizardStrings.Description % ( - UiStrings.Import.toLower(), - self.plugin.getString(StringContent.Name)[u'plural'], - UiStrings.Import.toLower())) + self.direction.toLower(), self.itemType[u'plural'], + self.direction.toLower())) self.sourcePage.setTitle(WizardStrings.ImportSelect) self.sourcePage.setSubTitle(WizardStrings.ImportSelectLong) self.formatLabel.setText(WizardStrings.FormatLabel) @@ -235,12 +232,10 @@ class SongImportForm(OpenLPWizard): # translate('SongsPlugin.ImportWizardForm', 'CSV')) self.openLP2FilenameLabel.setText( translate('SongsPlugin.ImportWizardForm', 'Filename:')) - self.openLP2BrowseButton.setText( - translate('SongsPlugin.ImportWizardForm', 'Browse...')) + self.openLP2BrowseButton.setText(UiStrings.Browse) self.openLP1FilenameLabel.setText( translate('SongsPlugin.ImportWizardForm', 'Filename:')) - self.openLP1BrowseButton.setText( - translate('SongsPlugin.ImportWizardForm', 'Browse...')) + self.openLP1BrowseButton.setText(UiStrings.Browse) self.openLP1DisabledLabel.setText( translate('SongsPlugin.ImportWizardForm', 'The openlp.org 1.x ' 'importer has been disabled due to a missing Python module. If ' @@ -285,20 +280,17 @@ class SongImportForm(OpenLPWizard): 'find OpenOffice.org on your computer.')) self.easiSlidesFilenameLabel.setText( translate('SongsPlugin.ImportWizardForm', 'Filename:')) - self.easiSlidesBrowseButton.setText( - translate('SongsPlugin.ImportWizardForm', 'Browse...')) + self.easiSlidesBrowseButton.setText(UiStrings.Browse) self.ewFilenameLabel.setText( translate('SongsPlugin.ImportWizardForm', 'Filename:')) - self.ewBrowseButton.setText( - translate('SongsPlugin.ImportWizardForm', 'Browse...')) + self.ewBrowseButton.setText(UiStrings.Browse) self.songBeamerAddButton.setText( translate('SongsPlugin.ImportWizardForm', 'Add Files...')) self.songBeamerRemoveButton.setText( translate('SongsPlugin.ImportWizardForm', 'Remove File(s)')) # self.csvFilenameLabel.setText( # translate('SongsPlugin.ImportWizardForm', 'Filename:')) -# self.csvBrowseButton.setText( -# translate('SongsPlugin.ImportWizardForm', 'Browse...')) +# self.csvBrowseButton.setText(UiStrings.Browse) self.progressPage.setTitle( translate('SongsPlugin.ImportWizardForm', 'Importing')) self.progressPage.setSubTitle( diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 99a827a4e..b95a28c74 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -125,10 +125,8 @@ class SongMediaItem(MediaManagerItem): QtCore.QVariant(u'True')).toBool() def retranslateUi(self): - self.searchTextLabel.setText( - translate('SongsPlugin.MediaItem', 'Search:')) - self.searchTextButton.setText( - translate('SongsPlugin.MediaItem', 'Search')) + self.searchTextLabel.setText(u'%s:' % UiStrings.Search) + self.searchTextButton.setText(UiStrings.Search) self.maintenanceAction.setText(SongStrings.TypeMaintenance % self.plugin.getString(StringContent.Name)[u'singular']) self.maintenanceAction.setToolTip(translate('SongsPlugin.MediaItem', From 0988158c560992b9d65ee8072eec5c445079402c Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sat, 12 Feb 2011 04:20:53 +0000 Subject: [PATCH 092/243] Import fixes --- openlp/plugins/bibles/forms/bibleimportform.py | 2 +- openlp/plugins/images/lib/mediaitem.py | 2 +- openlp/plugins/songs/forms/songimportform.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index 115d30bfe..e4f1a2342 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -33,7 +33,7 @@ import os.path from PyQt4 import QtCore, QtGui -from openlp.core.lib import Receiver, StringContent, translate +from openlp.core.lib import Receiver, translate from openlp.core.lib.db import delete_database from openlp.core.lib.ui import UiStrings, critical_error_message_box from openlp.core.ui.wizard import OpenLPWizard, WizardStrings diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index 2a66038ef..ef5b6174a 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -31,7 +31,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, build_icon, ItemCapabilities, \ SettingsManager, translate, check_item_selected, check_directory_exists, \ - Receiver + Receiver, StringContent from openlp.core.lib.ui import UiStrings, critical_error_message_box from openlp.core.utils import AppLocation, delete_file, get_images_filter diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index 99ff63b3d..b0ca243ca 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -31,7 +31,7 @@ import os from PyQt4 import QtCore, QtGui -from openlp.core.lib import Receiver, SettingsManager, StringContent, translate +from openlp.core.lib import Receiver, SettingsManager, translate from openlp.core.lib.ui import UiStrings, critical_error_message_box from openlp.core.ui.wizard import OpenLPWizard, WizardStrings from openlp.plugins.songs.lib.importer import SongFormat From d98ea53cc15e3b039ca043a3e9282b02acdddc24 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 12 Feb 2011 10:04:10 +0000 Subject: [PATCH 093/243] Allow media items to start in the middle --- openlp/core/lib/serviceitem.py | 7 ++- openlp/core/lib/theme.py | 4 +- openlp/core/ui/__init__.py | 1 + openlp/core/ui/maindisplay.py | 13 +++++ openlp/core/ui/servicemanager.py | 27 +++++++++-- openlp/core/ui/starttimedialog.py | 70 +++++++++++++++++++++++++++ openlp/core/ui/starttimeform.py | 48 ++++++++++++++++++ openlp/plugins/media/lib/mediaitem.py | 1 + 8 files changed, 165 insertions(+), 6 deletions(-) create mode 100644 openlp/core/ui/starttimedialog.py create mode 100644 openlp/core/ui/starttimeform.py diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index c74b89144..4652aa503 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -60,6 +60,7 @@ class ItemCapabilities(object): AddIfNewItem = 9 ProvidesOwnDisplay = 10 AllowsDetailedTitleDisplay = 11 + AllowsVarableStartTime = 12 class ServiceItem(object): @@ -105,6 +106,7 @@ class ServiceItem(object): self.data_string = u'' self.edit_id = None self.xml_version = None + self.start_time =[0, 0, 0] self._new_item() def _new_item(self): @@ -257,7 +259,8 @@ class ServiceItem(object): u'capabilities': self.capabilities, u'search': self.search_string, u'data': self.data_string, - u'xml_version': self.xml_version + u'xml_version': self.xml_version, + u'start_time': self.start_time } service_data = [] if self.service_item_type == ServiceItemType.Text: @@ -301,6 +304,8 @@ class ServiceItem(object): self.data_string = header[u'data'] if u'xml_version' in header: self.xml_version = header[u'xml_version'] + if u'start_time' in header: + self.start_time = header[u'start_time'] if self.service_item_type == ServiceItemType.Text: for slide in serviceitem[u'serviceitem'][u'data']: self._raw_frames.append(slide) diff --git a/openlp/core/lib/theme.py b/openlp/core/lib/theme.py index 06340c2eb..4189452bc 100644 --- a/openlp/core/lib/theme.py +++ b/openlp/core/lib/theme.py @@ -170,8 +170,8 @@ class HorizontalType(object): Type enumeration for horizontal alignment. """ Left = 0 - Center = 1 - Right = 2 + Center = 2 + Right = 1 @staticmethod def to_string(horizontal_type): diff --git a/openlp/core/ui/__init__.py b/openlp/core/ui/__init__.py index d820c9a5b..45218802e 100644 --- a/openlp/core/ui/__init__.py +++ b/openlp/core/ui/__init__.py @@ -53,6 +53,7 @@ class HideMode(object): from themeform import ThemeForm from filerenameform import FileRenameForm +from starttimeform import StartTimeForm from maindisplay import MainDisplay from servicenoteform import ServiceNoteForm from serviceitemeditform import ServiceItemEditForm diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 05a301bd7..caf84855a 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -105,6 +105,9 @@ class MainDisplay(DisplayWidget): self.audio = Phonon.AudioOutput(Phonon.VideoCategory, self.mediaObject) Phonon.createPath(self.mediaObject, self.videoWidget) Phonon.createPath(self.mediaObject, self.audio) + QtCore.QObject.connect(self.mediaObject, + QtCore.SIGNAL(u'stateChanged(Phonon::State, Phonon::State)'), + self.videoStart) self.webView = QtWebKit.QWebView(self) self.webView.setGeometry(0, 0, self.screen[u'size'].width(), self.screen[u'size'].height()) @@ -340,6 +343,16 @@ class MainDisplay(DisplayWidget): Receiver.send_message(u'maindisplay_active') return self.preview() + def videoStart(self, newState, oldState): + """ + Start the video at a predetermined point. + """ + if newState == 2: + time = self.serviceItem.start_time[0] * 60 * 60 + \ + self.serviceItem.start_time[1] * 60 + \ + self.serviceItem.start_time[2] + self.mediaObject.seek(time * 1000) + def isWebLoaded(self): """ Called by webView event to show display is fully loaded diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 744da7b46..de7047fb6 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -36,7 +36,7 @@ from openlp.core.lib import OpenLPToolbar, ServiceItem, context_menu_action, \ Receiver, build_icon, ItemCapabilities, SettingsManager, translate, \ ThemeLevel from openlp.core.lib.ui import UiStrings, critical_error_message_box -from openlp.core.ui import ServiceNoteForm, ServiceItemEditForm +from openlp.core.ui import ServiceNoteForm, ServiceItemEditForm, StartTimeForm from openlp.core.ui.printserviceorderform import PrintServiceOrderForm from openlp.core.utils import AppLocation, delete_file, file_is_unicode, \ split_filename @@ -88,6 +88,7 @@ class ServiceManager(QtGui.QWidget): self._fileName = u'' self.serviceNoteForm = ServiceNoteForm(self.mainwindow) self.serviceItemEditForm = ServiceItemEditForm(self.mainwindow) + self.startTimeForm = StartTimeForm(self.mainwindow) # start with the layout self.layout = QtGui.QVBoxLayout(self) self.layout.setSpacing(0) @@ -270,16 +271,19 @@ class ServiceManager(QtGui.QWidget): self.notesAction = self.menu.addAction( translate('OpenLP.ServiceManager', '&Notes')) self.notesAction.setIcon(build_icon(u':/services/service_notes.png')) + self.timeAction = self.menu.addAction( + translate('OpenLP.ServiceManager', '&Start Time')) + self.timeAction.setIcon(build_icon(u':/media/media_time.png')) self.deleteAction = self.menu.addAction( translate('OpenLP.ServiceManager', '&Delete From Service')) self.deleteAction.setIcon(build_icon(u':/general/general_delete.png')) self.sep1 = self.menu.addAction(u'') self.sep1.setSeparator(True) self.previewAction = self.menu.addAction( - translate('OpenLP.ServiceManager', '&Preview Verse')) + translate('OpenLP.ServiceManager', 'Show &Preview')) self.previewAction.setIcon(build_icon(u':/general/general_preview.png')) self.liveAction = self.menu.addAction( - translate('OpenLP.ServiceManager', '&Live Verse')) + translate('OpenLP.ServiceManager', 'Show &Live')) self.liveAction.setIcon(build_icon(u':/general/general_live.png')) self.sep2 = self.menu.addAction(u'') self.sep2.setSeparator(True) @@ -563,6 +567,7 @@ class ServiceManager(QtGui.QWidget): self.editAction.setVisible(False) self.maintainAction.setVisible(False) self.notesAction.setVisible(False) + self.timeAction.setVisible(False) if serviceItem[u'service_item'].is_capable(ItemCapabilities.AllowsEdit)\ and serviceItem[u'service_item'].edit_id: self.editAction.setVisible(True) @@ -571,6 +576,9 @@ class ServiceManager(QtGui.QWidget): self.maintainAction.setVisible(True) if item.parent() is None: self.notesAction.setVisible(True) + if serviceItem[u'service_item']\ + .is_capable(ItemCapabilities.AllowsVarableStartTime): + self.timeAction.setVisible(True) self.themeMenu.menuAction().setVisible(False) if serviceItem[u'service_item'].is_text(): self.themeMenu.menuAction().setVisible(True) @@ -583,6 +591,8 @@ class ServiceManager(QtGui.QWidget): self.onDeleteFromService() if action == self.notesAction: self.onServiceItemNoteForm() + if action == self.timeAction: + self.onStartTimeForm() if action == self.previewAction: self.makePreview() if action == self.liveAction: @@ -597,6 +607,17 @@ class ServiceManager(QtGui.QWidget): self.serviceNoteForm.textEdit.toPlainText() self.repaintServiceList(item, -1) + def onStartTimeForm(self): + item = self.findServiceItem()[0] + self.startTimeForm.item = self.serviceItems[item] + if self.startTimeForm.exec_(): + self.serviceItems[item][u'service_item'].start_time[0] = \ + self.startTimeForm.hourSpinBox.value() + self.serviceItems[item][u'service_item'].start_time[1] = \ + self.startTimeForm.minuteSpinBox.value() + self.serviceItems[item][u'service_item'].start_time[2] = \ + self.startTimeForm.secondSpinBox.value() + def onServiceItemEditForm(self): item = self.findServiceItem()[0] self.serviceItemEditForm.setServiceItem( diff --git a/openlp/core/ui/starttimedialog.py b/openlp/core/ui/starttimedialog.py new file mode 100644 index 000000000..8dcc2c9ee --- /dev/null +++ b/openlp/core/ui/starttimedialog.py @@ -0,0 +1,70 @@ +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 + +############################################################################### +# OpenLP - Open Source Lyrics Projection # +# --------------------------------------------------------------------------- # +# Copyright (c) 2008-2011 Raoul Snyman # +# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # +# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # +# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # +# Carsten Tinggaard, Frode Woldsund # +# --------------------------------------------------------------------------- # +# This program is free software; you can redistribute it and/or modify it # +# under the terms of the GNU General Public License as published by the Free # +# Software Foundation; version 2 of the License. # +# # +# This program is distributed in the hope that it will be useful, but WITHOUT # +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # +# more details. # +# # +# You should have received a copy of the GNU General Public License along # +# with this program; if not, write to the Free Software Foundation, Inc., 59 # +# Temple Place, Suite 330, Boston, MA 02111-1307 USA # +############################################################################### + +from PyQt4 import QtCore, QtGui + +from openlp.core.lib import translate +from openlp.core.lib.ui import create_accept_reject_button_box + +class Ui_StartTimeDialog(object): + def setupUi(self, StartTimeDialog): + StartTimeDialog.setObjectName(u'StartTimeDialog') + StartTimeDialog.resize(300, 10) + self.dialogLayout = QtGui.QGridLayout(StartTimeDialog) + self.dialogLayout.setObjectName(u'dialogLayout') + self.hourLabel = QtGui.QLabel(StartTimeDialog) + self.hourLabel.setObjectName("hourLabel") + self.dialogLayout.addWidget(self.hourLabel, 0, 0, 1, 1) + self.hourSpinBox = QtGui.QSpinBox(StartTimeDialog) + self.hourSpinBox.setObjectName("hourSpinBox") + self.dialogLayout.addWidget(self.hourSpinBox, 0, 1, 1, 1) + self.minuteLabel = QtGui.QLabel(StartTimeDialog) + self.minuteLabel.setObjectName("minuteLabel") + self.dialogLayout.addWidget(self.minuteLabel, 1, 0, 1, 1) + self.minuteSpinBox = QtGui.QSpinBox(StartTimeDialog) + self.minuteSpinBox.setObjectName("minuteSpinBox") + self.dialogLayout.addWidget(self.minuteSpinBox, 1, 1, 1, 1) + self.secondLabel = QtGui.QLabel(StartTimeDialog) + self.secondLabel.setObjectName("secondLabel") + self.dialogLayout.addWidget(self.secondLabel, 2, 0, 1, 1) + self.secondSpinBox = QtGui.QSpinBox(StartTimeDialog) + self.secondSpinBox.setObjectName("secondSpinBox") + self.dialogLayout.addWidget(self.secondSpinBox, 2, 1, 1, 1) + self.buttonBox = create_accept_reject_button_box(StartTimeDialog, True) + self.dialogLayout.addWidget(self.buttonBox, 4, 0, 1, 2) + self.retranslateUi(StartTimeDialog) + self.setMaximumHeight(self.sizeHint().height()) + QtCore.QMetaObject.connectSlotsByName(StartTimeDialog) + + def retranslateUi(self, StartTimeDialog): + self.setWindowTitle(translate('OpenLP.StartTimeForm', + 'Item Start Time')) + self.hourLabel.setText(translate('OpenLP.StartTimeForm', 'Hours:')) + self.hourSpinBox.setSuffix(translate('OpenLP.StartTimeForm', 'h')) + self.minuteSpinBox.setSuffix(translate('OpenLP.StartTimeForm', 'm')) + self.secondSpinBox.setSuffix(translate('OpenLP.StartTimeForm', 's')) + self.minuteLabel.setText(translate('OpenLP.StartTimeForm', 'Minutes:')) + self.secondLabel.setText(translate('OpenLP.StartTimeForm', 'Seconds:')) diff --git a/openlp/core/ui/starttimeform.py b/openlp/core/ui/starttimeform.py new file mode 100644 index 000000000..8bd3cd085 --- /dev/null +++ b/openlp/core/ui/starttimeform.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 + +############################################################################### +# OpenLP - Open Source Lyrics Projection # +# --------------------------------------------------------------------------- # +# Copyright (c) 2008-2011 Raoul Snyman # +# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # +# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # +# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # +# Carsten Tinggaard, Frode Woldsund # +# --------------------------------------------------------------------------- # +# This program is free software; you can redistribute it and/or modify it # +# under the terms of the GNU General Public License as published by the Free # +# Software Foundation; version 2 of the License. # +# # +# This program is distributed in the hope that it will be useful, but WITHOUT # +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # +# more details. # +# # +# You should have received a copy of the GNU General Public License along # +# with this program; if not, write to the Free Software Foundation, Inc., 59 # +# Temple Place, Suite 330, Boston, MA 02111-1307 USA # +############################################################################### + +from PyQt4 import QtGui + +from starttimedialog import Ui_StartTimeDialog + +from openlp.core.lib import translate + +class StartTimeForm(QtGui.QDialog, Ui_StartTimeDialog): + """ + The exception dialog + """ + def __init__(self, parent): + QtGui.QDialog.__init__(self, parent) + self.setupUi(self) + + def exec_(self): + """ + Run the Dialog with correct heading. + """ + self.hourSpinBox.setValue(self.item[u'service_item'].start_time[0]) + self.minuteSpinBox.setValue(self.item[u'service_item'].start_time[1]) + self.secondSpinBox.setValue(self.item[u'service_item'].start_time[2]) + return QtGui.QDialog.exec_(self) diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index 7fb0ed0c1..55b745ec5 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -123,6 +123,7 @@ class MediaMediaItem(MediaManagerItem): service_item.title = unicode( translate('MediaPlugin.MediaItem', 'Media')) service_item.add_capability(ItemCapabilities.RequiresMedia) + service_item.add_capability(ItemCapabilities.AllowsVarableStartTime) # force a nonexistent theme service_item.theme = -1 frame = u':/media/image_clapperboard.png' From 34cf16fd0671eeb5cf47b05f3be5b3dac2cb948a Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sat, 12 Feb 2011 15:37:02 +0000 Subject: [PATCH 094/243] WizardStrings --- openlp/core/ui/wizard.py | 1 + openlp/plugins/bibles/forms/bibleimportform.py | 3 +-- openlp/plugins/songs/forms/songimportform.py | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/openlp/core/ui/wizard.py b/openlp/core/ui/wizard.py index 1599b4738..0bb610104 100644 --- a/openlp/core/ui/wizard.py +++ b/openlp/core/ui/wizard.py @@ -48,6 +48,7 @@ class WizardStrings(object): 'Variable 1 & 3 are import/export. Variable 2 is a type like Bibles')) FinishedType = unicode(translate('OpenLP.Ui', 'Finished %s.')) FormatLabel = translate('OpenLP.Ui', 'Format:') + Importing = translate('OpenLP.Ui', 'Importing') ImportSelect = translate('OpenLP.Ui', 'Select Import Source') ImportSelectLong = unicode(translate('OpenLP.Ui', 'Select the import format and the location to import from.')) diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index e4f1a2342..b3fa403e8 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -426,8 +426,7 @@ class BibleImportForm(OpenLPWizard): translate('BiblesPlugin.ImportWizardForm', 'Copyright:')) self.permissionsLabel.setText( translate('BiblesPlugin.ImportWizardForm', 'Permissions:')) - self.progressPage.setTitle( - translate('BiblesPlugin.ImportWizardForm', 'Importing')) + self.progressPage.setTitle(WizardStrings.Importing) self.progressPage.setSubTitle( translate('BiblesPlugin.ImportWizardForm', 'Please wait while your Bible is imported.')) diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index b0ca243ca..8d79acec0 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -291,8 +291,7 @@ class SongImportForm(OpenLPWizard): # self.csvFilenameLabel.setText( # translate('SongsPlugin.ImportWizardForm', 'Filename:')) # self.csvBrowseButton.setText(UiStrings.Browse) - self.progressPage.setTitle( - translate('SongsPlugin.ImportWizardForm', 'Importing')) + self.progressPage.setTitle(WizardStrings.Importing) self.progressPage.setSubTitle( translate('SongsPlugin.ImportWizardForm', 'Please wait while your songs are imported.')) From 9f25de02802f0fdfc3441fc5e84d32a318feee89 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sat, 12 Feb 2011 15:38:28 +0000 Subject: [PATCH 095/243] Path typo --- openlp/core/utils/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/utils/__init__.py b/openlp/core/utils/__init__.py index a589c7309..a23077c39 100644 --- a/openlp/core/utils/__init__.py +++ b/openlp/core/utils/__init__.py @@ -184,7 +184,7 @@ def _get_os_dir_path(dir_type): elif dir_type == AppLocation.CacheDir: return os.path.join(BaseDirectory.xdg_cache_home, u'openlp') if dir_type == AppLocation.DataDir: - return os.path.join(os.getenv(u'HOME'), u'openlp', u'data') + return os.path.join(os.getenv(u'HOME'), u'.openlp', u'data') return os.path.join(os.getenv(u'HOME'), u'.openlp') def _get_frozen_path(frozen_option, non_frozen_option): From e69819a3d36a21043f4396c48ac9ebfe8b9ccdd6 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sat, 12 Feb 2011 16:07:11 +0000 Subject: [PATCH 096/243] Fix alertTabs --- openlp/core/ui/maindisplay.py | 5 +++-- openlp/core/ui/slidecontroller.py | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 05a301bd7..11412549c 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -65,6 +65,7 @@ class MainDisplay(DisplayWidget): self.parent = parent self.screens = screens self.isLive = live + self.alertTab = None self.hideMode = None self.override = {} mainIcon = build_icon(u':/icon/openlp-logo-16x16.png') @@ -144,7 +145,7 @@ class MainDisplay(DisplayWidget): serviceItem = ServiceItem() serviceItem.bg_image_bytes = image_to_byte(initialFrame) self.webView.setHtml(build_html(serviceItem, self.screen, - self.parent.alertTab, self.isLive, None)) + self.alertTab, self.isLive, None)) self.initialFrame = True # To display or not to display? if not self.screen[u'primary']: @@ -405,7 +406,7 @@ class MainDisplay(DisplayWidget): if self.serviceItem.themedata.background_filename: self.serviceItem.bg_image_bytes = self.imageManager. \ get_image_bytes(self.serviceItem.themedata.theme_name) - html = build_html(self.serviceItem, self.screen, self.parent.alertTab, + html = build_html(self.serviceItem, self.screen, self.alertTab, self.isLive, background) log.debug(u'buildHtml - pre setHtml') self.webView.setHtml(html) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index cd43cddb4..52626f24f 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -415,6 +415,7 @@ class SlideController(QtGui.QWidget): # rebuild display as screen size changed self.display = MainDisplay(self, self.screens, self.isLive) self.display.imageManager = self.parent.renderManager.image_manager + self.display.alertTab = self.alertTab self.display.setup() if self.isLive: self.__addActionsToWidget(self.display) From 0561fa2525321aebe096bab4f927d8299fd748c1 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sat, 12 Feb 2011 18:43:23 +0000 Subject: [PATCH 097/243] Strings --- openlp/core/lib/ui.py | 5 +++-- openlp/core/ui/thememanager.py | 6 +++--- openlp/plugins/songs/forms/songmaintenanceform.py | 13 +++++++------ 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 6ce04af75..5a8293617 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -52,13 +52,14 @@ class UiStrings(object): Delete = translate('OpenLP.Ui', '&Delete') DeleteSelect = unicode(translate('OpenLP.Ui', 'Delete the selected %s.')) DeleteType = unicode(translate('OpenLP.Ui', 'Delete %s')) + AmpDeleteType = unicode(translate('OpenLP.Ui', '&Delete %s')) Edit = translate('OpenLP.Ui', '&Edit') EditSelect = unicode(translate('OpenLP.Ui', 'Edit the selected %s.')) - EditType = unicode(translate('OpenLP.Ui', 'Edit %s')) + EditType = unicode(translate('OpenLP.Ui', '&Edit %s')) EmptyField = translate('OpenLP.Ui', 'Empty Field') Error = translate('OpenLP.Ui', 'Error') Export = translate('OpenLP.Ui', 'Export') - ExportType = unicode(translate('OpenLP.Ui', 'Export %s')) + ExportType = unicode(translate('OpenLP.Ui', '&Export %s')) Image = translate('OpenLP.Ui', 'Image') Import = translate('OpenLP.Ui', 'Import') ImportType = unicode(translate('OpenLP.Ui', 'Import %s')) diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 36abb19c1..8dcc2454e 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -105,7 +105,7 @@ class ThemeManager(QtGui.QWidget): # build the context menu self.menu = QtGui.QMenu() self.editAction = self.menu.addAction( - translate('OpenLP.ThemeManager', '&Edit Theme')) + UiStrings.EditType % UiStrings.Theme) self.editAction.setIcon(build_icon(u':/themes/theme_edit.png')) self.copyAction = self.menu.addAction( translate('OpenLP.ThemeManager', '&Copy Theme')) @@ -114,14 +114,14 @@ class ThemeManager(QtGui.QWidget): translate('OpenLP.ThemeManager', '&Rename Theme')) self.renameAction.setIcon(build_icon(u':/themes/theme_edit.png')) self.deleteAction = self.menu.addAction( - translate('OpenLP.ThemeManager', '&Delete Theme')) + UiStrings.AmpDeleteType % UiStrings.Theme) self.deleteAction.setIcon(build_icon(u':/general/general_delete.png')) self.separator = self.menu.addSeparator() self.globalAction = self.menu.addAction( translate('OpenLP.ThemeManager', 'Set As &Global Default')) self.globalAction.setIcon(build_icon(u':/general/general_export.png')) self.exportAction = self.menu.addAction( - translate('OpenLP.ThemeManager', '&Export Theme')) + UiStrings.ExportType % UiStrings.Theme) self.exportAction.setIcon(build_icon(u':/general/general_export.png')) # Signals QtCore.QObject.connect(self.themeListWidget, diff --git a/openlp/plugins/songs/forms/songmaintenanceform.py b/openlp/plugins/songs/forms/songmaintenanceform.py index 1eb63fbf4..218debd7d 100644 --- a/openlp/plugins/songs/forms/songmaintenanceform.py +++ b/openlp/plugins/songs/forms/songmaintenanceform.py @@ -29,9 +29,10 @@ from PyQt4 import QtGui, QtCore from sqlalchemy.sql import and_ from openlp.core.lib import Receiver, translate -from openlp.core.lib.ui import critical_error_message_box +from openlp.core.lib.ui import UiStrings, critical_error_message_box from openlp.plugins.songs.forms import AuthorsForm, TopicsForm, SongBookForm from openlp.plugins.songs.lib.db import Author, Book, Topic, Song +from openlp.plugins.songs.lib.ui import SongStrings from songmaintenancedialog import Ui_SongMaintenanceDialog log = logging.getLogger(__name__) @@ -447,7 +448,7 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): Delete the author if the author is not attached to any songs. """ self._deleteItem(Author, self.authorsListWidget, self.resetAuthors, - translate('SongsPlugin.SongMaintenanceForm', 'Delete Author'), + UiStrings.DeleteType % SongStrings.Author, translate('SongsPlugin.SongMaintenanceForm', 'Are you sure you want to delete the selected author?'), translate('SongsPlugin.SongMaintenanceForm', @@ -457,10 +458,10 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): def onTopicDeleteButtonClick(self): """ - Delete the Book is the Book is not attached to any songs. + Delete the Book if the Book is not attached to any songs. """ self._deleteItem(Topic, self.topicsListWidget, self.resetTopics, - translate('SongsPlugin.SongMaintenanceForm', 'Delete Topic'), + UiStrings.DeleteType % SongStrings.Topic, translate('SongsPlugin.SongMaintenanceForm', 'Are you sure you want to delete the selected topic?'), translate('SongsPlugin.SongMaintenanceForm', @@ -470,10 +471,10 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): def onBookDeleteButtonClick(self): """ - Delete the Book is the Book is not attached to any songs. + Delete the Book if the Book is not attached to any songs. """ self._deleteItem(Book, self.booksListWidget, self.resetBooks, - translate('SongsPlugin.SongMaintenanceForm', 'Delete Book'), + UiStrings.DeleteType % SongStrings.SongBook, translate('SongsPlugin.SongMaintenanceForm', 'Are you sure you want to delete the selected book?'), translate('SongsPlugin.SongMaintenanceForm', From bffa44a1cb1c3bd9099bc168b568866ea8c28dc3 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sat, 12 Feb 2011 20:25:40 +0000 Subject: [PATCH 098/243] Wizards and applications --- openlp/core/lib/ui.py | 1 + openlp/core/ui/wizard.py | 17 +++ .../plugins/bibles/forms/bibleimportform.py | 48 +++--- openlp/plugins/songs/forms/songimportform.py | 140 +++++------------- 4 files changed, 75 insertions(+), 131 deletions(-) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 5a8293617..737bb75d2 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -74,6 +74,7 @@ class UiStrings(object): NFSp = translate('OpenLP.Ui', 'No Files Selected', 'Plural') NISs = translate('OpenLP.Ui', 'No Item Selected', 'Singular') NISp = translate('OpenLP.Ui', 'No Items Selected', 'Plural') + OLPV1 = translate('OpenLP.Ui', 'openlp.org 1.x') OLPV2 = translate('OpenLP.Ui', 'OpenLP 2.0') OpenType = unicode(translate('OpenLP.Ui', 'Open %s')) Preview = translate('OpenLP.Ui', 'Preview') diff --git a/openlp/core/ui/wizard.py b/openlp/core/ui/wizard.py index 0bb610104..14511f21f 100644 --- a/openlp/core/ui/wizard.py +++ b/openlp/core/ui/wizard.py @@ -41,6 +41,20 @@ class WizardStrings(object): """ Provide standard strings for wizards to use. """ + # Applications/Formats we import from or export to. These get used in + # multiple places but do not need translating unless you find evidence of + # the writers translating their own product name. + CCLI = u'CCLI/SongSelect' + CSV = u'CSV' + EW = u'EasyWorship' + ES = u'EasiSlides' + GDP = translate('OpenLP.Ui', 'Generic Document or Presentation') + OL = u'OpenLyrics' + OS = u'OpenSong' + OSIS = u'OSIS' + SB = u'SongBeamer' + SoF = u'Songs of Fellowship' + WoW = u'Words of Worship' # These strings should need a good reason to be retranslated elsewhere. Description = unicode(translate('OpenLP.Ui', 'This wizard will help you ' 'to %s %s from a variety of formats. Click the next button ' @@ -52,9 +66,12 @@ class WizardStrings(object): ImportSelect = translate('OpenLP.Ui', 'Select Import Source') ImportSelectLong = unicode(translate('OpenLP.Ui', 'Select the import format and the location to import from.')) + OpenTypeFile = unicode(translate('OpenLP.Ui', 'Open %s File')) Welcome = u'%s' % \ translate('OpenLP.Ui', 'Welcome to the %s %s Wizard', 'Variable 1 is the type e.g. Bible and variable 2 is import/export') + YouSpecifyFile = unicode(translate('OpenLP.Ui', 'You need to specify at ' + 'least one %s file to import from.', 'A file type e.g. OpenSong')) class OpenLPWizard(QtGui.QWizard): diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index b3fa403e8..80f44e481 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -370,12 +370,9 @@ class BibleImportForm(OpenLPWizard): self.selectPage.setTitle(WizardStrings.ImportSelect) self.selectPage.setSubTitle(WizardStrings.ImportSelectLong) self.formatLabel.setText(WizardStrings.FormatLabel) - self.formatComboBox.setItemText(0, - translate('BiblesPlugin.ImportWizardForm', 'OSIS')) - self.formatComboBox.setItemText(1, - translate('BiblesPlugin.ImportWizardForm', 'CSV')) - self.formatComboBox.setItemText(2, - translate('BiblesPlugin.ImportWizardForm', 'OpenSong')) + self.formatComboBox.setItemText(0, WizardStrings.OSIS) + self.formatComboBox.setItemText(1, WizardStrings.CSV) + self.formatComboBox.setItemText(2, WizardStrings.OS) self.formatComboBox.setItemText(3, translate('BiblesPlugin.ImportWizardForm', 'Web Download')) self.formatComboBox.setItemText(4, @@ -459,9 +456,7 @@ class BibleImportForm(OpenLPWizard): if self.field(u'source_format').toInt()[0] == BibleFormat.OSIS: if not self.field(u'osis_location').toString(): critical_error_message_box(UiStrings.NFSs, - translate('BiblesPlugin.ImportWizardForm', - 'You need to specify a file to import your ' - 'Bible from.')) + WizardStrings.YouSpecifyFile % WizardStrings.OSIS) self.osisFileEdit.setFocus() return False elif self.field(u'source_format').toInt()[0] == BibleFormat.CSV: @@ -473,7 +468,7 @@ class BibleImportForm(OpenLPWizard): if answer == QtGui.QMessageBox.No: self.csvTestamentsEdit.setFocus() return False - elif not self.field(u'csv_booksfile').toString(): + if not self.field(u'csv_booksfile').toString(): critical_error_message_box(UiStrings.NFSs, translate('BiblesPlugin.ImportWizardForm', 'You need to specify a file with books of ' @@ -491,17 +486,13 @@ class BibleImportForm(OpenLPWizard): BibleFormat.OpenSong: if not self.field(u'opensong_file').toString(): critical_error_message_box(UiStrings.NFSs, - translate('BiblesPlugin.ImportWizardForm', - 'You need to specify an OpenSong Bible ' - 'file to import.')) + WizardStrings.YouSpecifyFile % WizardStrings.OS) self.openSongFileEdit.setFocus() return False elif self.field(u'source_format').toInt()[0] == BibleFormat.OpenLP1: if not self.field(u'openlp1_location').toString(): critical_error_message_box(UiStrings.NFSs, - translate('BiblesPlugin.ImportWizardForm', - 'You need to specify a file to import your ' - 'Bible from.')) + WizardStrings.YouSpecifyFile % UiStrings.OLPV1) self.openlp1FileEdit.setFocus() return False return True @@ -551,24 +542,22 @@ class BibleImportForm(OpenLPWizard): """ Show the file open dialog for the OSIS file. """ - self.getFileName( - translate('BiblesPlugin.ImportWizardForm', 'Open OSIS File'), + self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.OSIS, self.osisFileEdit) def onCsvTestamentsBrowseButtonClicked(self): """ Show the file open dialog for the testaments CSV file. """ - self.getFileName(translate('BiblesPlugin.ImportWizardForm', - 'Open Testaments CSV File'), self.csvTestamentsEdit, u'%s (*.csv)' + self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.CSV, + self.csvTestamentsEdit, u'%s (*.csv)' % translate('BiblesPlugin.ImportWizardForm', 'CSV File')) def onCsvBooksBrowseButtonClicked(self): """ Show the file open dialog for the books CSV file. """ - self.getFileName( - translate('BiblesPlugin.ImportWizardForm', 'Open Books CSV File'), + self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.CSV, self.csvBooksEdit, u'%s (*.csv)' % translate('BiblesPlugin.ImportWizardForm', 'CSV File')) @@ -576,27 +565,24 @@ class BibleImportForm(OpenLPWizard): """ Show the file open dialog for the verses CSV file. """ - self.getFileName(translate('BiblesPlugin.ImportWizardForm', - 'Open Verses CSV File'), self.csvVersesEdit, u'%s (*.csv)' + self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.CSV, + self.csvVersesEdit, u'%s (*.csv)' % translate('BiblesPlugin.ImportWizardForm', 'CSV File')) def onOpenSongBrowseButtonClicked(self): """ Show the file open dialog for the OpenSong file. """ - self.getFileName( - translate('BiblesPlugin.ImportWizardForm', 'Open OpenSong Bible'), + self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.OS, self.openSongFileEdit) def onOpenlp1BrowseButtonClicked(self): """ Show the file open dialog for the openlp.org 1.x file. """ - self.getFileName( - translate('BiblesPlugin.ImportWizardForm', - 'Open openlp.org 1.x Bible'), self.openlp1FileEdit, - u'%s (*.bible)' % translate('BiblesPlugin.ImportWizardForm', - 'openlp.org 1.x bible')) + self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.OLPV1, + self.openlp1FileEdit, u'%s (*.bible)' % + translate('BiblesPlugin.ImportWizardForm', 'openlp.org 1.x bible')) def registerFields(self): """ diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index 8d79acec0..6c851b04b 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -207,29 +207,17 @@ class SongImportForm(OpenLPWizard): self.sourcePage.setSubTitle(WizardStrings.ImportSelectLong) self.formatLabel.setText(WizardStrings.FormatLabel) self.formatComboBox.setItemText(0, UiStrings.OLPV2) - self.formatComboBox.setItemText(1, - translate('SongsPlugin.ImportWizardForm', 'openlp.org 1.x')) - self.formatComboBox.setItemText(2, - translate('SongsPlugin.ImportWizardForm', 'OpenLyrics')) - self.formatComboBox.setItemText(3, - translate('SongsPlugin.ImportWizardForm', 'OpenSong')) - self.formatComboBox.setItemText(4, - translate('SongsPlugin.ImportWizardForm', 'Words of Worship')) - self.formatComboBox.setItemText(5, - translate('SongsPlugin.ImportWizardForm', 'CCLI/SongSelect')) - self.formatComboBox.setItemText(6, - translate('SongsPlugin.ImportWizardForm', 'Songs of Fellowship')) - self.formatComboBox.setItemText(7, - translate('SongsPlugin.ImportWizardForm', - 'Generic Document/Presentation')) - self.formatComboBox.setItemText(8, - translate('SongsPlugin.ImportWizardForm', 'EasiSlides')) - self.formatComboBox.setItemText(9, - translate('SongsPlugin.ImportWizardForm', 'EasyWorship')) - self.formatComboBox.setItemText(10, - translate('SongsPlugin.ImportWizardForm', 'SongBeamer')) -# self.formatComboBox.setItemText(11, -# translate('SongsPlugin.ImportWizardForm', 'CSV')) + self.formatComboBox.setItemText(1, UiStrings.OLPV1) + self.formatComboBox.setItemText(2, WizardStrings.OL) + self.formatComboBox.setItemText(3, WizardStrings.OS) + self.formatComboBox.setItemText(4, WizardStrings.WoW) + self.formatComboBox.setItemText(5, WizardStrings.CCLI) + self.formatComboBox.setItemText(6, WizardStrings.SoF) + self.formatComboBox.setItemText(7, WizardStrings.GDP) + self.formatComboBox.setItemText(8, WizardStrings.ES) + self.formatComboBox.setItemText(9, WizardStrings.EW) + self.formatComboBox.setItemText(10, WizardStrings.SB) +# self.formatComboBox.setItemText(11, WizardStrings.CSV) self.openLP2FilenameLabel.setText( translate('SongsPlugin.ImportWizardForm', 'Filename:')) self.openLP2BrowseButton.setText(UiStrings.Browse) @@ -316,89 +304,68 @@ class SongImportForm(OpenLPWizard): if source_format == SongFormat.OpenLP2: if self.openLP2FilenameEdit.text().isEmpty(): critical_error_message_box(UiStrings.NFSs, - translate('SongsPlugin.ImportWizardForm', - 'You need to select an OpenLP 2.0 song database ' - 'file to import from.')) + WizardStrings.YouSpecifyFile % UiStrings.OLPV2) self.openLP2BrowseButton.setFocus() return False elif source_format == SongFormat.OpenLP1: if self.openLP1FilenameEdit.text().isEmpty(): critical_error_message_box(UiStrings.NFSs, - translate('SongsPlugin.ImportWizardForm', - 'You need to select an openlp.org 1.x song ' - 'database file to import from.')) + WizardStrings.YouSpecifyFile % UiStrings.OLPV1) self.openLP1BrowseButton.setFocus() return False elif source_format == SongFormat.OpenLyrics: if self.openLyricsFileListWidget.count() == 0: critical_error_message_box(UiStrings.NFSp, - translate('SongsPlugin.ImportWizardForm', - 'You need to add at least one OpenLyrics ' - 'song file to import from.')) + WizardStrings.YouSpecifyFile % WizardStrings.OL) self.openLyricsAddButton.setFocus() return False elif source_format == SongFormat.OpenSong: if self.openSongFileListWidget.count() == 0: critical_error_message_box(UiStrings.NFSp, - translate('SongsPlugin.ImportWizardForm', - 'You need to add at least one OpenSong ' - 'song file to import from.')) + WizardStrings.YouSpecifyFile % WizardStrings.OS) self.openSongAddButton.setFocus() return False elif source_format == SongFormat.WordsOfWorship: if self.wordsOfWorshipFileListWidget.count() == 0: critical_error_message_box(UiStrings.NFSp, - translate('SongsPlugin.ImportWizardForm', - 'You need to add at least one Words of Worship ' - 'file to import from.')) + WizardStrings.YouSpecifyFile % WizardStrings.WoW) self.wordsOfWorshipAddButton.setFocus() return False elif source_format == SongFormat.CCLI: if self.ccliFileListWidget.count() == 0: critical_error_message_box(UiStrings.NFSp, - translate('SongsPlugin.ImportWizardForm', - 'You need to add at least one CCLI file ' - 'to import from.')) + WizardStrings.YouSpecifyFile % WizardStrings.CCLI) self.ccliAddButton.setFocus() return False elif source_format == SongFormat.SongsOfFellowship: if self.songsOfFellowshipFileListWidget.count() == 0: critical_error_message_box(UiStrings.NFSp, - translate('SongsPlugin.ImportWizardForm', - 'You need to add at least one Songs of Fellowship ' - 'file to import from.')) + WizardStrings.YouSpecifyFile % WizardStrings.SoF) self.songsOfFellowshipAddButton.setFocus() return False elif source_format == SongFormat.Generic: if self.genericFileListWidget.count() == 0: critical_error_message_box(UiStrings.NFSp, - translate('SongsPlugin.ImportWizardForm', - 'You need to add at least one document or ' - 'presentation file to import from.')) + WizardStrings.YouSpecifyFile % + WizardStrings.GDP.toLower()) self.genericAddButton.setFocus() return False elif source_format == SongFormat.EasiSlides: if self.easiSlidesFilenameEdit.text().isEmpty(): critical_error_message_box(UiStrings.NFSp, - translate('SongsPlugin.ImportWizardForm', - 'You need to select an xml song file exported from ' - 'EasiSlides, to import from.')) + WizardStrings.YouSpecifyFile % WizardStrings.ES) self.easiSlidesBrowseButton.setFocus() return False elif source_format == SongFormat.EasyWorship: if self.ewFilenameEdit.text().isEmpty(): critical_error_message_box(UiStrings.NFSs, - translate('SongsPlugin.ImportWizardForm', - 'You need to select an EasyWorship song database ' - 'file to import from.')) + WizardStrings.YouSpecifyFile % WizardStrings.EW) self.ewBrowseButton.setFocus() return False elif source_format == SongFormat.SongBeamer: if self.songBeamerFileListWidget.count() == 0: critical_error_message_box(UiStrings.NFSp, - translate('SongsPlugin.ImportWizardForm', - 'You need to add at least one SongBeamer ' - 'file to import from.')) + WizardStrings.YouSpecifyFile % WizardStrings.SB) self.songBeamerAddButton.setFocus() return False return True @@ -454,9 +421,7 @@ class SongImportForm(OpenLPWizard): """ Get OpenLP v2 song database file """ - self.getFileName( - translate('SongsPlugin.ImportWizardForm', - 'Select OpenLP 2.0 Database File'), + self.getFileName(WizardStrings.OpenTypeFile % UiStrings.OLPV2, self.openLP2FilenameEdit, u'%s (*.sqlite)' % (translate('SongsPlugin.ImportWizardForm', 'OpenLP 2.0 Databases')) @@ -466,9 +431,7 @@ class SongImportForm(OpenLPWizard): """ Get OpenLP v1 song database file """ - self.getFileName( - translate('SongsPlugin.ImportWizardForm', - 'Select openlp.org 1.x Database File'), + self.getFileName(WizardStrings.OpenTypeFile % UiStrings.OLPV1, self.openLP1FilenameEdit, u'%s (*.olp)' % translate('SongsPlugin.ImportWizardForm', 'openlp.org v1.x Databases') @@ -478,11 +441,8 @@ class SongImportForm(OpenLPWizard): """ Get OpenLyrics song database files """ - self.getFiles( - translate('SongsPlugin.ImportWizardForm', - 'Select OpenLyrics Files'), - self.openLyricsFileListWidget - ) + self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.OL, + self.openLyricsFileListWidget) def onOpenLyricsRemoveButtonClicked(self): """ @@ -494,10 +454,8 @@ class SongImportForm(OpenLPWizard): """ Get OpenSong song database files """ - self.getFiles( - translate('SongsPlugin.ImportWizardForm', 'Select Open Song Files'), - self.openSongFileListWidget - ) + self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.OS, + self.openSongFileListWidget) def onOpenSongRemoveButtonClicked(self): """ @@ -509,9 +467,7 @@ class SongImportForm(OpenLPWizard): """ Get Words of Worship song database files """ - self.getFiles( - translate('SongsPlugin.ImportWizardForm', - 'Select Words of Worship Files'), + self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.WoW, self.wordsOfWorshipFileListWidget, u'%s (*.wsg *.wow-song)' % translate('SongsPlugin.ImportWizardForm', 'Words Of Worship Song Files') @@ -527,11 +483,8 @@ class SongImportForm(OpenLPWizard): """ Get CCLI song database files """ - self.getFiles( - translate('SongsPlugin.ImportWizardForm', - 'Select CCLI Files'), - self.ccliFileListWidget - ) + self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.CCLI, + self.ccliFileListWidget) def onCCLIRemoveButtonClicked(self): """ @@ -543,9 +496,7 @@ class SongImportForm(OpenLPWizard): """ Get Songs of Fellowship song database files """ - self.getFiles( - translate('SongsPlugin.ImportWizardForm', - 'Select Songs of Fellowship Files'), + self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.SoF, self.songsOfFellowshipFileListWidget, u'%s (*.rtf)' % translate('SongsPlugin.ImportWizardForm', 'Songs Of Fellowship Song Files') @@ -561,11 +512,8 @@ class SongImportForm(OpenLPWizard): """ Get song database files """ - self.getFiles( - translate('SongsPlugin.ImportWizardForm', - 'Select Document/Presentation Files'), - self.genericFileListWidget - ) + self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.GDP, + self.genericFileListWidget) def onGenericRemoveButtonClicked(self): """ @@ -574,29 +522,21 @@ class SongImportForm(OpenLPWizard): self.removeSelectedItems(self.genericFileListWidget) def onEasiSlidesBrowseButtonClicked(self): - self.getFileName( - translate('SongsPlugin.ImportWizardForm', - 'Select EasiSlides songfile'), - self.easiSlidesFilenameEdit - ) + self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.ES, + self.easiSlidesFilenameEdit) def onEWBrowseButtonClicked(self): """ Get EasyWorship song database files """ - self.getFileName( - translate('SongsPlugin.ImportWizardForm', - 'Select EasyWorship Database File'), - self.ewFilenameEdit - ) + self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.EW, + self.ewFilenameEdit) def onSongBeamerAddButtonClicked(self): """ Get SongBeamer song database files """ - self.getFiles( - translate('SongsPlugin.ImportWizardForm', - 'Select SongBeamer Files'), + self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.SB, self.songBeamerFileListWidget, u'%s (*.sng)' % translate('SongsPlugin.ImportWizardForm', 'SongBeamer files') ) From ad03f8588e2c9ee8265f379b9f371a47e298d61c Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sat, 12 Feb 2011 22:01:18 +0000 Subject: [PATCH 099/243] Magic number -> SongSearch --- openlp/plugins/songs/lib/mediaitem.py | 33 ++++++++++++++++++--------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index b95a28c74..bbd1aad9c 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -33,16 +33,26 @@ from sqlalchemy.sql import or_ from openlp.core.lib import MediaManagerItem, Receiver, ItemCapabilities, \ translate, check_item_selected, PluginStatus, StringContent +from openlp.core.lib.searchedit import SearchEdit from openlp.core.lib.ui import UiStrings from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm, \ SongImportForm, SongExportForm from openlp.plugins.songs.lib import OpenLyrics, SongXML from openlp.plugins.songs.lib.db import Author, Song from openlp.plugins.songs.lib.ui import SongStrings -from openlp.core.lib.searchedit import SearchEdit log = logging.getLogger(__name__) +class SongSearch(object): + """ + An enumeration for song search methods. + """ + Entire = 1 + Titles = 2 + Lyrics = 3 + Authors = 4 + Themes = 5 + class SongMediaItem(MediaManagerItem): """ This is the custom media manager item for Songs. @@ -134,14 +144,15 @@ class SongMediaItem(MediaManagerItem): def initialise(self): self.searchTextEdit.setSearchTypes([ - (1, u':/songs/song_search_all.png', + (SongSearch.Entire, u':/songs/song_search_all.png', translate('SongsPlugin.MediaItem', 'Entire Song')), - (2, u':/songs/song_search_title.png', + (SongSearch.Titles, u':/songs/song_search_title.png', translate('SongsPlugin.MediaItem', 'Titles')), - (3, u':/songs/song_search_lyrics.png', + (SongSearch.Lyrics, u':/songs/song_search_lyrics.png', translate('SongsPlugin.MediaItem', 'Lyrics')), - (4, u':/songs/song_search_author.png', SongStrings.Authors), - (5, u':/slides/slide_theme.png', UiStrings.Themes) + (SongSearch.Authors, u':/songs/song_search_author.png', + SongStrings.Authors), + (SongSearch.Themes, u':/slides/slide_theme.png', UiStrings.Themes) ]) self.configUpdated() @@ -150,7 +161,7 @@ class SongMediaItem(MediaManagerItem): search_results = [] # search_type = self.searchTypeComboBox.currentIndex() search_type = self.searchTextEdit.currentSearchType() - if search_type == 1: + if search_type == SongSearch.Entire: log.debug(u'Entire Song Search') search_results = self.parent.manager.get_all_objects(Song, or_(Song.search_title.like(u'%' + self.whitespace.sub(u' ', @@ -158,25 +169,25 @@ class SongMediaItem(MediaManagerItem): Song.search_lyrics.like(u'%' + search_keywords.lower() + \ u'%')), Song.search_title.asc()) self.displayResultsSong(search_results) - if search_type == 2: + elif search_type == SongSearch.Titles: log.debug(u'Titles Search') search_results = self.parent.manager.get_all_objects(Song, Song.search_title.like(u'%' + self.whitespace.sub(u' ', search_keywords.lower()) + u'%'), Song.search_title.asc()) self.displayResultsSong(search_results) - elif search_type == 3: + elif search_type == SongSearch.Lyrics: log.debug(u'Lyrics Search') search_results = self.parent.manager.get_all_objects(Song, Song.search_lyrics.like(u'%' + search_keywords.lower() + u'%'), Song.search_lyrics.asc()) self.displayResultsSong(search_results) - elif search_type == 4: + elif search_type == SongSearch.Authors: log.debug(u'Authors Search') search_results = self.parent.manager.get_all_objects(Author, Author.display_name.like(u'%' + search_keywords + u'%'), Author.display_name.asc()) self.displayResultsAuthor(search_results) - elif search_type == 5: + elif search_type == SongSearch.Themes: log.debug(u'Theme Search') search_results = self.parent.manager.get_all_objects(Song, Song.theme_name == search_keywords, Song.search_lyrics.asc()) From 323ab52848eb387f4e5a5c1daebb23b944763a99 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sun, 13 Feb 2011 01:09:04 +0000 Subject: [PATCH 100/243] Strings and magic numbers --- openlp/core/lib/mediamanageritem.py | 6 +-- openlp/core/lib/ui.py | 1 + openlp/core/ui/displaytagtab.py | 2 +- openlp/core/ui/themeform.py | 2 +- openlp/core/ui/wizard.py | 7 ++++ openlp/plugins/alerts/forms/alertform.py | 7 ++-- .../plugins/bibles/forms/bibleimportform.py | 25 ++++------- openlp/plugins/bibles/lib/openlp1.py | 4 +- openlp/plugins/media/lib/mediaitem.py | 4 +- openlp/plugins/presentations/lib/mediaitem.py | 7 ++-- openlp/plugins/songs/forms/songexportform.py | 3 +- openlp/plugins/songs/forms/songimportform.py | 42 +++++++++---------- openlp/plugins/songs/lib/importer.py | 2 +- openlp/plugins/songs/lib/mediaitem.py | 4 +- openlp/plugins/songs/lib/openlyricsimport.py | 6 +-- openlp/plugins/songs/lib/songbeamerimport.py | 6 +-- 16 files changed, 62 insertions(+), 66 deletions(-) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 74dbf7fe1..0bb765c6e 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -417,8 +417,7 @@ class MediaManagerItem(QtGui.QWidget): item to the preview slide controller. """ if not self.listView.selectedIndexes() and not self.remoteTriggered: - QtGui.QMessageBox.information(self, - translate('OpenLP.MediaManagerItem', 'No Items Selected'), + QtGui.QMessageBox.information(self, UiStrings.NISp, translate('OpenLP.MediaManagerItem', 'You must select one or more items to preview.')) else: @@ -434,8 +433,7 @@ class MediaManagerItem(QtGui.QWidget): item to the live slide controller. """ if not self.listView.selectedIndexes(): - QtGui.QMessageBox.information(self, - translate('OpenLP.MediaManagerItem', 'No Items Selected'), + QtGui.QMessageBox.information(self, UiStrings.NISp, translate('OpenLP.MediaManagerItem', 'You must select one or more items to send live.')) else: diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 737bb75d2..c8ffb8262 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -86,6 +86,7 @@ class UiStrings(object): ResetLiveBG = translate('OpenLP.Ui', 'Reset Live Background') SaveType = unicode(translate('OpenLP.Ui', 'Save %s')) Search = translate('OpenLP.Ui', 'Search') + SelectDelete = translate('OpenLP.Ui', 'You must select an item to delete.') SendSelectLive = unicode(translate('OpenLP.Ui', 'Send the selected %s live.')) Service = translate('OpenLP.Ui', 'Service') diff --git a/openlp/core/ui/displaytagtab.py b/openlp/core/ui/displaytagtab.py index abf0ca44f..30c593d36 100644 --- a/openlp/core/ui/displaytagtab.py +++ b/openlp/core/ui/displaytagtab.py @@ -167,7 +167,7 @@ class DisplayTagTab(SettingsTab): self.deletePushButton.setText(UiStrings.Delete) self.defaultPushButton.setText( translate('OpenLP.DisplayTagTab', 'Default')) - self.newPushButton.setText(translate('OpenLP.DisplayTagTab', 'New')) + self.newPushButton.setText(UiStrings.New) self.tagTableWidget.horizontalHeaderItem(0)\ .setText(translate('OpenLP.DisplayTagTab', 'Description')) self.tagTableWidget.horizontalHeaderItem(1)\ diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index f86fa0143..8e5bddc79 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -301,7 +301,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): 'Edit Theme - %s')) % self.theme.theme_name) self.next() else: - self.setWindowTitle(translate('OpenLP.ThemeWizard', 'New Theme')) + self.setWindowTitle(UiStrings.NewType % UiStrings.Theme) return QtGui.QWizard.exec_(self) def initializePage(self, id): diff --git a/openlp/core/ui/wizard.py b/openlp/core/ui/wizard.py index 14511f21f..0a3a1cab7 100644 --- a/openlp/core/ui/wizard.py +++ b/openlp/core/ui/wizard.py @@ -63,10 +63,17 @@ class WizardStrings(object): FinishedType = unicode(translate('OpenLP.Ui', 'Finished %s.')) FormatLabel = translate('OpenLP.Ui', 'Format:') Importing = translate('OpenLP.Ui', 'Importing') + ImportingType = unicode(translate('OpenLP.Ui', 'Importing %s...')) ImportSelect = translate('OpenLP.Ui', 'Select Import Source') ImportSelectLong = unicode(translate('OpenLP.Ui', 'Select the import format and the location to import from.')) + NoSqlite = translate('OpenLP.Ui', 'The openlp.org 1.x importer has been ' + 'disabled due to a missing Python module. If you want to use this ' + 'importer, you will need to install the "python-sqlite" ' + 'module.') OpenTypeFile = unicode(translate('OpenLP.Ui', 'Open %s File')) + Ready = translate('OpenLP.Ui', 'Ready.') + StartingImport = translate('OpenLP.Ui', 'Starting import...') Welcome = u'%s' % \ translate('OpenLP.Ui', 'Welcome to the %s %s Wizard', 'Variable 1 is the type e.g. Bible and variable 2 is import/export') diff --git a/openlp/plugins/alerts/forms/alertform.py b/openlp/plugins/alerts/forms/alertform.py index 0639f2bb1..93d64a401 100644 --- a/openlp/plugins/alerts/forms/alertform.py +++ b/openlp/plugins/alerts/forms/alertform.py @@ -26,7 +26,8 @@ from PyQt4 import QtGui, QtCore -from openlp.core.lib import translate +from openlp.core.lib import translate, StringContent +from openlp.core.lib.ui import UiStrings from openlp.plugins.alerts.lib.db import AlertItem from alertdialog import Ui_AlertDialog @@ -95,8 +96,8 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog): def onNewClick(self): if len(self.alertTextEdit.text()) == 0: - QtGui.QMessageBox.information(self, - translate('AlertsPlugin.AlertForm', 'New Alert'), + QtGui.QMessageBox.information(self, UiStrings.NewType % + self.plugin.getString(StringContent.Name)[u'singular'] translate('AlertsPlugin.AlertForm', 'You haven\'t specified ' 'any text for your alert. Please type in some text before ' 'clicking New.')) diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index 80f44e481..81ae6607a 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -370,13 +370,12 @@ class BibleImportForm(OpenLPWizard): self.selectPage.setTitle(WizardStrings.ImportSelect) self.selectPage.setSubTitle(WizardStrings.ImportSelectLong) self.formatLabel.setText(WizardStrings.FormatLabel) - self.formatComboBox.setItemText(0, WizardStrings.OSIS) - self.formatComboBox.setItemText(1, WizardStrings.CSV) - self.formatComboBox.setItemText(2, WizardStrings.OS) - self.formatComboBox.setItemText(3, + self.formatComboBox.setItemText(BibleFormat.OSIS, WizardStrings.OSIS) + self.formatComboBox.setItemText(BibleFormat.CSV, WizardStrings.CSV) + self.formatComboBox.setItemText(BibleFormat.OpenSong, WizardStrings.OS) + self.formatComboBox.setItemText(BibleFormat.WebDownload, translate('BiblesPlugin.ImportWizardForm', 'Web Download')) - self.formatComboBox.setItemText(4, - translate('BiblesPlugin.ImportWizardForm', 'openlp.org 1.x')) + self.formatComboBox.setItemText(BibleFormat.OpenLP1, UiStrings.OLPV1) self.openlp1FileLabel.setText( translate('BiblesPlugin.ImportWizardForm', 'Bible file:')) self.osisFileLabel.setText( @@ -427,14 +426,9 @@ class BibleImportForm(OpenLPWizard): self.progressPage.setSubTitle( translate('BiblesPlugin.ImportWizardForm', 'Please wait while your Bible is imported.')) - self.progressLabel.setText( - translate('BiblesPlugin.ImportWizardForm', 'Ready.')) + self.progressLabel.setText(WizardStrings.Ready) self.progressBar.setFormat(u'%p%') - self.openlp1DisabledLabel.setText( - translate('BiblesPlugin.ImportWizardForm', 'The openlp.org 1.x ' - 'importer has been disabled due to a missing Python module. If ' - 'you want to use this importer, you will need to install the ' - '"python-sqlite" module.')) + self.openlp1DisabledLabel.setText(WizardStrings.NoSqlite) # Align all QFormLayouts towards each other. labelWidth = max(self.formatLabel.minimumSizeHint().width(), self.osisFileLabel.minimumSizeHint().width(), @@ -580,7 +574,7 @@ class BibleImportForm(OpenLPWizard): """ Show the file open dialog for the openlp.org 1.x file. """ - self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.OLPV1, + self.getFileName(WizardStrings.OpenTypeFile % UiStrings.OLPV1, self.openlp1FileEdit, u'%s (*.bible)' % translate('BiblesPlugin.ImportWizardForm', 'openlp.org 1.x bible')) @@ -699,8 +693,7 @@ class BibleImportForm(OpenLPWizard): 'BiblesPlugin.ImportWizardForm', 'Starting Registering bible...')) else: - self.progressLabel.setText(translate( - 'BiblesPlugin.ImportWizardForm', 'Starting import...')) + self.progressLabel.setText(translate(WizardStrings.StartingImport) Receiver.send_message(u'openlp_process_events') def performWizard(self): diff --git a/openlp/plugins/bibles/lib/openlp1.py b/openlp/plugins/bibles/lib/openlp1.py index 2df6b1677..27731d7ea 100644 --- a/openlp/plugins/bibles/lib/openlp1.py +++ b/openlp/plugins/bibles/lib/openlp1.py @@ -30,6 +30,7 @@ import sqlite from PyQt4 import QtCore from openlp.core.lib import Receiver, translate +from openlp.core.ui.wizard import WizardStrings from openlp.plugins.bibles.lib.db import BibleDB log = logging.getLogger(__name__) @@ -73,8 +74,7 @@ class OpenLP1Bible(BibleDB): abbreviation = unicode(book[3], u'cp1252') self.create_book(name, abbreviation, testament_id) # Update the progess bar. - self.wizard.incrementProgressBar(unicode(translate( - 'BiblesPlugin.OpenLP1Import', 'Importing %s...')) % name) + self.wizard.incrementProgressBar(WizardStrings.ImportingType % name) # Import the verses for this book. cursor.execute(u'SELECT chapter, verse, text || \'\' AS text FROM ' 'verse WHERE book_id=%s' % book_id) diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index 7fb0ed0c1..758bd2e64 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -30,7 +30,7 @@ import os from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, build_icon, ItemCapabilities, \ - SettingsManager, translate, check_item_selected, Receiver + SettingsManager, translate, check_item_selected, Receiver, StringContent from openlp.core.lib.ui import UiStrings, critical_error_message_box log = logging.getLogger(__name__) @@ -121,7 +121,7 @@ class MediaMediaItem(MediaManagerItem): filename = unicode(item.data(QtCore.Qt.UserRole).toString()) if os.path.exists(filename): service_item.title = unicode( - translate('MediaPlugin.MediaItem', 'Media')) + self.plugin.getString(StringContent.Name)[u'singular']) service_item.add_capability(ItemCapabilities.RequiresMedia) # force a nonexistent theme service_item.theme = -1 diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index 0b6ab39cd..64c1f7ece 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -31,7 +31,8 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, build_icon, SettingsManager, \ translate, check_item_selected, Receiver, ItemCapabilities -from openlp.core.lib.ui import critical_error_message_box, media_item_combo_box +from openlp.core.lib.ui import UiStrings, critical_error_message_box, \ + media_item_combo_box from openlp.plugins.presentations.lib import MessageListener log = logging.getLogger(__name__) @@ -202,9 +203,7 @@ class PresentationMediaItem(MediaManagerItem): """ Remove a presentation item from the list """ - if check_item_selected(self.listView, - translate('PresentationPlugin.MediaItem', - 'You must select an item to delete.')): + if check_item_selected(self.listView, UiStrings.SelectDelete): items = self.listView.selectedIndexes() row_list = [item.row() for item in items] row_list.sort(reverse=True) diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index 86b4e448c..66003532b 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -191,8 +191,7 @@ class SongExportForm(OpenLPWizard): self.progressPage.setSubTitle( translate('SongsPlugin.ExportWizardForm', 'Please wait while your songs are exported.')) - self.progressLabel.setText( - translate('SongsPlugin.ExportWizardForm', 'Ready.')) + self.progressLabel.setText(WizardStrings.Ready) self.progressBar.setFormat( translate('SongsPlugin.ExportWizardForm', '%p%')) diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index 6c851b04b..1ebbafb45 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -206,29 +206,31 @@ class SongImportForm(OpenLPWizard): self.sourcePage.setTitle(WizardStrings.ImportSelect) self.sourcePage.setSubTitle(WizardStrings.ImportSelectLong) self.formatLabel.setText(WizardStrings.FormatLabel) - self.formatComboBox.setItemText(0, UiStrings.OLPV2) - self.formatComboBox.setItemText(1, UiStrings.OLPV1) - self.formatComboBox.setItemText(2, WizardStrings.OL) - self.formatComboBox.setItemText(3, WizardStrings.OS) - self.formatComboBox.setItemText(4, WizardStrings.WoW) - self.formatComboBox.setItemText(5, WizardStrings.CCLI) - self.formatComboBox.setItemText(6, WizardStrings.SoF) - self.formatComboBox.setItemText(7, WizardStrings.GDP) - self.formatComboBox.setItemText(8, WizardStrings.ES) - self.formatComboBox.setItemText(9, WizardStrings.EW) - self.formatComboBox.setItemText(10, WizardStrings.SB) -# self.formatComboBox.setItemText(11, WizardStrings.CSV) + self.formatComboBox.setItemText(SongFormat.OpenLP2, UiStrings.OLPV2) + self.formatComboBox.setItemText(SongFormat.OpenLP1, UiStrings.OLPV1) + self.formatComboBox.setItemText( + SongFormat.OpenLyrics, WizardStrings.OL) + self.formatComboBox.setItemText(SongFormat.OpenSong, WizardStrings.OS) + self.formatComboBox.setItemText( + SongFormat.WordsOfWorship, WizardStrings.WoW) + self.formatComboBox.setItemText(SongFormat.CCLI, WizardStrings.CCLI) + self.formatComboBox.setItemText( + SongFormat.SongsOfFellowship, WizardStrings.SoF) + self.formatComboBox.setItemText(SongFormat.Generic, WizardStrings.GDP) + self.formatComboBox.setItemText( + SongFormat.EasiSlides, WizardStrings.ES) + self.formatComboBox.setItemText( + SongFormat.EasyWorship, WizardStrings.EW) + self.formatComboBox.setItemText( + SongFormat.SongBeamer, WizardStrings.SB) +# self.formatComboBox.setItemText(SongFormat.CSV, WizardStrings.CSV) self.openLP2FilenameLabel.setText( translate('SongsPlugin.ImportWizardForm', 'Filename:')) self.openLP2BrowseButton.setText(UiStrings.Browse) self.openLP1FilenameLabel.setText( translate('SongsPlugin.ImportWizardForm', 'Filename:')) self.openLP1BrowseButton.setText(UiStrings.Browse) - self.openLP1DisabledLabel.setText( - translate('SongsPlugin.ImportWizardForm', 'The openlp.org 1.x ' - 'importer has been disabled due to a missing Python module. If ' - 'you want to use this importer, you will need to install the ' - '"python-sqlite" module.')) + self.openLP1DisabledLabel.setText(WizardStrings.NoSqlite) self.openLyricsAddButton.setText( translate('SongsPlugin.ImportWizardForm', 'Add Files...')) self.openLyricsRemoveButton.setText( @@ -283,8 +285,7 @@ class SongImportForm(OpenLPWizard): self.progressPage.setSubTitle( translate('SongsPlugin.ImportWizardForm', 'Please wait while your songs are imported.')) - self.progressLabel.setText( - translate('SongsPlugin.ImportWizardForm', 'Ready.')) + self.progressLabel.setText(WizardStrings.Ready) self.progressBar.setFormat( translate('SongsPlugin.ImportWizardForm', '%p%')) # Align all QFormLayouts towards each other. @@ -573,8 +574,7 @@ class SongImportForm(OpenLPWizard): Perform pre import tasks """ OpenLPWizard.preWizard(self) - self.progressLabel.setText( - translate('SongsPlugin.ImportWizardForm', 'Starting import...')) + self.progressLabel.setText(WizardStrings.StartingImport) Receiver.send_message(u'openlp_process_events') def performWizard(self): diff --git a/openlp/plugins/songs/lib/importer.py b/openlp/plugins/songs/lib/importer.py index 6f566ff4f..c38392df8 100644 --- a/openlp/plugins/songs/lib/importer.py +++ b/openlp/plugins/songs/lib/importer.py @@ -67,10 +67,10 @@ class SongFormat(object): CCLI = 5 SongsOfFellowship = 6 Generic = 7 - #CSV = 8 EasiSlides = 8 EasyWorship = 9 SongBeamer = 10 + #CSV = 11 @staticmethod def get_class(format): diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index bbd1aad9c..50203902d 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -318,9 +318,7 @@ class SongMediaItem(MediaManagerItem): """ Remove a song from the list and database """ - if check_item_selected(self.listView, - translate('SongsPlugin.MediaItem', - 'You must select an item to delete.')): + if check_item_selected(self.listView, UiStrings.SelectDelete): items = self.listView.selectedIndexes() if QtGui.QMessageBox.question(self, translate('SongsPlugin.MediaItem', 'Delete Song(s)?'), diff --git a/openlp/plugins/songs/lib/openlyricsimport.py b/openlp/plugins/songs/lib/openlyricsimport.py index 37407c75c..20d780992 100644 --- a/openlp/plugins/songs/lib/openlyricsimport.py +++ b/openlp/plugins/songs/lib/openlyricsimport.py @@ -34,6 +34,7 @@ import os from lxml import etree from openlp.core.lib import translate +from openlp.core.ui.wizard import WizardStrings from openlp.plugins.songs.lib.songimport import SongImport from openlp.plugins.songs.lib import OpenLyrics @@ -65,9 +66,8 @@ class OpenLyricsImport(SongImport): for file_path in self.import_source: if self.stop_import_flag: return False - self.import_wizard.incrementProgressBar(unicode(translate( - 'SongsPlugin.OpenLyricsImport', 'Importing %s...')) % - os.path.basename(file_path)) + self.import_wizard.incrementProgressBar( + WizardStrings.ImportingType % os.path.basename(file_path)) try: parsed_file = etree.parse(file_path, parser) xml = unicode(etree.tostring(parsed_file)) diff --git a/openlp/plugins/songs/lib/songbeamerimport.py b/openlp/plugins/songs/lib/songbeamerimport.py index 47290bfbd..ddbe0525b 100644 --- a/openlp/plugins/songs/lib/songbeamerimport.py +++ b/openlp/plugins/songs/lib/songbeamerimport.py @@ -34,6 +34,7 @@ import os import re from openlp.core.lib import translate +from openlp.core.ui.wizard import WizardStrings from openlp.plugins.songs.lib.songimport import SongImport log = logging.getLogger(__name__) @@ -134,9 +135,8 @@ class SongBeamerImport(SongImport): self.add_verse(self.current_verse, self.current_verse_type) if self.check_complete(): self.finish() - self.import_wizard.incrementProgressBar(unicode(translate( - 'SongsPlugin.SongBeamerImport', 'Importing %s...')) % - file_name) + self.import_wizard.incrementProgressBar( + WizardStrings.ImportingType % file_name) return True def replace_html_tags(self): From 321269b11bc88ca080a7cd28dccaecaeb072d044 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sun, 13 Feb 2011 01:24:47 +0000 Subject: [PATCH 101/243] Fixes and cleanups --- openlp/plugins/alerts/forms/alertform.py | 2 +- openlp/plugins/bibles/forms/bibleimportform.py | 2 +- openlp/plugins/bibles/lib/openlp1.py | 2 +- openlp/plugins/songs/lib/openlyricsimport.py | 1 - openlp/plugins/songs/lib/songbeamerimport.py | 1 - 5 files changed, 3 insertions(+), 5 deletions(-) diff --git a/openlp/plugins/alerts/forms/alertform.py b/openlp/plugins/alerts/forms/alertform.py index 93d64a401..bd4c8e735 100644 --- a/openlp/plugins/alerts/forms/alertform.py +++ b/openlp/plugins/alerts/forms/alertform.py @@ -97,7 +97,7 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog): def onNewClick(self): if len(self.alertTextEdit.text()) == 0: QtGui.QMessageBox.information(self, UiStrings.NewType % - self.plugin.getString(StringContent.Name)[u'singular'] + self.plugin.getString(StringContent.Name)[u'singular'], translate('AlertsPlugin.AlertForm', 'You haven\'t specified ' 'any text for your alert. Please type in some text before ' 'clicking New.')) diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index 81ae6607a..7854a7096 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -693,7 +693,7 @@ class BibleImportForm(OpenLPWizard): 'BiblesPlugin.ImportWizardForm', 'Starting Registering bible...')) else: - self.progressLabel.setText(translate(WizardStrings.StartingImport) + self.progressLabel.setText(WizardStrings.StartingImport) Receiver.send_message(u'openlp_process_events') def performWizard(self): diff --git a/openlp/plugins/bibles/lib/openlp1.py b/openlp/plugins/bibles/lib/openlp1.py index 27731d7ea..73b7eb91a 100644 --- a/openlp/plugins/bibles/lib/openlp1.py +++ b/openlp/plugins/bibles/lib/openlp1.py @@ -29,7 +29,7 @@ import sqlite from PyQt4 import QtCore -from openlp.core.lib import Receiver, translate +from openlp.core.lib import Receiver from openlp.core.ui.wizard import WizardStrings from openlp.plugins.bibles.lib.db import BibleDB diff --git a/openlp/plugins/songs/lib/openlyricsimport.py b/openlp/plugins/songs/lib/openlyricsimport.py index 20d780992..f4506c2be 100644 --- a/openlp/plugins/songs/lib/openlyricsimport.py +++ b/openlp/plugins/songs/lib/openlyricsimport.py @@ -33,7 +33,6 @@ import os from lxml import etree -from openlp.core.lib import translate from openlp.core.ui.wizard import WizardStrings from openlp.plugins.songs.lib.songimport import SongImport from openlp.plugins.songs.lib import OpenLyrics diff --git a/openlp/plugins/songs/lib/songbeamerimport.py b/openlp/plugins/songs/lib/songbeamerimport.py index ddbe0525b..eeabc0e5d 100644 --- a/openlp/plugins/songs/lib/songbeamerimport.py +++ b/openlp/plugins/songs/lib/songbeamerimport.py @@ -33,7 +33,6 @@ import logging import os import re -from openlp.core.lib import translate from openlp.core.ui.wizard import WizardStrings from openlp.plugins.songs.lib.songimport import SongImport From 57c0ab31dc7e937af5b7fe7fc5a87b83b3f6a4f6 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 13 Feb 2011 10:37:27 +0000 Subject: [PATCH 102/243] Video length tagging and display --- openlp/core/lib/serviceitem.py | 32 +++++++++++++++++++++++++++++++- openlp/core/lib/ui.py | 3 ++- openlp/core/ui/servicemanager.py | 5 +++++ openlp/core/ui/starttimeform.py | 1 + 4 files changed, 39 insertions(+), 2 deletions(-) diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index 4652aa503..943294f7a 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -28,11 +28,14 @@ The :mod:`serviceitem` provides the service item functionality including the type and capability of an item. """ +import datetime import logging +import mutagen import os import uuid from openlp.core.lib import build_icon, clean_tags, expand_tags +from openlp.core.lib.ui import UiStrings log = logging.getLogger(__name__) @@ -106,7 +109,7 @@ class ServiceItem(object): self.data_string = u'' self.edit_id = None self.xml_version = None - self.start_time =[0, 0, 0] + self.start_time = [0, 0, 0] self._new_item() def _new_item(self): @@ -425,3 +428,30 @@ class ServiceItem(object): return self._raw_frames[row][u'path'] except IndexError: return u'' + + def get_media_time(self): + """ + Returns the start and finish time for a media item + """ + tooltip = None + start = None + end = None + if self.start_time != [0, 0, 0]: + start = UiStrings.Start % \ + (self.start_time[0], self.start_time[1], self.start_time[2]) + path = os.path.join(self.get_frames()[0][u'path'], + self.get_frames()[0][u'title']) + if os.path.isfile(path): + file = mutagen.File(path) + if file is not None: + seconds = int(file.info.length) + end = UiStrings.Length % \ + unicode(datetime.timedelta(seconds=seconds)) + if not start and not end: + return None + elif start and not end: + return start + elif not start and end: + return end + else: + return u'%s : %s' % (start, end) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index a3b442801..0013b7099 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -58,6 +58,7 @@ class UiStrings(object): ExportType = unicode(translate('OpenLP.Ui', 'Export %s')) Import = translate('OpenLP.Ui', 'Import') ImportType = unicode(translate('OpenLP.Ui', 'Import %s')) + Length = unicode(translate('OpenLP.Ui', 'Length %s')) Live = translate('OpenLP.Ui', 'Live') Load = translate('OpenLP.Ui', 'Load') LoadANew = unicode(translate('OpenLP.Ui', 'Load a new %s.')) @@ -75,10 +76,10 @@ class UiStrings(object): SendSelectLive = unicode(translate('OpenLP.Ui', 'Send the selected %s live.')) Service = translate('OpenLP.Ui', 'Service') + Start = unicode(translate('OpenLP.Ui', 'Start %02d:%02d:%02d')) Theme = translate('OpenLP.Ui', 'Theme') Themes = translate('OpenLP.Ui', 'Themes') - def add_welcome_page(parent, image): """ Generate an opening welcome page for a wizard using a provided image. diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index de7047fb6..714c555a1 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -611,12 +611,14 @@ class ServiceManager(QtGui.QWidget): item = self.findServiceItem()[0] self.startTimeForm.item = self.serviceItems[item] if self.startTimeForm.exec_(): + self.serviceItems[item][u'service_item'].start_time = [0, 0, 0] self.serviceItems[item][u'service_item'].start_time[0] = \ self.startTimeForm.hourSpinBox.value() self.serviceItems[item][u'service_item'].start_time[1] = \ self.startTimeForm.minuteSpinBox.value() self.serviceItems[item][u'service_item'].start_time[2] = \ self.startTimeForm.secondSpinBox.value() + self.repaintServiceList(item, -1) def onServiceItemEditForm(self): item = self.findServiceItem()[0] @@ -864,6 +866,9 @@ class ServiceManager(QtGui.QWidget): text = frame[u'title'].replace(u'\n', u' ') child.setText(0, text[:40]) child.setData(0, QtCore.Qt.UserRole, QtCore.QVariant(count)) + tip= item[u'service_item'].get_media_time() + if tip: + child.setToolTip(0, tip) if serviceItem == itemcount: if item[u'expanded'] and serviceItemChild == count: self.serviceManagerList.setCurrentItem(child) diff --git a/openlp/core/ui/starttimeform.py b/openlp/core/ui/starttimeform.py index 8bd3cd085..f8b27bd8d 100644 --- a/openlp/core/ui/starttimeform.py +++ b/openlp/core/ui/starttimeform.py @@ -46,3 +46,4 @@ class StartTimeForm(QtGui.QDialog, Ui_StartTimeDialog): self.minuteSpinBox.setValue(self.item[u'service_item'].start_time[1]) self.secondSpinBox.setValue(self.item[u'service_item'].start_time[2]) return QtGui.QDialog.exec_(self) + From c75e884c7e622f1b3769dc08ecca8e9587e0b355 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 13 Feb 2011 11:05:56 +0000 Subject: [PATCH 103/243] Minor fixes --- openlp/core/ui/servicemanager.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 714c555a1..444b02d7a 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -611,7 +611,6 @@ class ServiceManager(QtGui.QWidget): item = self.findServiceItem()[0] self.startTimeForm.item = self.serviceItems[item] if self.startTimeForm.exec_(): - self.serviceItems[item][u'service_item'].start_time = [0, 0, 0] self.serviceItems[item][u'service_item'].start_time[0] = \ self.startTimeForm.hourSpinBox.value() self.serviceItems[item][u'service_item'].start_time[1] = \ @@ -866,7 +865,7 @@ class ServiceManager(QtGui.QWidget): text = frame[u'title'].replace(u'\n', u' ') child.setText(0, text[:40]) child.setData(0, QtCore.Qt.UserRole, QtCore.QVariant(count)) - tip= item[u'service_item'].get_media_time() + tip = item[u'service_item'].get_media_time() if tip: child.setToolTip(0, tip) if serviceItem == itemcount: From 720c2036e3ac378c55f14f08269672b4bdc45efa Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 13 Feb 2011 13:11:15 +0000 Subject: [PATCH 104/243] Review comments --- openlp/core/lib/serviceitem.py | 10 +++++----- openlp/core/lib/ui.py | 4 ++-- openlp/core/ui/maindisplay.py | 5 +---- openlp/core/ui/servicemanager.py | 16 ++++++++-------- openlp/core/ui/starttimeform.py | 13 ++++++++----- 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index 943294f7a..1b5261773 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -109,7 +109,7 @@ class ServiceItem(object): self.data_string = u'' self.edit_id = None self.xml_version = None - self.start_time = [0, 0, 0] + self.start_time = 0 self._new_item() def _new_item(self): @@ -436,16 +436,16 @@ class ServiceItem(object): tooltip = None start = None end = None - if self.start_time != [0, 0, 0]: - start = UiStrings.Start % \ - (self.start_time[0], self.start_time[1], self.start_time[2]) + if self.start_time != 0: + start = UiStrings.StartTimeCode % \ + unicode(datetime.timedelta(seconds=self.start_time)) path = os.path.join(self.get_frames()[0][u'path'], self.get_frames()[0][u'title']) if os.path.isfile(path): file = mutagen.File(path) if file is not None: seconds = int(file.info.length) - end = UiStrings.Length % \ + end = UiStrings.LengthTime % \ unicode(datetime.timedelta(seconds=seconds)) if not start and not end: return None diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 0013b7099..400381b0c 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -58,7 +58,7 @@ class UiStrings(object): ExportType = unicode(translate('OpenLP.Ui', 'Export %s')) Import = translate('OpenLP.Ui', 'Import') ImportType = unicode(translate('OpenLP.Ui', 'Import %s')) - Length = unicode(translate('OpenLP.Ui', 'Length %s')) + LengthTime = unicode(translate('OpenLP.Ui', 'Length %s')) Live = translate('OpenLP.Ui', 'Live') Load = translate('OpenLP.Ui', 'Load') LoadANew = unicode(translate('OpenLP.Ui', 'Load a new %s.')) @@ -76,7 +76,7 @@ class UiStrings(object): SendSelectLive = unicode(translate('OpenLP.Ui', 'Send the selected %s live.')) Service = translate('OpenLP.Ui', 'Service') - Start = unicode(translate('OpenLP.Ui', 'Start %02d:%02d:%02d')) + StartTimeCode = unicode(translate('OpenLP.Ui', 'Start %s')) Theme = translate('OpenLP.Ui', 'Theme') Themes = translate('OpenLP.Ui', 'Themes') diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 744908406..cc2f2f72d 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -349,10 +349,7 @@ class MainDisplay(DisplayWidget): Start the video at a predetermined point. """ if newState == 2: - time = self.serviceItem.start_time[0] * 60 * 60 + \ - self.serviceItem.start_time[1] * 60 + \ - self.serviceItem.start_time[2] - self.mediaObject.seek(time * 1000) + self.mediaObject.seek(self.serviceItem.start_time * 1000) def isWebLoaded(self): """ diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 444b02d7a..71191fdbf 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -611,11 +611,9 @@ class ServiceManager(QtGui.QWidget): item = self.findServiceItem()[0] self.startTimeForm.item = self.serviceItems[item] if self.startTimeForm.exec_(): - self.serviceItems[item][u'service_item'].start_time[0] = \ - self.startTimeForm.hourSpinBox.value() - self.serviceItems[item][u'service_item'].start_time[1] = \ - self.startTimeForm.minuteSpinBox.value() - self.serviceItems[item][u'service_item'].start_time[2] = \ + self.serviceItems[item][u'service_item'].start_time = \ + self.startTimeForm.hourSpinBox.value() * 3600 + \ + self.startTimeForm.minuteSpinBox.value() * 60 + \ self.startTimeForm.secondSpinBox.value() self.repaintServiceList(item, -1) @@ -865,9 +863,11 @@ class ServiceManager(QtGui.QWidget): text = frame[u'title'].replace(u'\n', u' ') child.setText(0, text[:40]) child.setData(0, QtCore.Qt.UserRole, QtCore.QVariant(count)) - tip = item[u'service_item'].get_media_time() - if tip: - child.setToolTip(0, tip) + if item[u'service_item'] \ + .is_capable(ItemCapabilities.AllowsVarableStartTime): + tip = item[u'service_item'].get_media_time() + if tip: + child.setToolTip(0, tip) if serviceItem == itemcount: if item[u'expanded'] and serviceItemChild == count: self.serviceManagerList.setCurrentItem(child) diff --git a/openlp/core/ui/starttimeform.py b/openlp/core/ui/starttimeform.py index f8b27bd8d..1280931d5 100644 --- a/openlp/core/ui/starttimeform.py +++ b/openlp/core/ui/starttimeform.py @@ -28,8 +28,6 @@ from PyQt4 import QtGui from starttimedialog import Ui_StartTimeDialog -from openlp.core.lib import translate - class StartTimeForm(QtGui.QDialog, Ui_StartTimeDialog): """ The exception dialog @@ -42,8 +40,13 @@ class StartTimeForm(QtGui.QDialog, Ui_StartTimeDialog): """ Run the Dialog with correct heading. """ - self.hourSpinBox.setValue(self.item[u'service_item'].start_time[0]) - self.minuteSpinBox.setValue(self.item[u'service_item'].start_time[1]) - self.secondSpinBox.setValue(self.item[u'service_item'].start_time[2]) + seconds = self.item[u'service_item'].start_time + hours = seconds / 3600 + seconds -= 3600 * hours + minutes = seconds / 60 + seconds -= 60 * minutes + self.hourSpinBox.setValue(hours) + self.minuteSpinBox.setValue(minutes) + self.secondSpinBox.setValue(seconds) return QtGui.QDialog.exec_(self) From 816b17c245795ebcca05d44e2324a3f0e079f8b0 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sun, 13 Feb 2011 14:21:12 +0000 Subject: [PATCH 105/243] UiStrings --- openlp/core/lib/ui.py | 1 + openlp/plugins/custom/lib/mediaitem.py | 9 +++------ openlp/plugins/songs/lib/mediaitem.py | 4 +--- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index c8ffb8262..4852bc3ca 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -87,6 +87,7 @@ class UiStrings(object): SaveType = unicode(translate('OpenLP.Ui', 'Save %s')) Search = translate('OpenLP.Ui', 'Search') SelectDelete = translate('OpenLP.Ui', 'You must select an item to delete.') + SelectEdit = translate('OpenLP.Ui', 'You must select an item to edit.') SendSelectLive = unicode(translate('OpenLP.Ui', 'Send the selected %s live.')) Service = translate('OpenLP.Ui', 'Service') diff --git a/openlp/plugins/custom/lib/mediaitem.py b/openlp/plugins/custom/lib/mediaitem.py index c1da5bdfa..522d36e5c 100644 --- a/openlp/plugins/custom/lib/mediaitem.py +++ b/openlp/plugins/custom/lib/mediaitem.py @@ -30,6 +30,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, Receiver, ItemCapabilities, \ translate, check_item_selected +from openlp.core.lib.ui import UiStrings from openlp.plugins.custom.lib import CustomXMLParser from openlp.plugins.custom.lib.db import CustomSlide @@ -108,9 +109,7 @@ class CustomMediaItem(MediaManagerItem): """ Edit a custom item """ - if check_item_selected(self.listView, - translate('CustomPlugin.MediaItem', - 'You haven\'t selected an item to edit.')): + if check_item_selected(self.listView, UiStrings.SelectEdit): item = self.listView.currentItem() item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0] self.parent.edit_custom_form.loadCustom(item_id, False) @@ -121,9 +120,7 @@ class CustomMediaItem(MediaManagerItem): """ Remove a custom item from the list and database """ - if check_item_selected(self.listView, - translate('CustomPlugin.MediaItem', - 'You haven\'t selected an item to delete.')): + if check_item_selected(self.listView, UiStrings.SelectDelete): row_list = [item.row() for item in self.listView.selectedIndexes()] row_list.sort(reverse=True) id_list = [(item.data(QtCore.Qt.UserRole)).toInt()[0] diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 50203902d..ccfb8df90 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -306,9 +306,7 @@ class SongMediaItem(MediaManagerItem): Edit a song """ log.debug(u'onEditClick') - if check_item_selected(self.listView, - translate('SongsPlugin.MediaItem', - 'You must select an item to edit.')): + if check_item_selected(self.listView, UiStrings.SelectEdit): self.editItem = self.listView.currentItem() item_id = (self.editItem.data(QtCore.Qt.UserRole)).toInt()[0] self.edit_song_form.loadSong(item_id, False) From ffd4d4176091c712c095fbb929afd95ecfb4f47c Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sun, 13 Feb 2011 15:11:06 +0000 Subject: [PATCH 106/243] Strings including Author Unknown --- openlp/core/lib/ui.py | 1 + openlp/core/ui/slidecontroller.py | 3 +-- openlp/core/ui/starttimedialog.py | 4 ++-- openlp/plugins/alerts/lib/alertstab.py | 3 +-- openlp/plugins/songs/lib/opensongimport.py | 4 ++-- openlp/plugins/songs/lib/songimport.py | 3 +-- openlp/plugins/songs/lib/ui.py | 1 + openlp/plugins/songs/lib/xml.py | 4 +--- 8 files changed, 10 insertions(+), 13 deletions(-) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index f335c165f..f4aa8162e 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -85,6 +85,7 @@ class UiStrings(object): ReplaceLiveBG = translate('OpenLP.Ui', 'Replace Live Background') ResetBG = translate('OpenLP.Ui', 'Reset Background') ResetLiveBG = translate('OpenLP.Ui', 'Reset Live Background') + S = translate('OpenLP.Ui', 's', 'The abbreviated unit for seconds') SaveType = unicode(translate('OpenLP.Ui', 'Save %s')) Search = translate('OpenLP.Ui', 'Search') SelectDelete = translate('OpenLP.Ui', 'You must select an item to delete.') diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 52626f24f..f3bf7ee52 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -191,8 +191,7 @@ class SlideController(QtGui.QWidget): self.delaySpinBox.setMinimum(1) self.delaySpinBox.setMaximum(180) self.toolbar.addToolbarWidget(u'Image SpinBox', self.delaySpinBox) - self.delaySpinBox.setSuffix(translate('OpenLP.SlideController', - 's')) + self.delaySpinBox.setSuffix(UiStrings.S) self.delaySpinBox.setToolTip(translate('OpenLP.SlideController', 'Delay between slides in seconds')) else: diff --git a/openlp/core/ui/starttimedialog.py b/openlp/core/ui/starttimedialog.py index 8dcc2c9ee..d87df71c4 100644 --- a/openlp/core/ui/starttimedialog.py +++ b/openlp/core/ui/starttimedialog.py @@ -27,7 +27,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate -from openlp.core.lib.ui import create_accept_reject_button_box +from openlp.core.lib.ui import UiStrings, create_accept_reject_button_box class Ui_StartTimeDialog(object): def setupUi(self, StartTimeDialog): @@ -65,6 +65,6 @@ class Ui_StartTimeDialog(object): self.hourLabel.setText(translate('OpenLP.StartTimeForm', 'Hours:')) self.hourSpinBox.setSuffix(translate('OpenLP.StartTimeForm', 'h')) self.minuteSpinBox.setSuffix(translate('OpenLP.StartTimeForm', 'm')) - self.secondSpinBox.setSuffix(translate('OpenLP.StartTimeForm', 's')) + self.secondSpinBox.setSuffix(UiStrings.S) self.minuteLabel.setText(translate('OpenLP.StartTimeForm', 'Minutes:')) self.secondLabel.setText(translate('OpenLP.StartTimeForm', 'Seconds:')) diff --git a/openlp/plugins/alerts/lib/alertstab.py b/openlp/plugins/alerts/lib/alertstab.py index 48a4527ed..8c1538e4d 100644 --- a/openlp/plugins/alerts/lib/alertstab.py +++ b/openlp/plugins/alerts/lib/alertstab.py @@ -113,8 +113,7 @@ class AlertsTab(SettingsTab): translate('AlertsPlugin.AlertsTab', 'pt')) self.TimeoutLabel.setText( translate('AlertsPlugin.AlertsTab', 'Alert timeout:')) - self.TimeoutSpinBox.setSuffix( - translate('AlertsPlugin.AlertsTab', 's')) + self.TimeoutSpinBox.setSuffix(UiStrings.S) self.PreviewGroupBox.setTitle(UiStrings.Preview) self.FontPreview.setText(UiStrings.OLPV2) diff --git a/openlp/plugins/songs/lib/opensongimport.py b/openlp/plugins/songs/lib/opensongimport.py index 8c6d283e3..24043d6f0 100644 --- a/openlp/plugins/songs/lib/opensongimport.py +++ b/openlp/plugins/songs/lib/opensongimport.py @@ -32,6 +32,7 @@ from lxml.etree import Error, LxmlError import re from openlp.core.lib import translate +from openlp.core.ui.wizard import WizardStrings from openlp.plugins.songs.lib.songimport import SongImport log = logging.getLogger(__name__) @@ -159,8 +160,7 @@ class OpenSongImport(SongImport): # not a zipfile log.info(u'Direct import %s', filename) self.import_wizard.incrementProgressBar( - unicode(translate('SongsPlugin.ImportWizardForm', - 'Importing %s...')) % os.path.split(filename)[-1]) + WizardStrings.ImportingType % os.path.split(filename)[-1]) file = open(filename) self.do_import_file(file) if self.commit: diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index da017d4f5..b56b54b58 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -260,8 +260,7 @@ class SongImport(QtCore.QObject): All fields have been set to this song. Write the song to disk. """ if not self.authors: - self.authors.append(unicode(translate('SongsPlugin.SongImport', - 'Author unknown'))) + self.authors.append(u'Author Unknown') log.info(u'commiting song %s to database', self.title) song = Song() song.title = self.title diff --git a/openlp/plugins/songs/lib/ui.py b/openlp/plugins/songs/lib/ui.py index 2a67fce55..d712b9922 100644 --- a/openlp/plugins/songs/lib/ui.py +++ b/openlp/plugins/songs/lib/ui.py @@ -36,6 +36,7 @@ class SongStrings(object): # These strings should need a good reason to be retranslated elsewhere. Author = translate('OpenLP.Ui', 'Author', 'Singular') Authors = translate('OpenLP.Ui', 'Authors', 'Plural') + AuthorUnknown = translate('OpenLP.Ui', 'Author Unknown') SongBook = translate('OpenLP.Ui', 'Song Book', 'Singular') SongBooks = translate('OpenLP.Ui', 'Song Books', 'Plural') Topic = translate('OpenLP.Ui', 'Topic', 'Singular') diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index b96e79961..73c65f7c8 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -377,9 +377,7 @@ class OpenLyrics(object): except AttributeError: pass if not authors: - # Add "Author unknown" (can be translated). - authors.append((unicode(translate('SongsPlugin.XML', - 'Author unknown')))) + authors.append(u'Author Unknown') for display_name in authors: author = self.manager.get_object_filtered(Author, Author.display_name == display_name) From 1913da71cce8007ec4d75ca1a87f12218d7a1df9 Mon Sep 17 00:00:00 2001 From: Philip Ridout Date: Sun, 13 Feb 2011 15:13:52 +0000 Subject: [PATCH 107/243] Added SongShow Plus importer. --- openlp/plugins/songs/forms/songimportform.py | 49 ++++ openlp/plugins/songs/lib/importer.py | 7 +- .../plugins/songs/lib/songshowplusimport.py | 212 ++++++++++++++++++ 3 files changed, 267 insertions(+), 1 deletion(-) create mode 100644 openlp/plugins/songs/lib/songshowplusimport.py diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index 8cd8c70fa..e641ccba7 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -140,6 +140,12 @@ class SongImportForm(OpenLPWizard): QtCore.QObject.connect(self.songBeamerRemoveButton, QtCore.SIGNAL(u'clicked()'), self.onSongBeamerRemoveButtonClicked) + QtCore.QObject.connect(self.songShowPlusAddButton, + QtCore.SIGNAL(u'clicked()'), + self.onSongShowPlusAddButtonClicked) + QtCore.QObject.connect(self.songShowPlusRemoveButton, + QtCore.SIGNAL(u'clicked()'), + self.onSongShowPlusRemoveButtonClicked) def addCustomPages(self): """ @@ -188,6 +194,8 @@ class SongImportForm(OpenLPWizard): self.addFileSelectItem(u'ew', single_select=True) # Words of Worship self.addFileSelectItem(u'songBeamer') + # Song Show Plus + self.addFileSelectItem(u'songShowPlus') # Commented out for future use. # self.addFileSelectItem(u'csv', u'CSV', single_select=True) self.sourceLayout.addLayout(self.formatStack) @@ -237,6 +245,8 @@ class SongImportForm(OpenLPWizard): translate('SongsPlugin.ImportWizardForm', 'EasyWorship')) self.formatComboBox.setItemText(10, translate('SongsPlugin.ImportWizardForm', 'SongBeamer')) + self.formatComboBox.setItemText(11, + translate('SongsPlugin.ImportWizardForm', 'SongShow Plus')) # self.formatComboBox.setItemText(11, # translate('SongsPlugin.ImportWizardForm', 'CSV')) self.openLP2FilenameLabel.setText( @@ -301,6 +311,10 @@ class SongImportForm(OpenLPWizard): translate('SongsPlugin.ImportWizardForm', 'Add Files...')) self.songBeamerRemoveButton.setText( translate('SongsPlugin.ImportWizardForm', 'Remove File(s)')) + self.songShowPlusAddButton.setText( + translate('SongsPlugin.ImportWizardForm', 'Add Files...')) + self.songShowPlusRemoveButton.setText( + translate('SongsPlugin.ImportWizardForm', 'Remove File(s)')) # self.csvFilenameLabel.setText( # translate('SongsPlugin.ImportWizardForm', 'Filename:')) # self.csvBrowseButton.setText( @@ -438,6 +452,16 @@ class SongImportForm(OpenLPWizard): 'file to import from.')) self.songBeamerAddButton.setFocus() return False + elif source_format == SongFormat.SongShowPlus: + if self.songShowPlusFileListWidget.count() == 0: + critical_error_message_box( + translate('SongsPlugin.ImportWizardForm', + 'No SongShow Plus Files Selected'), + translate('SongsPlugin.ImportWizardForm', + 'You need to add at least one SongShow Plus ' + 'file to import from.')) + self.wordsOfWorshipAddButton.setFocus() + return False return True elif self.currentPage() == self.progressPage: return True @@ -671,6 +695,24 @@ class SongImportForm(OpenLPWizard): Remove selected SongBeamer files from the import list """ self.removeSelectedItems(self.songBeamerFileListWidget) + + def onSongShowPlusAddButtonClicked(self): + """ + Get SongShow Plus song database files + """ + self.getFiles( + translate('SongsPlugin.ImportWizardForm', + 'Select SongShow Plus Files'), + self.songShowPlusFileListWidget, u'%s (*.sbsong)' + % translate('SongsPlugin.ImportWizardForm', + 'SongShow Plus Song Files') + ) + + def onSongShowPlusRemoveButtonClicked(self): + """ + Remove selected SongShow Plus files from the import list + """ + self.removeSelectedItems(self.songShowPlusFileListWidget) def registerFields(self): """ @@ -697,6 +739,7 @@ class SongImportForm(OpenLPWizard): self.easiSlidesFilenameEdit.setText(u'') self.ewFilenameEdit.setText(u'') self.songBeamerFileListWidget.clear() + self.songShowPlusFileListWidget.clear() #self.csvFilenameEdit.setText(u'') def preWizard(self): @@ -773,6 +816,12 @@ class SongImportForm(OpenLPWizard): importer = self.plugin.importSongs(SongFormat.SongBeamer, filenames=self.getListOfFiles(self.songBeamerFileListWidget) ) + elif source_format == SongFormat.SongShowPlus: + # Import ShongShow Plus songs + importer = self.plugin.importSongs(SongFormat.SongShowPlus, + filenames=self.getListOfFiles( + self.songShowPlusFileListWidget) + ) if importer.do_import(): self.progressLabel.setText( translate('SongsPlugin.SongImportForm', 'Finished import.')) diff --git a/openlp/plugins/songs/lib/importer.py b/openlp/plugins/songs/lib/importer.py index 6f566ff4f..cbe5c6922 100644 --- a/openlp/plugins/songs/lib/importer.py +++ b/openlp/plugins/songs/lib/importer.py @@ -34,6 +34,7 @@ from wowimport import WowImport from cclifileimport import CCLIFileImport from ewimport import EasyWorshipSongImport from songbeamerimport import SongBeamerImport +from songshowplusimport import SongShowPlusImport # Imports that might fail try: from olp1import import OpenLP1SongImport @@ -71,6 +72,7 @@ class SongFormat(object): EasiSlides = 8 EasyWorship = 9 SongBeamer = 10 + SongShowPlus = 11 @staticmethod def get_class(format): @@ -102,6 +104,8 @@ class SongFormat(object): return EasyWorshipSongImport elif format == SongFormat.SongBeamer: return SongBeamerImport + elif format == SongFormat.SongShowPlus: + return SongShowPlusImport return None @staticmethod @@ -120,7 +124,8 @@ class SongFormat(object): SongFormat.Generic, SongFormat.EasiSlides, SongFormat.EasyWorship, - SongFormat.SongBeamer + SongFormat.SongBeamer, + SongFormat.SongShowPlus ] @staticmethod diff --git a/openlp/plugins/songs/lib/songshowplusimport.py b/openlp/plugins/songs/lib/songshowplusimport.py new file mode 100644 index 000000000..78c2e838d --- /dev/null +++ b/openlp/plugins/songs/lib/songshowplusimport.py @@ -0,0 +1,212 @@ +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 + +############################################################################### +# OpenLP - Open Source Lyrics Projection # +# --------------------------------------------------------------------------- # +# Copyright (c) 2008-2011 Raoul Snyman # +# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # +# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # +# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # +# Carsten Tinggaard, Frode Woldsund # +# --------------------------------------------------------------------------- # +# This program is free software; you can redistribute it and/or modify it # +# under the terms of the GNU General Public License as published by the Free # +# Software Foundation; version 2 of the License. # +# # +# This program is distributed in the hope that it will be useful, but WITHOUT # +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # +# more details. # +# # +# You should have received a copy of the GNU General Public License along # +# with this program; if not, write to the Free Software Foundation, Inc., 59 # +# Temple Place, Suite 330, Boston, MA 02111-1307 USA # +############################################################################### +""" +The :mod:`wowimport` module provides the functionality for importing Words of +Worship songs into the OpenLP database. +""" +import os +import logging +import struct + +from openlp.plugins.songs.lib.songimport import SongImport + +TITLE = 1 +AUTHOR = 2 +COPYRIGHT = 3 +CCLI_NO = 5 +VERSE = 12 +CHORUS = 20 +TOPIC = 29 +COMMENTS = 30 +VERSE_ORDER = 31 +SONG_BOOK = 35 +SONG_NUMBER = 36 +CUSTOM_VERSE = 37 + +log = logging.getLogger(__name__) + +class SongShowPlusImport(SongImport): + """ + The :class:`SongShowPlusImport` class provides the ability to import song + files from SongShow Plus. + + **SongShow Plus Song File Format:** + + The SongShow Plus song file format is as follows: + + * Each piece of data in the song file has some information that precedes + it. + * The general format of this data is as follows: + 4 Bytes, forming a 32 bit number, a key if you will, this describes what + the data is (see blockKey below) + 4 Bytes, forming a 32 bit number, which is the number of bytes until the + next block starts + 1 Byte, which tells how namy bytes follows + 1 or 4 Bytes, describes how long the string is, if its 1 byte, the string + is less than 255 + The next bytes are the actuall data. + The next block of data follows on. + + This description does differ for verses. Which includes extra bytes + stating the verse type or number. In some cases a "custom" verse is used, + in that case, this block will in include 2 strings, with the associated + string length descriptors. The first string is the name of the verse, the + second is the verse content. + + The file is ended with four null bytes. + + Valid extensions for a SongShow Plus song file are: + + * .sbsong + """ + otherList = {} + otherCount = 0 + + def __init__(self, master_manager, **kwargs): + """ + Initialise the import. + + ``master_manager`` + The song manager for the running OpenLP installation. + """ + SongImport.__init__(self, master_manager) + if kwargs.has_key(u'filename'): + self.import_source = kwargs[u'filename'] + if kwargs.has_key(u'filenames'): + self.import_source = kwargs[u'filenames'] + log.debug(self.import_source) + + def do_import(self): + """ + Receive a single file or a list of files to import. + """ + if isinstance(self.import_source, list): + self.import_wizard.progressBar.setMaximum(len(self.import_source)) + for file in self.import_source: + author = u'' + copyright = u'' + self.sspVerseOrderList = [] + otherCount = 0 + otherList = {} + file_name = os.path.split(file)[1] + self.import_wizard.incrementProgressBar( + u'Importing %s' % (file_name), 0) + songData = open(file, 'rb') + while (1): + blockKey, = struct.unpack("I",songData.read(4)) + # The file ends with 4 NUL's + if blockKey == 0: + break + nextBlockStarts, = struct.unpack("I",songData.read(4)) + if blockKey == VERSE or blockKey == CHORUS: + null, verseNo, = struct.unpack("BB",songData.read(2)) + elif blockKey == CUSTOM_VERSE: + null, verseNameLength, = struct.unpack("BB", + songData.read(2)) + verseName = songData.read(verseNameLength) + lengthDescriptorSize, = struct.unpack("B",songData.read(1)) + # Detect if/how long the length descriptor is + if lengthDescriptorSize == 12: + lengthDescriptor, = struct.unpack("I",songData.read(4)) + elif lengthDescriptorSize == 2: + lengthDescriptor = 1 + elif lengthDescriptorSize == 9: + lengthDescriptor = 0 + else: + lengthDescriptor, = struct.unpack("B",songData.read(1)) + data = songData.read(lengthDescriptor) + + if blockKey == TITLE: + self.title = unicode(data, u'cp1252') + elif blockKey == AUTHOR: + authors = data.split(" / ") + for author in authors: + if author.find(",") !=-1: + authorParts = author.split(", ") + author = authorParts[1] + " " + authorParts[0] + self.parse_author(unicode(author, u'cp1252')) + elif blockKey == COPYRIGHT: + self.add_copyright(unicode(data, u'cp1252')) + elif blockKey == CCLI_NO: + self.ccli_number = int(data) + elif blockKey == VERSE: + self.add_verse(unicode(data, u'cp1252'), + "V%s" % verseNo) + elif blockKey == CHORUS: + self.add_verse(unicode(data, u'cp1252'), + "C%s" % verseNo) + elif blockKey == TOPIC: + self.topics.append(unicode(data, u'cp1252')) + elif blockKey == COMMENTS: + self.comments = unicode(data, u'cp1252') + elif blockKey == VERSE_ORDER: + verseTag = self.toOpenLPVerseTag(data) + self.sspVerseOrderList.append(unicode(verseTag, + u'cp1252')) + elif blockKey == SONG_BOOK: + self.song_book_name = unicode(data, u'cp1252') + elif blockKey == SONG_NUMBER: + self.song_number = ord(data) + elif blockKey == CUSTOM_VERSE: + verseTag = self.toOpenLPVerseTag(verseName) + self.add_verse(unicode(data, u'cp1252'), verseTag) + else: + log.debug("Unrecognised blockKey: %s, data: %s" + %(blockKey, data)) + self.verse_order_list = self.sspVerseOrderList + songData.close() + self.finish() + self.import_wizard.incrementProgressBar( + u'Importing %s' % (file_name)) + return True + + def toOpenLPVerseTag(self, verseName): + if verseName.find(" ")!=-1: + verseParts = verseName.split(" ") + verseType = verseParts[0] + verseNumber = verseParts[1] + else: + verseType = verseName + verseNumber = "1" + verseType = verseType.lower() + if verseType == "verse": + verseTag = "V" + elif verseType == "chorus": + verseTag = "C" + elif verseType == "bridge": + verseTag = "B" + elif verseType == "pre-chorus": + verseTag = "P" + elif verseType == "bridge": + verseTag = "B" + else: + if not self.otherList.has_key(verseName): + self.otherCount = self.otherCount + 1 + self.otherList[verseName] = str(self.otherCount) + verseTag = "O" + verseNumber = self.otherList[verseName] + verseTag = verseTag + verseNumber + return verseTag From d129085d87745a10a756ca8bba747ff7316dd04a Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sun, 13 Feb 2011 15:17:42 +0000 Subject: [PATCH 108/243] Improve Author Unknown strings --- openlp/plugins/songs/lib/songimport.py | 3 ++- openlp/plugins/songs/lib/ui.py | 3 ++- openlp/plugins/songs/lib/xml.py | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index b56b54b58..7f0e622bd 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -31,6 +31,7 @@ from PyQt4 import QtCore from openlp.core.lib import Receiver, translate from openlp.plugins.songs.lib import VerseType from openlp.plugins.songs.lib.db import Song, Author, Topic, Book, MediaFile +from openlp.plugins.songs.lib.ui import SongStrings from openlp.plugins.songs.lib.xml import SongXML log = logging.getLogger(__name__) @@ -260,7 +261,7 @@ class SongImport(QtCore.QObject): All fields have been set to this song. Write the song to disk. """ if not self.authors: - self.authors.append(u'Author Unknown') + self.authors.append(SongStrings.AuthorUnknownUnT) log.info(u'commiting song %s to database', self.title) song = Song() song.title = self.title diff --git a/openlp/plugins/songs/lib/ui.py b/openlp/plugins/songs/lib/ui.py index d712b9922..3871c80b0 100644 --- a/openlp/plugins/songs/lib/ui.py +++ b/openlp/plugins/songs/lib/ui.py @@ -36,7 +36,8 @@ class SongStrings(object): # These strings should need a good reason to be retranslated elsewhere. Author = translate('OpenLP.Ui', 'Author', 'Singular') Authors = translate('OpenLP.Ui', 'Authors', 'Plural') - AuthorUnknown = translate('OpenLP.Ui', 'Author Unknown') + AuthorUnknown = translate('OpenLP.Ui', 'Author Unknown') # Used in the UI. + AuthorUnknownUnT = u'Author Unknown' # Used to populate the database. SongBook = translate('OpenLP.Ui', 'Song Book', 'Singular') SongBooks = translate('OpenLP.Ui', 'Song Books', 'Plural') Topic = translate('OpenLP.Ui', 'Topic', 'Singular') diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index 73c65f7c8..64fefdad2 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -69,6 +69,7 @@ from lxml import etree, objectify from openlp.core.lib import translate from openlp.plugins.songs.lib import VerseType from openlp.plugins.songs.lib.db import Author, Book, Song, Topic +from openlp.plugins.songs.lib.ui import SongStrings log = logging.getLogger(__name__) @@ -377,7 +378,7 @@ class OpenLyrics(object): except AttributeError: pass if not authors: - authors.append(u'Author Unknown') + authors.append(SongStrings.AuthorUnknownUnT) for display_name in authors: author = self.manager.get_object_filtered(Author, Author.display_name == display_name) From b10f59c870a424cca49ff44247b12814ee07a090 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sun, 13 Feb 2011 16:51:19 +0100 Subject: [PATCH 109/243] added icons --- openlp/plugins/bibles/lib/mediaitem.py | 14 +++++++------- resources/images/openlp-2.qrc | 4 ++++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index b83e62c57..d4e2d837e 100644 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -90,9 +90,9 @@ class BibleMediaItem(MediaManagerItem): self.quickSearchEdit.setObjectName(u'quickSearchEdit') self.quickSearchLabel.setBuddy(self.quickSearchEdit) self.quickSearchEdit.setSearchTypes([ - (1, u':/songs/song_topic_edit.png', - translate('BiblesPlugin.MediaItem', 'Verse Search')), - (2, u':/songs/song_search_author.png', + (1, u':/bibles/bibles_serach_reference.png', + translate('BiblesPlugin.MediaItem', 'Scripture Reference')), + (2, u':/bibles/bibles_serach_text.png', translate('BiblesPlugin.MediaItem', 'Text Search')) ]) self.quickLayout.addRow(self.quickSearchLabel, self.quickSearchEdit) @@ -352,10 +352,10 @@ class BibleMediaItem(MediaManagerItem): """ This updates the bible book completion list for the search field. The completion depends on the bible. It is only updated when we are doing a - verse search, otherwise the auto completion list is removed. + reference search, otherwise the auto completion list is removed. """ books = [] - # We have to do a 'Verse Search'. + # We have to do a 'Reference Search'. if self.quickSearchEdit.currentSearchType() == 1: bibles = self.parent.manager.get_bibles() bible = unicode(self.quickVersionComboBox.currentText()) @@ -485,7 +485,7 @@ class BibleMediaItem(MediaManagerItem): def onQuickSearchButton(self): """ Does a quick search and saves the search results. Quick search can - either be "Verse Search" or "Text Search". + either be "Reference Search" or "Text Search". """ log.debug(u'Quick Search Button pressed') self.quickSearchButton.setEnabled(False) @@ -494,7 +494,7 @@ class BibleMediaItem(MediaManagerItem): second_bible = unicode(self.quickSecondComboBox.currentText()) text = unicode(self.quickSearchEdit.text()) if self.quickSearchEdit.currentSearchType() == 1: - # We are doing a 'Verse Search'. + # We are doing a 'Reference Search'. self.search_results = self.parent.manager.get_verses(bible, text) if second_bible and self.search_results: self.second_search_results = self.parent.manager.get_verses( diff --git a/resources/images/openlp-2.qrc b/resources/images/openlp-2.qrc index dd5abd861..929775f78 100644 --- a/resources/images/openlp-2.qrc +++ b/resources/images/openlp-2.qrc @@ -21,6 +21,10 @@ song_topic_edit.png song_book_edit.png
+ + bibles_serach_text.png + bibles_serach_reference.png + plugin_alerts.png plugin_bibles.png From 365072c05c79637510324fb47f6a3388368c8665 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sun, 13 Feb 2011 16:02:12 +0000 Subject: [PATCH 110/243] SongStrings --- .../songs/forms/songmaintenanceform.py | 30 +++++++------------ openlp/plugins/songs/lib/ui.py | 2 ++ 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/openlp/plugins/songs/forms/songmaintenanceform.py b/openlp/plugins/songs/forms/songmaintenanceform.py index 218debd7d..41f3e4237 100644 --- a/openlp/plugins/songs/forms/songmaintenanceform.py +++ b/openlp/plugins/songs/forms/songmaintenanceform.py @@ -215,13 +215,11 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): if self.manager.save_object(author): self.resetAuthors() else: - critical_error_message_box( - message=translate('SongsPlugin.SongMaintenanceForm', - 'Could not add your author.')) + critical_error_message_box(SongStrings.CouldNotAdd % + SongStrings.Author.toLower()) else: critical_error_message_box( - message=translate('SongsPlugin.SongMaintenanceForm', - 'This author already exists.')) + SongStrings.ThisTypeExists % SongStrings.Author.toLower()) def onTopicAddButtonClick(self): if self.topicform.exec_(): @@ -230,13 +228,11 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): if self.manager.save_object(topic): self.resetTopics() else: - critical_error_message_box( - message=translate('SongsPlugin.SongMaintenanceForm', - 'Could not add your topic.')) + critical_error_message_box(SongStrings.CouldNotAdd % + SongStrings.Topic.toLower()) else: critical_error_message_box( - message=translate('SongsPlugin.SongMaintenanceForm', - 'This topic already exists.')) + SongStrings.ThisTypeExists % SongStrings.Topic.toLower()) def onBookAddButtonClick(self): if self.bookform.exec_(): @@ -246,13 +242,11 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): if self.manager.save_object(book): self.resetBooks() else: - critical_error_message_box( - message=translate('SongsPlugin.SongMaintenanceForm', - 'Could not add your book.')) + critical_error_message_box(SongStrings.CouldNotAdd % + SongStrings.SongBook.toLower()) else: critical_error_message_box( - message=translate('SongsPlugin.SongMaintenanceForm', - 'This book already exists.')) + SongStrings.ThisTypeExists % SongStrings.SongBook.toLower()) def onAuthorEditButtonClick(self): author_id = self._getCurrentItemId(self.authorsListWidget) @@ -269,11 +263,9 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): temp_last_name = author.last_name temp_display_name = author.display_name if self.authorform.exec_(False): - author.first_name = unicode( - self.authorform.firstNameEdit.text()) + author.first_name = unicode(self.authorform.firstNameEdit.text()) author.last_name = unicode(self.authorform.lastNameEdit.text()) - author.display_name = unicode( - self.authorform.displayEdit.text()) + author.display_name = unicode(self.authorform.displayEdit.text()) if self.checkAuthor(author, True): if self.manager.save_object(author): self.resetAuthors() diff --git a/openlp/plugins/songs/lib/ui.py b/openlp/plugins/songs/lib/ui.py index 3871c80b0..0203c166e 100644 --- a/openlp/plugins/songs/lib/ui.py +++ b/openlp/plugins/songs/lib/ui.py @@ -38,8 +38,10 @@ class SongStrings(object): Authors = translate('OpenLP.Ui', 'Authors', 'Plural') AuthorUnknown = translate('OpenLP.Ui', 'Author Unknown') # Used in the UI. AuthorUnknownUnT = u'Author Unknown' # Used to populate the database. + CouldNotAdd = unicode(translate('OpenLP.Ui', 'Could not add your %s.')) SongBook = translate('OpenLP.Ui', 'Song Book', 'Singular') SongBooks = translate('OpenLP.Ui', 'Song Books', 'Plural') + ThisTypeExists = unicode(translate('OpenLP.Ui', 'This %s already exists.')) Topic = translate('OpenLP.Ui', 'Topic', 'Singular') Topics = translate('OpenLP.Ui', 'Topics', 'Plural') TypeMaintenance = unicode(translate('OpenLP.Ui', '%s Maintenance')) From 4d310f17df0d4c32fd288d9eb42b3af8bea82e9c Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sun, 13 Feb 2011 17:31:44 +0100 Subject: [PATCH 111/243] added files, spelling --- openlp/plugins/bibles/lib/mediaitem.py | 4 ++-- resources/images/bibles_search_reference.png | Bin 0 -> 2031 bytes resources/images/bibles_search_text.png | Bin 0 -> 335 bytes resources/images/openlp-2.qrc | 4 ++-- 4 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 resources/images/bibles_search_reference.png create mode 100644 resources/images/bibles_search_text.png diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index d4e2d837e..5f18beca4 100644 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -90,9 +90,9 @@ class BibleMediaItem(MediaManagerItem): self.quickSearchEdit.setObjectName(u'quickSearchEdit') self.quickSearchLabel.setBuddy(self.quickSearchEdit) self.quickSearchEdit.setSearchTypes([ - (1, u':/bibles/bibles_serach_reference.png', + (1, u':/bibles/bibles_search_reference.png', translate('BiblesPlugin.MediaItem', 'Scripture Reference')), - (2, u':/bibles/bibles_serach_text.png', + (2, u':/bibles/bibles_search_text.png', translate('BiblesPlugin.MediaItem', 'Text Search')) ]) self.quickLayout.addRow(self.quickSearchLabel, self.quickSearchEdit) diff --git a/resources/images/bibles_search_reference.png b/resources/images/bibles_search_reference.png new file mode 100644 index 0000000000000000000000000000000000000000..f64c0ad78ea8c37e0982cc56a93991d776d56faf GIT binary patch literal 2031 zcmV{l`45fF)Sd}nJobU8nr>0%Xr&{P;r+8i|24V%^3U#TJS7W63x!hkkSNJn zIpze}GN{xf>L$>l%JH}C4`Tq{oI9~OQ4aym%;nMmPXD;5TlKaJH--7m)nf3sPdgG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J4I}rs2&>G|4Oh~|$hcSq+nTE;Q)4mTZ z{-z9_8$i&59`pbti6oIE=01HvpV2lh7Fw8qr9NVb=&7jaa<^V*2rvpAgR1I3#ZLMM zxtl1NqY0h}GE}V($705dUn0_Q&Ce+ zi_f9#f2xjY*9CG606Y=#un`-v5uk0fjkeLlzkSO(HK*r{oJkkxljHlbua~4l^33Dvzm3P1q`6#sWTvdD9h=c0-1n-5vAgzOF39kR3LepX3VSys8B zN+npYRXJ5zm;Ji5E$!27n2<4Uo9tA~(NVp$^0x~hWKuL!1^_>9EpIq>iIDx1h^7~g&L@k=I#SQ%`fYc+ zAj^=i^J{lM<({nQ_tJ~ci(WcEbT^Qn$UIa?{yM66lCXbadKnKaW(>?e@)Gzj2$Uw1 z1OLb*0000YdQ@0+Q*UN;cVTj6004N}D=#nC%goCzPEIUH)ypqR2LLwM23QbN%3J^d N002ovPDHLkV1nG};fw$P literal 0 HcmV?d00001 diff --git a/resources/images/bibles_search_text.png b/resources/images/bibles_search_text.png new file mode 100644 index 0000000000000000000000000000000000000000..1ab7145c6520bc770aedc33259b26d1df59f1361 GIT binary patch literal 335 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJbFq_W2nPqp?T7vkfLzW3kH}&M z2FBeW%xLxI@gtz1WQl7;NpOBzNqJ&XDnogBxn5>oc5!lIL8@MUQTpt6Hc~)E9sxcf zuK)l42QsW(4WB}%e<@${og@7nN9H?@3?TWQBjY_sI*9D< z?gpxa10dJu!nw~tzF0|+UoeBTk&%ge1qf7DRoB$k)i*S??EDrrc?M8LxTlL_h=gS8 z!AQO)2L{#+TAvsMkL2$7@2jeJ^3TOh>n+2jc(j*irOC*oWysc)|Il#i*CwBG^$WflIelF{r5}E*( C9&~j8 literal 0 HcmV?d00001 diff --git a/resources/images/openlp-2.qrc b/resources/images/openlp-2.qrc index 929775f78..9e6ff6543 100644 --- a/resources/images/openlp-2.qrc +++ b/resources/images/openlp-2.qrc @@ -22,8 +22,8 @@ song_book_edit.png - bibles_serach_text.png - bibles_serach_reference.png + bibles_search_text.png + bibles_search_reference.png plugin_alerts.png From 043665d154f6da3bf2c6a9dc2ef532ef51d1c535 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sun, 13 Feb 2011 16:39:03 +0000 Subject: [PATCH 112/243] Fixes --- openlp/plugins/custom/lib/mediaitem.py | 2 +- openlp/plugins/songs/lib/opensongimport.py | 3 +-- openlp/plugins/songs/lib/songshowplusimport.py | 12 ++++++------ openlp/plugins/songs/lib/xml.py | 1 - 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/openlp/plugins/custom/lib/mediaitem.py b/openlp/plugins/custom/lib/mediaitem.py index 522d36e5c..b0834f170 100644 --- a/openlp/plugins/custom/lib/mediaitem.py +++ b/openlp/plugins/custom/lib/mediaitem.py @@ -29,7 +29,7 @@ import logging from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, Receiver, ItemCapabilities, \ - translate, check_item_selected + check_item_selected from openlp.core.lib.ui import UiStrings from openlp.plugins.custom.lib import CustomXMLParser from openlp.plugins.custom.lib.db import CustomSlide diff --git a/openlp/plugins/songs/lib/opensongimport.py b/openlp/plugins/songs/lib/opensongimport.py index 24043d6f0..b2d82c081 100644 --- a/openlp/plugins/songs/lib/opensongimport.py +++ b/openlp/plugins/songs/lib/opensongimport.py @@ -147,8 +147,7 @@ class OpenSongImport(SongImport): continue log.info(u'Zip importing %s', parts[-1]) self.import_wizard.incrementProgressBar( - unicode(translate('SongsPlugin.ImportWizardForm', - 'Importing %s...')) % parts[-1]) + WizardStrings.ImportingType % parts[-1]) songfile = z.open(song) self.do_import_file(songfile) if self.commit: diff --git a/openlp/plugins/songs/lib/songshowplusimport.py b/openlp/plugins/songs/lib/songshowplusimport.py index 78c2e838d..924f7eeaf 100644 --- a/openlp/plugins/songs/lib/songshowplusimport.py +++ b/openlp/plugins/songs/lib/songshowplusimport.py @@ -116,27 +116,27 @@ class SongShowPlusImport(SongImport): u'Importing %s' % (file_name), 0) songData = open(file, 'rb') while (1): - blockKey, = struct.unpack("I",songData.read(4)) + blockKey, = struct.unpack("I", songData.read(4)) # The file ends with 4 NUL's if blockKey == 0: break - nextBlockStarts, = struct.unpack("I",songData.read(4)) + nextBlockStarts, = struct.unpack("I", songData.read(4)) if blockKey == VERSE or blockKey == CHORUS: - null, verseNo, = struct.unpack("BB",songData.read(2)) + null, verseNo, = struct.unpack("BB", songData.read(2)) elif blockKey == CUSTOM_VERSE: null, verseNameLength, = struct.unpack("BB", songData.read(2)) verseName = songData.read(verseNameLength) - lengthDescriptorSize, = struct.unpack("B",songData.read(1)) + lengthDescriptorSize, = struct.unpack("B", songData.read(1)) # Detect if/how long the length descriptor is if lengthDescriptorSize == 12: - lengthDescriptor, = struct.unpack("I",songData.read(4)) + lengthDescriptor, = struct.unpack("I", songData.read(4)) elif lengthDescriptorSize == 2: lengthDescriptor = 1 elif lengthDescriptorSize == 9: lengthDescriptor = 0 else: - lengthDescriptor, = struct.unpack("B",songData.read(1)) + lengthDescriptor, = struct.unpack("B", songData.read(1)) data = songData.read(lengthDescriptor) if blockKey == TITLE: diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index 64fefdad2..6d015701f 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -66,7 +66,6 @@ import re from lxml import etree, objectify -from openlp.core.lib import translate from openlp.plugins.songs.lib import VerseType from openlp.plugins.songs.lib.db import Author, Book, Song, Topic from openlp.plugins.songs.lib.ui import SongStrings From 572cbd95f0708c5f77c5a8fd83ac54b2e5ef42cf Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Sun, 13 Feb 2011 22:03:55 +0200 Subject: [PATCH 113/243] Re-fixed the data directory on Linux with XDG installed. --- openlp/core/utils/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openlp/core/utils/__init__.py b/openlp/core/utils/__init__.py index a23077c39..9db744460 100644 --- a/openlp/core/utils/__init__.py +++ b/openlp/core/utils/__init__.py @@ -179,8 +179,7 @@ def _get_os_dir_path(dir_type): if dir_type == AppLocation.ConfigDir: return os.path.join(BaseDirectory.xdg_config_home, u'openlp') elif dir_type == AppLocation.DataDir: - return os.path.join(BaseDirectory.xdg_data_home, u'openlp', - u'data') + return os.path.join(BaseDirectory.xdg_data_home, u'openlp') elif dir_type == AppLocation.CacheDir: return os.path.join(BaseDirectory.xdg_cache_home, u'openlp') if dir_type == AppLocation.DataDir: From 1d91192e3b00cd5e04557a25e440487abf4cbc7c Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 14 Feb 2011 00:35:53 +0000 Subject: [PATCH 114/243] WizardStrings --- openlp/core/lib/ui.py | 1 + openlp/plugins/songs/forms/editsongform.py | 16 ++++++++-------- openlp/plugins/songs/lib/easislidesimport.py | 4 ++-- openlp/plugins/songs/lib/ewimport.py | 4 ++-- openlp/plugins/songs/lib/olp1import.py | 4 ++-- openlp/plugins/songs/lib/songbeamerimport.py | 2 +- openlp/plugins/songs/lib/songshowplusimport.py | 14 +++++++------- openlp/plugins/songs/lib/wowimport.py | 5 +++-- 8 files changed, 26 insertions(+), 24 deletions(-) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index f4aa8162e..196a8567f 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -45,6 +45,7 @@ class UiStrings(object): AddANew = unicode(translate('OpenLP.Ui', 'Add a new %s.')) AddSelectService = unicode(translate('OpenLP.Ui', 'Add the selected %s to the service.')) + AddType = unicode(translate('OpenLP.Ui', 'Add %s')) Advanced = translate('OpenLP.Ui', 'Advanced') AllFiles = translate('OpenLP.Ui', 'All Files') Browse = translate('OpenLP.Ui', 'Browse...') diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 8536d38b8..d792afa2f 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -30,10 +30,12 @@ import re from PyQt4 import QtCore, QtGui from openlp.core.lib import Receiver, translate -from openlp.core.lib.ui import add_widget_completer, critical_error_message_box +from openlp.core.lib.ui import UiStrings, add_widget_completer, \ + critical_error_message_box from openlp.plugins.songs.forms import EditVerseForm from openlp.plugins.songs.lib import SongXML, VerseType from openlp.plugins.songs.lib.db import Book, Song, Author, Topic +from openlp.plugins.songs.lib.ui import SongStrings from editsongdialog import Ui_EditSongDialog log = logging.getLogger(__name__) @@ -307,7 +309,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): text = unicode(self.authorsComboBox.currentText()) if item == 0 and text: if QtGui.QMessageBox.question(self, - translate('SongsPlugin.EditSongForm', 'Add Author'), + UiStrings.AddType % SongStrings.Author, translate('SongsPlugin.EditSongForm', 'This author does not ' 'exist, do you want to add them?'), QtGui.QMessageBox.Yes | QtGui.QMessageBox.No, @@ -336,8 +338,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): self.__addAuthorToList(author) self.authorsComboBox.setCurrentIndex(0) else: - QtGui.QMessageBox.warning(self, - translate('SongsPlugin.EditSongForm', 'No Author Selected'), + QtGui.QMessageBox.warning(self, UiStrings.NISs, translate('SongsPlugin.EditSongForm', 'You have not selected ' 'a valid author. Either select an author from the list, ' 'or type in a new author and click the "Add Author to ' @@ -366,7 +367,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): text = unicode(self.topicsComboBox.currentText()) if item == 0 and text: if QtGui.QMessageBox.question(self, - translate('SongsPlugin.EditSongForm', 'Add Topic'), + UiStrings.AddType % SongStrings.Topic, translate('SongsPlugin.EditSongForm', 'This topic does not ' 'exist, do you want to add it?'), QtGui.QMessageBox.Yes | QtGui.QMessageBox.No, @@ -396,8 +397,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): self.topicsListView.addItem(topic_item) self.topicsComboBox.setCurrentIndex(0) else: - QtGui.QMessageBox.warning(self, - translate('SongsPlugin.EditSongForm', 'No Topic Selected'), + QtGui.QMessageBox.warning(self, UiStrings.NISs, translate('SongsPlugin.EditSongForm', 'You have not selected ' 'a valid topic. Either select a topic from the list, or ' 'type in a new topic and click the "Add Topic to Song" ' @@ -584,7 +584,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): text = unicode(self.songBookComboBox.currentText()) if self.songBookComboBox.findText(text, QtCore.Qt.MatchExactly) < 0: if QtGui.QMessageBox.question(self, - translate('SongsPlugin.EditSongForm', 'Add Book'), + UiStrings.AddType % SongStrings.SongBook, translate('SongsPlugin.EditSongForm', 'This song book does ' 'not exist, do you want to add it?'), QtGui.QMessageBox.Yes | QtGui.QMessageBox.No, diff --git a/openlp/plugins/songs/lib/easislidesimport.py b/openlp/plugins/songs/lib/easislidesimport.py index 5d56af8ce..232202c4f 100644 --- a/openlp/plugins/songs/lib/easislidesimport.py +++ b/openlp/plugins/songs/lib/easislidesimport.py @@ -30,6 +30,7 @@ from lxml import etree, objectify import re from openlp.core.lib import translate +from openlp.core.ui.wizard import WizardStrings from openlp.plugins.songs.lib.songimport import SongImport log = logging.getLogger(__name__) @@ -64,8 +65,7 @@ class EasiSlidesImport(SongImport): xml = unicode(etree.tostring(file)) song_xml = objectify.fromstring(xml) self.import_wizard.incrementProgressBar( - unicode(translate('SongsPlugin.ImportWizardForm', - u'Importing %s...')) % os.path.split(self.filename)[-1]) + WizardStrings.ImportingType % os.path.split(self.filename)[-1]) self.import_wizard.progressBar.setMaximum(len(song_xml.Item)) for song in song_xml.Item: self.import_wizard.incrementProgressBar( diff --git a/openlp/plugins/songs/lib/ewimport.py b/openlp/plugins/songs/lib/ewimport.py index 312e3b759..df88f025b 100644 --- a/openlp/plugins/songs/lib/ewimport.py +++ b/openlp/plugins/songs/lib/ewimport.py @@ -32,6 +32,7 @@ import os import struct from openlp.core.lib import translate +from openlp.core.ui.wizard import WizardStrings from openlp.plugins.songs.lib import retrieve_windows_encoding from songimport import SongImport @@ -231,8 +232,7 @@ class EasyWorshipSongImport(SongImport): title = self.get_field(fi_title) if title: self.import_wizard.incrementProgressBar( - unicode(translate('SongsPlugin.ImportWizardForm', - 'Importing "%s"...')) % title, 0) + WizardStrings.ImportingType % title, 0) self.title = title # Get remaining fields copy = self.get_field(fi_copy) diff --git a/openlp/plugins/songs/lib/olp1import.py b/openlp/plugins/songs/lib/olp1import.py index c3e1ca6b4..daf3629a4 100644 --- a/openlp/plugins/songs/lib/olp1import.py +++ b/openlp/plugins/songs/lib/olp1import.py @@ -33,6 +33,7 @@ from chardet.universaldetector import UniversalDetector import sqlite from openlp.core.lib import translate +from openlp.core.ui.wizard import WizardStrings from openlp.plugins.songs.lib import retrieve_windows_encoding from songimport import SongImport @@ -103,8 +104,7 @@ class OpenLP1SongImport(SongImport): lyrics = song[2].replace(u'\r\n', u'\n') copyright = song[3] self.import_wizard.incrementProgressBar( - unicode(translate('SongsPlugin.ImportWizardForm', - 'Importing "%s"...')) % title) + WizardStrings.ImportingType % title) self.title = title verses = lyrics.split(u'\n\n') for verse in verses: diff --git a/openlp/plugins/songs/lib/songbeamerimport.py b/openlp/plugins/songs/lib/songbeamerimport.py index eeabc0e5d..9b47b2c52 100644 --- a/openlp/plugins/songs/lib/songbeamerimport.py +++ b/openlp/plugins/songs/lib/songbeamerimport.py @@ -96,7 +96,7 @@ class SongBeamerImport(SongImport): read_verses = False file_name = os.path.split(file)[1] self.import_wizard.incrementProgressBar( - u'Importing %s' % (file_name), 0) + WizardStrings.ImportingType % file_name, 0) if os.path.isfile(file): detect_file = open(file, u'r') details = chardet.detect(detect_file.read(2048)) diff --git a/openlp/plugins/songs/lib/songshowplusimport.py b/openlp/plugins/songs/lib/songshowplusimport.py index 924f7eeaf..289fd2860 100644 --- a/openlp/plugins/songs/lib/songshowplusimport.py +++ b/openlp/plugins/songs/lib/songshowplusimport.py @@ -31,6 +31,7 @@ import os import logging import struct +from openlp.core.ui.wizard import WizardStrings from openlp.plugins.songs.lib.songimport import SongImport TITLE = 1 @@ -113,7 +114,7 @@ class SongShowPlusImport(SongImport): otherList = {} file_name = os.path.split(file)[1] self.import_wizard.incrementProgressBar( - u'Importing %s' % (file_name), 0) + WizardStrings.ImportingType % file_name, 0) songData = open(file, 'rb') while (1): blockKey, = struct.unpack("I", songData.read(4)) @@ -138,7 +139,6 @@ class SongShowPlusImport(SongImport): else: lengthDescriptor, = struct.unpack("B", songData.read(1)) data = songData.read(lengthDescriptor) - if blockKey == TITLE: self.title = unicode(data, u'cp1252') elif blockKey == AUTHOR: @@ -153,10 +153,10 @@ class SongShowPlusImport(SongImport): elif blockKey == CCLI_NO: self.ccli_number = int(data) elif blockKey == VERSE: - self.add_verse(unicode(data, u'cp1252'), + self.add_verse(unicode(data, u'cp1252'), "V%s" % verseNo) elif blockKey == CHORUS: - self.add_verse(unicode(data, u'cp1252'), + self.add_verse(unicode(data, u'cp1252'), "C%s" % verseNo) elif blockKey == TOPIC: self.topics.append(unicode(data, u'cp1252')) @@ -180,11 +180,11 @@ class SongShowPlusImport(SongImport): songData.close() self.finish() self.import_wizard.incrementProgressBar( - u'Importing %s' % (file_name)) + WizardStrings.ImportingType % file_name) return True - + def toOpenLPVerseTag(self, verseName): - if verseName.find(" ")!=-1: + if verseName.find(" ") != -1: verseParts = verseName.split(" ") verseType = verseParts[0] verseNumber = verseParts[1] diff --git a/openlp/plugins/songs/lib/wowimport.py b/openlp/plugins/songs/lib/wowimport.py index b90a47de6..c7bd5d743 100644 --- a/openlp/plugins/songs/lib/wowimport.py +++ b/openlp/plugins/songs/lib/wowimport.py @@ -30,6 +30,7 @@ Worship songs into the OpenLP database. import os import logging +from openlp.core.ui.wizard import WizardStrings from openlp.plugins.songs.lib.songimport import SongImport BLOCK_TYPES = (u'V', u'C', u'B') @@ -116,7 +117,7 @@ class WowImport(SongImport): copyright = u'' file_name = os.path.split(file)[1] self.import_wizard.incrementProgressBar( - u'Importing %s' % (file_name), 0) + WizardStrings.ImportingType % file_name, 0) # Get the song title self.title = file_name.rpartition(u'.')[0] songData = open(file, 'rb') @@ -162,5 +163,5 @@ class WowImport(SongImport): songData.close() self.finish() self.import_wizard.incrementProgressBar( - u'Importing %s' % (file_name)) + WizardStrings.ImportingType % file_name) return True From 71cbbfcbf22443a36ea794cbcc6d3d8a6490ba2a Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 14 Feb 2011 01:55:34 +0000 Subject: [PATCH 115/243] Unused imports --- openlp/plugins/songs/lib/olp1import.py | 1 - openlp/plugins/songs/lib/opensongimport.py | 1 - 2 files changed, 2 deletions(-) diff --git a/openlp/plugins/songs/lib/olp1import.py b/openlp/plugins/songs/lib/olp1import.py index daf3629a4..a8fb29691 100644 --- a/openlp/plugins/songs/lib/olp1import.py +++ b/openlp/plugins/songs/lib/olp1import.py @@ -32,7 +32,6 @@ import logging from chardet.universaldetector import UniversalDetector import sqlite -from openlp.core.lib import translate from openlp.core.ui.wizard import WizardStrings from openlp.plugins.songs.lib import retrieve_windows_encoding from songimport import SongImport diff --git a/openlp/plugins/songs/lib/opensongimport.py b/openlp/plugins/songs/lib/opensongimport.py index b2d82c081..081c4c662 100644 --- a/openlp/plugins/songs/lib/opensongimport.py +++ b/openlp/plugins/songs/lib/opensongimport.py @@ -31,7 +31,6 @@ from lxml import objectify from lxml.etree import Error, LxmlError import re -from openlp.core.lib import translate from openlp.core.ui.wizard import WizardStrings from openlp.plugins.songs.lib.songimport import SongImport From 2316ab4ed47bba894c9c31bd71ba17947e8da418 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 14 Feb 2011 02:54:24 +0000 Subject: [PATCH 116/243] Deleting song items --- .../songs/forms/songmaintenanceform.py | 38 ++++++------------- openlp/plugins/songs/lib/ui.py | 4 ++ 2 files changed, 15 insertions(+), 27 deletions(-) diff --git a/openlp/plugins/songs/forms/songmaintenanceform.py b/openlp/plugins/songs/forms/songmaintenanceform.py index 41f3e4237..ffea2ffa6 100644 --- a/openlp/plugins/songs/forms/songmaintenanceform.py +++ b/openlp/plugins/songs/forms/songmaintenanceform.py @@ -103,20 +103,22 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): else: return -1 - def _deleteItem(self, item_class, list_widget, reset_func, dlg_title, - del_text, err_text, sel_text): + def _deleteItem(self, item_class, list_widget, reset_func, del_type): + dlg_title = UiStrings.DeleteType % del_type item_id = self._getCurrentItemId(list_widget) if item_id != -1: item = self.manager.get_object(item_class, item_id) if item and len(item.songs) == 0: - if critical_error_message_box(title=dlg_title, message=del_text, - parent=self, question=True) == QtGui.QMessageBox.Yes: + if critical_error_message_box(dlg_title, + SongStrings.SureDeleteType % del_type, + self, True) == QtGui.QMessageBox.Yes: self.manager.delete_object(item_class, item.id) reset_func() else: - critical_error_message_box(dlg_title, err_text) + critical_error_message_box(dlg_title, + SongStrings.NoDeleteAssigned % del_type) else: - critical_error_message_box(dlg_title, sel_text) + critical_error_message_box(dlg_title, UiStrings.NISs) def resetAuthors(self): """ @@ -440,39 +442,21 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): Delete the author if the author is not attached to any songs. """ self._deleteItem(Author, self.authorsListWidget, self.resetAuthors, - UiStrings.DeleteType % SongStrings.Author, - translate('SongsPlugin.SongMaintenanceForm', - 'Are you sure you want to delete the selected author?'), - translate('SongsPlugin.SongMaintenanceForm', - 'This author cannot be deleted, they are currently ' - 'assigned to at least one song.'), - translate('SongsPlugin.SongMaintenanceForm', 'No author selected!')) + SongStrings.Author) def onTopicDeleteButtonClick(self): """ Delete the Book if the Book is not attached to any songs. """ self._deleteItem(Topic, self.topicsListWidget, self.resetTopics, - UiStrings.DeleteType % SongStrings.Topic, - translate('SongsPlugin.SongMaintenanceForm', - 'Are you sure you want to delete the selected topic?'), - translate('SongsPlugin.SongMaintenanceForm', - 'This topic cannot be deleted, it is currently ' - 'assigned to at least one song.'), - translate('SongsPlugin.SongMaintenanceForm', 'No topic selected!')) + SongStrings.Topic) def onBookDeleteButtonClick(self): """ Delete the Book if the Book is not attached to any songs. """ self._deleteItem(Book, self.booksListWidget, self.resetBooks, - UiStrings.DeleteType % SongStrings.SongBook, - translate('SongsPlugin.SongMaintenanceForm', - 'Are you sure you want to delete the selected book?'), - translate('SongsPlugin.SongMaintenanceForm', - 'This book cannot be deleted, it is currently ' - 'assigned to at least one song.'), - translate('SongsPlugin.SongMaintenanceForm', 'No book selected!')) + SongStrings.SongBook) def onAuthorsListRowChanged(self, row): """ diff --git a/openlp/plugins/songs/lib/ui.py b/openlp/plugins/songs/lib/ui.py index 0203c166e..e16835ba3 100644 --- a/openlp/plugins/songs/lib/ui.py +++ b/openlp/plugins/songs/lib/ui.py @@ -39,8 +39,12 @@ class SongStrings(object): AuthorUnknown = translate('OpenLP.Ui', 'Author Unknown') # Used in the UI. AuthorUnknownUnT = u'Author Unknown' # Used to populate the database. CouldNotAdd = unicode(translate('OpenLP.Ui', 'Could not add your %s.')) + NoDeleteAssigned = unicode(translate('OpenLP.Ui', 'This %s cannot be ' + 'deleted as it is currently assigned to at least one song.')) SongBook = translate('OpenLP.Ui', 'Song Book', 'Singular') SongBooks = translate('OpenLP.Ui', 'Song Books', 'Plural') + SureDeleteType = unicode(translate('OpenLP.Ui', + 'Are you sure you want to delete the selected %s?')) ThisTypeExists = unicode(translate('OpenLP.Ui', 'This %s already exists.')) Topic = translate('OpenLP.Ui', 'Topic', 'Singular') Topics = translate('OpenLP.Ui', 'Topics', 'Plural') From 910df1cfde9da62bac277e3f799b520a3cd86c07 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 14 Feb 2011 03:19:30 +0000 Subject: [PATCH 117/243] More song items --- openlp/plugins/songs/forms/editsongform.py | 17 +++++++---------- openlp/plugins/songs/lib/ui.py | 4 ++++ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index d792afa2f..d8052ca57 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -310,8 +310,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): if item == 0 and text: if QtGui.QMessageBox.question(self, UiStrings.AddType % SongStrings.Author, - translate('SongsPlugin.EditSongForm', 'This author does not ' - 'exist, do you want to add them?'), + SongStrings.TypeNotExistAdd % SongStrings.Author.toLower(), QtGui.QMessageBox.Yes | QtGui.QMessageBox.No, QtGui.QMessageBox.Yes) == QtGui.QMessageBox.Yes: if text.find(u' ') == -1: @@ -332,8 +331,8 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): if self.authorsListView.findItems(unicode(author.display_name), QtCore.Qt.MatchExactly): critical_error_message_box( - message=translate('SongsPlugin.EditSongForm', - 'This author is already in the list.')) + message=SongStrings.TypeInList % + SongStrings.Author.toLower()) else: self.__addAuthorToList(author) self.authorsComboBox.setCurrentIndex(0) @@ -368,8 +367,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): if item == 0 and text: if QtGui.QMessageBox.question(self, UiStrings.AddType % SongStrings.Topic, - translate('SongsPlugin.EditSongForm', 'This topic does not ' - 'exist, do you want to add it?'), + SongStrings.TypeNotExistAdd % SongStrings.Topic.toLower(), QtGui.QMessageBox.Yes | QtGui.QMessageBox.No, QtGui.QMessageBox.Yes) == QtGui.QMessageBox.Yes: topic = Topic.populate(name=text) @@ -388,8 +386,8 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): if self.topicsListView.findItems(unicode(topic.name), QtCore.Qt.MatchExactly): critical_error_message_box( - message=translate('SongsPlugin.EditSongForm', - 'This topic is already in the list.')) + message=SongStrings.TypeInList % + SongStrings.Topic.toLower()) else: topic_item = QtGui.QListWidgetItem(unicode(topic.name)) topic_item.setData(QtCore.Qt.UserRole, @@ -585,8 +583,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): if self.songBookComboBox.findText(text, QtCore.Qt.MatchExactly) < 0: if QtGui.QMessageBox.question(self, UiStrings.AddType % SongStrings.SongBook, - translate('SongsPlugin.EditSongForm', 'This song book does ' - 'not exist, do you want to add it?'), + SongStrings.TypeNotExistAdd % SongStrings.SongBook.toLower(), QtGui.QMessageBox.Yes | QtGui.QMessageBox.No, QtGui.QMessageBox.Yes) == QtGui.QMessageBox.Yes: book = Book.populate(name=text, publisher=u'') diff --git a/openlp/plugins/songs/lib/ui.py b/openlp/plugins/songs/lib/ui.py index e16835ba3..beab16dd0 100644 --- a/openlp/plugins/songs/lib/ui.py +++ b/openlp/plugins/songs/lib/ui.py @@ -48,4 +48,8 @@ class SongStrings(object): ThisTypeExists = unicode(translate('OpenLP.Ui', 'This %s already exists.')) Topic = translate('OpenLP.Ui', 'Topic', 'Singular') Topics = translate('OpenLP.Ui', 'Topics', 'Plural') + TypeInList = unicode(translate('OpenLP.Ui', + 'This %s is already in the list.')) TypeMaintenance = unicode(translate('OpenLP.Ui', '%s Maintenance')) + TypeNotExistAdd = unicode(translate('OpenLP.Ui', + 'This %s does not exist, do you want to add it?')) From 68d6bc46d682d3f87bf9b27461f01f7a8b797eff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20K=C3=B6hler?= Date: Mon, 14 Feb 2011 13:20:30 +0100 Subject: [PATCH 118/243] Comment 14.02.2011 --- openlp/plugins/songs/forms/songimportform.py | 46 ++++++++++++++++++++ openlp/plugins/songs/lib/importer.py | 7 ++- 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index 433c9abfc..e07b8c019 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -140,6 +140,12 @@ class SongImportForm(OpenLPWizard): QtCore.QObject.connect(self.songBeamerRemoveButton, QtCore.SIGNAL(u'clicked()'), self.onSongBeamerRemoveButtonClicked) + QtCore.QObject.connect(self.foilPresenterAddButton, + QtCore.SIGNAL(u'clicked()'), + self.onFoilPresenterAddButtonClicked), + QtCore.QObject.connect(self.foilPresenterRemoveButton, + QtCore.SIGNAL(u'clicked()'), + self.onFoilPresenterRemoveButtonClicked) def addCustomPages(self): """ @@ -186,6 +192,8 @@ class SongImportForm(OpenLPWizard): self.addSingleFileSelectItem(u'ew') # Words of Worship self.addMultiFileSelectItem(u'songBeamer') + # Foilpresenter + self.addMultiFileSelectItem(u'foilPresenter') # Commented out for future use. # self.addSingleFileSelectItem(u'csv', u'CSV') self.sourceLayout.addLayout(self.formatStack) @@ -236,6 +244,8 @@ class SongImportForm(OpenLPWizard): translate('SongsPlugin.ImportWizardForm', 'EasyWorship')) self.formatComboBox.setItemText(10, translate('SongsPlugin.ImportWizardForm', 'SongBeamer')) + self.formatComboBox.setItemText(11, + translate('SongsPlugin.ImportWizardForm', 'FoilPresenter')) # self.formatComboBox.setItemText(11, # translate('SongsPlugin.ImportWizardForm', 'CSV')) self.openLP2FilenameLabel.setText( @@ -300,6 +310,10 @@ class SongImportForm(OpenLPWizard): translate('SongsPlugin.ImportWizardForm', 'Add Files...')) self.songBeamerRemoveButton.setText( translate('SongsPlugin.ImportWizardForm', 'Remove File(s)')) + self.foilPresenterAddButton.setText( + translate('SongsPlugin.ImportWizardForm', 'Add Files...')) + self.foilPresenterRemoveButton.setText( + translate('SongsPlugin.ImportWizardForm', 'Remove File(s)')) # self.csvFilenameLabel.setText( # translate('SongsPlugin.ImportWizardForm', 'Filename:')) # self.csvBrowseButton.setText( @@ -447,6 +461,16 @@ class SongImportForm(OpenLPWizard): 'file to import from.')) self.songBeamerAddButton.setFocus() return False + elif source_format == SongFormat.FoilPresenter: + if self.foilPresenterFileListWidget.count() == 0: + criticalErrorMessageBox( + translate('SongsPlugin.ImportWizardForm', + 'No Foilpresenter Files Selected'), + translate('SongsPlugin.ImportWizardForm', + 'You need to add at least one Foilpresenter ' + 'song file to import from.')) + self.foilPresenterAddButton.setFocus() + return False return True elif self.currentPage() == self.progressPage: return True @@ -682,6 +706,22 @@ class SongImportForm(OpenLPWizard): """ self.removeSelectedItems(self.songBeamerFileListWidget) + def onFoilPresenterAddButtonClicked(self): + """ + Get FoilPresenter song database files + """ + self.getFiles( + translate('SongsPlugin.ImportWizardForm', + 'Select FoilPresenter Files'), + self.foilPresenterFileListWidget + ) + + def onFoilPresenterRemoveButtonClicked(self): + """ + Remove selected FoilPresenter files from the import list + """ + self.removeSelectedItems(self.foilPresenterFileListWidget) + def registerFields(self): """ Register song import wizard fields. @@ -707,6 +747,7 @@ class SongImportForm(OpenLPWizard): self.easiSlidesFilenameEdit.setText(u'') self.ewFilenameEdit.setText(u'') self.songBeamerFileListWidget.clear() + self.foilPresenterFileListWidget.clear() #self.csvFilenameEdit.setText(u'') def preWizard(self): @@ -783,6 +824,11 @@ class SongImportForm(OpenLPWizard): importer = self.plugin.importSongs(SongFormat.SongBeamer, filenames=self.getListOfFiles(self.songBeamerFileListWidget) ) + elif source_format == SongFormat.FoilPresenter: + # Import Foilpresenter songs + importer = self.plugin.importSongs(SongFormat.FoilPresenter, + filenames=self.getListOfFiles(self.foilPresenterFileListWidget) + ) if importer.do_import(): # reload songs self.progressLabel.setText( diff --git a/openlp/plugins/songs/lib/importer.py b/openlp/plugins/songs/lib/importer.py index 91d3d7e6f..e914cc6ac 100644 --- a/openlp/plugins/songs/lib/importer.py +++ b/openlp/plugins/songs/lib/importer.py @@ -34,6 +34,7 @@ from wowimport import WowImport from cclifileimport import CCLIFileImport from ewimport import EasyWorshipSongImport from songbeamerimport import SongBeamerImport +from foilpresenterimport import FoilPresenterImport # Imports that might fail try: from olp1import import OpenLP1SongImport @@ -71,6 +72,7 @@ class SongFormat(object): EasiSlides = 8 EasyWorship = 9 SongBeamer = 10 + FoilPresenter = 11 @staticmethod def get_class(format): @@ -102,6 +104,8 @@ class SongFormat(object): return EasyWorshipSongImport elif format == SongFormat.SongBeamer: return SongBeamerImport + elif format == SongFormat.FoilPresenter: + return FoilPresenterImport return None @staticmethod @@ -120,7 +124,8 @@ class SongFormat(object): SongFormat.Generic, SongFormat.EasiSlides, SongFormat.EasyWorship, - SongFormat.SongBeamer + SongFormat.SongBeamer, + SongFormat.FoilPresenter ] @staticmethod From cafd7b397d3301431d05ef6a6c01aafaa3798fc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20K=C3=B6hler?= Date: Mon, 14 Feb 2011 14:01:52 +0100 Subject: [PATCH 119/243] 14.02.2011 --- openlp/plugins/songs/forms/songimportform.py | 17 +++++++++-------- openlp/plugins/songs/lib/importer.py | 5 +---- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index 6c5c90838..b6c7286bc 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -140,18 +140,18 @@ class SongImportForm(OpenLPWizard): QtCore.QObject.connect(self.songBeamerRemoveButton, QtCore.SIGNAL(u'clicked()'), self.onSongBeamerRemoveButtonClicked) - QtCore.QObject.connect(self.foilPresenterAddButton, - QtCore.SIGNAL(u'clicked()'), - self.onFoilPresenterAddButtonClicked), - QtCore.QObject.connect(self.foilPresenterRemoveButton, - QtCore.SIGNAL(u'clicked()'), - self.onFoilPresenterRemoveButtonClicked) QtCore.QObject.connect(self.songShowPlusAddButton, QtCore.SIGNAL(u'clicked()'), self.onSongShowPlusAddButtonClicked) QtCore.QObject.connect(self.songShowPlusRemoveButton, QtCore.SIGNAL(u'clicked()'), self.onSongShowPlusRemoveButtonClicked) + QtCore.QObject.connect(self.foilPresenterAddButton, + QtCore.SIGNAL(u'clicked()'), + self.onFoilPresenterAddButtonClicked) + QtCore.QObject.connect(self.foilPresenterRemoveButton, + QtCore.SIGNAL(u'clicked()'), + self.onFoilPresenterRemoveButtonClicked) def addCustomPages(self): """ @@ -200,10 +200,10 @@ class SongImportForm(OpenLPWizard): self.addFileSelectItem(u'ew', single_select=True) # Words of Worship self.addFileSelectItem(u'songBeamer') - # Foilpresenter - self.addFileSelectItem(u'foilPresenter') # Song Show Plus self.addFileSelectItem(u'songShowPlus') + # Foilpresenter + self.addFileSelectItem(u'foilPresenter') # Commented out for future use. # self.addFileSelectItem(u'csv', u'CSV', single_select=True) self.sourceLayout.addLayout(self.formatStack) @@ -475,6 +475,7 @@ class SongImportForm(OpenLPWizard): 'You need to add at least one SongShow Plus ' 'file to import from.')) self.wordsOfWorshipAddButton.setFocus() + return False elif source_format == SongFormat.FoilPresenter: if self.foilPresenterFileListWidget.count() == 0: criticalErrorMessageBox( diff --git a/openlp/plugins/songs/lib/importer.py b/openlp/plugins/songs/lib/importer.py index dbbcad596..53ba17de9 100644 --- a/openlp/plugins/songs/lib/importer.py +++ b/openlp/plugins/songs/lib/importer.py @@ -34,11 +34,8 @@ from wowimport import WowImport from cclifileimport import CCLIFileImport from ewimport import EasyWorshipSongImport from songbeamerimport import SongBeamerImport -<<<<<<< TREE -from foilpresenterimport import FoilPresenterImport -======= from songshowplusimport import SongShowPlusImport ->>>>>>> MERGE-SOURCE +from foilpresenterimport import FoilPresenterImport # Imports that might fail try: from olp1import import OpenLP1SongImport From e6ed43ae02210b432e068efe2453e7c649011cd7 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Mon, 14 Feb 2011 15:23:56 +0100 Subject: [PATCH 120/243] added enumeration class --- openlp/plugins/bibles/lib/mediaitem.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index 5f18beca4..a6ceba6ac 100644 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -38,6 +38,14 @@ from openlp.plugins.bibles.lib import get_reference_match log = logging.getLogger(__name__) +class BibleSearch(object): + """ + Enumeration class for the different search methods for the "quick search". + """ + Reference = 1 + Text = 2 + + class BibleMediaItem(MediaManagerItem): """ This is the custom media manager item for Bibles. @@ -90,9 +98,9 @@ class BibleMediaItem(MediaManagerItem): self.quickSearchEdit.setObjectName(u'quickSearchEdit') self.quickSearchLabel.setBuddy(self.quickSearchEdit) self.quickSearchEdit.setSearchTypes([ - (1, u':/bibles/bibles_search_reference.png', + (BibleSearch.Reference, u':/bibles/bibles_search_reference.png', translate('BiblesPlugin.MediaItem', 'Scripture Reference')), - (2, u':/bibles/bibles_search_text.png', + (BibleSearch.Text, u':/bibles/bibles_search_text.png', translate('BiblesPlugin.MediaItem', 'Text Search')) ]) self.quickLayout.addRow(self.quickSearchLabel, self.quickSearchEdit) @@ -356,7 +364,7 @@ class BibleMediaItem(MediaManagerItem): """ books = [] # We have to do a 'Reference Search'. - if self.quickSearchEdit.currentSearchType() == 1: + if self.quickSearchEdit.currentSearchType() == BibleSearch.Reference: bibles = self.parent.manager.get_bibles() bible = unicode(self.quickVersionComboBox.currentText()) if bible: @@ -493,7 +501,7 @@ class BibleMediaItem(MediaManagerItem): bible = unicode(self.quickVersionComboBox.currentText()) second_bible = unicode(self.quickSecondComboBox.currentText()) text = unicode(self.quickSearchEdit.text()) - if self.quickSearchEdit.currentSearchType() == 1: + if self.quickSearchEdit.currentSearchType() == BibleSearch.Reference: # We are doing a 'Reference Search'. self.search_results = self.parent.manager.get_verses(bible, text) if second_bible and self.search_results: From d5596583ff1e0804c71c8d2829c726df27aa5b4e Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 14 Feb 2011 16:08:17 +0000 Subject: [PATCH 121/243] Fixes, cleanups, strings --- openlp/core/lib/mediamanageritem.py | 1 - openlp/core/lib/plugin.py | 3 ++- openlp/core/lib/serviceitem.py | 1 - openlp/core/lib/ui.py | 3 +++ openlp/core/ui/pluginform.py | 13 +++++-------- openlp/core/ui/settingsdialog.py | 1 - openlp/core/ui/themeform.py | 2 +- openlp/core/ui/thememanager.py | 1 - openlp/core/ui/wizard.py | 6 ++---- openlp/plugins/alerts/forms/alertdialog.py | 4 ++-- openlp/plugins/alerts/forms/alertform.py | 6 +++--- openlp/plugins/bibles/forms/bibleimportform.py | 2 +- openlp/plugins/images/lib/mediaitem.py | 13 +++++-------- openlp/plugins/media/lib/mediaitem.py | 13 +++++-------- openlp/plugins/songs/forms/songimportform.py | 2 +- openlp/plugins/songs/lib/mediaitem.py | 4 ++-- openlp/plugins/songs/lib/songshowplusimport.py | 3 +-- 17 files changed, 33 insertions(+), 45 deletions(-) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 0bb765c6e..6f446619e 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -253,7 +253,6 @@ class MediaManagerItem(QtGui.QWidget): self.pageLayout.addWidget(self.listView) # define and add the context menu self.listView.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu) - name_string = self.plugin.getString(StringContent.Name) if self.hasEditIcon: self.listView.addAction( context_menu_action( diff --git a/openlp/core/lib/plugin.py b/openlp/core/lib/plugin.py index a073d31ea..1b58ec71c 100644 --- a/openlp/core/lib/plugin.py +++ b/openlp/core/lib/plugin.py @@ -339,6 +339,7 @@ class Plugin(QtCore.QObject): """ Called to define all translatable texts of the plugin """ + self.nameStrings = self.textStrings[StringContent.Name] ## Load Action ## self._setSingularTextString(StringContent.Load, UiStrings.Load, UiStrings.LoadANew) @@ -368,4 +369,4 @@ class Plugin(QtCore.QObject): after this has been set. """ self.textStrings[name] = { u'title': title, u'tooltip': tooltip % - self.getString(StringContent.Name)[u'singular']} + self.nameStrings[u'singular']} diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index 1b5261773..92c82087f 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -433,7 +433,6 @@ class ServiceItem(object): """ Returns the start and finish time for a media item """ - tooltip = None start = None end = None if self.start_time != 0: diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 196a8567f..0e5fcfd08 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -66,6 +66,7 @@ class UiStrings(object): ImportType = unicode(translate('OpenLP.Ui', 'Import %s')) LengthTime = unicode(translate('OpenLP.Ui', 'Length %s')) Live = translate('OpenLP.Ui', 'Live') + LiveBGError = translate('OpenLP.Ui', 'Live Background Error') LivePanel = translate('OpenLP.Ui', 'Live Panel') Load = translate('OpenLP.Ui', 'Load') LoadANew = unicode(translate('OpenLP.Ui', 'Load a new %s.')) @@ -82,6 +83,8 @@ class UiStrings(object): Preview = translate('OpenLP.Ui', 'Preview') PreviewPanel = translate('OpenLP.Ui', 'Preview Panel') PreviewSelect = unicode(translate('OpenLP.Ui', 'Preview the selected %s.')) + ProbReplaceBG = unicode(translate('OpenLP.Ui', 'There was a problem ' + 'replacing your background, the %s file "%s" no longer exists.')) ReplaceBG = translate('OpenLP.Ui', 'Replace Background') ReplaceLiveBG = translate('OpenLP.Ui', 'Replace Live Background') ResetBG = translate('OpenLP.Ui', 'Reset Background') diff --git a/openlp/core/ui/pluginform.py b/openlp/core/ui/pluginform.py index 6318a44a5..f8bfe4713 100644 --- a/openlp/core/ui/pluginform.py +++ b/openlp/core/ui/pluginform.py @@ -28,7 +28,7 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import PluginStatus, Receiver, StringContent, translate +from openlp.core.lib import PluginStatus, Receiver, translate from plugindialog import Ui_PluginViewDialog log = logging.getLogger(__name__) @@ -80,15 +80,14 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog): # PluginStatus.Inactive status_text = unicode( translate('OpenLP.PluginForm', '%s (Inactive)')) - name_string = plugin.getString(StringContent.Name) - item.setText(status_text % name_string[u'singular']) + item.setText(status_text % plugin.nameStrings[u'singular']) # If the plugin has an icon, set it! if plugin.icon: item.setIcon(plugin.icon) self.pluginListWidget.addItem(item) pluginListWidth = max(pluginListWidth, self.fontMetrics().width( unicode(translate('OpenLP.PluginForm', '%s (Inactive)')) % - name_string[u'singular'])) + plugin.nameStrings[u'singular'])) self.pluginListWidget.setFixedWidth(pluginListWidth + self.pluginListWidget.iconSize().width() + 48) @@ -118,8 +117,7 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog): self.pluginListWidget.currentItem().text().split(u' ')[0] self.activePlugin = None for plugin in self.parent.pluginManager.plugins: - name_string = plugin.getString(StringContent.Name) - if name_string[u'singular'] == plugin_name_singular: + if plugin.nameStrings[u'singular'] == plugin_name_singular: self.activePlugin = plugin break if self.activePlugin: @@ -147,6 +145,5 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog): elif self.activePlugin.status == PluginStatus.Disabled: status_text = unicode( translate('OpenLP.PluginForm', '%s (Disabled)')) - name_string = self.activePlugin.getString(StringContent.Name) self.pluginListWidget.currentItem().setText( - status_text % name_string[u'singular']) + status_text % self.activePlugin.nameStrings[u'singular']) diff --git a/openlp/core/ui/settingsdialog.py b/openlp/core/ui/settingsdialog.py index 99acadc14..41b6baccb 100644 --- a/openlp/core/ui/settingsdialog.py +++ b/openlp/core/ui/settingsdialog.py @@ -36,7 +36,6 @@ class Ui_SettingsDialog(object): settingsDialog.setWindowIcon( build_icon(u':/system/system_settings.png')) self.settingsLayout = QtGui.QVBoxLayout(settingsDialog) - margins = self.settingsLayout.contentsMargins() self.settingsLayout.setObjectName(u'settingsLayout') self.settingsTabWidget = QtGui.QTabWidget(settingsDialog) self.settingsTabWidget.setObjectName(u'settingsTabWidget') diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index 8e5bddc79..db31daa6c 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -204,7 +204,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): # Do not trigger on start up if self.currentPage != self.welcomePage: self.updateTheme() - frame = self.thememanager.generateImage(self.theme, True) + self.thememanager.generateImage(self.theme, True) def updateLinesText(self, lines): """ diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 8dcc2454e..24571882f 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -314,7 +314,6 @@ class ThemeManager(QtGui.QWidget): translate('OpenLP.ThemeManager', 'You must select a theme to edit.')): item = self.themeListWidget.currentItem() - themeName = unicode(item.text()) theme = self.getThemeData( unicode(item.data(QtCore.Qt.UserRole).toString())) if theme.background_type == u'image': diff --git a/openlp/core/ui/wizard.py b/openlp/core/ui/wizard.py index 9a6324d6a..c72d6a084 100644 --- a/openlp/core/ui/wizard.py +++ b/openlp/core/ui/wizard.py @@ -31,8 +31,7 @@ import os from PyQt4 import QtCore, QtGui -from openlp.core.lib import build_icon, Receiver, SettingsManager, translate, \ - StringContent +from openlp.core.lib import build_icon, Receiver, SettingsManager, translate from openlp.core.lib.ui import UiStrings, add_welcome_page log = logging.getLogger(__name__) @@ -91,7 +90,6 @@ class OpenLPWizard(QtGui.QWizard): QtGui.QWizard.__init__(self, parent) self.plugin = plugin self.setObjectName(name) - self.itemType = self.plugin.getString(StringContent.Name) self.direction = direction self.openIcon = build_icon(u':/general/general_open.png') self.deleteIcon = build_icon(u':/general/general_delete.png') @@ -124,7 +122,7 @@ class OpenLPWizard(QtGui.QWizard): Provides generic wizard localisation """ self.titleLabel.setText(WizardStrings.Welcome % - (self.itemType[u'singular'], self.direction)) + (self.plugin.nameStrings[u'singular'], self.direction)) def registerFields(self): """ diff --git a/openlp/plugins/alerts/forms/alertdialog.py b/openlp/plugins/alerts/forms/alertdialog.py index 12f5c04be..11596b700 100644 --- a/openlp/plugins/alerts/forms/alertdialog.py +++ b/openlp/plugins/alerts/forms/alertdialog.py @@ -26,7 +26,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import StringContent, build_icon, translate +from openlp.core.lib import build_icon, translate from openlp.core.lib.ui import create_delete_push_button class Ui_AlertDialog(object): @@ -67,7 +67,7 @@ class Ui_AlertDialog(object): self.saveButton.setObjectName(u'saveButton') self.manageButtonLayout.addWidget(self.saveButton) self.deleteButton = create_delete_push_button(alertDialog, - self.parent.getString(StringContent.Name)[u'singular'].toLower()) + self.parent.nameStrings[u'singular'].toLower()) self.deleteButton.setEnabled(False) self.manageButtonLayout.addWidget(self.deleteButton) self.manageButtonLayout.addStretch() diff --git a/openlp/plugins/alerts/forms/alertform.py b/openlp/plugins/alerts/forms/alertform.py index bd4c8e735..f2594d44a 100644 --- a/openlp/plugins/alerts/forms/alertform.py +++ b/openlp/plugins/alerts/forms/alertform.py @@ -26,7 +26,7 @@ from PyQt4 import QtGui, QtCore -from openlp.core.lib import translate, StringContent +from openlp.core.lib import translate from openlp.core.lib.ui import UiStrings from openlp.plugins.alerts.lib.db import AlertItem @@ -96,8 +96,8 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog): def onNewClick(self): if len(self.alertTextEdit.text()) == 0: - QtGui.QMessageBox.information(self, UiStrings.NewType % - self.plugin.getString(StringContent.Name)[u'singular'], + QtGui.QMessageBox.information(self, + UiStrings.NewType % self.plugin.nameStrings[u'singular'], translate('AlertsPlugin.AlertForm', 'You haven\'t specified ' 'any text for your alert. Please type in some text before ' 'clicking New.')) diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index 7854a7096..b27d12a44 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -365,7 +365,7 @@ class BibleImportForm(OpenLPWizard): self.setWindowTitle( translate('BiblesPlugin.ImportWizardForm', 'Bible Import Wizard')) self.informationLabel.setText(WizardStrings.Description % ( - self.direction.toLower(), self.itemType[u'plural'], + self.direction.toLower(), self.plugin.nameStrings[u'plural'], self.direction.toLower())) self.selectPage.setTitle(WizardStrings.ImportSelect) self.selectPage.setSubTitle(WizardStrings.ImportSelectLong) diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index ef5b6174a..556fff22b 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -31,7 +31,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, build_icon, ItemCapabilities, \ SettingsManager, translate, check_item_selected, check_directory_exists, \ - Receiver, StringContent + Receiver from openlp.core.lib.ui import UiStrings, critical_error_message_box from openlp.core.utils import AppLocation, delete_file, get_images_filter @@ -125,8 +125,7 @@ class ImageMediaItem(MediaManagerItem): def generateSlideData(self, service_item, item=None, xmlVersion=False): items = self.listView.selectedIndexes() if items: - service_item.title = unicode( - self.plugin.getString(StringContent.Name)[u'plural']) + service_item.title = unicode(self.plugin.nameStrings[u'plural']) service_item.add_capability(ItemCapabilities.AllowsMaintain) service_item.add_capability(ItemCapabilities.AllowsPreview) service_item.add_capability(ItemCapabilities.AllowsLoop) @@ -198,8 +197,6 @@ class ImageMediaItem(MediaManagerItem): self.parent.liveController.display.directImage(name, filename) self.resetAction.setVisible(True) else: - critical_error_message_box( - translate('ImagePlugin.MediaItem', 'Live Background Error'), - unicode(translate('ImagePlugin.MediaItem', - 'There was a problem replacing your background, ' - 'the image file "%s" no longer exists.')) % filename) + critical_error_message_box(UiStrings.LiveBGError, + UiStrings.ProbReplaceBG % ( + self.plugin.nameStrings[u'singular'].toLower(), filename)) diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index e50740be9..d57af14cf 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -30,7 +30,7 @@ import os from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, build_icon, ItemCapabilities, \ - SettingsManager, translate, check_item_selected, Receiver, StringContent + SettingsManager, translate, check_item_selected, Receiver from openlp.core.lib.ui import UiStrings, critical_error_message_box log = logging.getLogger(__name__) @@ -107,11 +107,9 @@ class MediaMediaItem(MediaManagerItem): self.parent.liveController.display.video(filename, 0, True) self.resetAction.setVisible(True) else: - critical_error_message_box(translate('MediaPlugin.MediaItem', - 'Live Background Error'), - unicode(translate('MediaPlugin.MediaItem', - 'There was a problem replacing your background, ' - 'the media file "%s" no longer exists.')) % filename) + critical_error_message_box(UiStrings.LiveBGError, + UiStrings.ProbReplaceBG % ( + self.plugin.nameStrings[u'singular'].toLower(), filename)) def generateSlideData(self, service_item, item=None, xmlVersion=False): if item is None: @@ -120,8 +118,7 @@ class MediaMediaItem(MediaManagerItem): return False filename = unicode(item.data(QtCore.Qt.UserRole).toString()) if os.path.exists(filename): - service_item.title = unicode( - self.plugin.getString(StringContent.Name)[u'singular']) + service_item.title = unicode(self.plugin.nameStrings[u'singular']) service_item.add_capability(ItemCapabilities.RequiresMedia) service_item.add_capability(ItemCapabilities.AllowsVarableStartTime) # force a nonexistent theme diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index 40ab0fc3d..dacba36aa 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -209,7 +209,7 @@ class SongImportForm(OpenLPWizard): self.setWindowTitle( translate('SongsPlugin.ImportWizardForm', 'Song Import Wizard')) self.informationLabel.setText(WizardStrings.Description % ( - self.direction.toLower(), self.itemType[u'plural'], + self.direction.toLower(), self.plugin.nameStrings[u'plural'], self.direction.toLower())) self.sourcePage.setTitle(WizardStrings.ImportSelect) self.sourcePage.setSubTitle(WizardStrings.ImportSelectLong) diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index ccfb8df90..30b1060bf 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -32,7 +32,7 @@ from PyQt4 import QtCore, QtGui from sqlalchemy.sql import or_ from openlp.core.lib import MediaManagerItem, Receiver, ItemCapabilities, \ - translate, check_item_selected, PluginStatus, StringContent + translate, check_item_selected, PluginStatus from openlp.core.lib.searchedit import SearchEdit from openlp.core.lib.ui import UiStrings from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm, \ @@ -138,7 +138,7 @@ class SongMediaItem(MediaManagerItem): self.searchTextLabel.setText(u'%s:' % UiStrings.Search) self.searchTextButton.setText(UiStrings.Search) self.maintenanceAction.setText(SongStrings.TypeMaintenance % - self.plugin.getString(StringContent.Name)[u'singular']) + self.plugin.nameStrings[u'singular']) self.maintenanceAction.setToolTip(translate('SongsPlugin.MediaItem', 'Maintain the lists of authors, topics and books')) diff --git a/openlp/plugins/songs/lib/songshowplusimport.py b/openlp/plugins/songs/lib/songshowplusimport.py index 289fd2860..d39557bb5 100644 --- a/openlp/plugins/songs/lib/songshowplusimport.py +++ b/openlp/plugins/songs/lib/songshowplusimport.py @@ -108,7 +108,6 @@ class SongShowPlusImport(SongImport): self.import_wizard.progressBar.setMaximum(len(self.import_source)) for file in self.import_source: author = u'' - copyright = u'' self.sspVerseOrderList = [] otherCount = 0 otherList = {} @@ -203,7 +202,7 @@ class SongShowPlusImport(SongImport): elif verseType == "bridge": verseTag = "B" else: - if not self.otherList.has_key(verseName): + if not self.otherList.has_key(verseName): self.otherCount = self.otherCount + 1 self.otherList[verseName] = str(self.otherCount) verseTag = "O" From 531e50a4174af16d25cfb82ecf6b63c8b12c2a16 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 14 Feb 2011 17:25:51 +0000 Subject: [PATCH 122/243] Fix translation breaking strings --- openlp/core/lib/plugin.py | 38 ++++++++++--------- openlp/core/lib/ui.py | 22 ++--------- openlp/core/ui/mainwindow.py | 9 ++--- openlp/core/ui/servicemanager.py | 14 +++---- openlp/core/ui/thememanager.py | 12 +++--- openlp/plugins/bibles/bibleplugin.py | 16 +++++--- openlp/plugins/custom/customplugin.py | 17 ++++++--- openlp/plugins/images/imageplugin.py | 13 ++++++- openlp/plugins/media/mediaplugin.py | 13 ++++++- .../presentations/presentationplugin.py | 16 +++++++- openlp/plugins/songs/songsplugin.py | 13 ++++++- 11 files changed, 112 insertions(+), 71 deletions(-) diff --git a/openlp/core/lib/plugin.py b/openlp/core/lib/plugin.py index a073d31ea..a525e70cc 100644 --- a/openlp/core/lib/plugin.py +++ b/openlp/core/lib/plugin.py @@ -335,37 +335,39 @@ class Plugin(QtCore.QObject): """ return self.textStrings[name] - def setPluginTextStrings(self): + def setPluginUiTextStrings(self, tooltips): """ Called to define all translatable texts of the plugin """ ## Load Action ## - self._setSingularTextString(StringContent.Load, - UiStrings.Load, UiStrings.LoadANew) + self.__setNameTextString(StringContent.Load, + UiStrings.Load, tooltips[load]) + ## Import Action ## + self.__setNameTextString(StringContent.Import, + UiStrings.Import, tooltips[import]) ## New Action ## - self._setSingularTextString(StringContent.New, - UiStrings.Add, UiStrings.AddANew) + self.__setNameTextString(StringContent.New, + UiStrings.Add, tooltips[new]) ## Edit Action ## - self._setSingularTextString(StringContent.Edit, - UiStrings.Edit, UiStrings.EditSelect) + self.__setNameTextString(StringContent.Edit, + UiStrings.Edit, tooltips[edit]) ## Delete Action ## - self._setSingularTextString(StringContent.Delete, - UiStrings.Delete, UiStrings.DeleteSelect) + self.__setNameTextString(StringContent.Delete, + UiStrings.Delete, tooltips[delete]) ## Preview Action ## - self._setSingularTextString(StringContent.Preview, - UiStrings.Preview, UiStrings.PreviewSelect) + self.__setNameTextString(StringContent.Preview, + UiStrings.Preview, tooltips[preview]) ## Send Live Action ## - self._setSingularTextString(StringContent.Live, - UiStrings.Live, UiStrings.SendSelectLive) + self.__setNameTextString(StringContent.Live, + UiStrings.Live, tooltips[live]) ## Add to Service Action ## - self._setSingularTextString(StringContent.Service, - UiStrings.Service, UiStrings.AddSelectService) + self.__setNameTextString(StringContent.Service, + UiStrings.Service, tooltips[service]) - def _setSingularTextString(self, name, title, tooltip): + def __setNameTextString(self, name, title, tooltip): """ Utility method for creating a plugin's textStrings. This method makes use of the singular name of the plugin object so must only be called after this has been set. """ - self.textStrings[name] = { u'title': title, u'tooltip': tooltip % - self.getString(StringContent.Name)[u'singular']} + self.textStrings[name] = {u'title': title, u'tooltip': tooltip} diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 400381b0c..48a932ab1 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -41,40 +41,26 @@ class UiStrings(object): # These strings should need a good reason to be retranslated elsewhere. # Should some/more/less of these have an & attached? Add = translate('OpenLP.Ui', '&Add') - AddANew = unicode(translate('OpenLP.Ui', 'Add a new %s.')) - AddSelectService = unicode(translate('OpenLP.Ui', - 'Add the selected %s to the service.')) Advanced = translate('OpenLP.Ui', 'Advanced') AllFiles = translate('OpenLP.Ui', 'All Files') Authors = translate('OpenLP.Ui', 'Authors') - CreateANew = unicode(translate('OpenLP.Ui', 'Create a new %s.')) + CreateService = translate('OpenLP.Ui', 'Create a new service.') Delete = translate('OpenLP.Ui', '&Delete') - DeleteSelect = unicode(translate('OpenLP.Ui', 'Delete the selected %s.')) - DeleteType = unicode(translate('OpenLP.Ui', 'Delete %s')) Edit = translate('OpenLP.Ui', '&Edit') - EditSelect = unicode(translate('OpenLP.Ui', 'Edit the selected %s.')) - EditType = unicode(translate('OpenLP.Ui', 'Edit %s')) Error = translate('OpenLP.Ui', 'Error') - ExportType = unicode(translate('OpenLP.Ui', 'Export %s')) Import = translate('OpenLP.Ui', 'Import') - ImportType = unicode(translate('OpenLP.Ui', 'Import %s')) - LengthTime = unicode(translate('OpenLP.Ui', 'Length %s')) Live = translate('OpenLP.Ui', 'Live') Load = translate('OpenLP.Ui', 'Load') - LoadANew = unicode(translate('OpenLP.Ui', 'Load a new %s.')) New = translate('OpenLP.Ui', 'New') - NewType = unicode(translate('OpenLP.Ui', 'New %s')) + NewService = translate('OpenLP.Ui', 'New Service') OLPV2 = translate('OpenLP.Ui', 'OpenLP 2.0') - OpenType = unicode(translate('OpenLP.Ui', 'Open %s')) + OpenService = translate('OpenLP.Ui', 'Open Service') Preview = translate('OpenLP.Ui', 'Preview') - PreviewSelect = unicode(translate('OpenLP.Ui', 'Preview the selected %s.')) ReplaceBG = translate('OpenLP.Ui', 'Replace Background') ReplaceLiveBG = translate('OpenLP.Ui', 'Replace Live Background') ResetBG = translate('OpenLP.Ui', 'Reset Background') ResetLiveBG = translate('OpenLP.Ui', 'Reset Live Background') - SaveType = unicode(translate('OpenLP.Ui', 'Save %s')) - SendSelectLive = unicode(translate('OpenLP.Ui', - 'Send the selected %s live.')) + SaveService = translate('OpenLP.Ui', 'Save Service') Service = translate('OpenLP.Ui', 'Service') StartTimeCode = unicode(translate('OpenLP.Ui', 'Start %s')) Theme = translate('OpenLP.Ui', 'Theme') diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 4840ef5da..c691c006e 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -319,17 +319,16 @@ class Ui_MainWindow(object): self.themeManagerDock.setWindowTitle( translate('OpenLP.MainWindow', 'Theme Manager')) self.FileNewItem.setText(translate('OpenLP.MainWindow', '&New')) - self.FileNewItem.setToolTip(UiStrings.NewType % UiStrings.Service) - self.FileNewItem.setStatusTip( - UiStrings.CreateANew % UiStrings.Service.toLower()) + self.FileNewItem.setToolTip(UiStrings.NewService) + self.FileNewItem.setStatusTip(UiStrings.CreateService) self.FileNewItem.setShortcut(translate('OpenLP.MainWindow', 'Ctrl+N')) self.FileOpenItem.setText(translate('OpenLP.MainWindow', '&Open')) - self.FileOpenItem.setToolTip(UiStrings.OpenType % UiStrings.Service) + self.FileOpenItem.setToolTip(UiStrings.OpenService) self.FileOpenItem.setStatusTip( translate('OpenLP.MainWindow', 'Open an existing service.')) self.FileOpenItem.setShortcut(translate('OpenLP.MainWindow', 'Ctrl+O')) self.FileSaveItem.setText(translate('OpenLP.MainWindow', '&Save')) - self.FileSaveItem.setToolTip(UiStrings.SaveType % UiStrings.Service) + self.FileSaveItem.setToolTip(UiStrings.SaveService) self.FileSaveItem.setStatusTip( translate('OpenLP.MainWindow', 'Save the current service to disk.')) self.FileSaveItem.setShortcut(translate('OpenLP.MainWindow', 'Ctrl+S')) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 71191fdbf..04a4753e8 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -96,18 +96,14 @@ class ServiceManager(QtGui.QWidget): # Create the top toolbar self.toolbar = OpenLPToolbar(self) self.toolbar.addToolbarButton( - UiStrings.NewType % UiStrings.Service, - u':/general/general_new.png', - UiStrings.CreateANew % UiStrings.Service.toLower(), - self.onNewServiceClicked) + UiStrings.NewService, u':/general/general_new.png', + UiStrings.Create.Service, self.onNewServiceClicked) self.toolbar.addToolbarButton( - UiStrings.OpenType % UiStrings.Service, - u':/general/general_open.png', + UiStrings.OpenService, u':/general/general_open.png', translate('OpenLP.ServiceManager', 'Load an existing service'), self.onLoadServiceClicked) self.toolbar.addToolbarButton( - UiStrings.SaveType % UiStrings.Service, - u':/general/general_save.png', + UiStrings.SaveService, u':/general/general_save.png', translate('OpenLP.ServiceManager', 'Save this service'), self.saveFile) self.toolbar.addSeparator() @@ -469,7 +465,7 @@ class ServiceManager(QtGui.QWidget): save the file. """ fileName = unicode(QtGui.QFileDialog.getSaveFileName(self.mainwindow, - UiStrings.SaveType % UiStrings.Service, + UiStrings.SaveService, SettingsManager.get_last_dir( self.mainwindow.serviceSettingsSection), translate('OpenLP.ServiceManager', 'OpenLP Service Files (*.osz)'))) diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 36abb19c1..8dc895862 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -63,28 +63,28 @@ class ThemeManager(QtGui.QWidget): self.layout.setObjectName(u'layout') self.toolbar = OpenLPToolbar(self) self.toolbar.addToolbarButton( - UiStrings.NewType % UiStrings.Theme, + translate('OpenLP.ThemeManager', 'New Theme'), u':/themes/theme_new.png', - UiStrings.CreateANew % UiStrings.Theme.toLower(), + translate('OpenLP.ThemeManager', 'Create a new theme.'), self.onAddTheme) self.toolbar.addToolbarButton( - UiStrings.EditType % UiStrings.Theme, + translate('OpenLP.ThemeManager', 'Edit Theme'), u':/themes/theme_edit.png', translate('OpenLP.ThemeManager', 'Edit a theme.'), self.onEditTheme) self.deleteToolbarAction = self.toolbar.addToolbarButton( - UiStrings.DeleteType % UiStrings.Theme, + translate('OpenLP.ThemeManager', 'Delete Theme'), u':/general/general_delete.png', translate('OpenLP.ThemeManager', 'Delete a theme.'), self.onDeleteTheme) self.toolbar.addSeparator() self.toolbar.addToolbarButton( - UiStrings.ImportType % UiStrings.Theme, + translate('OpenLP.ThemeManager', 'Import Theme'), u':/general/general_import.png', translate('OpenLP.ThemeManager', 'Import a theme.'), self.onImportTheme) self.toolbar.addToolbarButton( - UiStrings.ExportType % UiStrings.Theme, + translate('OpenLP.ThemeManager', 'Export Theme'), u':/general/general_export.png', translate('OpenLP.ThemeManager', 'Export a theme.'), self.onExportTheme) diff --git a/openlp/plugins/bibles/bibleplugin.py b/openlp/plugins/bibles/bibleplugin.py index e3447cfdd..63fb28b67 100644 --- a/openlp/plugins/bibles/bibleplugin.py +++ b/openlp/plugins/bibles/bibleplugin.py @@ -129,9 +129,15 @@ class BiblePlugin(Plugin): u'title': translate('BiblesPlugin', 'Bibles', 'container title') } # Middle Header Bar - ## Import Action ## - self.textStrings[StringContent.Import] = { - u'title': UiStrings.Import, - u'tooltip': translate('BiblesPlugin', 'Import a Bible') + tooltips = { + load: u'' + import: translate('BiblesPlugin', 'Import a Bible') + new: translate('BiblesPlugin', 'Add a new Bible') + edit: translate('BiblesPlugin', 'Edit the selected Bible') + delete: translate('BiblesPlugin', 'Delete the selected Bible') + preview: translate('BiblesPlugin', 'Preview the selected Bible') + live: translate('BiblesPlugin', 'Send the selected Bible live') + service: translate('BiblesPlugin', + 'Add the selected Bible to the service') } - Plugin.setPluginTextStrings(self) + self.setPluginUiTextStrings(tooltips) diff --git a/openlp/plugins/custom/customplugin.py b/openlp/plugins/custom/customplugin.py index 92546cd4f..86f1b20d8 100644 --- a/openlp/plugins/custom/customplugin.py +++ b/openlp/plugins/custom/customplugin.py @@ -106,13 +106,18 @@ class CustomPlugin(Plugin): u'title': translate('CustomsPlugin', 'Custom', 'container title') } # Middle Header Bar - ## Import Action ## - self.textStrings[StringContent.Import] = { - u'title': UiStrings.Import, - u'tooltip': translate('CustomsPlugin', - 'Import a Custom') + tooltips = { + load: translate('CustomsPlugin', 'Load a new Custom') + import: translate('CustomsPlugin', 'Import a Custom') + new: translate('CustomsPlugin', 'Add a new Custom') + edit: translate('CustomsPlugin', 'Edit the selected Custom') + delete: translate('CustomsPlugin', 'Delete the selected Custom') + preview: translate('CustomsPlugin', 'Preview the selected Custom') + live: translate('CustomsPlugin', 'Send the selected Custom live') + service: translate('CustomsPlugin', + 'Add the selected Custom to the service') } - Plugin.setPluginTextStrings(self) + self.setPluginUiTextStrings(tooltips) def finalise(self): """ diff --git a/openlp/plugins/images/imageplugin.py b/openlp/plugins/images/imageplugin.py index 6b64598fc..59005de4f 100644 --- a/openlp/plugins/images/imageplugin.py +++ b/openlp/plugins/images/imageplugin.py @@ -69,4 +69,15 @@ class ImagePlugin(Plugin): u'title': translate('ImagePlugin', 'Images', 'container title') } # Middle Header Bar - Plugin.setPluginTextStrings(self) + tooltips = { + load: translate('ImagePlugin', 'Load a new Image') + import: u'' + new: translate('ImagePlugin', 'Add a new Image') + edit: translate('ImagePlugin', 'Edit the selected Image') + delete: translate('ImagePlugin', 'Delete the selected Image') + preview: translate('ImagePlugin', 'Preview the selected Image') + live: translate('ImagePlugin', 'Send the selected Image live') + service: translate('ImagePlugin', + 'Add the selected Image to the service') + } + self.setPluginUiTextStrings(tooltips) diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index b9db9b8c1..6989e91aa 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -95,4 +95,15 @@ class MediaPlugin(Plugin): u'title': translate('MediaPlugin', 'Media', 'container title') } # Middle Header Bar - Plugin.setPluginTextStrings(self) + tooltips = { + load: translate('MediaPlugin', 'Load a new Media') + import: u'' + new: translate('MediaPlugin', 'Add a new Media') + edit: translate('MediaPlugin', 'Edit the selected Media') + delete: translate('MediaPlugin', 'Delete the selected Media') + preview: translate('MediaPlugin', 'Preview the selected Media') + live: translate('MediaPlugin', 'Send the selected Media live') + service: translate('MediaPlugin', + 'Add the selected Media to the service') + } + self.setPluginUiTextStrings(tooltips) diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index c81cdc028..fba332eb0 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -167,4 +167,18 @@ class PresentationPlugin(Plugin): 'container title') } # Middle Header Bar - Plugin.setPluginTextStrings(self) + tooltips = { + load: translate('PresentationPlugin', 'Load a new Presentation') + import: u'' + new: u'' + edit: u'' + delete: translate('PresentationPlugin', + 'Delete the selected Presentation') + preview: translate('PresentationPlugin', + 'Preview the selected Presentation') + live: translate('PresentationPlugin', + 'Send the selected Presentation live') + service: translate('PresentationPlugin', + 'Add the selected Presentation to the service') + } + self.setPluginUiTextStrings(tooltips) diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 646e8e86e..abeddfdae 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -228,7 +228,18 @@ class SongsPlugin(Plugin): u'title': translate('SongsPlugin', 'Songs', 'container title') } # Middle Header Bar - Plugin.setPluginTextStrings(self) + tooltips = { + load: u'' + import: u'' + new: translate('SongsPlugin', 'Add a new Song') + edit: translate('SongsPlugin', 'Edit the selected Song') + delete: translate('SongsPlugin', 'Delete the selected Song') + preview: translate('SongsPlugin', 'Preview the selected Song') + live: translate('SongsPlugin', 'Send the selected Song live') + service: translate('SongsPlugin', + 'Add the selected Song to the service') + } + self.setPluginUiTextStrings(tooltips) def finalise(self): """ From 5800d01fa13219c3ad28d323e24f97ec19bdf2d9 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 14 Feb 2011 17:30:41 +0000 Subject: [PATCH 123/243] Don't remove LengthTime --- openlp/core/lib/ui.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 48a932ab1..a98e2fb7f 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -49,6 +49,7 @@ class UiStrings(object): Edit = translate('OpenLP.Ui', '&Edit') Error = translate('OpenLP.Ui', 'Error') Import = translate('OpenLP.Ui', 'Import') + LengthTime = unicode(translate('OpenLP.Ui', 'Length %s')) Live = translate('OpenLP.Ui', 'Live') Load = translate('OpenLP.Ui', 'Load') New = translate('OpenLP.Ui', 'New') From fba2a245fb9e2020d2326658c0ad301912a6cb8d Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Mon, 14 Feb 2011 17:54:09 +0000 Subject: [PATCH 124/243] Fix Media length calc --- openlp/core/lib/serviceitem.py | 18 ++++++++---------- openlp/core/ui/printserviceorderform.py | 14 +++----------- openlp/plugins/media/lib/mediaitem.py | 22 ++++++++++++++++++++++ 3 files changed, 33 insertions(+), 21 deletions(-) diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index 1b5261773..e8e1f68f0 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -30,7 +30,6 @@ type and capability of an item. import datetime import logging -import mutagen import os import uuid @@ -110,6 +109,7 @@ class ServiceItem(object): self.edit_id = None self.xml_version = None self.start_time = 0 + self.media_length = 0 self._new_item() def _new_item(self): @@ -263,7 +263,8 @@ class ServiceItem(object): u'search': self.search_string, u'data': self.data_string, u'xml_version': self.xml_version, - u'start_time': self.start_time + u'start_time': self.start_time, + u'media_length': self.media_length } service_data = [] if self.service_item_type == ServiceItemType.Text: @@ -309,6 +310,8 @@ class ServiceItem(object): self.xml_version = header[u'xml_version'] if u'start_time' in header: self.start_time = header[u'start_time'] + if u'media_length' in header: + self.media_length = header[u'media_length'] if self.service_item_type == ServiceItemType.Text: for slide in serviceitem[u'serviceitem'][u'data']: self._raw_frames.append(slide) @@ -439,14 +442,9 @@ class ServiceItem(object): if self.start_time != 0: start = UiStrings.StartTimeCode % \ unicode(datetime.timedelta(seconds=self.start_time)) - path = os.path.join(self.get_frames()[0][u'path'], - self.get_frames()[0][u'title']) - if os.path.isfile(path): - file = mutagen.File(path) - if file is not None: - seconds = int(file.info.length) - end = UiStrings.LengthTime % \ - unicode(datetime.timedelta(seconds=seconds)) + if self.media_length != 0: + end = UiStrings.LengthTime % \ + unicode(datetime.timedelta(seconds=self.media_length)) if not start and not end: return None elif start and not end: diff --git a/openlp/core/ui/printserviceorderform.py b/openlp/core/ui/printserviceorderform.py index 3b01f9ac7..70128cb89 100644 --- a/openlp/core/ui/printserviceorderform.py +++ b/openlp/core/ui/printserviceorderform.py @@ -24,7 +24,6 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### import datetime -import mutagen import os from PyQt4 import QtCore, QtGui @@ -113,16 +112,9 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): item.notes.replace(u'\n', u'
')) # Add play length of media files. if item.is_media() and self.printMetaDataCheckBox.isChecked(): - path = os.path.join(item.get_frames()[0][u'path'], - item.get_frames()[0][u'title']) - if not os.path.isfile(path): - continue - file = mutagen.File(path) - if file is not None: - length = int(file.info.length) - text += u'

%s %s

' % (translate( - 'OpenLP.ServiceManager', u'Playing time:'), - unicode(datetime.timedelta(seconds=length))) + text += u'

%s %s

' % (translate( + 'OpenLP.ServiceManager', u'Playing time:'), + unicode(datetime.timedelta(seconds=item.media_length))) if self.customNoteEdit.toPlainText(): text += u'

%s

%s' % (translate('OpenLP.ServiceManager', u'Custom Service Notes:'), self.customNoteEdit.toPlainText()) diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index 55b745ec5..47fe44801 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -32,6 +32,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, build_icon, ItemCapabilities, \ SettingsManager, translate, check_item_selected, Receiver from openlp.core.lib.ui import UiStrings, critical_error_message_box +from PyQt4.phonon import Phonon log = logging.getLogger(__name__) @@ -48,9 +49,13 @@ class MediaMediaItem(MediaManagerItem): u':/media/media_video.png').toImage() MediaManagerItem.__init__(self, parent, self, icon) self.singleServiceItem = False + self.mediaObject = Phonon.MediaObject(self) QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'video_background_replaced'), self.videobackgroundReplaced) + QtCore.QObject.connect(self.mediaObject, + QtCore.SIGNAL(u'stateChanged(Phonon::State, Phonon::State)'), + self.videoStart) def retranslateUi(self): self.OnNewPrompt = translate('MediaPlugin.MediaItem', 'Select Media') @@ -120,6 +125,11 @@ class MediaMediaItem(MediaManagerItem): return False filename = unicode(item.data(QtCore.Qt.UserRole).toString()) if os.path.exists(filename): + self.MediaState = None + self.mediaObject.stop() + self.mediaObject.clearQueue() + self.mediaObject.setCurrentSource(Phonon.MediaSource(filename)) + self.mediaObject.play() service_item.title = unicode( translate('MediaPlugin.MediaItem', 'Media')) service_item.add_capability(ItemCapabilities.RequiresMedia) @@ -128,6 +138,9 @@ class MediaMediaItem(MediaManagerItem): service_item.theme = -1 frame = u':/media/image_clapperboard.png' (path, name) = os.path.split(filename) + while not self.MediaState: + Receiver.send_message(u'openlp_process_events') + service_item.media_length = self.mediaLength service_item.add_from_command(path, name, frame) return True else: @@ -165,3 +178,12 @@ class MediaMediaItem(MediaManagerItem): item_name.setIcon(build_icon(img)) item_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(file)) self.listView.addItem(item_name) + + def videoStart(self, newState, oldState): + """ + Start the video at a predetermined point. + """ + if newState == 2: + self.MediaState = newState + self.mediaLength = self.mediaObject.totalTime()/1000 + self.mediaObject.stop() From ba8918a1eaaf001762d26eb2ce9dd015953ef403 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 14 Feb 2011 18:20:59 +0000 Subject: [PATCH 125/243] Fixes --- openlp/core/ui/themeform.py | 3 ++- openlp/core/ui/thememanager.py | 4 ++-- openlp/plugins/bibles/bibleplugin.py | 14 +++++++------- openlp/plugins/custom/customplugin.py | 14 +++++++------- openlp/plugins/images/imageplugin.py | 14 +++++++------- openlp/plugins/media/mediaplugin.py | 14 +++++++------- .../presentations/presentationplugin.py | 18 +++++++++--------- openlp/plugins/songs/songsplugin.py | 14 +++++++------- 8 files changed, 48 insertions(+), 47 deletions(-) diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index f86fa0143..ad9e80d66 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -483,7 +483,8 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): Background Image button pushed. """ images_filter = get_images_filter() - images_filter = '%s;;%s (*.*) (*)' % (images_filter, UiStrings.AllFiles) + images_filter = u'%s;;%s (*.*) (*)' % ( + images_filter, UiStrings.AllFiles) filename = QtGui.QFileDialog.getOpenFileName(self, translate('OpenLP.ThemeForm', 'Select Image'), u'', images_filter) diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 8dc895862..69028ad76 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -406,8 +406,8 @@ class ThemeManager(QtGui.QWidget): files = QtGui.QFileDialog.getOpenFileNames(self, translate('OpenLP.ThemeManager', 'Select Theme Import File'), SettingsManager.get_last_dir(self.settingsSection), - translate('OpenLP.ThemeManager', 'Theme v1 (*.theme);;' - 'Theme v2 (*.otz);;%s (*.*)') % UiStrings.AllFiles) + unicode(translate('OpenLP.ThemeManager', 'Theme v1 (*.theme);;' + 'Theme v2 (*.otz);;%s (*.*)')) % UiStrings.AllFiles) log.info(u'New Themes %s', unicode(files)) if files: for file in files: diff --git a/openlp/plugins/bibles/bibleplugin.py b/openlp/plugins/bibles/bibleplugin.py index 63fb28b67..06fd78b60 100644 --- a/openlp/plugins/bibles/bibleplugin.py +++ b/openlp/plugins/bibles/bibleplugin.py @@ -130,13 +130,13 @@ class BiblePlugin(Plugin): } # Middle Header Bar tooltips = { - load: u'' - import: translate('BiblesPlugin', 'Import a Bible') - new: translate('BiblesPlugin', 'Add a new Bible') - edit: translate('BiblesPlugin', 'Edit the selected Bible') - delete: translate('BiblesPlugin', 'Delete the selected Bible') - preview: translate('BiblesPlugin', 'Preview the selected Bible') - live: translate('BiblesPlugin', 'Send the selected Bible live') + load: u'', + import: translate('BiblesPlugin', 'Import a Bible'), + new: translate('BiblesPlugin', 'Add a new Bible'), + edit: translate('BiblesPlugin', 'Edit the selected Bible'), + delete: translate('BiblesPlugin', 'Delete the selected Bible'), + preview: translate('BiblesPlugin', 'Preview the selected Bible'), + live: translate('BiblesPlugin', 'Send the selected Bible live'), service: translate('BiblesPlugin', 'Add the selected Bible to the service') } diff --git a/openlp/plugins/custom/customplugin.py b/openlp/plugins/custom/customplugin.py index 86f1b20d8..076f618bc 100644 --- a/openlp/plugins/custom/customplugin.py +++ b/openlp/plugins/custom/customplugin.py @@ -107,13 +107,13 @@ class CustomPlugin(Plugin): } # Middle Header Bar tooltips = { - load: translate('CustomsPlugin', 'Load a new Custom') - import: translate('CustomsPlugin', 'Import a Custom') - new: translate('CustomsPlugin', 'Add a new Custom') - edit: translate('CustomsPlugin', 'Edit the selected Custom') - delete: translate('CustomsPlugin', 'Delete the selected Custom') - preview: translate('CustomsPlugin', 'Preview the selected Custom') - live: translate('CustomsPlugin', 'Send the selected Custom live') + load: translate('CustomsPlugin', 'Load a new Custom'), + import: translate('CustomsPlugin', 'Import a Custom'), + new: translate('CustomsPlugin', 'Add a new Custom'), + edit: translate('CustomsPlugin', 'Edit the selected Custom'), + delete: translate('CustomsPlugin', 'Delete the selected Custom'), + preview: translate('CustomsPlugin', 'Preview the selected Custom'), + live: translate('CustomsPlugin', 'Send the selected Custom live'), service: translate('CustomsPlugin', 'Add the selected Custom to the service') } diff --git a/openlp/plugins/images/imageplugin.py b/openlp/plugins/images/imageplugin.py index 59005de4f..7c04f5c7a 100644 --- a/openlp/plugins/images/imageplugin.py +++ b/openlp/plugins/images/imageplugin.py @@ -70,13 +70,13 @@ class ImagePlugin(Plugin): } # Middle Header Bar tooltips = { - load: translate('ImagePlugin', 'Load a new Image') - import: u'' - new: translate('ImagePlugin', 'Add a new Image') - edit: translate('ImagePlugin', 'Edit the selected Image') - delete: translate('ImagePlugin', 'Delete the selected Image') - preview: translate('ImagePlugin', 'Preview the selected Image') - live: translate('ImagePlugin', 'Send the selected Image live') + load: translate('ImagePlugin', 'Load a new Image'), + import: u'', + new: translate('ImagePlugin', 'Add a new Image'), + edit: translate('ImagePlugin', 'Edit the selected Image'), + delete: translate('ImagePlugin', 'Delete the selected Image'), + preview: translate('ImagePlugin', 'Preview the selected Image'), + live: translate('ImagePlugin', 'Send the selected Image live'), service: translate('ImagePlugin', 'Add the selected Image to the service') } diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index 6989e91aa..68bdbe937 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -96,13 +96,13 @@ class MediaPlugin(Plugin): } # Middle Header Bar tooltips = { - load: translate('MediaPlugin', 'Load a new Media') - import: u'' - new: translate('MediaPlugin', 'Add a new Media') - edit: translate('MediaPlugin', 'Edit the selected Media') - delete: translate('MediaPlugin', 'Delete the selected Media') - preview: translate('MediaPlugin', 'Preview the selected Media') - live: translate('MediaPlugin', 'Send the selected Media live') + load: translate('MediaPlugin', 'Load a new Media'), + import: u'', + new: translate('MediaPlugin', 'Add a new Media'), + edit: translate('MediaPlugin', 'Edit the selected Media'), + delete: translate('MediaPlugin', 'Delete the selected Media'), + preview: translate('MediaPlugin', 'Preview the selected Media'), + live: translate('MediaPlugin', 'Send the selected Media live'), service: translate('MediaPlugin', 'Add the selected Media to the service') } diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index fba332eb0..7411c2f71 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -168,17 +168,17 @@ class PresentationPlugin(Plugin): } # Middle Header Bar tooltips = { - load: translate('PresentationPlugin', 'Load a new Presentation') - import: u'' - new: u'' - edit: u'' + load: translate('PresentationPlugin', 'Load a new Presentation'), + import: u'', + new: u'', + edit: u'', delete: translate('PresentationPlugin', - 'Delete the selected Presentation') + 'Delete the selected Presentation'), preview: translate('PresentationPlugin', - 'Preview the selected Presentation') + 'Preview the selected Presentation'), live: translate('PresentationPlugin', - 'Send the selected Presentation live') + 'Send the selected Presentation live'), service: translate('PresentationPlugin', 'Add the selected Presentation to the service') - } - self.setPluginUiTextStrings(tooltips) + } + self.setPluginUiTextStrings(tooltips) diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index abeddfdae..e8866e5b0 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -229,13 +229,13 @@ class SongsPlugin(Plugin): } # Middle Header Bar tooltips = { - load: u'' - import: u'' - new: translate('SongsPlugin', 'Add a new Song') - edit: translate('SongsPlugin', 'Edit the selected Song') - delete: translate('SongsPlugin', 'Delete the selected Song') - preview: translate('SongsPlugin', 'Preview the selected Song') - live: translate('SongsPlugin', 'Send the selected Song live') + load: u'', + import: u'', + new: translate('SongsPlugin', 'Add a new Song'), + edit: translate('SongsPlugin', 'Edit the selected Song'), + delete: translate('SongsPlugin', 'Delete the selected Song'), + preview: translate('SongsPlugin', 'Preview the selected Song'), + live: translate('SongsPlugin', 'Send the selected Song live'), service: translate('SongsPlugin', 'Add the selected Song to the service') } From 329db94fd204d0e9cc7ad2889b42253aa3d09c6f Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Mon, 14 Feb 2011 18:32:46 +0000 Subject: [PATCH 126/243] Fix indent --- openlp/core/lib/serviceitem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index e8e1f68f0..31852709a 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -444,7 +444,7 @@ class ServiceItem(object): unicode(datetime.timedelta(seconds=self.start_time)) if self.media_length != 0: end = UiStrings.LengthTime % \ - unicode(datetime.timedelta(seconds=self.media_length)) + unicode(datetime.timedelta(seconds=self.media_length)) if not start and not end: return None elif start and not end: From 774f9d6cdd4ff97554560ea18a3acfe0a40a69b2 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Mon, 14 Feb 2011 18:43:37 +0000 Subject: [PATCH 127/243] Fix names --- openlp/core/ui/maindisplay.py | 2 +- openlp/plugins/media/lib/mediaitem.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index cc2f2f72d..90042f80b 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -348,7 +348,7 @@ class MainDisplay(DisplayWidget): """ Start the video at a predetermined point. """ - if newState == 2: + if newState == Phonon.PlayingState: self.mediaObject.seek(self.serviceItem.start_time * 1000) def isWebLoaded(self): diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index 47fe44801..cc126bbef 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -183,7 +183,7 @@ class MediaMediaItem(MediaManagerItem): """ Start the video at a predetermined point. """ - if newState == 2: + if newState == Phonon.PlayingState: self.MediaState = newState self.mediaLength = self.mediaObject.totalTime()/1000 self.mediaObject.stop() From 5e8b8eedf3c5e3ac50da4bf36c03747925fe7b10 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 14 Feb 2011 19:08:18 +0000 Subject: [PATCH 128/243] Strings not variable names\! --- openlp/core/lib/plugin.py | 16 ++++++++-------- openlp/plugins/bibles/bibleplugin.py | 16 ++++++++-------- openlp/plugins/custom/customplugin.py | 18 ++++++++++-------- openlp/plugins/images/imageplugin.py | 16 ++++++++-------- openlp/plugins/media/mediaplugin.py | 16 ++++++++-------- .../presentations/presentationplugin.py | 16 ++++++++-------- openlp/plugins/songs/songsplugin.py | 16 ++++++++-------- 7 files changed, 58 insertions(+), 56 deletions(-) diff --git a/openlp/core/lib/plugin.py b/openlp/core/lib/plugin.py index a525e70cc..730bb1a36 100644 --- a/openlp/core/lib/plugin.py +++ b/openlp/core/lib/plugin.py @@ -341,28 +341,28 @@ class Plugin(QtCore.QObject): """ ## Load Action ## self.__setNameTextString(StringContent.Load, - UiStrings.Load, tooltips[load]) + UiStrings.Load, tooltips[u'load']) ## Import Action ## self.__setNameTextString(StringContent.Import, - UiStrings.Import, tooltips[import]) + UiStrings.Import, tooltips[u'import']) ## New Action ## self.__setNameTextString(StringContent.New, - UiStrings.Add, tooltips[new]) + UiStrings.Add, tooltips[u'new']) ## Edit Action ## self.__setNameTextString(StringContent.Edit, - UiStrings.Edit, tooltips[edit]) + UiStrings.Edit, tooltips[u'edit']) ## Delete Action ## self.__setNameTextString(StringContent.Delete, - UiStrings.Delete, tooltips[delete]) + UiStrings.Delete, tooltips[u'delete']) ## Preview Action ## self.__setNameTextString(StringContent.Preview, - UiStrings.Preview, tooltips[preview]) + UiStrings.Preview, tooltips[u'preview']) ## Send Live Action ## self.__setNameTextString(StringContent.Live, - UiStrings.Live, tooltips[live]) + UiStrings.Live, tooltips[u'live']) ## Add to Service Action ## self.__setNameTextString(StringContent.Service, - UiStrings.Service, tooltips[service]) + UiStrings.Service, tooltips[u'service']) def __setNameTextString(self, name, title, tooltip): """ diff --git a/openlp/plugins/bibles/bibleplugin.py b/openlp/plugins/bibles/bibleplugin.py index 06fd78b60..de0ea11f1 100644 --- a/openlp/plugins/bibles/bibleplugin.py +++ b/openlp/plugins/bibles/bibleplugin.py @@ -130,14 +130,14 @@ class BiblePlugin(Plugin): } # Middle Header Bar tooltips = { - load: u'', - import: translate('BiblesPlugin', 'Import a Bible'), - new: translate('BiblesPlugin', 'Add a new Bible'), - edit: translate('BiblesPlugin', 'Edit the selected Bible'), - delete: translate('BiblesPlugin', 'Delete the selected Bible'), - preview: translate('BiblesPlugin', 'Preview the selected Bible'), - live: translate('BiblesPlugin', 'Send the selected Bible live'), - service: translate('BiblesPlugin', + u'load': u'', + u'import': translate('BiblesPlugin', 'Import a Bible'), + u'new': translate('BiblesPlugin', 'Add a new Bible'), + u'edit': translate('BiblesPlugin', 'Edit the selected Bible'), + u'delete': translate('BiblesPlugin', 'Delete the selected Bible'), + u'preview': translate('BiblesPlugin', 'Preview the selected Bible'), + u'live': translate('BiblesPlugin', 'Send the selected Bible live'), + u'service': translate('BiblesPlugin', 'Add the selected Bible to the service') } self.setPluginUiTextStrings(tooltips) diff --git a/openlp/plugins/custom/customplugin.py b/openlp/plugins/custom/customplugin.py index 076f618bc..5a32d4657 100644 --- a/openlp/plugins/custom/customplugin.py +++ b/openlp/plugins/custom/customplugin.py @@ -107,14 +107,16 @@ class CustomPlugin(Plugin): } # Middle Header Bar tooltips = { - load: translate('CustomsPlugin', 'Load a new Custom'), - import: translate('CustomsPlugin', 'Import a Custom'), - new: translate('CustomsPlugin', 'Add a new Custom'), - edit: translate('CustomsPlugin', 'Edit the selected Custom'), - delete: translate('CustomsPlugin', 'Delete the selected Custom'), - preview: translate('CustomsPlugin', 'Preview the selected Custom'), - live: translate('CustomsPlugin', 'Send the selected Custom live'), - service: translate('CustomsPlugin', + u'load': translate('CustomsPlugin', 'Load a new Custom'), + u'import': translate('CustomsPlugin', 'Import a Custom'), + u'new': translate('CustomsPlugin', 'Add a new Custom'), + u'edit': translate('CustomsPlugin', 'Edit the selected Custom'), + u'delete': translate('CustomsPlugin', 'Delete the selected Custom'), + u'preview': translate('CustomsPlugin', + 'Preview the selected Custom'), + u'live': translate('CustomsPlugin', + 'Send the selected Custom live'), + u'service': translate('CustomsPlugin', 'Add the selected Custom to the service') } self.setPluginUiTextStrings(tooltips) diff --git a/openlp/plugins/images/imageplugin.py b/openlp/plugins/images/imageplugin.py index 7c04f5c7a..2cc0f1d93 100644 --- a/openlp/plugins/images/imageplugin.py +++ b/openlp/plugins/images/imageplugin.py @@ -70,14 +70,14 @@ class ImagePlugin(Plugin): } # Middle Header Bar tooltips = { - load: translate('ImagePlugin', 'Load a new Image'), - import: u'', - new: translate('ImagePlugin', 'Add a new Image'), - edit: translate('ImagePlugin', 'Edit the selected Image'), - delete: translate('ImagePlugin', 'Delete the selected Image'), - preview: translate('ImagePlugin', 'Preview the selected Image'), - live: translate('ImagePlugin', 'Send the selected Image live'), - service: translate('ImagePlugin', + u'load': translate('ImagePlugin', 'Load a new Image'), + u'import': u'', + u'new': translate('ImagePlugin', 'Add a new Image'), + u'edit': translate('ImagePlugin', 'Edit the selected Image'), + u'delete': translate('ImagePlugin', 'Delete the selected Image'), + u'preview': translate('ImagePlugin', 'Preview the selected Image'), + u'live': translate('ImagePlugin', 'Send the selected Image live'), + u'service': translate('ImagePlugin', 'Add the selected Image to the service') } self.setPluginUiTextStrings(tooltips) diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index 68bdbe937..ee413aa8c 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -96,14 +96,14 @@ class MediaPlugin(Plugin): } # Middle Header Bar tooltips = { - load: translate('MediaPlugin', 'Load a new Media'), - import: u'', - new: translate('MediaPlugin', 'Add a new Media'), - edit: translate('MediaPlugin', 'Edit the selected Media'), - delete: translate('MediaPlugin', 'Delete the selected Media'), - preview: translate('MediaPlugin', 'Preview the selected Media'), - live: translate('MediaPlugin', 'Send the selected Media live'), - service: translate('MediaPlugin', + u'load': translate('MediaPlugin', 'Load a new Media'), + u'import': u'', + u'new': translate('MediaPlugin', 'Add a new Media'), + u'edit': translate('MediaPlugin', 'Edit the selected Media'), + u'delete': translate('MediaPlugin', 'Delete the selected Media'), + u'preview': translate('MediaPlugin', 'Preview the selected Media'), + u'live': translate('MediaPlugin', 'Send the selected Media live'), + u'service': translate('MediaPlugin', 'Add the selected Media to the service') } self.setPluginUiTextStrings(tooltips) diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index 7411c2f71..ece25e363 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -168,17 +168,17 @@ class PresentationPlugin(Plugin): } # Middle Header Bar tooltips = { - load: translate('PresentationPlugin', 'Load a new Presentation'), - import: u'', - new: u'', - edit: u'', - delete: translate('PresentationPlugin', + u'load': translate('PresentationPlugin', 'Load a new Presentation'), + u'import': u'', + u'new': u'', + u'edit': u'', + u'delete': translate('PresentationPlugin', 'Delete the selected Presentation'), - preview: translate('PresentationPlugin', + u'preview': translate('PresentationPlugin', 'Preview the selected Presentation'), - live: translate('PresentationPlugin', + u'live': translate('PresentationPlugin', 'Send the selected Presentation live'), - service: translate('PresentationPlugin', + u'service': translate('PresentationPlugin', 'Add the selected Presentation to the service') } self.setPluginUiTextStrings(tooltips) diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index e8866e5b0..887ddb7b2 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -229,14 +229,14 @@ class SongsPlugin(Plugin): } # Middle Header Bar tooltips = { - load: u'', - import: u'', - new: translate('SongsPlugin', 'Add a new Song'), - edit: translate('SongsPlugin', 'Edit the selected Song'), - delete: translate('SongsPlugin', 'Delete the selected Song'), - preview: translate('SongsPlugin', 'Preview the selected Song'), - live: translate('SongsPlugin', 'Send the selected Song live'), - service: translate('SongsPlugin', + u'load': u'', + u'import': u'', + u'new': translate('SongsPlugin', 'Add a new Song'), + u'edit': translate('SongsPlugin', 'Edit the selected Song'), + u'delete': translate('SongsPlugin', 'Delete the selected Song'), + u'preview': translate('SongsPlugin', 'Preview the selected Song'), + u'live': translate('SongsPlugin', 'Send the selected Song live'), + u'service': translate('SongsPlugin', 'Add the selected Song to the service') } self.setPluginUiTextStrings(tooltips) From 3c8c87138f873979c84d047d3f39abd75d76ed16 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 14 Feb 2011 19:15:49 +0000 Subject: [PATCH 129/243] Typo --- openlp/core/ui/servicemanager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 04a4753e8..623c2d641 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -97,7 +97,7 @@ class ServiceManager(QtGui.QWidget): self.toolbar = OpenLPToolbar(self) self.toolbar.addToolbarButton( UiStrings.NewService, u':/general/general_new.png', - UiStrings.Create.Service, self.onNewServiceClicked) + UiStrings.CreateService, self.onNewServiceClicked) self.toolbar.addToolbarButton( UiStrings.OpenService, u':/general/general_open.png', translate('OpenLP.ServiceManager', 'Load an existing service'), From 4c0928699df3ec647f541f3470808b3a5cc9f6c5 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Mon, 14 Feb 2011 19:52:05 +0000 Subject: [PATCH 130/243] Print Dialog fixes --- openlp.pyw | 3 ++- openlp/core/ui/mainwindow.py | 5 +++-- openlp/core/ui/printserviceorderform.py | 6 ++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/openlp.pyw b/openlp.pyw index 100c3336f..d425a0b37 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -188,7 +188,8 @@ class OpenLP(QtGui.QApplication): u'primary': (self.desktop().primaryScreen() == screen)}) log.info(u'Screen %d found with resolution %s', screen, size) # start the main app window - self.mainWindow = MainWindow(screens, app_version) + self.appClipboard = self.clipboard() + self.mainWindow = MainWindow(screens, app_version, self.appClipboard) self.mainWindow.show() if show_splash: # now kill the splashscreen diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 4840ef5da..f498c1bc3 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -240,7 +240,7 @@ class Ui_MainWindow(object): languageItem.setChecked(True) add_actions(self.LanguageGroup, [languageItem]) self.SettingsShortcutsItem = icon_action(mainWindow, - u'SettingsShortcutsItem', + u'SettingsShortcutsItem', u':/system/system_configure_shortcuts.png') self.SettingsConfigureItem = icon_action(mainWindow, u'SettingsConfigureItem', u':/system/system_settings.png') @@ -458,7 +458,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): actionList = ActionList() - def __init__(self, screens, applicationVersion): + def __init__(self, screens, applicationVersion, clipboard): """ This constructor sets up the interface, the various managers, and the plugins. @@ -467,6 +467,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): self.screens = screens self.actionList = ActionList() self.applicationVersion = applicationVersion + self.clipboard = clipboard # Set up settings sections for the main application # (not for use by plugins) self.uiSettingsSection = u'user interface' diff --git a/openlp/core/ui/printserviceorderform.py b/openlp/core/ui/printserviceorderform.py index 70128cb89..cad654280 100644 --- a/openlp/core/ui/printserviceorderform.py +++ b/openlp/core/ui/printserviceorderform.py @@ -37,6 +37,7 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): Constructor """ QtGui.QDialog.__init__(self, parent) + self.parent = parent self.serviceManager = serviceManager self.printer = QtGui.QPrinter() self.printDialog = QtGui.QPrintDialog(self.printer, self) @@ -86,14 +87,14 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): for item in self.serviceManager.serviceItems: item = item[u'service_item'] # Add the title of the service item. - text += u'

%s

' % (item.icon, + text += u'

%s

' % (item.icon, item.get_display_title()) # Add slide text of the service item. if self.printSlideTextCheckBox.isChecked(): if item.is_text(): # Add the text of the service item. for slide in item.get_frames(): - text += u'

' + slide[u'text'] + u'

' + text += u'

' + slide[u'html'] + u'

' elif item.is_image(): # Add the image names of the service item. text += u'
    ' @@ -120,6 +121,7 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): u'Custom Service Notes:'), self.customNoteEdit.toPlainText()) self.document.setHtml(text) self.previewWidget.updatePreview() + self.parent.clipboard.setText(text) def paintRequested(self, printer): """ From 0920586e0d2847afd194ce053bdd8eccf729d1c9 Mon Sep 17 00:00:00 2001 From: rimach Date: Mon, 14 Feb 2011 21:06:32 +0100 Subject: [PATCH 131/243] use soffice for compatibility reasons --- openlp/core/utils/__init__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/openlp/core/utils/__init__.py b/openlp/core/utils/__init__.py index 37cbd7a63..dfef0372c 100644 --- a/openlp/core/utils/__init__.py +++ b/openlp/core/utils/__init__.py @@ -373,13 +373,13 @@ def get_uno_command(): """ Returns the UNO command to launch an openoffice.org instance. """ + COMMAND = u'soffice' + OPTIONS = u'-nologo -norestore -minimized -invisible -nofirststartwizard' if UNO_CONNECTION_TYPE == u'pipe': - return u'openoffice.org -nologo -norestore -minimized -invisible ' \ - + u'-nofirststartwizard -accept=pipe,name=openlp_pipe;urp;' + CONNECTION = u'"-accept=pipe,name=openlp_pipe;urp;"' else: - return u'openoffice.org -nologo -norestore -minimized ' \ - + u'-invisible -nofirststartwizard ' \ - + u'-accept=socket,host=localhost,port=2002;urp;' + CONNECTION = u'"-accept=socket,host=localhost,port=2002;urp;"' + return u'%s %s %s' % (COMMAND, OPTIONS, CONNECTION) def get_uno_instance(resolver): """ From d9a26ae4d92a37c7b096e18e29058c00d819c384 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 14 Feb 2011 20:32:19 +0000 Subject: [PATCH 132/243] Cleanups --- openlp/core/lib/mediamanageritem.py | 1 - openlp/core/lib/serviceitem.py | 1 - openlp/core/lib/theme.py | 4 +- openlp/core/ui/settingsdialog.py | 1 - openlp/core/ui/thememanager.py | 1 - openlp/plugins/songs/forms/songimportform.py | 6 +- .../songs/forms/songmaintenanceform.py | 4 +- openlp/plugins/songs/lib/importer.py | 2 +- .../plugins/songs/lib/songshowplusimport.py | 62 +++++++++---------- 9 files changed, 38 insertions(+), 44 deletions(-) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index f74ba63a9..d4fdfff17 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -252,7 +252,6 @@ class MediaManagerItem(QtGui.QWidget): self.pageLayout.addWidget(self.listView) # define and add the context menu self.listView.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu) - name_string = self.plugin.getString(StringContent.Name) if self.hasEditIcon: self.listView.addAction( context_menu_action( diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index 31852709a..f9d690ba2 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -436,7 +436,6 @@ class ServiceItem(object): """ Returns the start and finish time for a media item """ - tooltip = None start = None end = None if self.start_time != 0: diff --git a/openlp/core/lib/theme.py b/openlp/core/lib/theme.py index 4189452bc..225e1335c 100644 --- a/openlp/core/lib/theme.py +++ b/openlp/core/lib/theme.py @@ -178,9 +178,9 @@ class HorizontalType(object): """ Return a string representation of a horizontal type. """ - if horizontal_type == Horizontal.Right: + if horizontal_type == HorizontalType.Right: return u'right' - elif horizontal_type == Horizontal.Center: + elif horizontal_type == HorizontalType.Center: return u'center' else: return u'left' diff --git a/openlp/core/ui/settingsdialog.py b/openlp/core/ui/settingsdialog.py index 99acadc14..41b6baccb 100644 --- a/openlp/core/ui/settingsdialog.py +++ b/openlp/core/ui/settingsdialog.py @@ -36,7 +36,6 @@ class Ui_SettingsDialog(object): settingsDialog.setWindowIcon( build_icon(u':/system/system_settings.png')) self.settingsLayout = QtGui.QVBoxLayout(settingsDialog) - margins = self.settingsLayout.contentsMargins() self.settingsLayout.setObjectName(u'settingsLayout') self.settingsTabWidget = QtGui.QTabWidget(settingsDialog) self.settingsTabWidget.setObjectName(u'settingsTabWidget') diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 69028ad76..739de7182 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -314,7 +314,6 @@ class ThemeManager(QtGui.QWidget): translate('OpenLP.ThemeManager', 'You must select a theme to edit.')): item = self.themeListWidget.currentItem() - themeName = unicode(item.text()) theme = self.getThemeData( unicode(item.data(QtCore.Qt.UserRole).toString())) if theme.background_type == u'image': diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index 6e2a45b45..eda3d6750 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -480,7 +480,7 @@ class SongImportForm(OpenLPWizard): The file extension filters. It should contain the file descriptions as well as the file extensions. For example:: - u'SongBeamer files (*.sng)' + u'SongBeamer Files (*.sng)' """ if filters: filters += u';;' @@ -609,7 +609,7 @@ class SongImportForm(OpenLPWizard): 'Select Songs of Fellowship Files'), self.songsOfFellowshipFileListWidget, u'%s (*.rtf)' % translate('SongsPlugin.ImportWizardForm', - 'Songs Of Felloship Song Files') + 'Songs Of Fellowship Song Files') ) def onSongsOfFellowshipRemoveButtonClicked(self): @@ -659,7 +659,7 @@ class SongImportForm(OpenLPWizard): translate('SongsPlugin.ImportWizardForm', 'Select SongBeamer Files'), self.songBeamerFileListWidget, u'%s (*.sng)' % - translate('SongsPlugin.ImportWizardForm', 'SongBeamer files') + translate('SongsPlugin.ImportWizardForm', 'SongBeamer Files') ) def onSongBeamerRemoveButtonClicked(self): diff --git a/openlp/plugins/songs/forms/songmaintenanceform.py b/openlp/plugins/songs/forms/songmaintenanceform.py index 1eb63fbf4..1f693223c 100644 --- a/openlp/plugins/songs/forms/songmaintenanceform.py +++ b/openlp/plugins/songs/forms/songmaintenanceform.py @@ -457,7 +457,7 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): def onTopicDeleteButtonClick(self): """ - Delete the Book is the Book is not attached to any songs. + Delete the Book if the Book is not attached to any songs. """ self._deleteItem(Topic, self.topicsListWidget, self.resetTopics, translate('SongsPlugin.SongMaintenanceForm', 'Delete Topic'), @@ -470,7 +470,7 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): def onBookDeleteButtonClick(self): """ - Delete the Book is the Book is not attached to any songs. + Delete the Book if the Book is not attached to any songs. """ self._deleteItem(Book, self.booksListWidget, self.resetBooks, translate('SongsPlugin.SongMaintenanceForm', 'Delete Book'), diff --git a/openlp/plugins/songs/lib/importer.py b/openlp/plugins/songs/lib/importer.py index cbe5c6922..230dcd8d0 100644 --- a/openlp/plugins/songs/lib/importer.py +++ b/openlp/plugins/songs/lib/importer.py @@ -68,11 +68,11 @@ class SongFormat(object): CCLI = 5 SongsOfFellowship = 6 Generic = 7 - #CSV = 8 EasiSlides = 8 EasyWorship = 9 SongBeamer = 10 SongShowPlus = 11 + #CSV = 12 @staticmethod def get_class(format): diff --git a/openlp/plugins/songs/lib/songshowplusimport.py b/openlp/plugins/songs/lib/songshowplusimport.py index 78c2e838d..5df36a5b1 100644 --- a/openlp/plugins/songs/lib/songshowplusimport.py +++ b/openlp/plugins/songs/lib/songshowplusimport.py @@ -42,7 +42,7 @@ CHORUS = 20 TOPIC = 29 COMMENTS = 30 VERSE_ORDER = 31 -SONG_BOOK = 35 +SONG_BOOK = 35 SONG_NUMBER = 36 CUSTOM_VERSE = 37 @@ -50,32 +50,32 @@ log = logging.getLogger(__name__) class SongShowPlusImport(SongImport): """ - The :class:`SongShowPlusImport` class provides the ability to import song + The :class:`SongShowPlusImport` class provides the ability to import song files from SongShow Plus. **SongShow Plus Song File Format:** The SongShow Plus song file format is as follows: - - * Each piece of data in the song file has some information that precedes + + * Each piece of data in the song file has some information that precedes it. * The general format of this data is as follows: - 4 Bytes, forming a 32 bit number, a key if you will, this describes what + 4 Bytes, forming a 32 bit number, a key if you will, this describes what the data is (see blockKey below) - 4 Bytes, forming a 32 bit number, which is the number of bytes until the + 4 Bytes, forming a 32 bit number, which is the number of bytes until the next block starts 1 Byte, which tells how namy bytes follows - 1 or 4 Bytes, describes how long the string is, if its 1 byte, the string + 1 or 4 Bytes, describes how long the string is, if its 1 byte, the string is less than 255 The next bytes are the actuall data. The next block of data follows on. - - This description does differ for verses. Which includes extra bytes - stating the verse type or number. In some cases a "custom" verse is used, - in that case, this block will in include 2 strings, with the associated - string length descriptors. The first string is the name of the verse, the + + This description does differ for verses. Which includes extra bytes + stating the verse type or number. In some cases a "custom" verse is used, + in that case, this block will in include 2 strings, with the associated + string length descriptors. The first string is the name of the verse, the second is the verse content. - + The file is ended with four null bytes. Valid extensions for a SongShow Plus song file are: @@ -98,7 +98,7 @@ class SongShowPlusImport(SongImport): if kwargs.has_key(u'filenames'): self.import_source = kwargs[u'filenames'] log.debug(self.import_source) - + def do_import(self): """ Receive a single file or a list of files to import. @@ -107,38 +107,36 @@ class SongShowPlusImport(SongImport): self.import_wizard.progressBar.setMaximum(len(self.import_source)) for file in self.import_source: author = u'' - copyright = u'' self.sspVerseOrderList = [] otherCount = 0 otherList = {} file_name = os.path.split(file)[1] self.import_wizard.incrementProgressBar( - u'Importing %s' % (file_name), 0) + u'Importing %s' % (file_name), 0) songData = open(file, 'rb') while (1): - blockKey, = struct.unpack("I",songData.read(4)) + blockKey, = struct.unpack("I", songData.read(4)) # The file ends with 4 NUL's if blockKey == 0: break - nextBlockStarts, = struct.unpack("I",songData.read(4)) + nextBlockStarts, = struct.unpack("I", songData.read(4)) if blockKey == VERSE or blockKey == CHORUS: - null, verseNo, = struct.unpack("BB",songData.read(2)) + null, verseNo, = struct.unpack("BB", songData.read(2)) elif blockKey == CUSTOM_VERSE: - null, verseNameLength, = struct.unpack("BB", + null, verseNameLength, = struct.unpack("BB", songData.read(2)) verseName = songData.read(verseNameLength) - lengthDescriptorSize, = struct.unpack("B",songData.read(1)) + lengthDescriptorSize, = struct.unpack("B", songData.read(1)) # Detect if/how long the length descriptor is if lengthDescriptorSize == 12: - lengthDescriptor, = struct.unpack("I",songData.read(4)) + lengthDescriptor, = struct.unpack("I", songData.read(4)) elif lengthDescriptorSize == 2: lengthDescriptor = 1 elif lengthDescriptorSize == 9: lengthDescriptor = 0 - else: - lengthDescriptor, = struct.unpack("B",songData.read(1)) + else: + lengthDescriptor, = struct.unpack("B", songData.read(1)) data = songData.read(lengthDescriptor) - if blockKey == TITLE: self.title = unicode(data, u'cp1252') elif blockKey == AUTHOR: @@ -146,17 +144,17 @@ class SongShowPlusImport(SongImport): for author in authors: if author.find(",") !=-1: authorParts = author.split(", ") - author = authorParts[1] + " " + authorParts[0] - self.parse_author(unicode(author, u'cp1252')) + author = authorParts[1] + " " + authorParts[0] + self.parse_author(unicode(author, u'cp1252')) elif blockKey == COPYRIGHT: self.add_copyright(unicode(data, u'cp1252')) elif blockKey == CCLI_NO: self.ccli_number = int(data) elif blockKey == VERSE: - self.add_verse(unicode(data, u'cp1252'), + self.add_verse(unicode(data, u'cp1252'), "V%s" % verseNo) elif blockKey == CHORUS: - self.add_verse(unicode(data, u'cp1252'), + self.add_verse(unicode(data, u'cp1252'), "C%s" % verseNo) elif blockKey == TOPIC: self.topics.append(unicode(data, u'cp1252')) @@ -182,9 +180,9 @@ class SongShowPlusImport(SongImport): self.import_wizard.incrementProgressBar( u'Importing %s' % (file_name)) return True - + def toOpenLPVerseTag(self, verseName): - if verseName.find(" ")!=-1: + if verseName.find(" ") !=-1: verseParts = verseName.split(" ") verseType = verseParts[0] verseNumber = verseParts[1] @@ -203,7 +201,7 @@ class SongShowPlusImport(SongImport): elif verseType == "bridge": verseTag = "B" else: - if not self.otherList.has_key(verseName): + if not self.otherList.has_key(verseName): self.otherCount = self.otherCount + 1 self.otherList[verseName] = str(self.otherCount) verseTag = "O" From 5fa9ace1ce636a837f88784e995e8c3567f83d97 Mon Sep 17 00:00:00 2001 From: rimach Date: Mon, 14 Feb 2011 22:06:48 +0100 Subject: [PATCH 133/243] at output for alternate shortcut --- openlp/core/ui/shortcutlistdialog.py | 5 +++-- openlp/core/ui/shortcutlistform.py | 9 +++++++-- openlp/core/ui/slidecontroller.py | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/openlp/core/ui/shortcutlistdialog.py b/openlp/core/ui/shortcutlistdialog.py index 3f41d377a..4e20671c5 100644 --- a/openlp/core/ui/shortcutlistdialog.py +++ b/openlp/core/ui/shortcutlistdialog.py @@ -36,7 +36,7 @@ class Ui_ShortcutListDialog(object): self.treeWidget = QtGui.QTreeWidget(shortcutListDialog) self.treeWidget.setAlternatingRowColors(True) self.treeWidget.setObjectName(u'treeWidget') - self.treeWidget.setColumnCount(2) + self.treeWidget.setColumnCount(3) self.dialogLayout.addWidget(self.treeWidget) self.defaultButton = QtGui.QRadioButton(shortcutListDialog) self.defaultButton.setChecked(True) @@ -78,7 +78,8 @@ class Ui_ShortcutListDialog(object): translate('OpenLP.ShortcutListDialog', 'Customize Shortcuts')) self.treeWidget.setHeaderLabels([ translate('OpenLP.ShortcutListDialog', 'Action'), - translate('OpenLP.ShortcutListDialog', 'Shortcut')]) + translate('OpenLP.ShortcutListDialog', 'Shortcut'), + translate('OpenLP.ShortcutListDialog', 'Alternate')]) self.defaultButton.setText( translate('OpenLP.ShortcutListDialog', 'Default: %s')) self.customButton.setText( diff --git a/openlp/core/ui/shortcutlistform.py b/openlp/core/ui/shortcutlistform.py index 9d2b31853..0de4bea7f 100644 --- a/openlp/core/ui/shortcutlistform.py +++ b/openlp/core/ui/shortcutlistform.py @@ -95,8 +95,13 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog): item = QtGui.QTreeWidgetItem([category.name]) for action in category.actions: actionText = REMOVE_AMPERSAND.sub('', unicode(action.text())) - shortcutText = action.shortcut().toString() - actionItem = QtGui.QTreeWidgetItem([actionText, shortcutText]) + if (len(action.shortcuts()) == 2): + shortcutText = action.shortcuts()[0].toString() + alternateText = action.shortcuts()[1].toString() + else: + shortcutText = action.shortcut().toString() + alternateText = u'' + actionItem = QtGui.QTreeWidgetItem([actionText, shortcutText, alternateText]) actionItem.setIcon(0, action.icon()) item.addChild(actionItem) item.setExpanded(True) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 52626f24f..073263616 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -380,7 +380,7 @@ class SlideController(QtGui.QWidget): self.previousItem.setShortcuts([QtCore.Qt.Key_Up, QtCore.Qt.Key_PageUp]) self.previousItem.setShortcutContext( QtCore.Qt.WidgetWithChildrenShortcut) - actionList.add_action(self.nextItem, u'Live') + actionList.add_action(self.previousItem, u'Live') self.nextItem.setShortcuts([QtCore.Qt.Key_Down, QtCore.Qt.Key_PageDown]) self.nextItem.setShortcutContext(QtCore.Qt.WidgetWithChildrenShortcut) actionList.add_action(self.nextItem, u'Live') From 847dfdaafc685d5592443d00d1273292485b3152 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 14 Feb 2011 21:07:05 +0000 Subject: [PATCH 134/243] Unused imports --- openlp/core/ui/printserviceorderform.py | 1 - openlp/plugins/bibles/bibleplugin.py | 1 - openlp/plugins/custom/customplugin.py | 1 - 3 files changed, 3 deletions(-) diff --git a/openlp/core/ui/printserviceorderform.py b/openlp/core/ui/printserviceorderform.py index 70128cb89..b5160e61c 100644 --- a/openlp/core/ui/printserviceorderform.py +++ b/openlp/core/ui/printserviceorderform.py @@ -24,7 +24,6 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### import datetime -import os from PyQt4 import QtCore, QtGui diff --git a/openlp/plugins/bibles/bibleplugin.py b/openlp/plugins/bibles/bibleplugin.py index de0ea11f1..b992552f1 100644 --- a/openlp/plugins/bibles/bibleplugin.py +++ b/openlp/plugins/bibles/bibleplugin.py @@ -29,7 +29,6 @@ import logging from PyQt4 import QtCore, QtGui from openlp.core.lib import Plugin, StringContent, build_icon, translate -from openlp.core.lib.ui import UiStrings from openlp.plugins.bibles.lib import BibleManager, BiblesTab, BibleMediaItem log = logging.getLogger(__name__) diff --git a/openlp/plugins/custom/customplugin.py b/openlp/plugins/custom/customplugin.py index 5a32d4657..65245fc8a 100644 --- a/openlp/plugins/custom/customplugin.py +++ b/openlp/plugins/custom/customplugin.py @@ -30,7 +30,6 @@ from forms import EditCustomForm from openlp.core.lib import Plugin, StringContent, build_icon, translate from openlp.core.lib.db import Manager -from openlp.core.lib.ui import UiStrings from openlp.plugins.custom.lib import CustomMediaItem, CustomTab from openlp.plugins.custom.lib.db import CustomSlide, init_schema From cc96d96a6a0d8b19fa6d77deb833bad97dd6808c Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Tue, 15 Feb 2011 01:58:18 +0000 Subject: [PATCH 135/243] Fix song overwriting --- openlp/plugins/songs/forms/editsongform.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 8536d38b8..39f1ba256 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -161,6 +161,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): def newSong(self): log.debug(u'New Song') + self.song = None self.initialise() self.songTabWidget.setCurrentIndex(0) self.titleEdit.setText(u'') From a0aba0a715a95d4bd36953d9b35a05f112b24d4e Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Tue, 15 Feb 2011 14:17:35 +0000 Subject: [PATCH 136/243] Remove grammar breaking strings --- openlp/core/ui/wizard.py | 11 +---------- openlp/plugins/songs/lib/ui.py | 11 ----------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/openlp/core/ui/wizard.py b/openlp/core/ui/wizard.py index c72d6a084..b3b4f9233 100644 --- a/openlp/core/ui/wizard.py +++ b/openlp/core/ui/wizard.py @@ -47,7 +47,6 @@ class WizardStrings(object): CSV = u'CSV' EW = u'EasyWorship' ES = u'EasiSlides' - GDP = translate('OpenLP.Ui', 'Generic Document or Presentation') OL = u'OpenLyrics' OS = u'OpenSong' OSIS = u'OSIS' @@ -56,14 +55,9 @@ class WizardStrings(object): SSP = u'SongShow Plus' WoW = u'Words of Worship' # These strings should need a good reason to be retranslated elsewhere. - Description = unicode(translate('OpenLP.Ui', 'This wizard will help you ' - 'to %s %s from a variety of formats. Click the next button ' - 'below to start the process by selecting a format to %s from.', - 'Variable 1 & 3 are import/export. Variable 2 is a type like Bibles')) - FinishedType = unicode(translate('OpenLP.Ui', 'Finished %s.')) FormatLabel = translate('OpenLP.Ui', 'Format:') Importing = translate('OpenLP.Ui', 'Importing') - ImportingType = unicode(translate('OpenLP.Ui', 'Importing %s...')) + ImportingType = unicode(translate('OpenLP.Ui', 'Importing "%s"...')) ImportSelect = translate('OpenLP.Ui', 'Select Import Source') ImportSelectLong = unicode(translate('OpenLP.Ui', 'Select the import format and the location to import from.')) @@ -74,9 +68,6 @@ class WizardStrings(object): OpenTypeFile = unicode(translate('OpenLP.Ui', 'Open %s File')) Ready = translate('OpenLP.Ui', 'Ready.') StartingImport = translate('OpenLP.Ui', 'Starting import...') - Welcome = u'%s' % \ - translate('OpenLP.Ui', 'Welcome to the %s %s Wizard', - 'Variable 1 is the type e.g. Bible and variable 2 is import/export') YouSpecifyFile = unicode(translate('OpenLP.Ui', 'You need to specify at ' 'least one %s file to import from.', 'A file type e.g. OpenSong')) diff --git a/openlp/plugins/songs/lib/ui.py b/openlp/plugins/songs/lib/ui.py index beab16dd0..85d609762 100644 --- a/openlp/plugins/songs/lib/ui.py +++ b/openlp/plugins/songs/lib/ui.py @@ -38,18 +38,7 @@ class SongStrings(object): Authors = translate('OpenLP.Ui', 'Authors', 'Plural') AuthorUnknown = translate('OpenLP.Ui', 'Author Unknown') # Used in the UI. AuthorUnknownUnT = u'Author Unknown' # Used to populate the database. - CouldNotAdd = unicode(translate('OpenLP.Ui', 'Could not add your %s.')) - NoDeleteAssigned = unicode(translate('OpenLP.Ui', 'This %s cannot be ' - 'deleted as it is currently assigned to at least one song.')) SongBook = translate('OpenLP.Ui', 'Song Book', 'Singular') SongBooks = translate('OpenLP.Ui', 'Song Books', 'Plural') - SureDeleteType = unicode(translate('OpenLP.Ui', - 'Are you sure you want to delete the selected %s?')) - ThisTypeExists = unicode(translate('OpenLP.Ui', 'This %s already exists.')) Topic = translate('OpenLP.Ui', 'Topic', 'Singular') Topics = translate('OpenLP.Ui', 'Topics', 'Plural') - TypeInList = unicode(translate('OpenLP.Ui', - 'This %s is already in the list.')) - TypeMaintenance = unicode(translate('OpenLP.Ui', '%s Maintenance')) - TypeNotExistAdd = unicode(translate('OpenLP.Ui', - 'This %s does not exist, do you want to add it?')) From 32272d659948b12669e3a36b368911ed01267ef6 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Tue, 15 Feb 2011 20:36:52 +0200 Subject: [PATCH 137/243] Amalgamated OpenLP theme filters into one. --- openlp/core/ui/thememanager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 739de7182..4ec11c831 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -405,8 +405,8 @@ class ThemeManager(QtGui.QWidget): files = QtGui.QFileDialog.getOpenFileNames(self, translate('OpenLP.ThemeManager', 'Select Theme Import File'), SettingsManager.get_last_dir(self.settingsSection), - unicode(translate('OpenLP.ThemeManager', 'Theme v1 (*.theme);;' - 'Theme v2 (*.otz);;%s (*.*)')) % UiStrings.AllFiles) + unicode(translate('OpenLP.ThemeManager', + 'OpenLP Themes (*.theme *.otz);;%s (*.*)')) % UiStrings.AllFiles) log.info(u'New Themes %s', unicode(files)) if files: for file in files: From f980d1e0b9503e00f579d6b636ca49be83ca071f Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Tue, 15 Feb 2011 18:51:37 +0000 Subject: [PATCH 138/243] Finish Print dialog updates --- openlp/core/lib/ui.py | 2 ++ openlp/core/ui/printserviceorderdialog.py | 19 ++++++++--- openlp/core/ui/printserviceorderform.py | 41 +++++++++++++++++++++-- 3 files changed, 56 insertions(+), 6 deletions(-) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 400381b0c..224145a99 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -48,6 +48,8 @@ class UiStrings(object): AllFiles = translate('OpenLP.Ui', 'All Files') Authors = translate('OpenLP.Ui', 'Authors') CreateANew = unicode(translate('OpenLP.Ui', 'Create a new %s.')) + CopyToHtml = translate('OpenLP.Ui', 'Copy to Html') + CopyToText = translate('OpenLP.Ui', 'Copy to Text') Delete = translate('OpenLP.Ui', '&Delete') DeleteSelect = unicode(translate('OpenLP.Ui', 'Delete the selected %s.')) DeleteType = unicode(translate('OpenLP.Ui', 'Delete %s')) diff --git a/openlp/core/ui/printserviceorderdialog.py b/openlp/core/ui/printserviceorderdialog.py index f8db4d1c0..c464a7814 100644 --- a/openlp/core/ui/printserviceorderdialog.py +++ b/openlp/core/ui/printserviceorderdialog.py @@ -27,6 +27,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import build_icon, translate, SpellTextEdit +from openlp.core.lib.ui import UiStrings class Ui_PrintServiceOrderDialog(object): def setupUi(self, printServiceOrderDialog): @@ -75,6 +76,9 @@ class Ui_PrintServiceOrderDialog(object): self.printMetaDataCheckBox = QtGui.QCheckBox(printServiceOrderDialog) self.printMetaDataCheckBox.setObjectName(u'printMetaDataCheckBox') self.settingsLayout.addWidget(self.printMetaDataCheckBox) + self.copyMetaDataCheckBox = QtGui.QCheckBox(printServiceOrderDialog) + self.copyMetaDataCheckBox.setObjectName(u'copyMetaDataCheckBox') + self.settingsLayout.addWidget(self.copyMetaDataCheckBox) spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.settingsLayout.addItem(spacerItem) @@ -90,12 +94,15 @@ class Ui_PrintServiceOrderDialog(object): spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.buttonLayout.addItem(spacerItem) - self.cancelButton = QtGui.QPushButton(printServiceOrderDialog) - self.cancelButton.setObjectName(u'cancelButton') - self.buttonLayout.addWidget(self.cancelButton) + self.copyTextButton = QtGui.QPushButton(printServiceOrderDialog) + self.copyTextButton.setObjectName(u'copyTextButton') + self.buttonLayout.addWidget(self.copyTextButton) self.printButton = QtGui.QPushButton(printServiceOrderDialog) self.printButton.setObjectName(u'printButton') self.buttonLayout.addWidget(self.printButton) + self.cancelButton = QtGui.QPushButton(printServiceOrderDialog) + self.cancelButton.setObjectName(u'cancelButton') + self.buttonLayout.addWidget(self.cancelButton) self.dialogLayout.addLayout(self.buttonLayout, 1, 3, 1, 1) self.zoomButtonLayout = QtGui.QHBoxLayout() self.zoomButtonLayout.setObjectName(u'zoomButtonLayout') @@ -119,7 +126,7 @@ class Ui_PrintServiceOrderDialog(object): printServiceOrderDialog.setWindowTitle( translate('OpenLP.PrintServiceOrderForm', 'Print Service Order')) self.previewLabel.setText( - translate('OpenLP.ServiceManager', 'Preview:')) + translate('OpenLP.PrintServiceOrderForm', 'Preview:')) self.printSlideTextCheckBox.setText(translate( 'OpenLP.PrintServiceOrderForm', 'Include slide text if available')) self.printNotesCheckBox.setText(translate( @@ -127,10 +134,14 @@ class Ui_PrintServiceOrderDialog(object): self.printMetaDataCheckBox.setText( translate('OpenLP.PrintServiceOrderForm', 'Include play length of media items')) + self.copyMetaDataCheckBox.setText( + translate('OpenLP.PrintServiceOrderForm', + 'Copy output as HTML')) self.serviceTitleLabel.setText(translate( 'OpenLP.PrintServiceOrderForm', 'Title:')) self.serviceTitleLineEdit.setText(translate('OpenLP.ServiceManager', 'Service Order Sheet')) + self.copyTextButton.setText(UiStrings.CopyToText) self.printButton.setText(translate('OpenLP.ServiceManager', 'Print')) self.cancelButton.setText(translate('OpenLP.ServiceManager', 'Cancel')) self.customNotesLabel.setText( diff --git a/openlp/core/ui/printserviceorderform.py b/openlp/core/ui/printserviceorderform.py index cad654280..78ff34e1c 100644 --- a/openlp/core/ui/printserviceorderform.py +++ b/openlp/core/ui/printserviceorderform.py @@ -29,9 +29,11 @@ import os from PyQt4 import QtCore, QtGui from openlp.core.lib import translate +from openlp.core.lib.ui import UiStrings from openlp.core.ui.printserviceorderdialog import Ui_PrintServiceOrderDialog class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): + def __init__(self, parent, serviceManager): """ Constructor @@ -52,6 +54,10 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): u'print file meta data', QtCore.QVariant(False)).toBool()) self.printNotesCheckBox.setChecked(settings.value( u'print notes', QtCore.QVariant(False)).toBool()) + self.copyMetaDataCheckBox.setChecked(settings.value( + u'html copy', QtCore.QVariant(False)).toBool()) + if self.copyMetaDataCheckBox.isChecked(): + self.copyTextButton.setText(UiStrings.CopyToHtml) settings.endGroup() # Signals QtCore.QObject.connect(self.printButton, @@ -75,6 +81,10 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): QtCore.SIGNAL(u'textChanged()'), self.updatePreviewText) QtCore.QObject.connect(self.cancelButton, QtCore.SIGNAL(u'clicked()'), self.reject) + QtCore.QObject.connect(self.copyTextButton, + QtCore.SIGNAL(u'clicked()'), self.copyText) + QtCore.QObject.connect(self.copyMetaDataCheckBox, + QtCore.SIGNAL(u'stateChanged(int)'), self.updateTextFormat) self.updatePreviewText() def updatePreviewText(self): @@ -93,8 +103,17 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): if self.printSlideTextCheckBox.isChecked(): if item.is_text(): # Add the text of the service item. + verse = None for slide in item.get_frames(): - text += u'

    ' + slide[u'html'] + u'

    ' + if not verse: + text += u'

    ' + slide[u'html'] + verse = slide[u'verseTag'] + elif verse != slide[u'verseTag']: + text += u'<\p>

    ' + slide[u'html'] + verse = slide[u'verseTag'] + else: + text += u'
    ' + slide[u'html'] + text += u'

    ' elif item.is_image(): # Add the image names of the service item. text += u'
      ' @@ -121,7 +140,6 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): u'Custom Service Notes:'), self.customNoteEdit.toPlainText()) self.document.setHtml(text) self.previewWidget.updatePreview() - self.parent.clipboard.setText(text) def paintRequested(self, printer): """ @@ -132,6 +150,13 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): """ self.document.print_(printer) + def copyText(self): + if self.copyMetaDataCheckBox.isChecked(): + self.parent.clipboard.setText(self.document.toHtml()) + else: + self.parent.clipboard.setText(self.document.toPlainText()) + self.accept() + def printServiceOrder(self): """ Called, when the *printButton* is clicked. Opens the *printDialog*. @@ -154,6 +179,16 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): """ self.previewWidget.zoomOut() + def updateTextFormat(self, value): + """ + Called when html copy check box is selected. + """ + if value == QtCore.Qt.Checked: + self.copyTextButton.setText(UiStrings.CopyToHtml) + else: + self.copyTextButton.setText(UiStrings.CopyToText) + + def accept(self): """ Save the settings and close the dialog. @@ -167,6 +202,8 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): QtCore.QVariant(self.printMetaDataCheckBox.isChecked())) settings.setValue(u'print notes', QtCore.QVariant(self.printNotesCheckBox.isChecked())) + settings.setValue(u'html copy', + QtCore.QVariant(self.copyMetaDataCheckBox.isChecked())) settings.endGroup() # Close the dialog. return QtGui.QDialog.accept(self) From 6028e0633339ed4577593c7de7452af52dbb2514 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Tue, 15 Feb 2011 20:56:40 +0200 Subject: [PATCH 139/243] filesystem encoding fix for non-ascii home dir --- openlp/core/utils/__init__.py | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/openlp/core/utils/__init__.py b/openlp/core/utils/__init__.py index 9db744460..69e1288d8 100644 --- a/openlp/core/utils/__init__.py +++ b/openlp/core/utils/__init__.py @@ -164,27 +164,34 @@ def _get_os_dir_path(dir_type): """ Return a path based on which OS and environment we are running in. """ + encoding = sys.getfilesystemencoding() if sys.platform == u'win32': if dir_type == AppLocation.DataDir: - return os.path.join(os.getenv(u'APPDATA'), u'openlp', u'data') - return os.path.join(os.getenv(u'APPDATA'), u'openlp') + return os.path.join(unicode(os.getenv(u'APPDATA'), encoding), + u'openlp', u'data') + return os.path.join(unicode(os.getenv(u'APPDATA'), encoding), + u'openlp') elif sys.platform == u'darwin': if dir_type == AppLocation.DataDir: - return os.path.join(os.getenv(u'HOME'), u'Library', - u'Application Support', u'openlp', u'Data') - return os.path.join(os.getenv(u'HOME'), u'Library', - u'Application Support', u'openlp') + return os.path.join(unicode(os.getenv(u'HOME'), encoding), + u'Library', u'Application Support', u'openlp', u'Data') + return os.path.join(unicode(os.getenv(u'HOME'), encoding), + u'Library', u'Application Support', u'openlp') else: if XDG_BASE_AVAILABLE: if dir_type == AppLocation.ConfigDir: - return os.path.join(BaseDirectory.xdg_config_home, u'openlp') + return os.path.join(unicode(BaseDirectory.xdg_config_home, + encoding), u'openlp') elif dir_type == AppLocation.DataDir: - return os.path.join(BaseDirectory.xdg_data_home, u'openlp') + return os.path.join( + unicode(BaseDirectory.xdg_data_home, encoding), u'openlp') elif dir_type == AppLocation.CacheDir: - return os.path.join(BaseDirectory.xdg_cache_home, u'openlp') + return os.path.join(unicode(BaseDirectory.xdg_cache_home, + encoding), u'openlp') if dir_type == AppLocation.DataDir: - return os.path.join(os.getenv(u'HOME'), u'.openlp', u'data') - return os.path.join(os.getenv(u'HOME'), u'.openlp') + return os.path.join(unicode(os.getenv(u'HOME'), encoding), + u'.openlp', u'data') + return os.path.join(unicode(os.getenv(u'HOME'), encoding), u'.openlp') def _get_frozen_path(frozen_option, non_frozen_option): """ From 8ca735fe8e27174c7c185a8daa193604c4833104 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Tue, 15 Feb 2011 21:09:07 +0200 Subject: [PATCH 140/243] Removed "All Files" as per request. --- openlp/core/ui/thememanager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 4ec11c831..015e48f23 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -406,7 +406,7 @@ class ThemeManager(QtGui.QWidget): translate('OpenLP.ThemeManager', 'Select Theme Import File'), SettingsManager.get_last_dir(self.settingsSection), unicode(translate('OpenLP.ThemeManager', - 'OpenLP Themes (*.theme *.otz);;%s (*.*)')) % UiStrings.AllFiles) + 'OpenLP Themes (*.theme *.otz)'))) log.info(u'New Themes %s', unicode(files)) if files: for file in files: From 33a77b72f784a0d9d62a580beff6aaa9ff72a2f9 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Tue, 15 Feb 2011 19:26:43 +0000 Subject: [PATCH 141/243] Fixes --- openlp/core/lib/ui.py | 2 +- openlp/core/ui/printserviceorderform.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 8a1bf828f..27c510eb2 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -44,7 +44,7 @@ class UiStrings(object): Advanced = translate('OpenLP.Ui', 'Advanced') AllFiles = translate('OpenLP.Ui', 'All Files') Authors = translate('OpenLP.Ui', 'Authors') - CopyToHtml = translate('OpenLP.Ui', 'Copy to Html') + CopyToHtml = translate('OpenLP.Ui', 'Copy to HTML') CopyToText = translate('OpenLP.Ui', 'Copy to Text') CreateService = translate('OpenLP.Ui', 'Create a new service.') Delete = translate('OpenLP.Ui', '&Delete') diff --git a/openlp/core/ui/printserviceorderform.py b/openlp/core/ui/printserviceorderform.py index 0fca2c297..cfd0f7a52 100644 --- a/openlp/core/ui/printserviceorderform.py +++ b/openlp/core/ui/printserviceorderform.py @@ -187,7 +187,6 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): else: self.copyTextButton.setText(UiStrings.CopyToText) - def accept(self): """ Save the settings and close the dialog. From ed3d67c1f1f942a9a7b4456fe0d154e753e54b7e Mon Sep 17 00:00:00 2001 From: rimach Date: Tue, 15 Feb 2011 20:37:16 +0100 Subject: [PATCH 142/243] correction for Powerpoint and PptViewer --- openlp/core/utils/__init__.py | 4 ++-- openlp/plugins/presentations/lib/powerpointcontroller.py | 6 ++++-- openlp/plugins/presentations/lib/pptviewcontroller.py | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/openlp/core/utils/__init__.py b/openlp/core/utils/__init__.py index 9b868c6cd..bbedaaf6b 100644 --- a/openlp/core/utils/__init__.py +++ b/openlp/core/utils/__init__.py @@ -378,9 +378,9 @@ def get_uno_command(): COMMAND = u'soffice' OPTIONS = u'-nologo -norestore -minimized -invisible -nofirststartwizard' if UNO_CONNECTION_TYPE == u'pipe': - CONNECTION = u'"-accept=pipe,name=openlp_pipe;urp;"' + CONNECTION = u'"-accept=pipe,name=openlp_pipe;urp;"' else: - CONNECTION = u'"-accept=socket,host=localhost,port=2002;urp;"' + CONNECTION = u'"-accept=socket,host=localhost,port=2002;urp;"' return u'%s %s %s' % (COMMAND, OPTIONS, CONNECTION) def get_uno_instance(resolver): diff --git a/openlp/plugins/presentations/lib/powerpointcontroller.py b/openlp/plugins/presentations/lib/powerpointcontroller.py index 65e9f35ff..eb00da255 100644 --- a/openlp/plugins/presentations/lib/powerpointcontroller.py +++ b/openlp/plugins/presentations/lib/powerpointcontroller.py @@ -147,8 +147,10 @@ class PowerpointDocument(PresentationDocument): """ if self.check_thumbnails(): return - self.presentation.Export(os.path.join(self.get_thumbnail_folder(), ''), - 'png', 320, 240) + for num in range(0, self.presentation.Slides.Count): + self.presentation.Slides(num + 1).Export(os.path.join( + self.get_thumbnail_folder(), 'slide%d.png' % (num + 1)), + 'png', 320, 240) def close_presentation(self): """ diff --git a/openlp/plugins/presentations/lib/pptviewcontroller.py b/openlp/plugins/presentations/lib/pptviewcontroller.py index a64cd31dd..fc839195c 100644 --- a/openlp/plugins/presentations/lib/pptviewcontroller.py +++ b/openlp/plugins/presentations/lib/pptviewcontroller.py @@ -154,8 +154,9 @@ class PptviewDocument(PresentationDocument): being shut down """ log.debug(u'ClosePresentation') - self.controller.process.ClosePPT(self.pptid) - self.pptid = -1 + if self.controller.process: + self.controller.process.ClosePPT(self.pptid) + self.pptid = -1 self.controller.remove_doc(self) def is_loaded(self): From f27e6755cc9e040852f41e8f9354e1e3f415af81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Tue, 15 Feb 2011 23:19:45 +0200 Subject: [PATCH 143/243] easislides import to work again --- openlp/plugins/songs/lib/easislidesimport.py | 43 +++++++------------- 1 file changed, 15 insertions(+), 28 deletions(-) diff --git a/openlp/plugins/songs/lib/easislidesimport.py b/openlp/plugins/songs/lib/easislidesimport.py index 5d56af8ce..b31e50862 100644 --- a/openlp/plugins/songs/lib/easislidesimport.py +++ b/openlp/plugins/songs/lib/easislidesimport.py @@ -81,14 +81,16 @@ class EasiSlidesImport(SongImport): def _parse_song(self, song): self._success = True - self._add_unicode_attribute(self.title, song.Title1, True) - self._add_unicode_attribute(self.alternate_title, song.Title2) - self._add_unicode_attribute(self.song_number, song.SongNumber) + self._add_unicode_attribute(u'title', song.Title1, True) + self._add_unicode_attribute(u'alternate_title', song.Title2) + self._add_unicode_attribute(u'song_number', song.SongNumber) if self.song_number == u'0': self.song_number = u'' self._add_authors(song) - self._add_copyright(song) - self._add_unicode_attribute(self.song_book_name, song.BookReference) + self._add_copyright(song.Copyright) + self._add_copyright(song.LicenceAdmin1) + self._add_copyright(song.LicenceAdmin2) + self._add_unicode_attribute(u'song_book_name', song.BookReference) self._parse_and_add_lyrics(song) return self._success @@ -110,7 +112,7 @@ class EasiSlidesImport(SongImport): Signals that this attribute must exist in a valid song. """ try: - self_attribute = unicode(import_attribute).strip() + setattr(self, self_attribute, unicode(import_attribute).strip()) except UnicodeDecodeError: log.exception(u'UnicodeDecodeError decoding %s' % import_attribute) self._success = False @@ -124,7 +126,7 @@ class EasiSlidesImport(SongImport): authors = unicode(song.Writer).split(u',') for author in authors: author = author.strip() - if len(author) > 0: + if len(author): self.authors.append(author) except UnicodeDecodeError: log.exception(u'Unicode decode error while decoding Writer') @@ -132,35 +134,18 @@ class EasiSlidesImport(SongImport): except AttributeError: pass - def _add_copyright(self, song): - """ - Assign the copyright information from the import to the song being - created. - - ``song`` - The current song being imported. - """ - copyright_list = [] - self.__add_copyright_element(copyright_list, song.Copyright) - self.__add_copyright_element(copyright_list, song.LicenceAdmin1) - self.__add_copyright_element(copyright_list, song.LicenceAdmin2) - self.add_copyright(u' '.join(copyright_list)) - - def __add_copyright_element(self, copyright_list, element): + def _add_copyright(self, element): """ Add a piece of copyright to the total copyright information for the song. - ``copyright_list`` - The array to add the information to. - ``element`` The imported variable to get the data from. """ try: - copyright_list.append(unicode(element).strip()) + self.add_copyright(unicode(element).strip()) except UnicodeDecodeError: - log.exception(u'Unicode error decoding %s' % element) + log.exception(u'Unicode error on decoding copyright: %s' % element) self._success = False except AttributeError: pass @@ -285,10 +270,12 @@ class EasiSlidesImport(SongImport): # as these appeared originally in the file for [reg, vt, vn, inst] in our_verse_order: if self._listHas(verses, [reg, vt, vn, inst]): + # this is false, but needs user input + lang = None versetag = u'%s%s' % (vt, vn) versetags.append(versetag) lines = u'\n'.join(verses[reg][vt][vn][inst]) - self.verses.append([versetag, lines]) + self.verses.append([versetag, lines, lang]) SeqTypes = { u'p': u'P1', From a8d2d3661db5abac51da47d35852083967b62c57 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Wed, 16 Feb 2011 03:06:34 +0000 Subject: [PATCH 144/243] Sort grammar breakers --- openlp/core/lib/plugin.py | 2 +- openlp/core/lib/ui.py | 5 +- openlp/core/ui/mainwindow.py | 30 +++++----- openlp/core/ui/themeform.py | 2 +- openlp/core/ui/thememanager.py | 6 +- openlp/core/ui/wizard.py | 10 +--- openlp/plugins/alerts/forms/alertform.py | 3 +- .../plugins/bibles/forms/bibleimportform.py | 15 +++-- openlp/plugins/images/lib/mediaitem.py | 5 +- openlp/plugins/media/lib/mediaitem.py | 5 +- openlp/plugins/songs/forms/authorsdialog.py | 3 +- openlp/plugins/songs/forms/editsongform.py | 24 ++++---- openlp/plugins/songs/forms/songbookdialog.py | 3 +- openlp/plugins/songs/forms/songexportform.py | 5 +- openlp/plugins/songs/forms/songimportform.py | 36 +++++++----- .../songs/forms/songmaintenancedialog.py | 7 +-- .../songs/forms/songmaintenanceform.py | 55 ++++++++++++------- openlp/plugins/songs/forms/topicsdialog.py | 3 +- openlp/plugins/songs/lib/mediaitem.py | 4 +- 19 files changed, 122 insertions(+), 101 deletions(-) diff --git a/openlp/core/lib/plugin.py b/openlp/core/lib/plugin.py index 4f65a924e..39f13c37e 100644 --- a/openlp/core/lib/plugin.py +++ b/openlp/core/lib/plugin.py @@ -144,6 +144,7 @@ class Plugin(QtCore.QObject): self.name = name self.textStrings = {} self.setPluginTextStrings() + self.nameStrings = self.textStrings[StringContent.Name] if version: self.version = version self.settingsSection = self.name.lower() @@ -339,7 +340,6 @@ class Plugin(QtCore.QObject): """ Called to define all translatable texts of the plugin """ - self.nameStrings = self.textStrings[StringContent.Name] ## Load Action ## self.__setNameTextString(StringContent.Load, UiStrings.Load, tooltips[u'load']) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 59c6cd4d2..1e11133f4 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -177,7 +177,7 @@ def media_item_combo_box(parent, name): combo.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed) return combo -def create_delete_push_button(parent, item_name, icon=None): +def create_delete_push_button(parent, icon=None): """ Creates a standard push button with a delete label and optional icon. The button is connected to the parent's ``onDeleteButtonClicked()`` method to @@ -195,7 +195,8 @@ def create_delete_push_button(parent, item_name, icon=None): delete_icon = icon if icon else u':/general/general_delete.png' delete_button.setIcon(build_icon(delete_icon)) delete_button.setText(UiStrings.Delete) - delete_button.setToolTip(UiStrings.DeleteSelect % item_name) + delete_button.setToolTip( + translate('OpenLP.Ui', 'Delete the selected item.')) QtCore.QObject.connect(delete_button, QtCore.SIGNAL(u'clicked()'), parent.onDeleteButtonClicked) return delete_button diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index fc78fa54c..2ef1f834f 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -364,41 +364,41 @@ class Ui_MainWindow(object): self.ViewMediaManagerItem.setText( translate('OpenLP.MainWindow', '&Media Manager')) self.ViewMediaManagerItem.setToolTip( - UiStrings.ToggleType % UiStrings.MediaManager) - self.ViewMediaManagerItem.setStatusTip( - UiStrings.ToggleVisibility % UiStrings.MediaManager.toLower()) + translate('OpenLP.MainWindow', 'Toggle Media Manager')) + self.ViewMediaManagerItem.setStatusTip(translate('OpenLP.MainWindow', + 'Toggle the visibility of the media manager.')) self.ViewMediaManagerItem.setShortcut( translate('OpenLP.MainWindow', 'F8')) self.ViewThemeManagerItem.setText( translate('OpenLP.MainWindow', '&Theme Manager')) self.ViewThemeManagerItem.setToolTip( - UiStrings.ToggleType % UiStrings.ThemeManager) - self.ViewThemeManagerItem.setStatusTip( - UiStrings.ToggleVisibility % UiStrings.ThemeManager.toLower()) + translate('OpenLP.MainWindow', 'Toggle Theme Manager')) + self.ViewThemeManagerItem.setStatusTip(translate('OpenLP.MainWindow', + 'Toggle the visibility of the theme manager.')) self.ViewThemeManagerItem.setShortcut( translate('OpenLP.MainWindow', 'F10')) self.ViewServiceManagerItem.setText( translate('OpenLP.MainWindow', '&Service Manager')) self.ViewServiceManagerItem.setToolTip( - UiStrings.ToggleType % UiStrings.ServiceManager) - self.ViewServiceManagerItem.setStatusTip( - UiStrings.ToggleVisibility % UiStrings.ServiceManager.toLower()) + translate('OpenLP.MainWindow', 'Toggle Service Manager')) + self.ViewServiceManagerItem.setStatusTip(translate('OpenLP.MainWindow', + 'Toggle the visibility of the service manager.')) self.ViewServiceManagerItem.setShortcut( translate('OpenLP.MainWindow', 'F9')) self.ViewPreviewPanel.setText( translate('OpenLP.MainWindow', '&Preview Panel')) self.ViewPreviewPanel.setToolTip( - UiStrings.ToggleType % UiStrings.PreviewPanel) - self.ViewPreviewPanel.setStatusTip( - UiStrings.ToggleVisibility % UiStrings.PreviewPanel.toLower()) + translate('OpenLP.MainWindow', 'Toggle Preview Panel')) + self.ViewPreviewPanel.setStatusTip(translate('OpenLP.MainWindow', + 'Toggle the visibility of the preview panel.')) self.ViewPreviewPanel.setShortcut( translate('OpenLP.MainWindow', 'F11')) self.ViewLivePanel.setText( translate('OpenLP.MainWindow', '&Live Panel')) self.ViewLivePanel.setToolTip( - UiStrings.ToggleType % UiStrings.LivePanel) - self.ViewLivePanel.setStatusTip( - UiStrings.ToggleVisibility % UiStrings.LivePanel.toLower()) + translate('OpenLP.MainWindow', 'Toggle Live Panel')) + self.ViewLivePanel.setStatusTip(translate('OpenLP.MainWindow', + 'Toggle the visibility of the live panel.')) self.ViewLivePanel.setShortcut( translate('OpenLP.MainWindow', 'F12')) self.settingsPluginListItem.setText(translate('OpenLP.MainWindow', diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index 06be52dbe..f34e2b8d2 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -301,7 +301,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): 'Edit Theme - %s')) % self.theme.theme_name) self.next() else: - self.setWindowTitle(UiStrings.NewType % UiStrings.Theme) + self.setWindowTitle(translate('OpenLP.ThemeWizard', 'New Theme')) return QtGui.QWizard.exec_(self) def initializePage(self, id): diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index eddc1c3cf..739de7182 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -105,7 +105,7 @@ class ThemeManager(QtGui.QWidget): # build the context menu self.menu = QtGui.QMenu() self.editAction = self.menu.addAction( - UiStrings.EditType % UiStrings.Theme) + translate('OpenLP.ThemeManager', '&Edit Theme')) self.editAction.setIcon(build_icon(u':/themes/theme_edit.png')) self.copyAction = self.menu.addAction( translate('OpenLP.ThemeManager', '&Copy Theme')) @@ -114,14 +114,14 @@ class ThemeManager(QtGui.QWidget): translate('OpenLP.ThemeManager', '&Rename Theme')) self.renameAction.setIcon(build_icon(u':/themes/theme_edit.png')) self.deleteAction = self.menu.addAction( - UiStrings.AmpDeleteType % UiStrings.Theme) + translate('OpenLP.ThemeManager', '&Delete Theme')) self.deleteAction.setIcon(build_icon(u':/general/general_delete.png')) self.separator = self.menu.addSeparator() self.globalAction = self.menu.addAction( translate('OpenLP.ThemeManager', 'Set As &Global Default')) self.globalAction.setIcon(build_icon(u':/general/general_export.png')) self.exportAction = self.menu.addAction( - UiStrings.ExportType % UiStrings.Theme) + translate('OpenLP.ThemeManager', '&Export Theme')) self.exportAction.setIcon(build_icon(u':/general/general_export.png')) # Signals QtCore.QObject.connect(self.themeListWidget, diff --git a/openlp/core/ui/wizard.py b/openlp/core/ui/wizard.py index b3b4f9233..7e9511c33 100644 --- a/openlp/core/ui/wizard.py +++ b/openlp/core/ui/wizard.py @@ -56,6 +56,7 @@ class WizardStrings(object): WoW = u'Words of Worship' # These strings should need a good reason to be retranslated elsewhere. FormatLabel = translate('OpenLP.Ui', 'Format:') + Header = u'%s' Importing = translate('OpenLP.Ui', 'Importing') ImportingType = unicode(translate('OpenLP.Ui', 'Importing "%s"...')) ImportSelect = translate('OpenLP.Ui', 'Select Import Source') @@ -63,7 +64,7 @@ class WizardStrings(object): 'Select the import format and the location to import from.')) NoSqlite = translate('OpenLP.Ui', 'The openlp.org 1.x importer has been ' 'disabled due to a missing Python module. If you want to use this ' - 'importer, you will need to install the "python-sqlite" ' + 'importer, you will need to install the "python-sqlite" ' 'module.') OpenTypeFile = unicode(translate('OpenLP.Ui', 'Open %s File')) Ready = translate('OpenLP.Ui', 'Ready.') @@ -108,13 +109,6 @@ class OpenLPWizard(QtGui.QWizard): self.retranslateUi() QtCore.QMetaObject.connectSlotsByName(self) - def retranslateUi(self): - """ - Provides generic wizard localisation - """ - self.titleLabel.setText(WizardStrings.Welcome % - (self.plugin.nameStrings[u'singular'], self.direction)) - def registerFields(self): """ Hook method for wizards to register any fields they need. diff --git a/openlp/plugins/alerts/forms/alertform.py b/openlp/plugins/alerts/forms/alertform.py index f2594d44a..0639f2bb1 100644 --- a/openlp/plugins/alerts/forms/alertform.py +++ b/openlp/plugins/alerts/forms/alertform.py @@ -27,7 +27,6 @@ from PyQt4 import QtGui, QtCore from openlp.core.lib import translate -from openlp.core.lib.ui import UiStrings from openlp.plugins.alerts.lib.db import AlertItem from alertdialog import Ui_AlertDialog @@ -97,7 +96,7 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog): def onNewClick(self): if len(self.alertTextEdit.text()) == 0: QtGui.QMessageBox.information(self, - UiStrings.NewType % self.plugin.nameStrings[u'singular'], + translate('AlertsPlugin.AlertForm', 'New Alert'), translate('AlertsPlugin.AlertForm', 'You haven\'t specified ' 'any text for your alert. Please type in some text before ' 'clicking New.')) diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index b27d12a44..b3b7aeb7e 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -361,12 +361,15 @@ class BibleImportForm(OpenLPWizard): """ Allow for localisation of the bible import wizard. """ - OpenLPWizard.retranslateUi(self) self.setWindowTitle( translate('BiblesPlugin.ImportWizardForm', 'Bible Import Wizard')) - self.informationLabel.setText(WizardStrings.Description % ( - self.direction.toLower(), self.plugin.nameStrings[u'plural'], - self.direction.toLower())) + self.titleLabel.setText(WizardStrings.Header % + translate('OpenLP.Ui', 'Welcome to the Bible Import Wizard')) + self.informationLabel.setText( + translate('BiblesPlugin.ImportWizardForm', + 'This wizard will help you to import Bibles from a variety of ' + 'formats. Click the next button below to start the process by ' + 'selecting a format to import from.')) self.selectPage.setTitle(WizardStrings.ImportSelect) self.selectPage.setSubTitle(WizardStrings.ImportSelectLong) self.formatLabel.setText(WizardStrings.FormatLabel) @@ -765,8 +768,8 @@ class BibleImportForm(OpenLPWizard): 'bible. Please note, that verses will be downloaded on\n' 'demand and thus an internet connection is required.')) else: - self.progressLabel.setText( - WizardStrings.FinishedType % UiStrings.Import.toLower()) + self.progressLabel.setText(translate( + 'BiblesPlugin.ImportWizardForm', 'Finished import.')) else: self.progressLabel.setText(translate( 'BiblesPlugin.ImportWizardForm', 'Your Bible import failed.')) diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index 556fff22b..137485eb5 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -198,5 +198,6 @@ class ImageMediaItem(MediaManagerItem): self.resetAction.setVisible(True) else: critical_error_message_box(UiStrings.LiveBGError, - UiStrings.ProbReplaceBG % ( - self.plugin.nameStrings[u'singular'].toLower(), filename)) + unicode(translate('ImagePlugin.MediaItem', + 'There was a problem replacing your background, ' + 'the image file "%s" no longer exists.')) % filename) diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index 93c201c14..89db9d993 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -113,8 +113,9 @@ class MediaMediaItem(MediaManagerItem): self.resetAction.setVisible(True) else: critical_error_message_box(UiStrings.LiveBGError, - UiStrings.ProbReplaceBG % ( - self.plugin.nameStrings[u'singular'].toLower(), filename)) + unicode(translate('MediaPlugin.MediaItem', + 'There was a problem replacing your background, ' + 'the media file "%s" no longer exists.')) % filename) def generateSlideData(self, service_item, item=None, xmlVersion=False): if item is None: diff --git a/openlp/plugins/songs/forms/authorsdialog.py b/openlp/plugins/songs/forms/authorsdialog.py index 6cfe83e67..09c723364 100644 --- a/openlp/plugins/songs/forms/authorsdialog.py +++ b/openlp/plugins/songs/forms/authorsdialog.py @@ -28,7 +28,6 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate from openlp.core.lib.ui import create_accept_reject_button_box -from openlp.plugins.songs.lib.ui import SongStrings class Ui_AuthorsDialog(object): def setupUi(self, authorsDialog): @@ -65,7 +64,7 @@ class Ui_AuthorsDialog(object): def retranslateUi(self, authorsDialog): authorsDialog.setWindowTitle( - SongStrings.TypeMaintenance % SongStrings.Author) + translate('SongsPlugin.AuthorsForm', 'Author Maintenance')) self.displayLabel.setText( translate('SongsPlugin.AuthorsForm', 'Display name:')) self.firstNameLabel.setText( diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 2f0475828..9874b7952 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -35,7 +35,6 @@ from openlp.core.lib.ui import UiStrings, add_widget_completer, \ from openlp.plugins.songs.forms import EditVerseForm from openlp.plugins.songs.lib import SongXML, VerseType from openlp.plugins.songs.lib.db import Book, Song, Author, Topic -from openlp.plugins.songs.lib.ui import SongStrings from editsongdialog import Ui_EditSongDialog log = logging.getLogger(__name__) @@ -310,8 +309,9 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): text = unicode(self.authorsComboBox.currentText()) if item == 0 and text: if QtGui.QMessageBox.question(self, - UiStrings.AddType % SongStrings.Author, - SongStrings.TypeNotExistAdd % SongStrings.Author.toLower(), + translate('SongsPlugin.EditSongForm', 'Add Author'), + translate('SongsPlugin.EditSongForm', 'This author does not ' + 'exist, do you want to add them?'), QtGui.QMessageBox.Yes | QtGui.QMessageBox.No, QtGui.QMessageBox.Yes) == QtGui.QMessageBox.Yes: if text.find(u' ') == -1: @@ -332,8 +332,8 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): if self.authorsListView.findItems(unicode(author.display_name), QtCore.Qt.MatchExactly): critical_error_message_box( - message=SongStrings.TypeInList % - SongStrings.Author.toLower()) + message=translate('SongsPlugin.EditSongForm', + 'This author is already in the list.')) else: self.__addAuthorToList(author) self.authorsComboBox.setCurrentIndex(0) @@ -367,8 +367,9 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): text = unicode(self.topicsComboBox.currentText()) if item == 0 and text: if QtGui.QMessageBox.question(self, - UiStrings.AddType % SongStrings.Topic, - SongStrings.TypeNotExistAdd % SongStrings.Topic.toLower(), + translate('SongsPlugin.EditSongForm', 'Add Topic'), + translate('SongsPlugin.EditSongForm', 'This topic does not ' + 'exist, do you want to add it?'), QtGui.QMessageBox.Yes | QtGui.QMessageBox.No, QtGui.QMessageBox.Yes) == QtGui.QMessageBox.Yes: topic = Topic.populate(name=text) @@ -387,8 +388,8 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): if self.topicsListView.findItems(unicode(topic.name), QtCore.Qt.MatchExactly): critical_error_message_box( - message=SongStrings.TypeInList % - SongStrings.Topic.toLower()) + message=translate('SongsPlugin.EditSongForm', + 'This topic is already in the list.')) else: topic_item = QtGui.QListWidgetItem(unicode(topic.name)) topic_item.setData(QtCore.Qt.UserRole, @@ -583,8 +584,9 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): text = unicode(self.songBookComboBox.currentText()) if self.songBookComboBox.findText(text, QtCore.Qt.MatchExactly) < 0: if QtGui.QMessageBox.question(self, - UiStrings.AddType % SongStrings.SongBook, - SongStrings.TypeNotExistAdd % SongStrings.SongBook.toLower(), + translate('SongsPlugin.EditSongForm', 'Add Book'), + translate('SongsPlugin.EditSongForm', 'This song book does ' + 'not exist, do you want to add it?'), QtGui.QMessageBox.Yes | QtGui.QMessageBox.No, QtGui.QMessageBox.Yes) == QtGui.QMessageBox.Yes: book = Book.populate(name=text, publisher=u'') diff --git a/openlp/plugins/songs/forms/songbookdialog.py b/openlp/plugins/songs/forms/songbookdialog.py index d185a9e1e..f6dd3930c 100644 --- a/openlp/plugins/songs/forms/songbookdialog.py +++ b/openlp/plugins/songs/forms/songbookdialog.py @@ -28,7 +28,6 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate from openlp.core.lib.ui import create_accept_reject_button_box -from openlp.plugins.songs.lib.ui import SongStrings class Ui_SongBookDialog(object): def setupUi(self, songBookDialog): @@ -59,7 +58,7 @@ class Ui_SongBookDialog(object): def retranslateUi(self, songBookDialog): songBookDialog.setWindowTitle( - SongStrings.TypeMaintenance % SongStrings.SongBook) + translate('SongsPlugin.SongBookForm', 'Song Book Maintenance')) self.nameLabel.setText(translate('SongsPlugin.SongBookForm', '&Name:')) self.publisherLabel.setText( translate('SongsPlugin.SongBookForm', '&Publisher:')) diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index 66003532b..231e9ff19 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -162,9 +162,10 @@ class SongExportForm(OpenLPWizard): """ Song wizard localisation. """ - OpenLPWizard.retranslateUi(self) self.setWindowTitle( translate('SongsPlugin.ExportWizardForm', 'Song Export Wizard')) + self.titleLabel.setText(WizardStrings.Header % + translate('OpenLP.Ui', 'Welcome to the Song Export Wizard')) self.informationLabel.setText( translate('SongsPlugin.ExportWizardForm', 'This wizard will help to' ' export your songs to the open and free OpenLyrics worship song ' @@ -281,7 +282,7 @@ class SongExportForm(OpenLPWizard): self, songs, unicode(self.directoryLineEdit.text())) if exporter.do_export(): self.progressLabel.setText( - WizardStrings.FinishedType % UiStrings.Export.toLower()) + translate('SongsPlugin.SongExportForm', 'Finished export.')) else: self.progressLabel.setText( translate('SongsPlugin.SongExportForm', diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index 9f85762f2..aa65501b3 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -205,12 +205,15 @@ class SongImportForm(OpenLPWizard): """ Song wizard localisation. """ - OpenLPWizard.retranslateUi(self) self.setWindowTitle( translate('SongsPlugin.ImportWizardForm', 'Song Import Wizard')) - self.informationLabel.setText(WizardStrings.Description % ( - self.direction.toLower(), self.plugin.nameStrings[u'plural'], - self.direction.toLower())) + self.titleLabel.setText(WizardStrings.Header % + translate('OpenLP.Ui', 'Welcome to the Song Import Wizard')) + self.informationLabel.setText( + translate('SongsPlugin.ImportWizardForm', + 'This wizard will help you to import songs from a variety of ' + 'formats. Click the next button below to start the process by ' + 'selecting a format to import from.')) self.sourcePage.setTitle(WizardStrings.ImportSelect) self.sourcePage.setSubTitle(WizardStrings.ImportSelectLong) self.formatLabel.setText(WizardStrings.FormatLabel) @@ -224,7 +227,9 @@ class SongImportForm(OpenLPWizard): self.formatComboBox.setItemText(SongFormat.CCLI, WizardStrings.CCLI) self.formatComboBox.setItemText( SongFormat.SongsOfFellowship, WizardStrings.SoF) - self.formatComboBox.setItemText(SongFormat.Generic, WizardStrings.GDP) + self.formatComboBox.setItemText(SongFormat.Generic, + translate('SongsPlugin.ImportWizardForm', + 'Generic Document/Presentation')) self.formatComboBox.setItemText( SongFormat.EasiSlides, WizardStrings.ES) self.formatComboBox.setItemText( @@ -361,8 +366,9 @@ class SongImportForm(OpenLPWizard): elif source_format == SongFormat.Generic: if self.genericFileListWidget.count() == 0: critical_error_message_box(UiStrings.NFSp, - WizardStrings.YouSpecifyFile % - WizardStrings.GDP.toLower()) + translate('SongsPlugin.ImportWizardForm', + 'You need to add at least one document or ' + 'presentation file to import from.')) self.genericAddButton.setFocus() return False elif source_format == SongFormat.EasiSlides: @@ -417,8 +423,7 @@ class SongImportForm(OpenLPWizard): filters) if filenames: listbox.addItems(filenames) - SettingsManager.set_last_dir( - self.plugin.settingsSection, + SettingsManager.set_last_dir(self.plugin.settingsSection, os.path.split(unicode(filenames[0]))[0], 1) def getListOfFiles(self, listbox): @@ -533,8 +538,11 @@ class SongImportForm(OpenLPWizard): """ Get song database files """ - self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.GDP, - self.genericFileListWidget) + self.getFileName( + translate('SongsPlugin.ImportWizardForm', + 'Select Document/Presentation Files'), + self.genericFileListWidget + ) def onGenericRemoveButtonClicked(self): """ @@ -572,7 +580,7 @@ class SongImportForm(OpenLPWizard): """ Get SongShow Plus song database files """ - self.getFiles(WizardStrings.OpenFileType % WizardStrings.SSP, + self.getFiles(WizardStrings.OpenTypeFile % WizardStrings.SSP, self.songShowPlusFileListWidget, u'%s (*.sbsong)' % translate('SongsPlugin.ImportWizardForm', 'SongShow Plus Song Files') @@ -660,7 +668,7 @@ class SongImportForm(OpenLPWizard): self.songsOfFellowshipFileListWidget) ) elif source_format == SongFormat.Generic: - # Import a generic document or presentatoin + # Import a generic document or presentation importer = self.plugin.importSongs(SongFormat.Generic, filenames=self.getListOfFiles(self.genericFileListWidget) ) @@ -686,7 +694,7 @@ class SongImportForm(OpenLPWizard): ) if importer.do_import(): self.progressLabel.setText( - WizardStrings.FinishedType % UiStrings.Import.toLower()) + translate('SongsPlugin.SongImportForm', 'Finished import.')) else: self.progressLabel.setText( translate('SongsPlugin.SongImportForm', diff --git a/openlp/plugins/songs/forms/songmaintenancedialog.py b/openlp/plugins/songs/forms/songmaintenancedialog.py index 14ad1132d..d17442b4c 100644 --- a/openlp/plugins/songs/forms/songmaintenancedialog.py +++ b/openlp/plugins/songs/forms/songmaintenancedialog.py @@ -26,7 +26,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import build_icon, StringContent +from openlp.core.lib import build_icon, translate from openlp.core.lib.ui import UiStrings from openlp.plugins.songs.lib.ui import SongStrings @@ -145,9 +145,8 @@ class Ui_SongMaintenanceDialog(object): QtCore.QMetaObject.connectSlotsByName(songMaintenanceDialog) def retranslateUi(self, songMaintenanceDialog): - songMaintenanceDialog.setWindowTitle(SongStrings.TypeMaintenance % - songMaintenanceDialog.parent().plugin.getString( - StringContent.Name)[u'singular']) + songMaintenanceDialog.setWindowTitle( + translate('SongsPlugin.SongMaintenanceForm', 'Song Maintenance')) self.listItemAuthors.setText(SongStrings.Authors) self.listItemTopics.setText(SongStrings.Topics) self.listItemBooks.setText(SongStrings.SongBooks) diff --git a/openlp/plugins/songs/forms/songmaintenanceform.py b/openlp/plugins/songs/forms/songmaintenanceform.py index ffea2ffa6..7f9b8bec5 100644 --- a/openlp/plugins/songs/forms/songmaintenanceform.py +++ b/openlp/plugins/songs/forms/songmaintenanceform.py @@ -32,7 +32,6 @@ from openlp.core.lib import Receiver, translate from openlp.core.lib.ui import UiStrings, critical_error_message_box from openlp.plugins.songs.forms import AuthorsForm, TopicsForm, SongBookForm from openlp.plugins.songs.lib.db import Author, Book, Topic, Song -from openlp.plugins.songs.lib.ui import SongStrings from songmaintenancedialog import Ui_SongMaintenanceDialog log = logging.getLogger(__name__) @@ -103,20 +102,18 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): else: return -1 - def _deleteItem(self, item_class, list_widget, reset_func, del_type): - dlg_title = UiStrings.DeleteType % del_type + def _deleteItem(self, item_class, list_widget, reset_func, dlg_title, + del_text, err_text): item_id = self._getCurrentItemId(list_widget) if item_id != -1: item = self.manager.get_object(item_class, item_id) if item and len(item.songs) == 0: - if critical_error_message_box(dlg_title, - SongStrings.SureDeleteType % del_type, - self, True) == QtGui.QMessageBox.Yes: + if critical_error_message_box(dlg_title, del_text, self, + True) == QtGui.QMessageBox.Yes: self.manager.delete_object(item_class, item.id) reset_func() else: - critical_error_message_box(dlg_title, - SongStrings.NoDeleteAssigned % del_type) + critical_error_message_box(dlg_title, err_text) else: critical_error_message_box(dlg_title, UiStrings.NISs) @@ -217,11 +214,13 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): if self.manager.save_object(author): self.resetAuthors() else: - critical_error_message_box(SongStrings.CouldNotAdd % - SongStrings.Author.toLower()) + critical_error_message_box( + message=translate('SongsPlugin.SongMaintenanceForm', + 'Could not add your author.')) else: critical_error_message_box( - SongStrings.ThisTypeExists % SongStrings.Author.toLower()) + message=translate('SongsPlugin.SongMaintenanceForm', + 'This author already exists.')) def onTopicAddButtonClick(self): if self.topicform.exec_(): @@ -230,11 +229,13 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): if self.manager.save_object(topic): self.resetTopics() else: - critical_error_message_box(SongStrings.CouldNotAdd % - SongStrings.Topic.toLower()) + critical_error_message_box( + message=translate('SongsPlugin.SongMaintenanceForm', + 'Could not add your topic.')) else: critical_error_message_box( - SongStrings.ThisTypeExists % SongStrings.Topic.toLower()) + message=translate('SongsPlugin.SongMaintenanceForm', + 'This topic already exists.')) def onBookAddButtonClick(self): if self.bookform.exec_(): @@ -244,11 +245,13 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): if self.manager.save_object(book): self.resetBooks() else: - critical_error_message_box(SongStrings.CouldNotAdd % - SongStrings.SongBook.toLower()) + critical_error_message_box( + message=translate('SongsPlugin.SongMaintenanceForm', + 'Could not add your book.')) else: critical_error_message_box( - SongStrings.ThisTypeExists % SongStrings.SongBook.toLower()) + message=translate('SongsPlugin.SongMaintenanceForm', + 'This book already exists.')) def onAuthorEditButtonClick(self): author_id = self._getCurrentItemId(self.authorsListWidget) @@ -442,21 +445,33 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): Delete the author if the author is not attached to any songs. """ self._deleteItem(Author, self.authorsListWidget, self.resetAuthors, - SongStrings.Author) + translate('SongsPlugin.SongMaintenanceForm', 'Delete Author'), + translate('SongsPlugin.SongMaintenanceForm', + 'Are you sure you want to delete the selected author?'), + translate('SongsPlugin.SongMaintenanceForm', 'This author cannot ' + 'be deleted, they are currently assigned to at least one song.')) def onTopicDeleteButtonClick(self): """ Delete the Book if the Book is not attached to any songs. """ self._deleteItem(Topic, self.topicsListWidget, self.resetTopics, - SongStrings.Topic) + translate('SongsPlugin.SongMaintenanceForm', 'Delete Topic'), + translate('SongsPlugin.SongMaintenanceForm', + 'Are you sure you want to delete the selected topic?'), + translate('SongsPlugin.SongMaintenanceForm', 'This topic cannot ' + 'be deleted, it is currently assigned to at least one song.')) def onBookDeleteButtonClick(self): """ Delete the Book if the Book is not attached to any songs. """ self._deleteItem(Book, self.booksListWidget, self.resetBooks, - SongStrings.SongBook) + translate('SongsPlugin.SongMaintenanceForm', 'Delete Book'), + translate('SongsPlugin.SongMaintenanceForm', + 'Are you sure you want to delete the selected book?'), + translate('SongsPlugin.SongMaintenanceForm', 'This book cannot be ' + 'deleted, it is currently assigned to at least one song.')) def onAuthorsListRowChanged(self, row): """ diff --git a/openlp/plugins/songs/forms/topicsdialog.py b/openlp/plugins/songs/forms/topicsdialog.py index 4e2349019..1e7bdb6a0 100644 --- a/openlp/plugins/songs/forms/topicsdialog.py +++ b/openlp/plugins/songs/forms/topicsdialog.py @@ -28,7 +28,6 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate from openlp.core.lib.ui import create_accept_reject_button_box -from openlp.plugins.songs.lib.ui import SongStrings class Ui_TopicsDialog(object): def setupUi(self, topicsDialog): @@ -53,6 +52,6 @@ class Ui_TopicsDialog(object): def retranslateUi(self, topicsDialog): topicsDialog.setWindowTitle( - SongStrings.TypeMaintenance % SongStrings.Topic) + translate('SongsPlugin.TopicsForm', 'Topic Maintenance')) self.nameLabel.setText( translate('SongsPlugin.TopicsForm', 'Topic name:')) diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 30b1060bf..6e0c9537d 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -137,8 +137,8 @@ class SongMediaItem(MediaManagerItem): def retranslateUi(self): self.searchTextLabel.setText(u'%s:' % UiStrings.Search) self.searchTextButton.setText(UiStrings.Search) - self.maintenanceAction.setText(SongStrings.TypeMaintenance % - self.plugin.nameStrings[u'singular']) + self.maintenanceAction.setText( + translate('SongsPlugin.MediaItem', 'Song Maintenance')) self.maintenanceAction.setToolTip(translate('SongsPlugin.MediaItem', 'Maintain the lists of authors, topics and books')) From 1fbc873a8c09dcbe14acc494b0efefb1b512fada Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Wed, 16 Feb 2011 03:28:06 +0000 Subject: [PATCH 145/243] Cleanups --- openlp/core/lib/rendermanager.py | 11 +++++------ openlp/core/lib/serviceitem.py | 2 +- openlp/core/ui/exceptionform.py | 2 +- openlp/core/ui/screen.py | 4 ++-- openlp/core/ui/servicemanager.py | 4 ++-- openlp/core/ui/slidecontroller.py | 4 ++-- openlp/core/ui/thememanager.py | 2 +- openlp/plugins/custom/forms/editcustomslideform.py | 4 ++-- openlp/plugins/custom/lib/mediaitem.py | 2 +- openlp/plugins/songs/lib/cclifileimport.py | 2 +- 10 files changed, 18 insertions(+), 19 deletions(-) diff --git a/openlp/core/lib/rendermanager.py b/openlp/core/lib/rendermanager.py index 32a29915f..3935b4b15 100644 --- a/openlp/core/lib/rendermanager.py +++ b/openlp/core/lib/rendermanager.py @@ -173,14 +173,13 @@ class RenderManager(object): main_rect = None footer_rect = None if not theme.font_main_override: - main_rect = QtCore.QRect(10, 0, - self.width - 20, self.footer_start) + main_rect = QtCore.QRect(10, 0, self.width - 20, self.footer_start) else: main_rect = QtCore.QRect(theme.font_main_x, theme.font_main_y, theme.font_main_width - 1, theme.font_main_height - 1) if not theme.font_footer_override: - footer_rect = QtCore.QRect(10, self.footer_start, - self.width - 20, self.height - self.footer_start) + footer_rect = QtCore.QRect(10, self.footer_start, self.width - 20, + self.height - self.footer_start) else: footer_rect = QtCore.QRect(theme.font_footer_x, theme.font_footer_y, theme.font_footer_width - 1, @@ -215,7 +214,7 @@ class RenderManager(object): else: self.image_manager.del_image(theme_data.theme_name) footer = [] - footer.append(u'Arky Arky (Unknown)' ) + footer.append(u'Arky Arky (Unknown)') footer.append(u'Public Domain') footer.append(u'CCLI 123456') # build a service item to generate preview @@ -258,6 +257,6 @@ class RenderManager(object): self.height = screen.height() self.screen_ratio = float(self.height) / float(self.width) log.debug(u'calculate default %d, %d, %f', - self.width, self.height, self.screen_ratio ) + self.width, self.height, self.screen_ratio) # 90% is start of footer self.footer_start = int(self.height * 0.90) diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index f9d690ba2..f5b606467 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -323,7 +323,7 @@ class ServiceItem(object): for text_image in serviceitem[u'serviceitem'][u'data']: filename = os.path.join(path, text_image[u'title']) self.add_from_command( - path, text_image[u'title'], text_image[u'image'] ) + path, text_image[u'title'], text_image[u'image']) self._new_item() def get_display_title(self): diff --git a/openlp/core/ui/exceptionform.py b/openlp/core/ui/exceptionform.py index f0c1c9ab0..cb3cc4ef4 100644 --- a/openlp/core/ui/exceptionform.py +++ b/openlp/core/ui/exceptionform.py @@ -170,7 +170,7 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog): self.__buttonState(False) self.descriptionWordCount.setText( unicode(translate('OpenLP.ExceptionDialog', - 'Description characters to enter : %s')) % count ) + 'Description characters to enter : %s')) % count) def onAttachFileButtonPressed(self): files = QtGui.QFileDialog.getOpenFileName( diff --git a/openlp/core/ui/screen.py b/openlp/core/ui/screen.py index 430426fd5..82238d738 100644 --- a/openlp/core/ui/screen.py +++ b/openlp/core/ui/screen.py @@ -71,7 +71,7 @@ class ScreenList(object): """ Set up the current screen dimensions """ - log.debug(u'set_current_display %s', number, ) + log.debug(u'set_current_display %s', number) if number + 1 > self.display_count: self.current = self.screen_list[0] self.override = copy.deepcopy(self.current) @@ -99,4 +99,4 @@ class ScreenList(object): user wants to use the correct screen attributes """ log.debug(u'reset_current_display') - self.set_current_display(self.current_display) \ No newline at end of file + self.set_current_display(self.current_display) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 0bddbc5a5..3dfcb6ded 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -1061,8 +1061,8 @@ class ServiceManager(QtGui.QWidget): if self.serviceItems[item][u'service_item']\ .is_capable(ItemCapabilities.AllowsEdit): Receiver.send_message(u'%s_edit' % - self.serviceItems[item][u'service_item'].name.lower(), u'L:%s' % - self.serviceItems[item][u'service_item'].edit_id ) + self.serviceItems[item][u'service_item'].name.lower(), + u'L:%s' % self.serviceItems[item][u'service_item'].edit_id) def findServiceItem(self): """ diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index f3bf7ee52..14ec92983 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -603,8 +603,8 @@ class SlideController(QtGui.QWidget): if self.serviceItem.is_text(): if frame[u'verseTag']: bits = frame[u'verseTag'].split(u':') - tag = u'%s\n%s' % (bits[0][0], bits[1][0:] ) - tag1 = u'%s%s' % (bits[0][0], bits[1][0:] ) + tag = u'%s\n%s' % (bits[0][0], bits[1][0:]) + tag1 = u'%s%s' % (bits[0][0], bits[1][0:]) row = tag if self.isLive: if tag1 not in self.slideList: diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 015e48f23..90f74fcfa 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -36,7 +36,7 @@ from openlp.core.lib import OpenLPToolbar, ThemeXML, get_text_file_string, \ build_icon, Receiver, SettingsManager, translate, check_item_selected, \ BackgroundType, BackgroundGradientType, check_directory_exists, \ VerticalType -from openlp.core.lib.ui import UiStrings, critical_error_message_box +from openlp.core.lib.ui import critical_error_message_box from openlp.core.theme import Theme from openlp.core.ui import FileRenameForm, ThemeForm from openlp.core.utils import AppLocation, delete_file, file_is_unicode, \ diff --git a/openlp/plugins/custom/forms/editcustomslideform.py b/openlp/plugins/custom/forms/editcustomslideform.py index c8b74a387..80141cfb3 100644 --- a/openlp/plugins/custom/forms/editcustomslideform.py +++ b/openlp/plugins/custom/forms/editcustomslideform.py @@ -71,5 +71,5 @@ class EditCustomSlideForm(QtGui.QDialog, Ui_CustomSlideEditDialog): """ if self.slideTextEdit.textCursor().columnNumber() != 0: self.slideTextEdit.insertPlainText(u'\n') - self.slideTextEdit.insertPlainText(u'[---]\n' ) - self.slideTextEdit.setFocus() \ No newline at end of file + self.slideTextEdit.insertPlainText(u'[---]\n') + self.slideTextEdit.setFocus() diff --git a/openlp/plugins/custom/lib/mediaitem.py b/openlp/plugins/custom/lib/mediaitem.py index b0834f170..7ffdfd0b2 100644 --- a/openlp/plugins/custom/lib/mediaitem.py +++ b/openlp/plugins/custom/lib/mediaitem.py @@ -55,7 +55,7 @@ class CustomMediaItem(MediaManagerItem): QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'custom_edit'), self.onRemoteEdit) QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'custom_edit_clear' ), self.onRemoteEditClear) + QtCore.SIGNAL(u'custom_edit_clear'), self.onRemoteEditClear) QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'custom_load_list'), self.initialise) QtCore.QObject.connect(Receiver.get_receiver(), diff --git a/openlp/plugins/songs/lib/cclifileimport.py b/openlp/plugins/songs/lib/cclifileimport.py index 441391d02..534cbeab7 100644 --- a/openlp/plugins/songs/lib/cclifileimport.py +++ b/openlp/plugins/songs/lib/cclifileimport.py @@ -187,7 +187,7 @@ class CCLIFileImport(SongImport): if check_first_verse_line: if verse_lines[0].startswith(u'(PRE-CHORUS'): verse_type = u'P' - log.debug(u'USR verse PRE-CHORUS: %s', verse_lines[0] ) + log.debug(u'USR verse PRE-CHORUS: %s', verse_lines[0]) verse_text = verse_lines[1] elif verse_lines[0].startswith(u'(BRIDGE'): verse_type = u'B' From 7e18b8e3e6641342f32094b65130ddebabda371c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Wed, 16 Feb 2011 11:36:59 +0200 Subject: [PATCH 146/243] fix opensong order shuffling + refactoring --- openlp/plugins/songs/lib/opensongimport.py | 152 ++++++++++----------- openlp/plugins/songs/lib/songimport.py | 17 ++- 2 files changed, 83 insertions(+), 86 deletions(-) diff --git a/openlp/plugins/songs/lib/opensongimport.py b/openlp/plugins/songs/lib/opensongimport.py index 8c6d283e3..66ccdd3cc 100644 --- a/openlp/plugins/songs/lib/opensongimport.py +++ b/openlp/plugins/songs/lib/opensongimport.py @@ -149,23 +149,25 @@ class OpenSongImport(SongImport): unicode(translate('SongsPlugin.ImportWizardForm', 'Importing %s...')) % parts[-1]) songfile = z.open(song) - self.do_import_file(songfile) - if self.commit: + if self.do_import_file(songfile) and self.commit and \ + not self.stop_import_flag: self.finish() - if self.stop_import_flag: - success = False - break + else: + success = False + break else: # not a zipfile log.info(u'Direct import %s', filename) self.import_wizard.incrementProgressBar( unicode(translate('SongsPlugin.ImportWizardForm', 'Importing %s...')) % os.path.split(filename)[-1]) - file = open(filename) - self.do_import_file(file) - if self.commit: + songfile = open(filename) + if self.do_import_file(songfile) and self.commit and \ + not self.stop_import_flag: self.finish() - + else: + success = False + break return success def do_import_file(self, file): @@ -178,7 +180,7 @@ class OpenSongImport(SongImport): tree = objectify.parse(file) except (Error, LxmlError): log.exception(u'Error parsing XML') - return + return False root = tree.getroot() fields = dir(root) decode = { @@ -196,19 +198,22 @@ class OpenSongImport(SongImport): setattr(self, fn_or_string, ustring) else: fn_or_string(ustring) + if not len(self.title): + # to prevent creation of empty songs from wrong files + return False if u'theme' in fields and unicode(root.theme) not in self.topics: self.topics.append(unicode(root.theme)) if u'alttheme' in fields and unicode(root.alttheme) not in self.topics: self.topics.append(unicode(root.alttheme)) # data storage while importing verses = {} - # keep track of a "default" verse order, in case none is specified + # keep track of verses appearance order our_verse_order = [] - verses_seen = {} - # in the absence of any other indication, verses are the default, - # erm, versetype! - versetype = u'V' - versenum = None + # default versetype + vt = u'V' + vn = u'1' + # for the case where song has several sections with same marker + inst = 1 lyrics = unicode(root.lyrics) for thisline in lyrics.split(u'\n'): # remove comments @@ -216,14 +221,14 @@ class OpenSongImport(SongImport): if semicolon >= 0: thisline = thisline[:semicolon] thisline = thisline.strip() - if len(thisline) == 0: + if not len(thisline): continue - # skip inthisline guitar chords and page and column breaks - if thisline[0] == u'.' or thisline.startswith(u'---') \ + # skip guitar chords and page and column breaks + if thisline.startswith(u'.') or thisline.startswith(u'---') \ or thisline.startswith(u'-!!'): continue # verse/chorus/etc. marker - if thisline[0] == u'[': + if thisline.startswith(u'['): # drop the square brackets right_bracket = thisline.find(u']') content = thisline[1:right_bracket].upper() @@ -232,78 +237,63 @@ class OpenSongImport(SongImport): # to the end (even if there are some alpha chars on the end) match = re.match(u'(.*)(\d+.*)', content) if match is not None: - versetype = match.group(1) - versenum = match.group(2) + vt = match.group(1) + vn = match.group(2) else: # otherwise we assume number 1 and take the whole prefix as # the versetype - versetype = content - versenum = u'1' + vt = content + vn = u'1' + inst = 1 + if [vt, vn, inst] in our_verse_order and verses.has_key(vt) \ + and verses[vt].has_key(vn): + inst = len(verses[vt][vn])+1 + our_verse_order.append([vt, vn, inst]) continue - words = None # number at start of line.. it's verse number if thisline[0].isdigit(): - versenum = thisline[0] - words = thisline[1:].strip() - if words is None: - words = thisline - if not versenum: - versenum = u'1' - if versenum is not None: - versetag = u'%s%s' % (versetype, versenum) - if not verses.has_key(versetype): - verses[versetype] = {} - if not verses[versetype].has_key(versenum): - # storage for lines in this verse - verses[versetype][versenum] = [] - if not verses_seen.has_key(versetag): - verses_seen[versetag] = 1 - our_verse_order.append(versetag) + vn = thisline[0] + thisline = thisline[1:].strip() + our_verse_order.append([vt, vn, inst]) + if not verses.has_key(vt): + verses[vt] = {} + if not verses[vt].has_key(vn): + verses[vt][vn] = {} + if not verses[vt][vn].has_key(inst): + verses[vt][vn][inst] = [] if words: # Tidy text and remove the ____s from extended words - words = self.tidy_text(words) - words = words.replace('_', '') - verses[versetype][versenum].append(words) + thisline = self.tidy_text(thisline) + thisline = thisline.replace(u'_', u'') + thisline = thisline.replace(u'|', u'\n') + verses[vt][vn][inst].append(thisline) # done parsing - versetypes = verses.keys() - versetypes.sort() - versetags = {} - for versetype in versetypes: - our_verse_type = versetype - if our_verse_type == u'': - our_verse_type = u'V' - versenums = verses[versetype].keys() - versenums.sort() - for num in versenums: - versetag = u'%s%s' % (our_verse_type, num) - lines = u'\n'.join(verses[versetype][num]) - self.add_verse(lines, versetag) - # Keep track of what we have for error checking later - versetags[versetag] = 1 - # now figure out the presentation order - order = [] + # add verses in original order + for (vt, vn, inst) in our_verse_order: + vtag = u'%s%s' % (vt, vn) + lines = u'\n'.join(verses[vt][vn][inst]) + self.add_verse(lines, vtag) + # figure out the presentation order, if present if u'presentation' in fields and root.presentation != u'': order = unicode(root.presentation) # We make all the tags in the lyrics upper case, so match that here # and then split into a list on the whitespace order = order.upper().split() - else: - if len(our_verse_order) > 0: - order = our_verse_order - else: - log.warn(u'No verse order available for %s, skipping.', - self.title) - # TODO: make sure that the default order list will be overwritten, if - # the songs provides its own order list. - for tag in order: - if tag[0].isdigit(): - # Assume it's a verse if it has no prefix - tag = u'V' + tag - elif not re.search('\d+', tag): - # Assume it's no.1 if there's no digits - tag = tag + u'1' - if not versetags.has_key(tag): - log.info(u'Got order %s but not in versetags, dropping this' - u'item from presentation order', tag) - else: - self.verse_order_list.append(tag) + for tag in order: + match = re.match(u'(.*)(\d+.*)', tag) + if match is not None: + vt = match.group(1) + vn = match.group(2) + if not len(vt): + vt = u'V' + else: + # Assume it's no.1 if there are no digits + vt = tag + vn = u'1' + vtagString = u'%s%s' % (vt, vn) + if verses.has_key(vt) and verses[vt].has_key(vn): + self.verse_order_list.append(vtagString) + else: + log.info(u'Got order %s but not in versetags, dropping' + u'this item from presentation order', vtagString) + return True diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index da017d4f5..ca54009cb 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -75,6 +75,8 @@ class SongImport(QtCore.QObject): self.media_files = [] self.song_book_name = u'' self.song_book_pub = u'' + self.verse_order_list_generated_useful = False + self.verse_order_list_generated = [] self.verse_order_list = [] self.verses = [] self.versecounts = {} @@ -217,7 +219,8 @@ class SongImport(QtCore.QObject): """ for (oldversetag, oldverse, oldlang) in self.verses: if oldverse.strip() == versetext.strip(): - self.verse_order_list.append(oldversetag) + self.verse_order_list_generated.append(oldversetag) + self.verse_order_list_generated_useful = True return if versetag[0] in self.versecounts: self.versecounts[versetag[0]] += 1 @@ -228,15 +231,15 @@ class SongImport(QtCore.QObject): elif int(versetag[1:]) > self.versecounts[versetag[0]]: self.versecounts[versetag[0]] = int(versetag[1:]) self.verses.append([versetag, versetext.rstrip(), lang]) - self.verse_order_list.append(versetag) - if versetag.startswith(u'V') and u'C1' in self.verse_order_list: - self.verse_order_list.append(u'C1') + self.verse_order_list_generated.append(versetag) def repeat_verse(self): """ Repeat the previous verse in the verse order """ - self.verse_order_list.append(self.verse_order_list[-1]) + self.verse_order_list_generated.append( + self.verse_order_list_generated[-1]) + self.verse_order_list_generated_useful = True def check_complete(self): """ @@ -297,6 +300,9 @@ class SongImport(QtCore.QObject): song.search_lyrics += u' ' + self.remove_punctuation(versetext) song.search_lyrics = song.search_lyrics.lower() song.lyrics = unicode(sxml.extract_xml(), u'utf-8') + if not len(self.verse_order_list) and \ + self.verse_order_list_generated_useful: + self.verse_order_list = self.verse_order_list_generated for i, current_verse_tag in enumerate(self.verse_order_list): if verses_changed_to_other.has_key(current_verse_tag): self.verse_order_list[i] = \ @@ -348,6 +354,7 @@ class SongImport(QtCore.QObject): for (versetag, versetext, lang) in self.verses: print u'VERSE ' + versetag + u': ' + versetext print u'ORDER: ' + u' '.join(self.verse_order_list) + print u'GENERATED ORDER: ' + u' '.join(self.verse_order_list_generated) for author in self.authors: print u'AUTHOR: ' + author if self.copyright: From 31fbb999f912063a81c0b9e2e1a7cdc97071d083 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Wed, 16 Feb 2011 11:43:07 +0200 Subject: [PATCH 147/243] forgot one --- openlp/plugins/songs/lib/opensongimport.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/openlp/plugins/songs/lib/opensongimport.py b/openlp/plugins/songs/lib/opensongimport.py index 66ccdd3cc..83a26249a 100644 --- a/openlp/plugins/songs/lib/opensongimport.py +++ b/openlp/plugins/songs/lib/opensongimport.py @@ -261,12 +261,11 @@ class OpenSongImport(SongImport): verses[vt][vn] = {} if not verses[vt][vn].has_key(inst): verses[vt][vn][inst] = [] - if words: - # Tidy text and remove the ____s from extended words - thisline = self.tidy_text(thisline) - thisline = thisline.replace(u'_', u'') - thisline = thisline.replace(u'|', u'\n') - verses[vt][vn][inst].append(thisline) + # Tidy text and remove the ____s from extended words + thisline = self.tidy_text(thisline) + thisline = thisline.replace(u'_', u'') + thisline = thisline.replace(u'|', u'\n') + verses[vt][vn][inst].append(thisline) # done parsing # add verses in original order for (vt, vn, inst) in our_verse_order: From cd431652caab01542a020a2938e40a16b041e556 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Wed, 16 Feb 2011 12:20:25 +0200 Subject: [PATCH 148/243] no translation for song tags in database --- openlp/plugins/songs/lib/songimport.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index ca54009cb..8c3457ebf 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -138,12 +138,12 @@ class SongImport(QtCore.QObject): def process_verse_text(self, text): lines = text.split(u'\n') if text.lower().find(self.copyright_string) >= 0 \ - or text.lower().find(self.copyright_symbol) >= 0: + or text.find(self.copyright_symbol) >= 0: copyright_found = False for line in lines: if (copyright_found or line.lower().find(self.copyright_string) >= 0 or - line.lower().find(self.copyright_symbol) >= 0): + line.find(self.copyright_symbol) >= 0): copyright_found = True self.add_copyright(line) else: @@ -219,6 +219,7 @@ class SongImport(QtCore.QObject): """ for (oldversetag, oldverse, oldlang) in self.verses: if oldverse.strip() == versetext.strip(): + # this verse is already present self.verse_order_list_generated.append(oldversetag) self.verse_order_list_generated_useful = True return @@ -278,17 +279,17 @@ class SongImport(QtCore.QObject): other_count = 1 for (versetag, versetext, lang) in self.verses: if versetag[0] == u'C': - versetype = VerseType.to_string(VerseType.Chorus) + versetype = u'Chorus' elif versetag[0] == u'V': - versetype = VerseType.to_string(VerseType.Verse) + versetype = u'Verse' elif versetag[0] == u'B': - versetype = VerseType.to_string(VerseType.Bridge) + versetype = u'Bridge' elif versetag[0] == u'I': - versetype = VerseType.to_string(VerseType.Intro) + versetype = u'Intro' elif versetag[0] == u'P': - versetype = VerseType.to_string(VerseType.PreChorus) + versetype = u'Pre-Chorus' elif versetag[0] == u'E': - versetype = VerseType.to_string(VerseType.Ending) + versetype = u'Ending' else: newversetag = u'O%d' % other_count verses_changed_to_other[versetag] = newversetag From 04a90fe42bc70ee82f06d0f394eb65aff4f59512 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Wed, 16 Feb 2011 16:51:40 +0200 Subject: [PATCH 149/243] longer variable names --- openlp/plugins/songs/lib/opensongimport.py | 62 +++++++++++----------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/openlp/plugins/songs/lib/opensongimport.py b/openlp/plugins/songs/lib/opensongimport.py index 83a26249a..29648214e 100644 --- a/openlp/plugins/songs/lib/opensongimport.py +++ b/openlp/plugins/songs/lib/opensongimport.py @@ -210,8 +210,8 @@ class OpenSongImport(SongImport): # keep track of verses appearance order our_verse_order = [] # default versetype - vt = u'V' - vn = u'1' + versetype = u'V' + versenum = u'1' # for the case where song has several sections with same marker inst = 1 lyrics = unicode(root.lyrics) @@ -237,40 +237,41 @@ class OpenSongImport(SongImport): # to the end (even if there are some alpha chars on the end) match = re.match(u'(.*)(\d+.*)', content) if match is not None: - vt = match.group(1) - vn = match.group(2) + versetype = match.group(1) + versenum = match.group(2) else: # otherwise we assume number 1 and take the whole prefix as # the versetype - vt = content - vn = u'1' + versetype = content + versenum = u'1' inst = 1 - if [vt, vn, inst] in our_verse_order and verses.has_key(vt) \ - and verses[vt].has_key(vn): - inst = len(verses[vt][vn])+1 - our_verse_order.append([vt, vn, inst]) + if [versetype, versenum, inst] in our_verse_order \ + and verses.has_key(versetype) \ + and verses[versetype].has_key(versenum): + inst = len(verses[versetype][versenum])+1 + our_verse_order.append([versetype, versenum, inst]) continue # number at start of line.. it's verse number if thisline[0].isdigit(): - vn = thisline[0] + versenum = thisline[0] thisline = thisline[1:].strip() - our_verse_order.append([vt, vn, inst]) - if not verses.has_key(vt): - verses[vt] = {} - if not verses[vt].has_key(vn): - verses[vt][vn] = {} - if not verses[vt][vn].has_key(inst): - verses[vt][vn][inst] = [] + our_verse_order.append([versetype, versenum, inst]) + if not verses.has_key(versetype): + verses[versetype] = {} + if not verses[versetype].has_key(versenum): + verses[versetype][versenum] = {} + if not verses[versetype][versenum].has_key(inst): + verses[versetype][versenum][inst] = [] # Tidy text and remove the ____s from extended words thisline = self.tidy_text(thisline) thisline = thisline.replace(u'_', u'') thisline = thisline.replace(u'|', u'\n') - verses[vt][vn][inst].append(thisline) + verses[versetype][versenum][inst].append(thisline) # done parsing # add verses in original order - for (vt, vn, inst) in our_verse_order: - vtag = u'%s%s' % (vt, vn) - lines = u'\n'.join(verses[vt][vn][inst]) + for (versetype, versenum, inst) in our_verse_order: + vtag = u'%s%s' % (versetype, versenum) + lines = u'\n'.join(verses[versetype][versenum][inst]) self.add_verse(lines, vtag) # figure out the presentation order, if present if u'presentation' in fields and root.presentation != u'': @@ -281,16 +282,17 @@ class OpenSongImport(SongImport): for tag in order: match = re.match(u'(.*)(\d+.*)', tag) if match is not None: - vt = match.group(1) - vn = match.group(2) - if not len(vt): - vt = u'V' + versetype = match.group(1) + versenum = match.group(2) + if not len(versetype): + versetype = u'V' else: # Assume it's no.1 if there are no digits - vt = tag - vn = u'1' - vtagString = u'%s%s' % (vt, vn) - if verses.has_key(vt) and verses[vt].has_key(vn): + versetype = tag + versenum = u'1' + vtagString = u'%s%s' % (versetype, versenum) + if verses.has_key(versetype) \ + and verses[versetype].has_key(versenum): self.verse_order_list.append(vtagString) else: log.info(u'Got order %s but not in versetags, dropping' From 175bfd2f97a7bb62a086e9a86a4f1faead832783 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Wed, 16 Feb 2011 19:09:35 +0200 Subject: [PATCH 150/243] change back, leave massive change for later --- openlp/plugins/songs/lib/songimport.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index 8c3457ebf..ad18b57ef 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -279,17 +279,17 @@ class SongImport(QtCore.QObject): other_count = 1 for (versetag, versetext, lang) in self.verses: if versetag[0] == u'C': - versetype = u'Chorus' + versetype = VerseType.to_string(VerseType.Chorus) elif versetag[0] == u'V': - versetype = u'Verse' + versetype = VerseType.to_string(VerseType.Verse) elif versetag[0] == u'B': - versetype = u'Bridge' + versetype = VerseType.to_string(VerseType.Bridge) elif versetag[0] == u'I': - versetype = u'Intro' + versetype = VerseType.to_string(VerseType.Intro) elif versetag[0] == u'P': - versetype = u'Pre-Chorus' + versetype = VerseType.to_string(VerseType.PreChorus) elif versetag[0] == u'E': - versetype = u'Ending' + versetype = VerseType.to_string(VerseType.Ending) else: newversetag = u'O%d' % other_count verses_changed_to_other[versetag] = newversetag From 032c48df60c295181b39888d56d0a1cb1c1b8d96 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Wed, 16 Feb 2011 17:54:31 +0000 Subject: [PATCH 151/243] Finish grammar corrections, more strings and cleanups --- openlp/core/lib/mediamanageritem.py | 2 +- openlp/core/lib/ui.py | 9 +++---- openlp/core/ui/exceptionform.py | 24 +++++++++---------- openlp/core/ui/mainwindow.py | 12 ++++++---- openlp/core/ui/printserviceorderdialog.py | 4 ++-- openlp/core/ui/serviceitemeditdialog.py | 5 ++-- openlp/core/ui/shortcutlistform.py | 3 ++- openlp/core/ui/themewizard.py | 2 +- openlp/core/ui/wizard.py | 7 +++--- openlp/plugins/alerts/forms/alertdialog.py | 3 +-- openlp/plugins/alerts/lib/alertstab.py | 3 +-- .../plugins/bibles/forms/bibleimportform.py | 7 +++--- openlp/plugins/bibles/lib/osis.py | 4 ++-- .../plugins/custom/forms/editcustomdialog.py | 9 +++---- openlp/plugins/songs/forms/editsongform.py | 6 ++--- openlp/plugins/songs/forms/songexportform.py | 7 +++--- openlp/plugins/songs/forms/songimportform.py | 12 ++++------ .../songs/forms/songmaintenancedialog.py | 5 ++-- openlp/plugins/songs/lib/mediaitem.py | 3 +-- openlp/plugins/songs/lib/songimport.py | 6 ++--- openlp/plugins/songs/lib/ui.py | 2 ++ 21 files changed, 64 insertions(+), 71 deletions(-) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 6f446619e..2fb100f30 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -475,7 +475,7 @@ class MediaManagerItem(QtGui.QWidget): if not self.listView.selectedIndexes() and not self.remoteTriggered: QtGui.QMessageBox.information(self, UiStrings.NISp, translate('OpenLP.MediaManagerItem', - 'You must select one or more items')) + 'You must select one or more items.')) else: log.debug(u'%s Add requested', self.plugin.name) serviceItem = self.parent.serviceManager.getServiceItem() diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 1e11133f4..e77ad2f10 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -52,6 +52,8 @@ class UiStrings(object): EmptyField = translate('OpenLP.Ui', 'Empty Field') Error = translate('OpenLP.Ui', 'Error') Export = translate('OpenLP.Ui', 'Export') + FontSizePtUnit = translate('OpenLP.Ui', 'pt', + 'Abbreviated font pointsize unit') Image = translate('OpenLP.Ui', 'Image') Import = translate('OpenLP.Ui', 'Import') LengthTime = unicode(translate('OpenLP.Ui', 'Length %s')) @@ -59,33 +61,32 @@ class UiStrings(object): LiveBGError = translate('OpenLP.Ui', 'Live Background Error') LivePanel = translate('OpenLP.Ui', 'Live Panel') Load = translate('OpenLP.Ui', 'Load') - MediaManager = translate('OpenLP.Ui', 'Media Manager') New = translate('OpenLP.Ui', 'New') + NewService = translate('OpenLP.Ui', 'New Service') NFSs = translate('OpenLP.Ui', 'No File Selected', 'Singular') NFSp = translate('OpenLP.Ui', 'No Files Selected', 'Plural') NISs = translate('OpenLP.Ui', 'No Item Selected', 'Singular') NISp = translate('OpenLP.Ui', 'No Items Selected', 'Plural') OLPV1 = translate('OpenLP.Ui', 'openlp.org 1.x') - NewService = translate('OpenLP.Ui', 'New Service') OLPV2 = translate('OpenLP.Ui', 'OpenLP 2.0') OpenService = translate('OpenLP.Ui', 'Open Service') Preview = translate('OpenLP.Ui', 'Preview') PreviewPanel = translate('OpenLP.Ui', 'Preview Panel') + PrintServiceOrder = translate('OpenLP.Ui', 'Print Service Order') ReplaceBG = translate('OpenLP.Ui', 'Replace Background') ReplaceLiveBG = translate('OpenLP.Ui', 'Replace Live Background') ResetBG = translate('OpenLP.Ui', 'Reset Background') ResetLiveBG = translate('OpenLP.Ui', 'Reset Live Background') S = translate('OpenLP.Ui', 's', 'The abbreviated unit for seconds') + SaveAndPreview = translate('OpenLP.Ui', 'Save && Preview') Search = translate('OpenLP.Ui', 'Search') SelectDelete = translate('OpenLP.Ui', 'You must select an item to delete.') SelectEdit = translate('OpenLP.Ui', 'You must select an item to edit.') SaveService = translate('OpenLP.Ui', 'Save Service') Service = translate('OpenLP.Ui', 'Service') - ServiceManager = translate('OpenLP.Ui', 'Service Manager') StartTimeCode = unicode(translate('OpenLP.Ui', 'Start %s')) Theme = translate('OpenLP.Ui', 'Theme', 'Singular') Themes = translate('OpenLP.Ui', 'Themes', 'Plural') - ThemeManager = translate('OpenLP.Ui', 'Theme Manager') Version = translate('OpenLP.Ui', 'Version') def add_welcome_page(parent, image): diff --git a/openlp/core/ui/exceptionform.py b/openlp/core/ui/exceptionform.py index cb3cc4ef4..023bb6b36 100644 --- a/openlp/core/ui/exceptionform.py +++ b/openlp/core/ui/exceptionform.py @@ -35,24 +35,24 @@ from PyQt4 import Qt, QtCore, QtGui try: from PyQt4.phonon import Phonon - phonon_version = Phonon.phononVersion() + PHONON_VERSION = Phonon.phononVersion() except ImportError: - phonon_version = u'-' + PHONON_VERSION = u'-' try: import chardet - chardet_version = chardet.__version__ + CHARDET_VERSION = chardet.__version__ except ImportError: - chardet_version = u'-' + CHARDET_VERSION = u'-' try: import enchant - enchant_version = enchant.__version__ + ENCHANT_VERSION = enchant.__version__ except ImportError: - enchant_version = u'-' + ENCHANT_VERSION = u'-' try: import sqlite - sqlite_version = sqlite.version + SQLITE_VERSION = sqlite.version except ImportError: - sqlite_version = u'-' + SQLITE_VERSION = u'-' from openlp.core.lib import translate, SettingsManager from openlp.core.lib.mailto import mailto @@ -85,14 +85,14 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog): 'Platform: %s\n')) % platform.platform() libraries = u'Python: %s\n' % platform.python_version() + \ u'Qt4: %s\n' % Qt.qVersion() + \ - u'Phonon: %s\n' % phonon_version + \ + u'Phonon: %s\n' % PHONON_VERSION + \ u'PyQt4: %s\n' % Qt.PYQT_VERSION_STR + \ u'SQLAlchemy: %s\n' % sqlalchemy.__version__ + \ u'BeautifulSoup: %s\n' % BeautifulSoup.__version__ + \ u'lxml: %s\n' % etree.__version__ + \ - u'Chardet: %s\n' % chardet_version + \ - u'PyEnchant: %s\n' % enchant_version + \ - u'PySQLite: %s\n' % sqlite_version + u'Chardet: %s\n' % CHARDET_VERSION + \ + u'PyEnchant: %s\n' % ENCHANT_VERSION + \ + u'PySQLite: %s\n' % SQLITE_VERSION if platform.system() == u'Linux': if os.environ.get(u'KDE_FULL_SESSION') == u'true': system = system + u'Desktop: KDE SC\n' diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 2ef1f834f..30afe4d13 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -312,9 +312,12 @@ class Ui_MainWindow(object): self.SettingsLanguageMenu.setTitle(translate('OpenLP.MainWindow', '&Language')) self.HelpMenu.setTitle(translate('OpenLP.MainWindow', '&Help')) - self.mediaManagerDock.setWindowTitle(UiStrings.MediaManager) - self.serviceManagerDock.setWindowTitle(UiStrings.ServiceManager) - self.themeManagerDock.setWindowTitle(UiStrings.ThemeManager) + self.mediaManagerDock.setWindowTitle( + translate('OpenLP.MainWindow', 'Media Manager')) + self.serviceManagerDock.setWindowTitle( + translate('OpenLP.MainWindow', 'Service Manager')) + self.themeManagerDock.setWindowTitle( + translate('OpenLP.MainWindow', 'Theme Manager')) self.FileNewItem.setText(translate('OpenLP.MainWindow', '&New')) self.FileNewItem.setToolTip(UiStrings.NewService) self.FileNewItem.setStatusTip(UiStrings.CreateService) @@ -337,8 +340,7 @@ class Ui_MainWindow(object): 'Save the current service under a new name.')) self.FileSaveAsItem.setShortcut( translate('OpenLP.MainWindow', 'Ctrl+Shift+S')) - self.printServiceOrderItem.setText( - translate('OpenLP.MainWindow', 'Print Service Order')) + self.printServiceOrderItem.setText(UiStrings.PrintServiceOrder) self.printServiceOrderItem.setStatusTip(translate('OpenLP.MainWindow', 'Print the current Service Order.')) self.printServiceOrderItem.setShortcut( diff --git a/openlp/core/ui/printserviceorderdialog.py b/openlp/core/ui/printserviceorderdialog.py index f8db4d1c0..22f8e9292 100644 --- a/openlp/core/ui/printserviceorderdialog.py +++ b/openlp/core/ui/printserviceorderdialog.py @@ -27,6 +27,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import build_icon, translate, SpellTextEdit +from openlp.core.lib.ui import UiStrings class Ui_PrintServiceOrderDialog(object): def setupUi(self, printServiceOrderDialog): @@ -116,8 +117,7 @@ class Ui_PrintServiceOrderDialog(object): QtCore.QMetaObject.connectSlotsByName(printServiceOrderDialog) def retranslateUi(self, printServiceOrderDialog): - printServiceOrderDialog.setWindowTitle( - translate('OpenLP.PrintServiceOrderForm', 'Print Service Order')) + printServiceOrderDialog.setWindowTitle(UiStrings.PrintServiceOrder) self.previewLabel.setText( translate('OpenLP.ServiceManager', 'Preview:')) self.printSlideTextCheckBox.setText(translate( diff --git a/openlp/core/ui/serviceitemeditdialog.py b/openlp/core/ui/serviceitemeditdialog.py index 0f9ddb4ac..ef7e99a5f 100644 --- a/openlp/core/ui/serviceitemeditdialog.py +++ b/openlp/core/ui/serviceitemeditdialog.py @@ -27,7 +27,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate -from openlp.core.lib.ui import UiStrings, create_accept_reject_button_box, \ +from openlp.core.lib.ui import create_accept_reject_button_box, \ create_delete_push_button, create_up_down_push_button_set class Ui_ServiceItemEditDialog(object): @@ -41,8 +41,7 @@ class Ui_ServiceItemEditDialog(object): self.dialogLayout.addWidget(self.listWidget, 0, 0) self.buttonLayout = QtGui.QVBoxLayout() self.buttonLayout.setObjectName(u'buttonLayout') - self.deleteButton = create_delete_push_button( - serviceItemEditDialog, UiStrings.Service.toLower()) + self.deleteButton = create_delete_push_button(serviceItemEditDialog) self.buttonLayout.addWidget(self.deleteButton) self.buttonLayout.addStretch() self.upButton, self.downButton = create_up_down_push_button_set( diff --git a/openlp/core/ui/shortcutlistform.py b/openlp/core/ui/shortcutlistform.py index 0de4bea7f..240bbf93c 100644 --- a/openlp/core/ui/shortcutlistform.py +++ b/openlp/core/ui/shortcutlistform.py @@ -101,7 +101,8 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog): else: shortcutText = action.shortcut().toString() alternateText = u'' - actionItem = QtGui.QTreeWidgetItem([actionText, shortcutText, alternateText]) + actionItem = QtGui.QTreeWidgetItem( + [actionText, shortcutText, alternateText]) actionItem.setIcon(0, action.icon()) item.addChild(actionItem) item.setExpanded(True) diff --git a/openlp/core/ui/themewizard.py b/openlp/core/ui/themewizard.py index 281e216d3..fc25e11fa 100644 --- a/openlp/core/ui/themewizard.py +++ b/openlp/core/ui/themewizard.py @@ -470,7 +470,7 @@ class Ui_ThemeWizard(object): self.footerFontLabel.setText(translate('OpenLP.ThemeWizard', 'Font:')) self.footerColorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:')) self.footerSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:')) - self.footerSizeSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt')) + self.footerSizeSpinBox.setSuffix(UiStrings.FontSizePtUnit) self.alignmentPage.setTitle( translate('OpenLP.ThemeWizard', 'Text Formatting Details')) self.alignmentPage.setSubTitle( diff --git a/openlp/core/ui/wizard.py b/openlp/core/ui/wizard.py index 7e9511c33..2960607e4 100644 --- a/openlp/core/ui/wizard.py +++ b/openlp/core/ui/wizard.py @@ -55,8 +55,9 @@ class WizardStrings(object): SSP = u'SongShow Plus' WoW = u'Words of Worship' # These strings should need a good reason to be retranslated elsewhere. + FinishedImport = translate('OpenLP.Ui', 'Finished import.') FormatLabel = translate('OpenLP.Ui', 'Format:') - Header = u'%s' + HeaderStyle = u'%s' Importing = translate('OpenLP.Ui', 'Importing') ImportingType = unicode(translate('OpenLP.Ui', 'Importing "%s"...')) ImportSelect = translate('OpenLP.Ui', 'Select Import Source') @@ -67,6 +68,7 @@ class WizardStrings(object): 'importer, you will need to install the "python-sqlite" ' 'module.') OpenTypeFile = unicode(translate('OpenLP.Ui', 'Open %s File')) + PercentSymbolFormat = unicode(translate('OpenLP.Ui', '%p%')) Ready = translate('OpenLP.Ui', 'Ready.') StartingImport = translate('OpenLP.Ui', 'Starting import...') YouSpecifyFile = unicode(translate('OpenLP.Ui', 'You need to specify at ' @@ -78,11 +80,10 @@ class OpenLPWizard(QtGui.QWizard): Generic OpenLP wizard to provide generic functionality and a unified look and feel. """ - def __init__(self, parent, plugin, name, image, direction): + def __init__(self, parent, plugin, name, image): QtGui.QWizard.__init__(self, parent) self.plugin = plugin self.setObjectName(name) - self.direction = direction self.openIcon = build_icon(u':/general/general_open.png') self.deleteIcon = build_icon(u':/general/general_delete.png') self.finishButton = self.button(QtGui.QWizard.FinishButton) diff --git a/openlp/plugins/alerts/forms/alertdialog.py b/openlp/plugins/alerts/forms/alertdialog.py index 11596b700..93f7ead06 100644 --- a/openlp/plugins/alerts/forms/alertdialog.py +++ b/openlp/plugins/alerts/forms/alertdialog.py @@ -66,8 +66,7 @@ class Ui_AlertDialog(object): self.saveButton.setIcon(build_icon(u':/general/general_save.png')) self.saveButton.setObjectName(u'saveButton') self.manageButtonLayout.addWidget(self.saveButton) - self.deleteButton = create_delete_push_button(alertDialog, - self.parent.nameStrings[u'singular'].toLower()) + self.deleteButton = create_delete_push_button(alertDialog) self.deleteButton.setEnabled(False) self.manageButtonLayout.addWidget(self.deleteButton) self.manageButtonLayout.addStretch() diff --git a/openlp/plugins/alerts/lib/alertstab.py b/openlp/plugins/alerts/lib/alertstab.py index 8c1538e4d..ac7316df2 100644 --- a/openlp/plugins/alerts/lib/alertstab.py +++ b/openlp/plugins/alerts/lib/alertstab.py @@ -109,8 +109,7 @@ class AlertsTab(SettingsTab): translate('AlertsPlugin.AlertsTab', 'Background color:')) self.FontSizeLabel.setText( translate('AlertsPlugin.AlertsTab', 'Font size:')) - self.FontSizeSpinBox.setSuffix( - translate('AlertsPlugin.AlertsTab', 'pt')) + self.FontSizeSpinBox.setSuffix(UiStrings.FontSizePtUnit) self.TimeoutLabel.setText( translate('AlertsPlugin.AlertsTab', 'Alert timeout:')) self.TimeoutSpinBox.setSuffix(UiStrings.S) diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index b3b7aeb7e..83e7065ac 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -88,7 +88,7 @@ class BibleImportForm(OpenLPWizard): self.manager = manager self.web_bible_list = {} OpenLPWizard.__init__(self, parent, bibleplugin, u'bibleImportWizard', - u':/wizards/wizard_importbible.bmp', UiStrings.Import) + u':/wizards/wizard_importbible.bmp') def setupUi(self, image): """ @@ -363,7 +363,7 @@ class BibleImportForm(OpenLPWizard): """ self.setWindowTitle( translate('BiblesPlugin.ImportWizardForm', 'Bible Import Wizard')) - self.titleLabel.setText(WizardStrings.Header % + self.titleLabel.setText(WizardStrings.HeaderStyle % translate('OpenLP.Ui', 'Welcome to the Bible Import Wizard')) self.informationLabel.setText( translate('BiblesPlugin.ImportWizardForm', @@ -768,8 +768,7 @@ class BibleImportForm(OpenLPWizard): 'bible. Please note, that verses will be downloaded on\n' 'demand and thus an internet connection is required.')) else: - self.progressLabel.setText(translate( - 'BiblesPlugin.ImportWizardForm', 'Finished import.')) + self.progressLabel.setText(WizardStrings.FinishedImport) else: self.progressLabel.setText(translate( 'BiblesPlugin.ImportWizardForm', 'Your Bible import failed.')) diff --git a/openlp/plugins/bibles/lib/osis.py b/openlp/plugins/bibles/lib/osis.py index 4a001987d..d21227090 100644 --- a/openlp/plugins/bibles/lib/osis.py +++ b/openlp/plugins/bibles/lib/osis.py @@ -69,7 +69,7 @@ class OSISBible(BibleDB): self.q1_regex = re.compile(r'') self.q2_regex = re.compile(r'') self.trans_regex = re.compile(r'(.*?)') - self.divineName_regex = re.compile( + self.divine_name_regex = re.compile( r'(.*?)') self.spaces_regex = re.compile(r'([ ]{2,})') filepath = os.path.join( @@ -161,7 +161,7 @@ class OSISBible(BibleDB): verse_text = self.q1_regex.sub(u'"', verse_text) verse_text = self.q2_regex.sub(u'\'', verse_text) verse_text = self.trans_regex.sub(u'', verse_text) - verse_text = self.divineName_regex.sub(u'', verse_text) + verse_text = self.divine_name_regex.sub(u'', verse_text) verse_text = verse_text.replace(u'', u'')\ .replace(u'', u'').replace(u'', u'')\ .replace(u'', u'').replace(u'', u'')\ diff --git a/openlp/plugins/custom/forms/editcustomdialog.py b/openlp/plugins/custom/forms/editcustomdialog.py index e63c057d0..8746d5548 100644 --- a/openlp/plugins/custom/forms/editcustomdialog.py +++ b/openlp/plugins/custom/forms/editcustomdialog.py @@ -26,7 +26,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import StringContent, build_icon, translate +from openlp.core.lib import build_icon, translate from openlp.core.lib.ui import UiStrings, create_accept_reject_button_box, \ create_delete_push_button, create_up_down_push_button_set @@ -66,9 +66,7 @@ class Ui_CustomEditDialog(object): self.editAllButton = QtGui.QPushButton(customEditDialog) self.editAllButton.setObjectName(u'editAllButton') self.buttonLayout.addWidget(self.editAllButton) - self.deleteButton = create_delete_push_button(customEditDialog, - customEditDialog.parent.getString( - StringContent.Name)[u'singular'].toLower()) + self.deleteButton = create_delete_push_button(customEditDialog) self.deleteButton.setEnabled(False) self.buttonLayout.addWidget(self.deleteButton) self.buttonLayout.addStretch() @@ -126,5 +124,4 @@ class Ui_CustomEditDialog(object): translate('CustomPlugin.EditCustomForm', 'The&me:')) self.creditLabel.setText( translate('CustomPlugin.EditCustomForm', '&Credits:')) - self.previewButton.setText( - translate('CustomPlugin.EditCustomForm', 'Save && Preview')) + self.previewButton.setText(UiStrings.SaveAndPreview) diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 9874b7952..6a8946c78 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -35,6 +35,7 @@ from openlp.core.lib.ui import UiStrings, add_widget_completer, \ from openlp.plugins.songs.forms import EditVerseForm from openlp.plugins.songs.lib import SongXML, VerseType from openlp.plugins.songs.lib.db import Book, Song, Author, Topic +from openlp.plugins.songs.lib.ui import SongStrings from editsongdialog import Ui_EditSongDialog log = logging.getLogger(__name__) @@ -95,8 +96,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): QtCore.SIGNAL(u'theme_update_list'), self.loadThemes) self.previewButton = QtGui.QPushButton() self.previewButton.setObjectName(u'previewButton') - self.previewButton.setText( - translate('SongsPlugin.EditSongForm', 'Save && Preview')) + self.previewButton.setText(UiStrings.SaveAndPreview) self.buttonBox.addButton( self.previewButton, QtGui.QDialogButtonBox.ActionRole) QtCore.QObject.connect(self.buttonBox, @@ -598,7 +598,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): def onCopyrightInsertButtonTriggered(self): text = self.copyrightEdit.text() pos = self.copyrightEdit.cursorPosition() - sign = translate('SongsPlugin.EditSongForm', '\xa9') + sign = SongStrings.CopyrightSymbol text = text[:pos] + sign + text[pos:] self.copyrightEdit.setText(text) self.copyrightEdit.setFocus() diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index 231e9ff19..202150394 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -57,7 +57,7 @@ class SongExportForm(OpenLPWizard): The songs plugin. """ OpenLPWizard.__init__(self, parent, plugin, u'songExportWizard', - u':/wizards/wizard_exportsong.bmp', UiStrings.Export) + u':/wizards/wizard_exportsong.bmp') self.stop_export_flag = False QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'openlp_stop_wizard'), self.stop_export) @@ -164,7 +164,7 @@ class SongExportForm(OpenLPWizard): """ self.setWindowTitle( translate('SongsPlugin.ExportWizardForm', 'Song Export Wizard')) - self.titleLabel.setText(WizardStrings.Header % + self.titleLabel.setText(WizardStrings.HeaderStyle % translate('OpenLP.Ui', 'Welcome to the Song Export Wizard')) self.informationLabel.setText( translate('SongsPlugin.ExportWizardForm', 'This wizard will help to' @@ -193,8 +193,7 @@ class SongExportForm(OpenLPWizard): translate('SongsPlugin.ExportWizardForm', 'Please wait while your songs are exported.')) self.progressLabel.setText(WizardStrings.Ready) - self.progressBar.setFormat( - translate('SongsPlugin.ExportWizardForm', '%p%')) + self.progressBar.setFormat(WizardStrings.PercentSymbolFormat) def validateCurrentPage(self): """ diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index aa65501b3..eef0a7004 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -56,7 +56,7 @@ class SongImportForm(OpenLPWizard): The songs plugin. """ OpenLPWizard.__init__(self, parent, plugin, u'songImportWizard', - u':/wizards/wizard_importsong.bmp', UiStrings.Import) + u':/wizards/wizard_importsong.bmp') def setupUi(self, image): """ @@ -207,7 +207,7 @@ class SongImportForm(OpenLPWizard): """ self.setWindowTitle( translate('SongsPlugin.ImportWizardForm', 'Song Import Wizard')) - self.titleLabel.setText(WizardStrings.Header % + self.titleLabel.setText(WizardStrings.HeaderStyle % translate('OpenLP.Ui', 'Welcome to the Song Import Wizard')) self.informationLabel.setText( translate('SongsPlugin.ImportWizardForm', @@ -305,8 +305,7 @@ class SongImportForm(OpenLPWizard): translate('SongsPlugin.ImportWizardForm', 'Please wait while your songs are imported.')) self.progressLabel.setText(WizardStrings.Ready) - self.progressBar.setFormat( - translate('SongsPlugin.ImportWizardForm', '%p%')) + self.progressBar.setFormat(WizardStrings.PercentSymbolFormat) # Align all QFormLayouts towards each other. width = max(self.formatLabel.minimumSizeHint().width(), self.openLP2FilenameLabel.minimumSizeHint().width()) @@ -367,7 +366,7 @@ class SongImportForm(OpenLPWizard): if self.genericFileListWidget.count() == 0: critical_error_message_box(UiStrings.NFSp, translate('SongsPlugin.ImportWizardForm', - 'You need to add at least one document or ' + 'You need to specify at least one document or ' 'presentation file to import from.')) self.genericAddButton.setFocus() return False @@ -693,8 +692,7 @@ class SongImportForm(OpenLPWizard): filenames=self.getListOfFiles(self.songShowPlusFileListWidget) ) if importer.do_import(): - self.progressLabel.setText( - translate('SongsPlugin.SongImportForm', 'Finished import.')) + self.progressLabel.setText(WizardStrings.FinishedImport) else: self.progressLabel.setText( translate('SongsPlugin.SongImportForm', diff --git a/openlp/plugins/songs/forms/songmaintenancedialog.py b/openlp/plugins/songs/forms/songmaintenancedialog.py index d17442b4c..0316ab42b 100644 --- a/openlp/plugins/songs/forms/songmaintenancedialog.py +++ b/openlp/plugins/songs/forms/songmaintenancedialog.py @@ -26,7 +26,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import build_icon, translate +from openlp.core.lib import build_icon from openlp.core.lib.ui import UiStrings from openlp.plugins.songs.lib.ui import SongStrings @@ -145,8 +145,7 @@ class Ui_SongMaintenanceDialog(object): QtCore.QMetaObject.connectSlotsByName(songMaintenanceDialog) def retranslateUi(self, songMaintenanceDialog): - songMaintenanceDialog.setWindowTitle( - translate('SongsPlugin.SongMaintenanceForm', 'Song Maintenance')) + songMaintenanceDialog.setWindowTitle(SongStrings.SongMaintenance) self.listItemAuthors.setText(SongStrings.Authors) self.listItemTopics.setText(SongStrings.Topics) self.listItemBooks.setText(SongStrings.SongBooks) diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 6e0c9537d..9666a9351 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -137,8 +137,7 @@ class SongMediaItem(MediaManagerItem): def retranslateUi(self): self.searchTextLabel.setText(u'%s:' % UiStrings.Search) self.searchTextButton.setText(UiStrings.Search) - self.maintenanceAction.setText( - translate('SongsPlugin.MediaItem', 'Song Maintenance')) + self.maintenanceAction.setText(SongStrings.SongMaintenance) self.maintenanceAction.setToolTip(translate('SongsPlugin.MediaItem', 'Maintain the lists of authors, topics and books')) diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index 7f0e622bd..79379106d 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -81,8 +81,6 @@ class SongImport(QtCore.QObject): self.versecounts = {} self.copyright_string = unicode(translate( 'SongsPlugin.SongImport', 'copyright')) - self.copyright_symbol = unicode(translate( - 'SongsPlugin.SongImport', '\xa9')) def stop_import(self): """ @@ -137,12 +135,12 @@ class SongImport(QtCore.QObject): def process_verse_text(self, text): lines = text.split(u'\n') if text.lower().find(self.copyright_string) >= 0 \ - or text.lower().find(self.copyright_symbol) >= 0: + or text.lower().find(SongStrings.CopyrightSymbol) >= 0: copyright_found = False for line in lines: if (copyright_found or line.lower().find(self.copyright_string) >= 0 or - line.lower().find(self.copyright_symbol) >= 0): + line.lower().find(SongStrings.CopyrightSymbol) >= 0): copyright_found = True self.add_copyright(line) else: diff --git a/openlp/plugins/songs/lib/ui.py b/openlp/plugins/songs/lib/ui.py index 85d609762..65f473e63 100644 --- a/openlp/plugins/songs/lib/ui.py +++ b/openlp/plugins/songs/lib/ui.py @@ -38,7 +38,9 @@ class SongStrings(object): Authors = translate('OpenLP.Ui', 'Authors', 'Plural') AuthorUnknown = translate('OpenLP.Ui', 'Author Unknown') # Used in the UI. AuthorUnknownUnT = u'Author Unknown' # Used to populate the database. + CopyrightSymbol = translate('OpenLP.Ui', '\xa9', 'Copyright symbol.') SongBook = translate('OpenLP.Ui', 'Song Book', 'Singular') SongBooks = translate('OpenLP.Ui', 'Song Books', 'Plural') + SongMaintenance = translate('OpenLP.Ui', 'Song Maintenance') Topic = translate('OpenLP.Ui', 'Topic', 'Singular') Topics = translate('OpenLP.Ui', 'Topics', 'Plural') From 89181e387dfa9193cccb8190eb52101a52c26716 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Wed, 16 Feb 2011 20:37:51 +0200 Subject: [PATCH 152/243] VerseType changes --- openlp/plugins/songs/lib/__init__.py | 161 +++++++++++++++++++-------- 1 file changed, 115 insertions(+), 46 deletions(-) diff --git a/openlp/plugins/songs/lib/__init__.py b/openlp/plugins/songs/lib/__init__.py index c763d70b9..4adeb5345 100644 --- a/openlp/plugins/songs/lib/__init__.py +++ b/openlp/plugins/songs/lib/__init__.py @@ -39,69 +39,138 @@ class VerseType(object): Intro = 4 Ending = 5 Other = 6 + Tags = [ + u'v', + u'c', + u'b', + u'p', + u'i', + u'e', + u'o'] + Names = [ + u'Verse', + u'Chorus', + u'Bridge', + u'Pre-Chorus', + u'Intro', + u'Ending', + u'Other'] + Translations = [ + translate('SongsPlugin.VerseType', 'Verse'), + translate('SongsPlugin.VerseType', 'Chorus'), + translate('SongsPlugin.VerseType', 'Bridge'), + translate('SongsPlugin.VerseType', 'Pre-Chorus'), + translate('SongsPlugin.VerseType', 'Intro'), + translate('SongsPlugin.VerseType', 'Ending'), + translate('SongsPlugin.VerseType', 'Other')] @staticmethod - def to_string(verse_type): + def tag(verse_type, strict=False): """ - Return a string for a given VerseType + Return a string for a given VerseType tag + + ``verse_type`` + The verse type to return a string for + + ``strict`` + If strict, False is returned instead of Other, when not found + """ + if isinstance(verse_type, int): + if verse_type >=0 and verse_type <= 6: + return VerseType.Tags[verse_type] + else: + return self.returnvalue(VerseType.Tags, strict) + elif verse_type[0].lower() in VerseType.Tags: + return verse_type[0].lower() + else: + return VerseType.returnvalue(VerseType.Tags, strict) + + @staticmethod + def to_string(verse_type, strict=False): + """ + Return a string for a given VerseType Name ``verse_type`` The type to return a string for + + ``strict`` + If strict, False is returned instead of Other, when not found """ - if not isinstance(verse_type, int): - verse_type = verse_type.lower() - if verse_type == VerseType.Verse or verse_type == \ - unicode(VerseType.to_string(VerseType.Verse)).lower()[0]: - return translate('SongsPlugin.VerseType', 'Verse') - elif verse_type == VerseType.Chorus or verse_type == \ - unicode(VerseType.to_string(VerseType.Chorus)).lower()[0]: - return translate('SongsPlugin.VerseType', 'Chorus') - elif verse_type == VerseType.Bridge or verse_type == \ - unicode(VerseType.to_string(VerseType.Bridge)).lower()[0]: - return translate('SongsPlugin.VerseType', 'Bridge') - elif verse_type == VerseType.PreChorus or verse_type == \ - unicode(VerseType.to_string(VerseType.PreChorus)).lower()[0]: - return translate('SongsPlugin.VerseType', 'Pre-Chorus') - elif verse_type == VerseType.Intro or verse_type == \ - unicode(VerseType.to_string(VerseType.Intro)).lower()[0]: - return translate('SongsPlugin.VerseType', 'Intro') - elif verse_type == VerseType.Ending or verse_type == \ - unicode(VerseType.to_string(VerseType.Ending)).lower()[0]: - return translate('SongsPlugin.VerseType', 'Ending') - elif verse_type == VerseType.Other or verse_type == \ - unicode(VerseType.to_string(VerseType.Other)).lower()[0]: - return translate('SongsPlugin.VerseType', 'Other') + if isinstance(verse_type, int): + if verse_type >=0 and verse_type <= 6: + return VerseType.Names[verse_type] + else: + return self.returnvalue(VerseType.Names, strict) + else: + verse_type = verse_type[0].lower() + for num, tag in enumerate(VerseType.Tags): + if verse_type == tag: + return VerseType.Names[num] + return VerseType.returnvalue(VerseType.Names, strict) @staticmethod - def from_string(verse_type): + def to_translated_string(verse_type, strict=False): + """ + Return a string for a given VerseType Name + + ``verse_type`` + The type to return a string for + + ``strict`` + If strict, False is returned instead of Other, when not found + """ + if isinstance(verse_type, int): + if verse_type >=0 and verse_type <= 6: + return VerseType.Translations[verse_type] + else: + return self.returnvalue(VerseType.Translations, strict) + else: + verse_type = verse_type[0].lower() + for num, tag in enumerate(VerseType.Tags): + if verse_type == tag: + return VerseType.Translations[num] + return VerseType.returnvalue(VerseType.Translations, strict) + + @staticmethod + def from_string(verse_type, strict=False): """ Return the VerseType for a given string ``verse_type`` The string to return a VerseType for + + ``strict`` + If strict, False is returned instead of Other, when not found """ verse_type = verse_type.lower() - if verse_type == unicode(VerseType.to_string(VerseType.Verse)).lower(): - return VerseType.Verse - elif verse_type == \ - unicode(VerseType.to_string(VerseType.Chorus)).lower(): - return VerseType.Chorus - elif verse_type == \ - unicode(VerseType.to_string(VerseType.Bridge)).lower(): - return VerseType.Bridge - elif verse_type == \ - unicode(VerseType.to_string(VerseType.PreChorus)).lower(): - return VerseType.PreChorus - elif verse_type == \ - unicode(VerseType.to_string(VerseType.Intro)).lower(): - return VerseType.Intro - elif verse_type == \ - unicode(VerseType.to_string(VerseType.Ending)).lower(): - return VerseType.Ending - elif verse_type == \ - unicode(VerseType.to_string(VerseType.Other)).lower(): - return VerseType.Other + for num, string in enumerate(VerseType.Names): + if verse_type == string: + return num + return VerseType.returnvalue(range(0,7), strict) + @staticmethod + def from_translated_string(verse_type, strict=False): + """ + Return the VerseType for a given string + + ``verse_type`` + The string to return a VerseType for + + ``strict`` + If strict, False is returned instead of Other, when not found + """ + verse_type = verse_type.lower() + for num, translation in enumerate(VerseType.Translations): + if verse_type == translation: + return num + return VerseType.returnvalue(range(0,7), strict) + + @staticmethod + def returnvalue(lst, strict): + if strict: + return False + else: + return lst[VerseType.Other] def retrieve_windows_encoding(recommendation=None): """ From 425ec8ece0636ac0ec66135c9bd109ecf9ee1db1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Wed, 16 Feb 2011 21:09:06 +0200 Subject: [PATCH 153/243] more changes reflecting VerseType changes --- openlp/plugins/songs/lib/opensongimport.py | 4 ++-- openlp/plugins/songs/lib/songimport.py | 21 ++++++--------------- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/openlp/plugins/songs/lib/opensongimport.py b/openlp/plugins/songs/lib/opensongimport.py index 29648214e..320339f36 100644 --- a/openlp/plugins/songs/lib/opensongimport.py +++ b/openlp/plugins/songs/lib/opensongimport.py @@ -210,7 +210,7 @@ class OpenSongImport(SongImport): # keep track of verses appearance order our_verse_order = [] # default versetype - versetype = u'V' + versetype = u'v' versenum = u'1' # for the case where song has several sections with same marker inst = 1 @@ -285,7 +285,7 @@ class OpenSongImport(SongImport): versetype = match.group(1) versenum = match.group(2) if not len(versetype): - versetype = u'V' + versetype = u'v' else: # Assume it's no.1 if there are no digits versetype = tag diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index ad18b57ef..f4a43c3b4 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -200,7 +200,7 @@ class SongImport(QtCore.QObject): return self.media_files.append(filename) - def add_verse(self, versetext, versetag=u'V', lang=None): + def add_verse(self, versetext, versetag=u'v', lang=None): """ Add a verse. This is the whole verse, lines split by \\n. It will also attempt to detect duplicates. In this case it will just add to the verse @@ -278,23 +278,14 @@ class SongImport(QtCore.QObject): sxml = SongXML() other_count = 1 for (versetag, versetext, lang) in self.verses: - if versetag[0] == u'C': - versetype = VerseType.to_string(VerseType.Chorus) - elif versetag[0] == u'V': - versetype = VerseType.to_string(VerseType.Verse) - elif versetag[0] == u'B': - versetype = VerseType.to_string(VerseType.Bridge) - elif versetag[0] == u'I': - versetype = VerseType.to_string(VerseType.Intro) - elif versetag[0] == u'P': - versetype = VerseType.to_string(VerseType.PreChorus) - elif versetag[0] == u'E': - versetype = VerseType.to_string(VerseType.Ending) + if versetag[0].lower() in VerseType.Tags: + versetype = versetag[0].lower() else: - newversetag = u'O%d' % other_count + newversetag = u'%s%d' % (VerseType.Tags[VerseType.Other], + other_count) verses_changed_to_other[versetag] = newversetag other_count += 1 - versetype = VerseType.to_string(VerseType.Other) + versetype = VerseType.Tags[VerseType.Other] log.info(u'Versetype %s changing to %s' , versetag, newversetag) versetag = newversetag sxml.add_verse_to_lyrics(versetype, versetag[1:], versetext, lang) From 18f43fc8589df13160085a37b0cc447d9984bc12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Wed, 16 Feb 2011 21:28:55 +0200 Subject: [PATCH 154/243] more lower case tags --- openlp/plugins/songs/lib/opensongimport.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openlp/plugins/songs/lib/opensongimport.py b/openlp/plugins/songs/lib/opensongimport.py index 320339f36..36d46b903 100644 --- a/openlp/plugins/songs/lib/opensongimport.py +++ b/openlp/plugins/songs/lib/opensongimport.py @@ -231,7 +231,7 @@ class OpenSongImport(SongImport): if thisline.startswith(u'['): # drop the square brackets right_bracket = thisline.find(u']') - content = thisline[1:right_bracket].upper() + content = thisline[1:right_bracket].lower() # have we got any digits? # If so, versenumber is everything from the digits # to the end (even if there are some alpha chars on the end) @@ -276,9 +276,9 @@ class OpenSongImport(SongImport): # figure out the presentation order, if present if u'presentation' in fields and root.presentation != u'': order = unicode(root.presentation) - # We make all the tags in the lyrics upper case, so match that here + # We make all the tags in the lyrics lower case, so match that here # and then split into a list on the whitespace - order = order.upper().split() + order = order.lower().split() for tag in order: match = re.match(u'(.*)(\d+.*)', tag) if match is not None: From e401bc851d59e0eb416fc2132bd679bc693adf02 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 17 Feb 2011 02:33:12 +0000 Subject: [PATCH 155/243] Some naming cleanups --- openlp/core/lib/mediamanageritem.py | 9 ++--- openlp/core/ui/mainwindow.py | 34 +++++++++---------- openlp/core/ui/themestab.py | 2 +- openlp/plugins/images/lib/mediaitem.py | 4 +-- openlp/plugins/media/lib/mediaitem.py | 10 +++--- openlp/plugins/presentations/lib/mediaitem.py | 4 +-- 6 files changed, 32 insertions(+), 31 deletions(-) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 2fb100f30..8b6731681 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -66,10 +66,11 @@ class MediaManagerItem(QtGui.QWidget): When creating a descendant class from this class for your plugin, the following member variables should be set. - ``self.OnNewPrompt`` + ``self.onNewPrompt`` + Defaults to *'Select Image(s)'*. - ``self.OnNewFileMasks`` + ``self.onNewFileMasks`` Defaults to *'Images (*.jpg *jpeg *.gif *.png *.bmp)'*. This assumes that the new action is to load a file. If not, you need to override the ``OnNew`` method. @@ -317,9 +318,9 @@ class MediaManagerItem(QtGui.QWidget): Add a file to the list widget to make it available for showing """ files = QtGui.QFileDialog.getOpenFileNames( - self, self.OnNewPrompt, + self, self.onNewPrompt, SettingsManager.get_last_dir(self.settingsSection), - self.OnNewFileMasks) + self.onNewFileMasks) log.info(u'New files(s) %s', unicode(files)) if files: Receiver.send_message(u'cursor_busy') diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 30afe4d13..c41ad4b17 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -73,15 +73,15 @@ class Ui_MainWindow(object): # Set up the main container, which contains all the other form widgets. self.MainContent = QtGui.QWidget(mainWindow) self.MainContent.setObjectName(u'MainContent') - self.MainContentLayout = QtGui.QHBoxLayout(self.MainContent) - self.MainContentLayout.setSpacing(0) - self.MainContentLayout.setMargin(0) - self.MainContentLayout.setObjectName(u'MainContentLayout') + self.mainContentLayout = QtGui.QHBoxLayout(self.MainContent) + self.mainContentLayout.setSpacing(0) + self.mainContentLayout.setMargin(0) + self.mainContentLayout.setObjectName(u'mainContentLayout') mainWindow.setCentralWidget(self.MainContent) self.controlSplitter = QtGui.QSplitter(self.MainContent) self.controlSplitter.setOrientation(QtCore.Qt.Horizontal) self.controlSplitter.setObjectName(u'controlSplitter') - self.MainContentLayout.addWidget(self.controlSplitter) + self.mainContentLayout.addWidget(self.controlSplitter) # Create slide controllers self.previewController = SlideController(self, self.settingsmanager, self.screens) @@ -152,10 +152,10 @@ class Ui_MainWindow(object): u'themeManagerDock', u':/system/system_thememanager.png') self.themeManagerDock.setMinimumWidth( self.settingsmanager.mainwindow_right) - self.ThemeManagerContents = ThemeManager(mainWindow, + self.themeManagerContents = ThemeManager(mainWindow, self.themeManagerDock) - self.ThemeManagerContents.setObjectName(u'ThemeManagerContents') - self.themeManagerDock.setWidget(self.ThemeManagerContents) + self.themeManagerContents.setObjectName(u'themeManagerContents') + self.themeManagerDock.setWidget(self.themeManagerContents) mainWindow.addDockWidget(QtCore.Qt.RightDockWidgetArea, self.themeManagerDock) # Create the menu items @@ -256,8 +256,8 @@ class Ui_MainWindow(object): self.HelpOnlineHelpItem = base_action(mainWindow, u'HelpOnlineHelpItem') self.HelpOnlineHelpItem.setEnabled(False) mainWindow.actionList.add_action(self.HelpOnlineHelpItem, u'Help') - self.HelpWebSiteItem = base_action(mainWindow, u'HelpWebSiteItem') - mainWindow.actionList.add_action(self.HelpWebSiteItem, u'Help') + self.helpWebSiteItem = base_action(mainWindow, u'helpWebSiteItem') + mainWindow.actionList.add_action(self.helpWebSiteItem, u'Help') add_actions(self.FileImportMenu, (self.ImportThemeItem, self.ImportLanguageItem)) add_actions(self.FileExportMenu, @@ -281,7 +281,7 @@ class Ui_MainWindow(object): add_actions(self.ToolsMenu, (self.ToolsAddToolItem, None)) add_actions(self.ToolsMenu, (self.ToolsOpenDataFolder, None)) add_actions(self.HelpMenu, (self.HelpDocumentationItem, - self.HelpOnlineHelpItem, None, self.HelpWebSiteItem, + self.HelpOnlineHelpItem, None, self.helpWebSiteItem, self.HelpAboutItem)) add_actions(self.MenuBar, (self.FileMenu.menuAction(), self.viewMenu.menuAction(), self.ToolsMenu.menuAction(), @@ -418,7 +418,7 @@ class Ui_MainWindow(object): translate('OpenLP.MainWindow', 'Ctrl+F1')) self.HelpOnlineHelpItem.setText( translate('OpenLP.MainWindow', '&Online Help')) - self.HelpWebSiteItem.setText( + self.helpWebSiteItem.setText( translate('OpenLP.MainWindow', '&Web Site')) self.AutoLanguageItem.setText( translate('OpenLP.MainWindow', '&Auto Detect')) @@ -491,10 +491,10 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): # Set up signals and slots QtCore.QObject.connect(self.ImportThemeItem, QtCore.SIGNAL(u'triggered()'), - self.ThemeManagerContents.onImportTheme) + self.themeManagerContents.onImportTheme) QtCore.QObject.connect(self.ExportThemeItem, QtCore.SIGNAL(u'triggered()'), - self.ThemeManagerContents.onExportTheme) + self.themeManagerContents.onExportTheme) QtCore.QObject.connect(self.ViewMediaManagerItem, QtCore.SIGNAL(u'triggered(bool)'), self.toggleMediaManager) QtCore.QObject.connect(self.ViewServiceManagerItem, @@ -514,7 +514,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): QtCore.QObject.connect(self.themeManagerDock, QtCore.SIGNAL(u'visibilityChanged(bool)'), self.ViewThemeManagerItem.setChecked) - QtCore.QObject.connect(self.HelpWebSiteItem, + QtCore.QObject.connect(self.helpWebSiteItem, QtCore.SIGNAL(u'triggered()'), self.onHelpWebSiteClicked) QtCore.QObject.connect(self.HelpAboutItem, QtCore.SIGNAL(u'triggered()'), self.onHelpAboutItemClicked) @@ -573,7 +573,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): # RenderManager needs to call ThemeManager and # ThemeManager needs to call RenderManager self.renderManager = RenderManager( - self.ThemeManagerContents, self.screens) + self.themeManagerContents, self.screens) # Define the media Dock Manager self.mediaDockManager = MediaDockManager(self.MediaToolBox) log.info(u'Load Plugins') @@ -607,7 +607,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): self.pluginManager.initialise_plugins() # Once all components are initialised load the Themes log.info(u'Load Themes') - self.ThemeManagerContents.loadThemes() + self.themeManagerContents.loadThemes() log.info(u'Load data from Settings') if QtCore.QSettings().value(u'advanced/save current plugin', QtCore.QVariant(False)).toBool(): diff --git a/openlp/core/ui/themestab.py b/openlp/core/ui/themestab.py index ba4ce5acb..20bd9a183 100644 --- a/openlp/core/ui/themestab.py +++ b/openlp/core/ui/themestab.py @@ -199,7 +199,7 @@ class ThemesTab(SettingsTab): """ Utility method to update the global theme preview image. """ - image = self.parent.ThemeManagerContents.getPreviewImage( + image = self.parent.themeManagerContents.getPreviewImage( self.global_theme) preview = QtGui.QPixmap(unicode(image)) if not preview.isNull(): diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index 137485eb5..5aa34cc24 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -50,10 +50,10 @@ class ImageMediaItem(MediaManagerItem): QtCore.SIGNAL(u'live_theme_changed'), self.liveThemeChanged) def retranslateUi(self): - self.OnNewPrompt = translate('ImagePlugin.MediaItem', + self.onNewPrompt = translate('ImagePlugin.MediaItem', 'Select Image(s)') file_formats = get_images_filter() - self.OnNewFileMasks = u'%s;;%s (*.*) (*)' % (file_formats, + self.onNewFileMasks = u'%s;;%s (*.*) (*)' % (file_formats, UiStrings.AllFiles) self.replaceAction.setText(UiStrings.ReplaceBG) self.replaceAction.setToolTip(UiStrings.ReplaceLiveBG) diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index 89db9d993..fd98cdefa 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -58,8 +58,8 @@ class MediaMediaItem(MediaManagerItem): self.videoStart) def retranslateUi(self): - self.OnNewPrompt = translate('MediaPlugin.MediaItem', 'Select Media') - self.OnNewFileMasks = unicode(translate('MediaPlugin.MediaItem', + self.onNewPrompt = translate('MediaPlugin.MediaItem', 'Select Media') + self.onNewFileMasks = unicode(translate('MediaPlugin.MediaItem', 'Videos (%s);;Audio (%s);;%s (*)')) % (self.parent.video_list, self.parent.audio_list, UiStrings.AllFiles) self.replaceAction.setText(UiStrings.ReplaceBG) @@ -124,7 +124,7 @@ class MediaMediaItem(MediaManagerItem): return False filename = unicode(item.data(QtCore.Qt.UserRole).toString()) if os.path.exists(filename): - self.MediaState = None + self.mediaState = None self.mediaObject.stop() self.mediaObject.clearQueue() self.mediaObject.setCurrentSource(Phonon.MediaSource(filename)) @@ -136,7 +136,7 @@ class MediaMediaItem(MediaManagerItem): service_item.theme = -1 frame = u':/media/image_clapperboard.png' (path, name) = os.path.split(filename) - while not self.MediaState: + while not self.mediaState: Receiver.send_message(u'openlp_process_events') service_item.media_length = self.mediaLength service_item.add_from_command(path, name, frame) @@ -182,6 +182,6 @@ class MediaMediaItem(MediaManagerItem): Start the video at a predetermined point. """ if newState == Phonon.PlayingState: - self.MediaState = newState + self.mediaState = newState self.mediaLength = self.mediaObject.totalTime()/1000 self.mediaObject.stop() diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index 64c1f7ece..35db047e2 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -60,7 +60,7 @@ class PresentationMediaItem(MediaManagerItem): """ The name of the plugin media displayed in UI """ - self.OnNewPrompt = translate('PresentationPlugin.MediaItem', + self.onNewPrompt = translate('PresentationPlugin.MediaItem', 'Select Presentation(s)') self.Automatic = translate('PresentationPlugin.MediaItem', 'Automatic') @@ -80,7 +80,7 @@ class PresentationMediaItem(MediaManagerItem): if fileType.find(type) == -1: fileType += u'*.%s ' % type self.parent.serviceManager.supportedSuffixes(type) - self.OnNewFileMasks = unicode(translate('PresentationPlugin.MediaItem', + self.onNewFileMasks = unicode(translate('PresentationPlugin.MediaItem', 'Presentations (%s)')) % fileType def requiredIcons(self): From 9d88cec9d36546f30cf0aa063d1907d6511fa805 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Thu, 17 Feb 2011 13:53:07 +0100 Subject: [PATCH 156/243] fixed creating theme preview image too early, fixed indents --- openlp/core/lib/__init__.py | 3 ++- openlp/core/lib/imagemanager.py | 6 ++---- openlp/core/lib/rendermanager.py | 12 ++++++------ openlp/core/ui/thememanager.py | 23 ++++++++++++----------- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index 5247ae938..80bf4a67b 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -239,7 +239,8 @@ def resize_image(image, width, height, background=QtCore.Qt.black): Resize an image to fit on the current screen. ``image`` - The image to resize. + The image to resize. It has to be either a ``QImage`` instance or the + path to the image. ``width`` The new image width. diff --git a/openlp/core/lib/imagemanager.py b/openlp/core/lib/imagemanager.py index fb242602a..0a76ce834 100644 --- a/openlp/core/lib/imagemanager.py +++ b/openlp/core/lib/imagemanager.py @@ -85,8 +85,7 @@ class ImageManager(QtCore.QObject): for key in self._cache.keys(): image = self._cache[key] image.dirty = True - image.image = resize_image(image.path, - self.width, self.height) + image.image = resize_image(image.path, self.width, self.height) self._cache_dirty = True # only one thread please if not self._thread_running: @@ -128,8 +127,7 @@ class ImageManager(QtCore.QObject): image = Image() image.name = name image.path = path - image.image = resize_image(path, - self.width, self.height) + image.image = resize_image(path, self.width, self.height) self._cache[name] = image else: log.debug(u'Image in cache %s:%s' % (name, path)) diff --git a/openlp/core/lib/rendermanager.py b/openlp/core/lib/rendermanager.py index 32a29915f..860a52b60 100644 --- a/openlp/core/lib/rendermanager.py +++ b/openlp/core/lib/rendermanager.py @@ -203,12 +203,12 @@ class RenderManager(object): # set the default image size for previews self.calculate_default(self.screens.preview[u'size']) verse = u'The Lord said to {r}Noah{/r}: \n' \ - 'There\'s gonna be a {su}floody{/su}, {sb}floody{/sb}\n' \ - 'The Lord said to {g}Noah{/g}:\n' \ - 'There\'s gonna be a {st}floody{/st}, {it}floody{/it}\n' \ - 'Get those children out of the muddy, muddy \n' \ - '{r}C{/r}{b}h{/b}{bl}i{/bl}{y}l{/y}{g}d{/g}{pk}' \ - 'r{/pk}{o}e{/o}{pp}n{/pp} of the Lord\n' + 'There\'s gonna be a {su}floody{/su}, {sb}floody{/sb}\n' \ + 'The Lord said to {g}Noah{/g}:\n' \ + 'There\'s gonna be a {st}floody{/st}, {it}floody{/it}\n' \ + 'Get those children out of the muddy, muddy \n' \ + '{r}C{/r}{b}h{/b}{bl}i{/bl}{y}l{/y}{g}d{/g}{pk}' \ + 'r{/pk}{o}e{/o}{pp}n{/pp} of the Lord\n' # make big page for theme edit dialog to get line count if self.force_page: verse = verse + verse + verse diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 015e48f23..78c4596e3 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -529,6 +529,18 @@ class ThemeManager(QtGui.QWidget): else: outfile = open(fullpath, u'wb') outfile.write(zip.read(file)) + except (IOError, NameError): + critical_error_message_box( + translate('OpenLP.ThemeManager', 'Validation Error'), + translate('OpenLP.ThemeManager', 'File is not a valid theme.')) + log.exception(u'Importing theme from zip failed %s' % filename) + finally: + # Close the files, to be able to continue creating the theme. + if zip: + zip.close() + if outfile: + outfile.close() + # As all files are closed, we can create the Theme. if filexml: theme = self._createThemeFromXml(filexml, self.path) self.generateAndSaveImage(dir, themename, theme) @@ -539,17 +551,6 @@ class ThemeManager(QtGui.QWidget): 'File is not a valid theme.')) log.exception(u'Theme file does not contain XML data %s' % filename) - except (IOError, NameError): - critical_error_message_box( - translate('OpenLP.ThemeManager', 'Validation Error'), - translate('OpenLP.ThemeManager', - 'File is not a valid theme.')) - log.exception(u'Importing theme from zip failed %s' % filename) - finally: - if zip: - zip.close() - if outfile: - outfile.close() def checkIfThemeExists(self, themeName): """ From 02c1bd441332c9b7c53044d12a3d93e7f7749df1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Thu, 17 Feb 2011 17:05:58 +0200 Subject: [PATCH 157/243] first working example with unilanguage tags handling --- openlp/plugins/songs/forms/editsongform.py | 72 +++++++++-- openlp/plugins/songs/forms/editversedialog.py | 14 +-- openlp/plugins/songs/forms/editverseform.py | 30 +++-- openlp/plugins/songs/lib/__init__.py | 115 ++++++++++-------- openlp/plugins/songs/lib/mediaitem.py | 16 ++- 5 files changed, 161 insertions(+), 86 deletions(-) diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 39f1ba256..7ff129de8 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -228,7 +228,14 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): self.verseListWidget.clear() self.verseListWidget.setRowCount(0) if self.song.verse_order: - self.verseOrderEdit.setText(self.song.verse_order) + # we translate verse order + translated = [] + for verse in self.song.verse_order.split(): + verseindex = VerseType.from_tag(verse[0]) + versetype = VerseType.Translations[verseindex][0] + versetag = verse[1:] + translated.append(u'%s%s' % (versetype, versetag)) + self.verseOrderEdit.setText(u' '.join(translated)) else: self.verseOrderEdit.setText(u'') if self.song.comments: @@ -256,6 +263,20 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): for count, verse in enumerate(verseList): self.verseListWidget.setRowCount( self.verseListWidget.rowCount() + 1) + # this takes care of silently migrating from old or any markup + # if we entirely trusted the database, this should + # be unnecessary in the future + vtype = verse[0][u'type'] + index = None + if len(vtype) > 1: + index = VerseType.from_translated_string(vtype) + if index is None: + index = VerseType.from_string(vtype) + if index is None: + index = VerseType.from_tag(vtype) + if index is None: + index = VerseType.Other + verse[0][u'type'] = VerseType.Tags[index] variant = u'%s:%s' % (verse[0][u'type'], verse[0][u'label']) item = QtGui.QTableWidgetItem(verse[1]) item.setData(QtCore.Qt.UserRole, QtCore.QVariant(variant)) @@ -267,7 +288,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): self.verseListWidget.rowCount() + 1) item = QtGui.QTableWidgetItem(verse) variant = u'%s:%s' % \ - (VerseType.to_string(VerseType.Verse), unicode(count + 1)) + (VerseType.Tags[VerseType.Verse], unicode(count + 1)) item.setData(QtCore.Qt.UserRole, QtCore.QVariant(variant)) self.verseListWidget.setItem(count, 0, item) self.verseListWidget.resizeRowsToContents() @@ -299,7 +320,8 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): item = self.verseListWidget.item(row, 0) data = unicode(item.data(QtCore.Qt.UserRole).toString()) bit = data.split(u':') - rowTag = u'%s%s' % (bit[0][0:1], bit[1]) + bit[0] = VerseType.Translations[VerseType.from_tag(bit[0])][0] + rowTag = u'%s%s' % (bit[0], bit[1]) rowLabel.append(rowTag) self.verseListWidget.setVerticalHeaderLabels(rowLabel) @@ -467,7 +489,9 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): for row in range(0, self.verseListWidget.rowCount()): item = self.verseListWidget.item(row, 0) field = unicode(item.data(QtCore.Qt.UserRole).toString()) - verse_list += u'---[%s]---\n' % field + versetype, versenum = field.split(u':') + versetype = VerseType.to_translated_string(versetype) + verse_list += u'---[%s:%s]---\n' % (versetype, versenum) verse_list += item.text() verse_list += u'\n' self.verse_form.setVerse(verse_list) @@ -483,9 +507,18 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): for count, parts in enumerate(match.split(u']---\n')): if len(parts) > 1: if count == 0: - # make sure the tag is correctly cased - variant = u'%s%s' % \ - (parts[0:1].upper(), parts[1:].lower()) + # handling carefully user inputted versetags + separator = parts.find(u':') + if separator >= 0: + verse = parts[0:separator].strip() + subVerse = parts[separator+1:].strip() + else: + verse = parts + verseIndex = VerseType.from_loose_input(verse) + verseType = VerseType.Tags[verseIndex] + if not len(subVerse): + subVerse = u'1' + variant = u'%s:%s' % (verseType, subVerse) else: if parts.endswith(u'\n'): parts = parts.rstrip(u'\n') @@ -543,9 +576,13 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): order_names = unicode(self.verseOrderEdit.text()).split() for item in order_names: if len(item) == 1: - order.append(item.lower() + u'1') + order.append(VerseType.Tags[VerseType.from_translated_tag( + item)] + u'1') else: - order.append(item.lower()) + versetag = VerseType.Tags[ + VerseType.from_translated_tag(item[0])] + versenum = item[1:].lower() + order.append(u'%s%s' % (versetag, versenum)) verses = [] verse_names = [] for index in range (0, self.verseListWidget.rowCount()): @@ -561,7 +598,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): self.verseOrderEdit.setFocus() valid = verses.pop(0) for verse in verses: - valid = valid + u', ' + verse + valid = valid + u', ' + verse.upper() critical_error_message_box( message=unicode(translate('SongsPlugin.EditSongForm', 'The verse order is invalid. There is no verse ' @@ -572,12 +609,16 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): if verse not in order: self.songTabWidget.setCurrentIndex(0) self.verseOrderEdit.setFocus() + versetype, versenum = verse_names[count].split(u':') + verseindex = VerseType.from_tag(versetype) + versetype = VerseType.Translations[verseindex][0] + versename = u'%s%s' % (versetype, versenum) answer = QtGui.QMessageBox.warning(self, translate('SongsPlugin.EditSongForm', 'Warning'), unicode(translate('SongsPlugin.EditSongForm', 'You have not used %s anywhere in the verse ' 'order. Are you sure you want to save the song ' - 'like this?')) % verse_names[count].replace(u':', u' '), + 'like this?')) % versename, QtGui.QMessageBox.Yes | QtGui.QMessageBox.No) if answer == QtGui.QMessageBox.No: return False @@ -684,7 +725,14 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): else: self.song.search_title = self.song.title self.song.comments = unicode(self.commentsEdit.toPlainText()) - self.song.verse_order = unicode(self.verseOrderEdit.text()) + ordertext = unicode(self.verseOrderEdit.text()) + order = [] + for item in ordertext.split(): + versetag = VerseType.Tags[ + VerseType.from_translated_tag(item[0])] + versenum = item[1:].lower() + order.append(u'%s%s' % (versetag, versenum)) + self.song.verse_order = u' '.join(order) self.song.ccli_number = unicode(self.CCLNumberEdit.text()) self.song.song_number = unicode(self.songBookNumberEdit.text()) book_name = unicode(self.songBookComboBox.currentText()) diff --git a/openlp/plugins/songs/forms/editversedialog.py b/openlp/plugins/songs/forms/editversedialog.py index 7caf782e6..fe857e12a 100644 --- a/openlp/plugins/songs/forms/editversedialog.py +++ b/openlp/plugins/songs/forms/editversedialog.py @@ -71,18 +71,18 @@ class Ui_EditVerseDialog(object): self.verseTypeLabel.setText( translate('SongsPlugin.EditVerseForm', '&Verse type:')) self.verseTypeComboBox.setItemText(0, - VerseType.to_string(VerseType.Verse)) + VerseType.Translations[VerseType.Verse]) self.verseTypeComboBox.setItemText(1, - VerseType.to_string(VerseType.Chorus)) + VerseType.Translations[VerseType.Chorus]) self.verseTypeComboBox.setItemText(2, - VerseType.to_string(VerseType.Bridge)) + VerseType.Translations[VerseType.Bridge]) self.verseTypeComboBox.setItemText(3, - VerseType.to_string(VerseType.PreChorus)) + VerseType.Translations[VerseType.PreChorus]) self.verseTypeComboBox.setItemText(4, - VerseType.to_string(VerseType.Intro)) + VerseType.Translations[VerseType.Intro]) self.verseTypeComboBox.setItemText(5, - VerseType.to_string(VerseType.Ending)) + VerseType.Translations[VerseType.Ending]) self.verseTypeComboBox.setItemText(6, - VerseType.to_string(VerseType.Other)) + VerseType.Translations[VerseType.Other]) self.insertButton.setText( translate('SongsPlugin.EditVerseForm', '&Insert')) diff --git a/openlp/plugins/songs/forms/editverseform.py b/openlp/plugins/songs/forms/editverseform.py index e67e0733a..bb9d9e906 100644 --- a/openlp/plugins/songs/forms/editverseform.py +++ b/openlp/plugins/songs/forms/editverseform.py @@ -57,7 +57,7 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): QtCore.QObject.connect(self.verseTypeComboBox, QtCore.SIGNAL(u'currentIndexChanged(int)'), self.onVerseTypeComboBoxChanged) - self.verse_regex = re.compile(r'---\[([-\w]+):([\d]+)\]---') + self.verse_regex = re.compile(r'---\[(.+):(.+)\]---') def contextMenu(self, point): item = self.serviceManagerList.itemAt(point) @@ -70,8 +70,8 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): def onInsertButtonClicked(self): verse_type = self.verseTypeComboBox.currentIndex() - if VerseType.to_string(verse_type) is not None: - self.insertVerse(VerseType.to_string(verse_type), + if VerseType.to_translated_string(verse_type) is not None: + self.insertVerse(VerseType.to_translated_string(verse_type), self.verseNumberBox.value()) def onVerseTypeComboBoxChanged(self): @@ -81,7 +81,8 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): """ position = self.verseTextEdit.textCursor().position() text = unicode(self.verseTextEdit.toPlainText()) - verse_type = VerseType.to_string(self.verseTypeComboBox.currentIndex()) + verse_type = VerseType.Translations[ + self.verseTypeComboBox.currentIndex()] if not text: return position = text.rfind(u'---[%s' % verse_type, 0, position) @@ -97,7 +98,11 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): if match: verse_type = match.group(1) verse_number = int(match.group(2)) - verse_type_index = VerseType.from_string(verse_type) + verse_type_index = VerseType.from_translated_string(verse_type) + if verse_type_index is None: + verse_type_index = VerseType.from_string(verse_type) + if verse_type_index is None: + verse_type_index = VerseType.from_tag(verse_type) if verse_type_index is not None: self.verseNumberBox.setValue(verse_number) @@ -125,24 +130,25 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): if match: verse_type = match.group(1) verse_number = int(match.group(2)) - verse_type_index = VerseType.from_string(verse_type) + verse_type_index = VerseType.from_loose_input(verse_type) if verse_type_index is not None: self.verseTypeComboBox.setCurrentIndex(verse_type_index) self.verseNumberBox.setValue(verse_number) def setVerse(self, text, single=False, - tag=u'%s:1' % VerseType.to_string(VerseType.Verse)): + tag=u'%s:1' % VerseType.tag(VerseType.Verse)): self.hasSingleVerse = single if single: verse_type, verse_number = tag.split(u':') - verse_type_index = VerseType.from_string(verse_type) + verse_type_index = VerseType.from_tag(verse_type) if verse_type_index is not None: self.verseTypeComboBox.setCurrentIndex(verse_type_index) self.verseNumberBox.setValue(int(verse_number)) self.insertButton.setVisible(False) else: if not text: - text = u'---[%s:1]---\n' % VerseType.to_string(VerseType.Verse) + text = u'---[%s:1]---\n' % \ + VerseType.to_translated_string(VerseType.Verse) self.verseTypeComboBox.setCurrentIndex(0) self.verseNumberBox.setValue(1) self.insertButton.setVisible(True) @@ -152,14 +158,14 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): def getVerse(self): return self.verseTextEdit.toPlainText(), \ - VerseType.to_string(self.verseTypeComboBox.currentIndex()), \ + VerseType.Tags[self.verseTypeComboBox.currentIndex()], \ unicode(self.verseNumberBox.value()) def getVerseAll(self): text = self.verseTextEdit.toPlainText() if not text.startsWith(u'---['): - text = u'---[%s:1]---\n%s' % (VerseType.to_string(VerseType.Verse), - text) + text = u'---[%s:1]---\n%s' % \ + (VerseType.to_translated_string(VerseType.Verse), text) return text def accept(self): diff --git a/openlp/plugins/songs/lib/__init__.py b/openlp/plugins/songs/lib/__init__.py index 4adeb5345..7853f6c61 100644 --- a/openlp/plugins/songs/lib/__init__.py +++ b/openlp/plugins/songs/lib/__init__.py @@ -56,121 +56,138 @@ class VerseType(object): u'Ending', u'Other'] Translations = [ - translate('SongsPlugin.VerseType', 'Verse'), - translate('SongsPlugin.VerseType', 'Chorus'), - translate('SongsPlugin.VerseType', 'Bridge'), - translate('SongsPlugin.VerseType', 'Pre-Chorus'), - translate('SongsPlugin.VerseType', 'Intro'), - translate('SongsPlugin.VerseType', 'Ending'), - translate('SongsPlugin.VerseType', 'Other')] + unicode(translate('SongsPlugin.VerseType', 'Verse')), + unicode(translate('SongsPlugin.VerseType', 'Chorus')), + unicode(translate('SongsPlugin.VerseType', 'Bridge')), + unicode(translate('SongsPlugin.VerseType', 'Pre-Chorus')), + unicode(translate('SongsPlugin.VerseType', 'Intro')), + unicode(translate('SongsPlugin.VerseType', 'Ending')), + unicode(translate('SongsPlugin.VerseType', 'Other'))] @staticmethod - def tag(verse_type, strict=False): + def tag(verse_type): """ Return a string for a given VerseType tag ``verse_type`` The verse type to return a string for - - ``strict`` - If strict, False is returned instead of Other, when not found """ if isinstance(verse_type, int): - if verse_type >=0 and verse_type <= 6: + try: return VerseType.Tags[verse_type] - else: - return self.returnvalue(VerseType.Tags, strict) + except: + return elif verse_type[0].lower() in VerseType.Tags: return verse_type[0].lower() - else: - return VerseType.returnvalue(VerseType.Tags, strict) @staticmethod - def to_string(verse_type, strict=False): + def to_string(verse_type): """ Return a string for a given VerseType Name ``verse_type`` The type to return a string for - - ``strict`` - If strict, False is returned instead of Other, when not found """ if isinstance(verse_type, int): - if verse_type >=0 and verse_type <= 6: + try: return VerseType.Names[verse_type] - else: - return self.returnvalue(VerseType.Names, strict) + except: + return else: verse_type = verse_type[0].lower() for num, tag in enumerate(VerseType.Tags): if verse_type == tag: return VerseType.Names[num] - return VerseType.returnvalue(VerseType.Names, strict) @staticmethod - def to_translated_string(verse_type, strict=False): + def to_translated_string(verse_type): """ Return a string for a given VerseType Name ``verse_type`` The type to return a string for - - ``strict`` - If strict, False is returned instead of Other, when not found """ if isinstance(verse_type, int): - if verse_type >=0 and verse_type <= 6: + try: return VerseType.Translations[verse_type] - else: - return self.returnvalue(VerseType.Translations, strict) + except: + return else: verse_type = verse_type[0].lower() for num, tag in enumerate(VerseType.Tags): if verse_type == tag: return VerseType.Translations[num] - return VerseType.returnvalue(VerseType.Translations, strict) @staticmethod - def from_string(verse_type, strict=False): + def from_tag(verse_type): + """ + Return the VerseType for a given tag + + ``verse_type`` + The string to return a VerseType for + """ + verse_type = verse_type[0].lower() + for num, string in enumerate(VerseType.Tags): + if verse_type == string: + return num + + @staticmethod + def from_translated_tag(verse_type): + """ + Return the VerseType for a given tag + + ``verse_type`` + The string to return a VerseType for + """ + verse_type = verse_type[0].lower() + for num, string in enumerate(VerseType.Translations): + if verse_type == string[0].lower(): + return num + + @staticmethod + def from_string(verse_type): """ Return the VerseType for a given string ``verse_type`` The string to return a VerseType for - - ``strict`` - If strict, False is returned instead of Other, when not found """ verse_type = verse_type.lower() for num, string in enumerate(VerseType.Names): - if verse_type == string: + if verse_type == string.lower(): return num - return VerseType.returnvalue(range(0,7), strict) @staticmethod - def from_translated_string(verse_type, strict=False): + def from_translated_string(verse_type): """ Return the VerseType for a given string ``verse_type`` The string to return a VerseType for - - ``strict`` - If strict, False is returned instead of Other, when not found """ verse_type = verse_type.lower() for num, translation in enumerate(VerseType.Translations): - if verse_type == translation: + if verse_type == translation.lower(): return num - return VerseType.returnvalue(range(0,7), strict) @staticmethod - def returnvalue(lst, strict): - if strict: - return False - else: - return lst[VerseType.Other] + def from_loose_input(verse_type): + """ + Return the VerseType for a given string, Other if not found + + ``verse_type`` + The string to return a VerseType for + """ + verseIndex = None + if len(verse_type) > 1: + verseIndex = VerseType.from_translated_string(verse_type) + if verseIndex is None: + verseIndex = VerseType.from_string(verse_type) + if verseIndex is None: + verseIndex = VerseType.from_translated_tag(verse_type) + elif verseIndex is None: + verseIndex = VerseType.from_tag(verse_type) + return verseIndex def retrieve_windows_encoding(recommendation=None): """ diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 283aa6c03..28f7822cb 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -36,7 +36,7 @@ from openlp.core.lib import MediaManagerItem, Receiver, ItemCapabilities, \ from openlp.core.lib.ui import UiStrings from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm, \ SongImportForm, SongExportForm -from openlp.plugins.songs.lib import OpenLyrics, SongXML +from openlp.plugins.songs.lib import OpenLyrics, SongXML, VerseType from openlp.plugins.songs.lib.db import Author, Song from openlp.core.lib.searchedit import SearchEdit @@ -344,22 +344,26 @@ class SongMediaItem(MediaManagerItem): if song.lyrics.startswith(u' Date: Thu, 17 Feb 2011 17:19:02 +0200 Subject: [PATCH 158/243] fix when loading from db to show preview/live --- openlp/plugins/songs/lib/mediaitem.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 28f7822cb..e71939bb7 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -346,8 +346,20 @@ class SongMediaItem(MediaManagerItem): # no verse list or only 1 space (in error) if not song.verse_order.strip(): for verse in verseList: - verseindex = VerseType.from_tag(verse[0][u'type']) - versetype = VerseType.Translations[verseindex][0] + # we cannot use from_loose_input() here, because database + # is supposed to contain English lowercase singlechar tags + verse_type = verse[0][u'type'] + verseIndex = None + if len(verse_type) > 1: + verseIndex = \ + VerseType.from_translated_string(verse_type) + if verseIndex is None: + verseIndex = VerseType.from_string(verse_type) + if verseIndex is None: + verseIndex = VerseType.from_tag(verse_type) + if verseIndex is None: + verseIndex = VerseType.Other + versetype = VerseType.Translations[verseIndex][0] verseTag = u'%s:%s' % (versetype, verse[0][u'label']) service_item.add_from_text( verse[1][:30], unicode(verse[1]), verseTag) From 9e6cfcfed4c7006db976cbe3f9ecf1b6feeb02cc Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Thu, 17 Feb 2011 17:11:32 +0100 Subject: [PATCH 159/243] clear search edit, when starting the wizard again; check/uncheck button change state of visible songs --- openlp/plugins/songs/forms/songexportform.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index 849a1ad1e..f331fbcb9 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -252,6 +252,7 @@ class SongExportForm(OpenLPWizard): self.availableListWidget.clear() self.selectedListWidget.clear() self.directoryLineEdit.clear() + self.searchLineEdit.clear() # Load the list of songs. Receiver.send_message(u'cursor_busy') songs = self.plugin.manager.get_all_objects(Song) @@ -340,19 +341,21 @@ class SongExportForm(OpenLPWizard): def onUncheckButtonClicked(self): """ - The *uncheckButton* has been clicked. Set all songs unchecked. + The *uncheckButton* has been clicked. Set all visible songs unchecked. """ for row in range(self.availableListWidget.count()): item = self.availableListWidget.item(row) - item.setCheckState(QtCore.Qt.Unchecked) + if not item.isHidden(): + item.setCheckState(QtCore.Qt.Unchecked) def onCheckButtonClicked(self): """ - The *checkButton* has been clicked. Set all songs checked. + The *checkButton* has been clicked. Set all visible songs checked. """ for row in range(self.availableListWidget.count()): item = self.availableListWidget.item(row) - item.setCheckState(QtCore.Qt.Checked) + if not item.isHidden(): + item.setCheckState(QtCore.Qt.Checked) def onDirectoryButtonClicked(self): """ From 059ca9ac08487a845b935d45dc904550ae66dfa9 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Thu, 17 Feb 2011 21:02:47 +0200 Subject: [PATCH 160/243] Updated InnoSetup script to add a 'Debug' shortcut to the Start Menu which invokes debug logging. --- resources/windows/OpenLP-2.0.iss | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/windows/OpenLP-2.0.iss b/resources/windows/OpenLP-2.0.iss index a85b41187..c64e2b488 100644 --- a/resources/windows/OpenLP-2.0.iss +++ b/resources/windows/OpenLP-2.0.iss @@ -68,6 +68,7 @@ Source: ..\..\dist\OpenLP\*; DestDir: {app}; Flags: ignoreversion recursesubdirs [Icons] Name: {group}\{#AppName}; Filename: {app}\{#AppExeName} +Name: {group}\{#AppName} (Debug); Filename: {app}\{#AppExeName}; Parameters: -l debug Name: {group}\{cm:ProgramOnTheWeb,{#AppName}}; Filename: {#AppURL} Name: {group}\{cm:UninstallProgram,{#AppName}}; Filename: {uninstallexe} Name: {commondesktop}\{#AppName}; Filename: {app}\{#AppExeName}; Tasks: desktopicon From dff393b6a4df6ff4e04190487fc49e254d6aac5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Thu, 17 Feb 2011 21:46:01 +0200 Subject: [PATCH 161/243] just another massive set of changes --- openlp/core/ui/slidecontroller.py | 15 ++-- openlp/plugins/songs/forms/editsongform.py | 87 +++++++++++-------- openlp/plugins/songs/forms/editversedialog.py | 28 +++--- openlp/plugins/songs/forms/editverseform.py | 46 +++++----- openlp/plugins/songs/lib/__init__.py | 86 ++++-------------- openlp/plugins/songs/lib/mediaitem.py | 16 ++-- openlp/plugins/songs/lib/xml.py | 5 +- 7 files changed, 122 insertions(+), 161 deletions(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 52626f24f..fda151c19 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -603,14 +603,15 @@ class SlideController(QtGui.QWidget): slideHeight = 0 if self.serviceItem.is_text(): if frame[u'verseTag']: - bits = frame[u'verseTag'].split(u':') - tag = u'%s\n%s' % (bits[0][0], bits[1][0:] ) - tag1 = u'%s%s' % (bits[0][0], bits[1][0:] ) - row = tag + # These tags are already translated. + versetag = frame[u'verseTag'] + versetag = u'%s%s' % (versetag[0].upper(), versetag[1:]) + twolineTag = u'%s\n%s' % (versetag[0], versetag[1:] ) + row = twolineTag if self.isLive: - if tag1 not in self.slideList: - self.slideList[tag1] = framenumber - self.songMenu.menu().addAction(tag1, + if versetag not in self.slideList: + self.slideList[versetag] = framenumber + self.songMenu.menu().addAction(versetag, self.onSongBarHandler) else: row += 1 diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 7ff129de8..34cab3c74 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -230,11 +230,11 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): if self.song.verse_order: # we translate verse order translated = [] - for verse in self.song.verse_order.split(): - verseindex = VerseType.from_tag(verse[0]) - versetype = VerseType.Translations[verseindex][0] - versetag = verse[1:] - translated.append(u'%s%s' % (versetype, versetag)) + for versetag in self.song.verse_order.split(): + verseindex = VerseType.from_tag(versetag[0]) + versetype = VerseType.TranslatedTags[verseindex] + versenum = versetag[1:] + translated.append(u'%s%s' % (versetype.upper(), versenum)) self.verseOrderEdit.setText(u' '.join(translated)) else: self.verseOrderEdit.setText(u'') @@ -263,9 +263,8 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): for count, verse in enumerate(verseList): self.verseListWidget.setRowCount( self.verseListWidget.rowCount() + 1) - # this takes care of silently migrating from old or any markup - # if we entirely trusted the database, this should - # be unnecessary in the future + # This silently migrates from localized verse type markup. + # If we trusted the database, this would be unnecessary. vtype = verse[0][u'type'] index = None if len(vtype) > 1: @@ -277,7 +276,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): if index is None: index = VerseType.Other verse[0][u'type'] = VerseType.Tags[index] - variant = u'%s:%s' % (verse[0][u'type'], verse[0][u'label']) + variant = u'%s%s' % (verse[0][u'type'], verse[0][u'label']) item = QtGui.QTableWidgetItem(verse[1]) item.setData(QtCore.Qt.UserRole, QtCore.QVariant(variant)) self.verseListWidget.setItem(count, 0, item) @@ -318,10 +317,10 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): rowLabel = [] for row in range(0, self.verseListWidget.rowCount()): item = self.verseListWidget.item(row, 0) - data = unicode(item.data(QtCore.Qt.UserRole).toString()) - bit = data.split(u':') - bit[0] = VerseType.Translations[VerseType.from_tag(bit[0])][0] - rowTag = u'%s%s' % (bit[0], bit[1]) + versetag = unicode(item.data(QtCore.Qt.UserRole).toString()) + versetype = VerseType.TranslatedTags[ + VerseType.from_tag(versetag[0])].upper() + rowTag = u'%s%s' % (versetype, versetag[1:]) rowLabel.append(rowTag) self.verseListWidget.setVerticalHeaderLabels(rowLabel) @@ -442,10 +441,10 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): def onVerseAddButtonClicked(self): self.verse_form.setVerse(u'', True) if self.verse_form.exec_(): - afterText, verse, subVerse = self.verse_form.getVerse() - data = u'%s:%s' % (verse, subVerse) + afterText, versetype, versenum = self.verse_form.getVerse() + versetag = u'%s%s' % (versetype, versenum) item = QtGui.QTableWidgetItem(afterText) - item.setData(QtCore.Qt.UserRole, QtCore.QVariant(data)) + item.setData(QtCore.Qt.UserRole, QtCore.QVariant(versetag)) item.setText(afterText) self.verseListWidget.setRowCount( self.verseListWidget.rowCount() + 1) @@ -462,9 +461,9 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): verseId = unicode(item.data(QtCore.Qt.UserRole).toString()) self.verse_form.setVerse(tempText, True, verseId) if self.verse_form.exec_(): - afterText, verse, subVerse = self.verse_form.getVerse() - data = u'%s:%s' % (verse, subVerse) - item.setData(QtCore.Qt.UserRole, QtCore.QVariant(data)) + afterText, versetype, versenum = self.verse_form.getVerse() + versetag = u'%s%s' % (versetype, versenum) + item.setData(QtCore.Qt.UserRole, QtCore.QVariant(versetag)) item.setText(afterText) # number of lines has change so repaint the list moving the data if len(tempText.split(u'\n')) != len(afterText.split(u'\n')): @@ -489,8 +488,9 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): for row in range(0, self.verseListWidget.rowCount()): item = self.verseListWidget.item(row, 0) field = unicode(item.data(QtCore.Qt.UserRole).toString()) - versetype, versenum = field.split(u':') - versetype = VerseType.to_translated_string(versetype) + versetypeindex = VerseType.from_tag(field[0]) + versetype = VerseType.TranslatedNames[versetypeindex] + versenum = field[1:] verse_list += u'---[%s:%s]---\n' % (versetype, versenum) verse_list += item.text() verse_list += u'\n' @@ -510,15 +510,25 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): # handling carefully user inputted versetags separator = parts.find(u':') if separator >= 0: - verse = parts[0:separator].strip() - subVerse = parts[separator+1:].strip() + versetype = parts[0:separator].strip() + versenum = parts[separator+1:].strip() else: - verse = parts - verseIndex = VerseType.from_loose_input(verse) - verseType = VerseType.Tags[verseIndex] - if not len(subVerse): - subVerse = u'1' - variant = u'%s:%s' % (verseType, subVerse) + versetype = parts + versenum = u'1' + verseindex = \ + VerseType.from_loose_input(versetype) + if verseindex is None: + verseindex = VerseType.Verse + versetype = VerseType.Tags[verseindex] + # Later we need to handle v1a as well. + #regex = re.compile(r'(\d+\w.)') + regex = re.compile(r'\D*(\d+)\D*') + match = regex.match(versenum) + if match: + versenum = match.group(1) + else: + versenum = u'1' + variant = u'%s%s' % (versetype, versenum) else: if parts.endswith(u'\n'): parts = parts.rstrip(u'\n') @@ -585,7 +595,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): order.append(u'%s%s' % (versetag, versenum)) verses = [] verse_names = [] - for index in range (0, self.verseListWidget.rowCount()): + for index in range(0, self.verseListWidget.rowCount()): verse = self.verseListWidget.item(index, 0) verse = unicode(verse.data(QtCore.Qt.UserRole).toString()) if verse not in verse_names: @@ -609,9 +619,10 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): if verse not in order: self.songTabWidget.setCurrentIndex(0) self.verseOrderEdit.setFocus() - versetype, versenum = verse_names[count].split(u':') + versetype = verse_names[count][0] + versenum = verse_names[count][1:] verseindex = VerseType.from_tag(versetype) - versetype = VerseType.Translations[verseindex][0] + versetype = VerseType.TranslatedTags[verseindex].upper() versename = u'%s%s' % (versetype, versenum) answer = QtGui.QMessageBox.warning(self, translate('SongsPlugin.EditSongForm', 'Warning'), @@ -731,7 +742,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): versetag = VerseType.Tags[ VerseType.from_translated_tag(item[0])] versenum = item[1:].lower() - order.append(u'%s%s' % (versetag, versenum)) + order.append(u'%s%s' % (versetag, versenum)) self.song.verse_order = u' '.join(order) self.song.ccli_number = unicode(self.CCLNumberEdit.text()) self.song.song_number = unicode(self.songBookNumberEdit.text()) @@ -775,12 +786,14 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): for i in range(0, self.verseListWidget.rowCount()): item = self.verseListWidget.item(i, 0) verseId = unicode(item.data(QtCore.Qt.UserRole).toString()) - bits = verseId.split(u':') - sxml.add_verse_to_lyrics(bits[0], bits[1], unicode(item.text())) + versetype = verseId[0] + versenum = verseId[1:] + sxml.add_verse_to_lyrics(versetype, versenum, + unicode(item.text())) text = text + self.whitespace.sub(u' ', unicode(self.verseListWidget.item(i, 0).text())) + u' ' - if (bits[1] > u'1') and (bits[0][0] not in multiple): - multiple.append(bits[0][0]) + if (versenum > u'1') and (versetype not in multiple): + multiple.append(versetype) self.song.search_lyrics = text.lower() self.song.lyrics = unicode(sxml.extract_xml(), u'utf-8') for verse in multiple: diff --git a/openlp/plugins/songs/forms/editversedialog.py b/openlp/plugins/songs/forms/editversedialog.py index fe857e12a..64da3e89e 100644 --- a/openlp/plugins/songs/forms/editversedialog.py +++ b/openlp/plugins/songs/forms/editversedialog.py @@ -70,19 +70,19 @@ class Ui_EditVerseDialog(object): translate('SongsPlugin.EditVerseForm', 'Edit Verse')) self.verseTypeLabel.setText( translate('SongsPlugin.EditVerseForm', '&Verse type:')) - self.verseTypeComboBox.setItemText(0, - VerseType.Translations[VerseType.Verse]) - self.verseTypeComboBox.setItemText(1, - VerseType.Translations[VerseType.Chorus]) - self.verseTypeComboBox.setItemText(2, - VerseType.Translations[VerseType.Bridge]) - self.verseTypeComboBox.setItemText(3, - VerseType.Translations[VerseType.PreChorus]) - self.verseTypeComboBox.setItemText(4, - VerseType.Translations[VerseType.Intro]) - self.verseTypeComboBox.setItemText(5, - VerseType.Translations[VerseType.Ending]) - self.verseTypeComboBox.setItemText(6, - VerseType.Translations[VerseType.Other]) + self.verseTypeComboBox.setItemText(VerseType.Verse, + VerseType.TranslatedNames[VerseType.Verse]) + self.verseTypeComboBox.setItemText(VerseType.Chorus, + VerseType.TranslatedNames[VerseType.Chorus]) + self.verseTypeComboBox.setItemText(VerseType.Bridge, + VerseType.TranslatedNames[VerseType.Bridge]) + self.verseTypeComboBox.setItemText(VerseType.PreChorus, + VerseType.TranslatedNames[VerseType.PreChorus]) + self.verseTypeComboBox.setItemText(VerseType.Intro, + VerseType.TranslatedNames[VerseType.Intro]) + self.verseTypeComboBox.setItemText(VerseType.Ending, + VerseType.TranslatedNames[VerseType.Ending]) + self.verseTypeComboBox.setItemText(VerseType.Other, + VerseType.TranslatedNames[VerseType.Other]) self.insertButton.setText( translate('SongsPlugin.EditVerseForm', '&Insert')) diff --git a/openlp/plugins/songs/forms/editverseform.py b/openlp/plugins/songs/forms/editverseform.py index bb9d9e906..a8fe1302d 100644 --- a/openlp/plugins/songs/forms/editverseform.py +++ b/openlp/plugins/songs/forms/editverseform.py @@ -57,22 +57,23 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): QtCore.QObject.connect(self.verseTypeComboBox, QtCore.SIGNAL(u'currentIndexChanged(int)'), self.onVerseTypeComboBoxChanged) - self.verse_regex = re.compile(r'---\[(.+):(.+)\]---') + self.verse_regex = re.compile(r'---\[(.+):\D*(\d+)\D*\]---') def contextMenu(self, point): item = self.serviceManagerList.itemAt(point) - def insertVerse(self, title, num=1): + def insertVerse(self, versetype, num=1): if self.verseTextEdit.textCursor().columnNumber() != 0: self.verseTextEdit.insertPlainText(u'\n') - self.verseTextEdit.insertPlainText(u'---[%s:%s]---\n' % (title, num)) + versetype = VerseType.TranslatedNames[VerseTag.from_tag(versetype)] + self.verseTextEdit.insertPlainText(u'---[%s:%s]---\n' % \ + (versetype, num)) self.verseTextEdit.setFocus() def onInsertButtonClicked(self): - verse_type = self.verseTypeComboBox.currentIndex() - if VerseType.to_translated_string(verse_type) is not None: - self.insertVerse(VerseType.to_translated_string(verse_type), - self.verseNumberBox.value()) + vtypeindex = self.verseTypeComboBox.currentIndex() + self.insertVerse(VerseType.Tags[vtypeindex], + self.verseNumberBox.value()) def onVerseTypeComboBoxChanged(self): """ @@ -81,7 +82,7 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): """ position = self.verseTextEdit.textCursor().position() text = unicode(self.verseTextEdit.toPlainText()) - verse_type = VerseType.Translations[ + verse_type = VerseType.TranslatedNames[ self.verseTypeComboBox.currentIndex()] if not text: return @@ -98,11 +99,7 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): if match: verse_type = match.group(1) verse_number = int(match.group(2)) - verse_type_index = VerseType.from_translated_string(verse_type) - if verse_type_index is None: - verse_type_index = VerseType.from_string(verse_type) - if verse_type_index is None: - verse_type_index = VerseType.from_tag(verse_type) + verse_type_index = VerseType.from_loose_input(verse_type) if verse_type_index is not None: self.verseNumberBox.setValue(verse_number) @@ -128,19 +125,20 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): text = text[:position + 4] match = self.verse_regex.match(text) if match: - verse_type = match.group(1) - verse_number = int(match.group(2)) - verse_type_index = VerseType.from_loose_input(verse_type) - if verse_type_index is not None: - self.verseTypeComboBox.setCurrentIndex(verse_type_index) - self.verseNumberBox.setValue(verse_number) + versetype = match.group(1) + vtypeindex = VerseType.from_loose_input(versetype) + regex = re.compile(r'(\d+)') + versenum = int(match.group(2)) + if vtypeindex is not None: + self.verseTypeComboBox.setCurrentIndex(vtypeindex) + self.verseNumberBox.setValue(versenum) def setVerse(self, text, single=False, - tag=u'%s:1' % VerseType.tag(VerseType.Verse)): + tag=u'%s1' % VerseType.Tags[VerseType.Verse]): self.hasSingleVerse = single if single: - verse_type, verse_number = tag.split(u':') - verse_type_index = VerseType.from_tag(verse_type) + verse_type_index = VerseType.from_tag(tag[0]) + verse_number = tag[1:] if verse_type_index is not None: self.verseTypeComboBox.setCurrentIndex(verse_type_index) self.verseNumberBox.setValue(int(verse_number)) @@ -148,7 +146,7 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): else: if not text: text = u'---[%s:1]---\n' % \ - VerseType.to_translated_string(VerseType.Verse) + VerseType.TranslatedNames[VerseType.Verse] self.verseTypeComboBox.setCurrentIndex(0) self.verseNumberBox.setValue(1) self.insertButton.setVisible(True) @@ -165,7 +163,7 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): text = self.verseTextEdit.toPlainText() if not text.startsWith(u'---['): text = u'---[%s:1]---\n%s' % \ - (VerseType.to_translated_string(VerseType.Verse), text) + (VerseType.TranslatedNames[VerseType.Verse], text) return text def accept(self): diff --git a/openlp/plugins/songs/lib/__init__.py b/openlp/plugins/songs/lib/__init__.py index 7853f6c61..da3b97574 100644 --- a/openlp/plugins/songs/lib/__init__.py +++ b/openlp/plugins/songs/lib/__init__.py @@ -39,14 +39,7 @@ class VerseType(object): Intro = 4 Ending = 5 Other = 6 - Tags = [ - u'v', - u'c', - u'b', - u'p', - u'i', - u'e', - u'o'] + Names = [ u'Verse', u'Chorus', @@ -55,7 +48,11 @@ class VerseType(object): u'Intro', u'Ending', u'Other'] - Translations = [ + Tags = [] + for name in Names: + Tags.append(name[0].lower()) + + TranslatedNames = [ unicode(translate('SongsPlugin.VerseType', 'Verse')), unicode(translate('SongsPlugin.VerseType', 'Chorus')), unicode(translate('SongsPlugin.VerseType', 'Bridge')), @@ -63,60 +60,9 @@ class VerseType(object): unicode(translate('SongsPlugin.VerseType', 'Intro')), unicode(translate('SongsPlugin.VerseType', 'Ending')), unicode(translate('SongsPlugin.VerseType', 'Other'))] - - @staticmethod - def tag(verse_type): - """ - Return a string for a given VerseType tag - - ``verse_type`` - The verse type to return a string for - """ - if isinstance(verse_type, int): - try: - return VerseType.Tags[verse_type] - except: - return - elif verse_type[0].lower() in VerseType.Tags: - return verse_type[0].lower() - - @staticmethod - def to_string(verse_type): - """ - Return a string for a given VerseType Name - - ``verse_type`` - The type to return a string for - """ - if isinstance(verse_type, int): - try: - return VerseType.Names[verse_type] - except: - return - else: - verse_type = verse_type[0].lower() - for num, tag in enumerate(VerseType.Tags): - if verse_type == tag: - return VerseType.Names[num] - - @staticmethod - def to_translated_string(verse_type): - """ - Return a string for a given VerseType Name - - ``verse_type`` - The type to return a string for - """ - if isinstance(verse_type, int): - try: - return VerseType.Translations[verse_type] - except: - return - else: - verse_type = verse_type[0].lower() - for num, tag in enumerate(VerseType.Tags): - if verse_type == tag: - return VerseType.Translations[num] + TranslatedTags = [] + for name in TranslatedNames: + TranslatedTags.append(name[0].lower()) @staticmethod def from_tag(verse_type): @@ -140,9 +86,9 @@ class VerseType(object): The string to return a VerseType for """ verse_type = verse_type[0].lower() - for num, string in enumerate(VerseType.Translations): - if verse_type == string[0].lower(): - return num + for vtypeIndex, vtypeTag in enumerate(VerseType.TranslatedTags): + if verse_type == vtypeTag: + return vtypeIndex @staticmethod def from_string(verse_type): @@ -153,9 +99,9 @@ class VerseType(object): The string to return a VerseType for """ verse_type = verse_type.lower() - for num, string in enumerate(VerseType.Names): - if verse_type == string.lower(): - return num + for vtypeIndex, vtypeName in enumerate(VerseType.Names): + if verse_type == vtypeName.lower(): + return vtypeIndex @staticmethod def from_translated_string(verse_type): @@ -166,7 +112,7 @@ class VerseType(object): The string to return a VerseType for """ verse_type = verse_type.lower() - for num, translation in enumerate(VerseType.Translations): + for num, translation in enumerate(VerseType.TranslatedNames): if verse_type == translation.lower(): return num diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index e71939bb7..147450efd 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -346,8 +346,8 @@ class SongMediaItem(MediaManagerItem): # no verse list or only 1 space (in error) if not song.verse_order.strip(): for verse in verseList: - # we cannot use from_loose_input() here, because database - # is supposed to contain English lowercase singlechar tags + # We cannot use from_loose_input() here, because database + # is supposed to contain English lowercase singlechar tags. verse_type = verse[0][u'type'] verseIndex = None if len(verse_type) > 1: @@ -359,13 +359,12 @@ class SongMediaItem(MediaManagerItem): verseIndex = VerseType.from_tag(verse_type) if verseIndex is None: verseIndex = VerseType.Other - versetype = VerseType.Translations[verseIndex][0] - verseTag = u'%s:%s' % (versetype, verse[0][u'label']) + versetype = VerseType.TranslatedTags[verseIndex].upper() + verseTag = u'%s%s' % (versetype, verse[0][u'label']) service_item.add_from_text( verse[1][:30], unicode(verse[1]), verseTag) else: # Loop through the verse list and expand the song accordingly. - print song.verse_order for order in song.verse_order.lower().split(): if len(order) == 0: break @@ -373,9 +372,10 @@ class SongMediaItem(MediaManagerItem): if verse[0][u'type'][0] == order[0] and \ (verse[0][u'label'] == order[1:] or not order[1:]): verseindex = VerseType.from_tag(verse[0][u'type']) - versetype = VerseType.Translations[verseindex][0] - verseTag = u'%s:%s' % \ - (versetype, verse[0][u'label']) + versetype = VerseType.TranslatedTags[verseindex]\ + .upper() + verseTag = u'%s%s' % (versetype, + verse[0][u'label']) service_item.add_from_text( verse[1][:30], verse[1], verseTag) else: diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index b96e79961..bfae14db7 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -464,7 +464,10 @@ class OpenLyrics(object): text += u'\n' text += u'\n'.join([unicode(line) for line in lines.line]) verse_name = self._get(verse, u'name') - verse_type = unicode(VerseType.to_string(verse_name[0])) + verse_type_index = VerseType.from_tag(verse_name[0]) + if verse_type_index is None: + verse_type_index = VerseType.Other + verse_type = VerseType.Names[verse_type_index] verse_number = re.compile(u'[a-zA-Z]*').sub(u'', verse_name) verse_part = re.compile(u'[0-9]*').sub(u'', verse_name[1:]) # OpenLyrics allows e. g. "c", but we need "c1". From aac40357aee340028b83c7318b5f5e2e45456cb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Fri, 18 Feb 2011 02:48:58 +0200 Subject: [PATCH 162/243] better variable names, fixed translation issues for verse sequences --- openlp/core/ui/slidecontroller.py | 14 +- openlp/plugins/songs/forms/editsongform.py | 163 ++++++++++---------- openlp/plugins/songs/forms/editverseform.py | 38 ++--- openlp/plugins/songs/lib/__init__.py | 139 +++++++++++------ openlp/plugins/songs/lib/mediaitem.py | 51 +++--- openlp/plugins/songs/lib/xml.py | 2 - 6 files changed, 230 insertions(+), 177 deletions(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index fda151c19..ec9fe2080 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -604,14 +604,14 @@ class SlideController(QtGui.QWidget): if self.serviceItem.is_text(): if frame[u'verseTag']: # These tags are already translated. - versetag = frame[u'verseTag'] - versetag = u'%s%s' % (versetag[0].upper(), versetag[1:]) - twolineTag = u'%s\n%s' % (versetag[0], versetag[1:] ) - row = twolineTag + verse_def = frame[u'verseTag'] + verse_def = u'%s%s' % (verse_def[0].upper(), verse_def[1:]) + two_line_def = u'%s\n%s' % (verse_def[0], verse_def[1:] ) + row = two_line_def if self.isLive: - if versetag not in self.slideList: - self.slideList[versetag] = framenumber - self.songMenu.menu().addAction(versetag, + if verse_def not in self.slideList: + self.slideList[verse_def] = framenumber + self.songMenu.menu().addAction(verse_def, self.onSongBarHandler) else: row += 1 diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 34cab3c74..a9c5bac86 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -227,17 +227,6 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): self.copyrightEdit.setText(u'') self.verseListWidget.clear() self.verseListWidget.setRowCount(0) - if self.song.verse_order: - # we translate verse order - translated = [] - for versetag in self.song.verse_order.split(): - verseindex = VerseType.from_tag(versetag[0]) - versetype = VerseType.TranslatedTags[verseindex] - versenum = versetag[1:] - translated.append(u'%s%s' % (versetype.upper(), versenum)) - self.verseOrderEdit.setText(u' '.join(translated)) - else: - self.verseOrderEdit.setText(u'') if self.song.comments: self.commentsEdit.setPlainText(self.song.comments) else: @@ -257,6 +246,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): # This is just because occasionally the lyrics come back as a "buffer" if isinstance(self.song.lyrics, buffer): self.song.lyrics = unicode(self.song.lyrics) + verse_tags_translated = False if self.song.lyrics.startswith(u' 1: - index = VerseType.from_translated_string(vtype) + if len(verse_tag) > 1: + index = VerseType.from_translated_string(verse_tag) if index is None: - index = VerseType.from_string(vtype) + index = VerseType.from_string(verse_tag) + else: + verse_tags_translated = True if index is None: - index = VerseType.from_tag(vtype) + index = VerseType.from_tag(verse_tag) if index is None: index = VerseType.Other verse[0][u'type'] = VerseType.Tags[index] - variant = u'%s%s' % (verse[0][u'type'], verse[0][u'label']) + verse_def = u'%s%s' % (verse[0][u'type'], verse[0][u'label']) item = QtGui.QTableWidgetItem(verse[1]) - item.setData(QtCore.Qt.UserRole, QtCore.QVariant(variant)) + item.setData(QtCore.Qt.UserRole, QtCore.QVariant(verse_def)) self.verseListWidget.setItem(count, 0, item) else: verses = self.song.lyrics.split(u'\n\n') @@ -286,10 +278,24 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): self.verseListWidget.setRowCount( self.verseListWidget.rowCount() + 1) item = QtGui.QTableWidgetItem(verse) - variant = u'%s:%s' % \ + verse_def = u'%s%s' % \ (VerseType.Tags[VerseType.Verse], unicode(count + 1)) - item.setData(QtCore.Qt.UserRole, QtCore.QVariant(variant)) + item.setData(QtCore.Qt.UserRole, QtCore.QVariant(verse_def)) self.verseListWidget.setItem(count, 0, item) + if self.song.verse_order: + # we translate verse order + translated = [] + for verse_def in self.song.verse_order.split(): + verse_index = None + if verse_tags_translated: + verse_index = VerseType.from_translated_tag(verse_def[0]) + if verse_index is None: + verse_index = VerseType.from_tag(verse_def[0]) + verse_tag = VerseType.TranslatedTags[verse_index].upper() + translated.append(u'%s%s' % (verse_tag, verse_def[1:])) + self.verseOrderEdit.setText(u' '.join(translated)) + else: + self.verseOrderEdit.setText(u'') self.verseListWidget.resizeRowsToContents() self.tagRows() # clear the results @@ -314,15 +320,14 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): """ Tag the Song List rows based on the verse list """ - rowLabel = [] + row_label = [] for row in range(0, self.verseListWidget.rowCount()): item = self.verseListWidget.item(row, 0) - versetag = unicode(item.data(QtCore.Qt.UserRole).toString()) - versetype = VerseType.TranslatedTags[ - VerseType.from_tag(versetag[0])].upper() - rowTag = u'%s%s' % (versetype, versetag[1:]) - rowLabel.append(rowTag) - self.verseListWidget.setVerticalHeaderLabels(rowLabel) + verse_def = unicode(item.data(QtCore.Qt.UserRole).toString()) + verse_tag = VerseType.translated_tag(verse_def[0]) + row_def = u'%s%s' % (verse_tag, verse_def[1:]) + row_label.append(row_def) + self.verseListWidget.setVerticalHeaderLabels(row_label) def onAuthorAddButtonClicked(self): item = int(self.authorsComboBox.currentIndex()) @@ -441,11 +446,11 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): def onVerseAddButtonClicked(self): self.verse_form.setVerse(u'', True) if self.verse_form.exec_(): - afterText, versetype, versenum = self.verse_form.getVerse() - versetag = u'%s%s' % (versetype, versenum) + after_text, verse_tag, verse_num = self.verse_form.getVerse() + verse_def = u'%s%s' % (verse_tag, verse_num) item = QtGui.QTableWidgetItem(afterText) - item.setData(QtCore.Qt.UserRole, QtCore.QVariant(versetag)) - item.setText(afterText) + item.setData(QtCore.Qt.UserRole, QtCore.QVariant(verse_def)) + item.setText(after_text) self.verseListWidget.setRowCount( self.verseListWidget.rowCount() + 1) self.verseListWidget.setItem( @@ -461,12 +466,12 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): verseId = unicode(item.data(QtCore.Qt.UserRole).toString()) self.verse_form.setVerse(tempText, True, verseId) if self.verse_form.exec_(): - afterText, versetype, versenum = self.verse_form.getVerse() - versetag = u'%s%s' % (versetype, versenum) - item.setData(QtCore.Qt.UserRole, QtCore.QVariant(versetag)) - item.setText(afterText) + after_text, verse_tag, verse_num = self.verse_form.getVerse() + verse_def = u'%s%s' % (verse_tag, verse_num) + item.setData(QtCore.Qt.UserRole, QtCore.QVariant(verse_def)) + item.setText(after_text) # number of lines has change so repaint the list moving the data - if len(tempText.split(u'\n')) != len(afterText.split(u'\n')): + if len(tempText.split(u'\n')) != len(after_text.split(u'\n')): tempList = {} tempId = {} for row in range(0, self.verseListWidget.rowCount()): @@ -488,10 +493,9 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): for row in range(0, self.verseListWidget.rowCount()): item = self.verseListWidget.item(row, 0) field = unicode(item.data(QtCore.Qt.UserRole).toString()) - versetypeindex = VerseType.from_tag(field[0]) - versetype = VerseType.TranslatedNames[versetypeindex] - versenum = field[1:] - verse_list += u'---[%s:%s]---\n' % (versetype, versenum) + verse_tag = VerseType.translated_name(field[0]) + verse_num = field[1:] + verse_list += u'---[%s:%s]---\n' % (verse_tag, verse_num) verse_list += item.text() verse_list += u'\n' self.verse_form.setVerse(verse_list) @@ -510,31 +514,29 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): # handling carefully user inputted versetags separator = parts.find(u':') if separator >= 0: - versetype = parts[0:separator].strip() - versenum = parts[separator+1:].strip() + verse_name = parts[0:separator].strip() + verse_num = parts[separator+1:].strip() else: - versetype = parts - versenum = u'1' - verseindex = \ - VerseType.from_loose_input(versetype) - if verseindex is None: - verseindex = VerseType.Verse - versetype = VerseType.Tags[verseindex] + verse_name = parts + verse_num = u'1' + verse_index = \ + VerseType.from_loose_input(verse_name) + verse_tag = VerseType.Tags[verse_index] # Later we need to handle v1a as well. #regex = re.compile(r'(\d+\w.)') regex = re.compile(r'\D*(\d+)\D*') - match = regex.match(versenum) + match = regex.match(verse_num) if match: - versenum = match.group(1) + verse_num = match.group(1) else: - versenum = u'1' - variant = u'%s%s' % (versetype, versenum) + verse_num = u'1' + verse_def = u'%s%s' % (verse_tag, verse_num) else: if parts.endswith(u'\n'): parts = parts.rstrip(u'\n') item = QtGui.QTableWidgetItem(parts) item.setData(QtCore.Qt.UserRole, - QtCore.QVariant(variant)) + QtCore.QVariant(verse_def)) self.verseListWidget.setRowCount( self.verseListWidget.rowCount() + 1) self.verseListWidget.setItem( @@ -586,29 +588,31 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): order_names = unicode(self.verseOrderEdit.text()).split() for item in order_names: if len(item) == 1: - order.append(VerseType.Tags[VerseType.from_translated_tag( - item)] + u'1') + verse_index = VerseType.from_translated_tag(item) + if verse_index is not None: + order.append(VerseType.Tags[verse_index] + u'1') + else: + order.append(u'') # it matches no verses anyway else: - versetag = VerseType.Tags[ - VerseType.from_translated_tag(item[0])] - versenum = item[1:].lower() - order.append(u'%s%s' % (versetag, versenum)) + verse_index = VerseType.from_translated_tag(item[0]) + if verse_index is None: + order.append(u'') # same as above + else: + verse_tag = VerseType.Tags[verse_index] + verse_num = item[1:].lower() + order.append(verse_tag + verse_num) verses = [] verse_names = [] for index in range(0, self.verseListWidget.rowCount()): verse = self.verseListWidget.item(index, 0) verse = unicode(verse.data(QtCore.Qt.UserRole).toString()) if verse not in verse_names: - verses.append( - re.sub(r'(.)[^:]*:(.*)', r'\1\2', verse.lower())) - verse_names.append(verse) + verses.append(verse) + verse_names.append(u'%s%s' % ( + VerseType.translated_tag(verse[0]), verse[1:])) for count, item in enumerate(order): if item not in verses: - self.songTabWidget.setCurrentIndex(0) - self.verseOrderEdit.setFocus() - valid = verses.pop(0) - for verse in verses: - valid = valid + u', ' + verse.upper() + valid = u', '.join(verse_names) critical_error_message_box( message=unicode(translate('SongsPlugin.EditSongForm', 'The verse order is invalid. There is no verse ' @@ -619,17 +623,12 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): if verse not in order: self.songTabWidget.setCurrentIndex(0) self.verseOrderEdit.setFocus() - versetype = verse_names[count][0] - versenum = verse_names[count][1:] - verseindex = VerseType.from_tag(versetype) - versetype = VerseType.TranslatedTags[verseindex].upper() - versename = u'%s%s' % (versetype, versenum) answer = QtGui.QMessageBox.warning(self, translate('SongsPlugin.EditSongForm', 'Warning'), unicode(translate('SongsPlugin.EditSongForm', 'You have not used %s anywhere in the verse ' 'order. Are you sure you want to save the song ' - 'like this?')) % versename, + 'like this?')) % verse_names[count], QtGui.QMessageBox.Yes | QtGui.QMessageBox.No) if answer == QtGui.QMessageBox.No: return False @@ -739,10 +738,10 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): ordertext = unicode(self.verseOrderEdit.text()) order = [] for item in ordertext.split(): - versetag = VerseType.Tags[ + verse_tag = VerseType.Tags[ VerseType.from_translated_tag(item[0])] - versenum = item[1:].lower() - order.append(u'%s%s' % (versetag, versenum)) + verse_num = item[1:].lower() + order.append(u'%s%s' % (verse_tag, verse_num)) self.song.verse_order = u' '.join(order) self.song.ccli_number = unicode(self.CCLNumberEdit.text()) self.song.song_number = unicode(self.songBookNumberEdit.text()) @@ -786,14 +785,14 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): for i in range(0, self.verseListWidget.rowCount()): item = self.verseListWidget.item(i, 0) verseId = unicode(item.data(QtCore.Qt.UserRole).toString()) - versetype = verseId[0] - versenum = verseId[1:] - sxml.add_verse_to_lyrics(versetype, versenum, + verse_tag = verseId[0] + verse_num = verseId[1:] + sxml.add_verse_to_lyrics(verse_type, verse_num, unicode(item.text())) text = text + self.whitespace.sub(u' ', unicode(self.verseListWidget.item(i, 0).text())) + u' ' - if (versenum > u'1') and (versetype not in multiple): - multiple.append(versetype) + if (verse_num > u'1') and (verse_tag not in multiple): + multiple.append(verse_tag) self.song.search_lyrics = text.lower() self.song.lyrics = unicode(sxml.extract_xml(), u'utf-8') for verse in multiple: diff --git a/openlp/plugins/songs/forms/editverseform.py b/openlp/plugins/songs/forms/editverseform.py index a8fe1302d..ada612c43 100644 --- a/openlp/plugins/songs/forms/editverseform.py +++ b/openlp/plugins/songs/forms/editverseform.py @@ -57,22 +57,22 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): QtCore.QObject.connect(self.verseTypeComboBox, QtCore.SIGNAL(u'currentIndexChanged(int)'), self.onVerseTypeComboBoxChanged) - self.verse_regex = re.compile(r'---\[(.+):\D*(\d+)\D*\]---') + self.verse_regex = re.compile(r'---\[(.+):\D*(\d.)\D*\]---') def contextMenu(self, point): item = self.serviceManagerList.itemAt(point) - def insertVerse(self, versetype, num=1): + def insertVerse(self, verse_tag, verse_num=1): if self.verseTextEdit.textCursor().columnNumber() != 0: self.verseTextEdit.insertPlainText(u'\n') - versetype = VerseType.TranslatedNames[VerseTag.from_tag(versetype)] - self.verseTextEdit.insertPlainText(u'---[%s:%s]---\n' % \ - (versetype, num)) + verse_tag = VerseType.translated_name(verse_tag) + self.verseTextEdit.insertPlainText(u'---[%s:%s]---\n' % + (verse_tag, verse_num)) self.verseTextEdit.setFocus() def onInsertButtonClicked(self): - vtypeindex = self.verseTypeComboBox.currentIndex() - self.insertVerse(VerseType.Tags[vtypeindex], + verse_type_index = self.verseTypeComboBox.currentIndex() + self.insertVerse(VerseType.Tags[verse_type_index], self.verseNumberBox.value()) def onVerseTypeComboBoxChanged(self): @@ -82,11 +82,11 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): """ position = self.verseTextEdit.textCursor().position() text = unicode(self.verseTextEdit.toPlainText()) - verse_type = VerseType.TranslatedNames[ + verse_name = VerseType.TranslatedNames[ self.verseTypeComboBox.currentIndex()] if not text: return - position = text.rfind(u'---[%s' % verse_type, 0, position) + position = text.rfind(u'---[%s' % verse_name, 0, position) if position == -1: self.verseNumberBox.setValue(1) return @@ -97,11 +97,11 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): text = text[:position + 4] match = self.verse_regex.match(text) if match: - verse_type = match.group(1) - verse_number = int(match.group(2)) - verse_type_index = VerseType.from_loose_input(verse_type) + verse_tag = match.group(1) + verse_num = int(match.group(2)) + verse_type_index = VerseType.from_loose_input(verse_tag) if verse_type_index is not None: - self.verseNumberBox.setValue(verse_number) + self.verseNumberBox.setValue(verse_num) def onCursorPositionChanged(self): """ @@ -125,13 +125,13 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): text = text[:position + 4] match = self.verse_regex.match(text) if match: - versetype = match.group(1) - vtypeindex = VerseType.from_loose_input(versetype) + verse_type = match.group(1) + verse_type_index = VerseType.from_loose_input(verse_type) regex = re.compile(r'(\d+)') - versenum = int(match.group(2)) - if vtypeindex is not None: - self.verseTypeComboBox.setCurrentIndex(vtypeindex) - self.verseNumberBox.setValue(versenum) + verse_num = int(match.group(2)) + if verse_type_index is not None: + self.verseTypeComboBox.setCurrentIndex(verse_type_index) + self.verseNumberBox.setValue(verse_num) def setVerse(self, text, single=False, tag=u'%s1' % VerseType.Tags[VerseType.Verse]): diff --git a/openlp/plugins/songs/lib/__init__.py b/openlp/plugins/songs/lib/__init__.py index da3b97574..a1cc7e19d 100644 --- a/openlp/plugins/songs/lib/__init__.py +++ b/openlp/plugins/songs/lib/__init__.py @@ -48,9 +48,7 @@ class VerseType(object): u'Intro', u'Ending', u'Other'] - Tags = [] - for name in Names: - Tags.append(name[0].lower()) + Tags = [name[0].lower() for name in Names] TranslatedNames = [ unicode(translate('SongsPlugin.VerseType', 'Verse')), @@ -60,80 +58,129 @@ class VerseType(object): unicode(translate('SongsPlugin.VerseType', 'Intro')), unicode(translate('SongsPlugin.VerseType', 'Ending')), unicode(translate('SongsPlugin.VerseType', 'Other'))] - TranslatedTags = [] - for name in TranslatedNames: - TranslatedTags.append(name[0].lower()) + TranslatedTags = [name[0].lower() for name in TranslatedNames] @staticmethod - def from_tag(verse_type): + def translated_tag(verse_tag, strict=False): + """ + Return the translated UPPERCASE tag for a given tag, + used to show translated verse tags in UI + + ``verse_tag`` + The string to return a VerseType for + + ``strict`` + Determines if the default Other or None should be returned + """ + if strict: + not_found_value = None + else: + not_found_value = VerseType.TranslatedTags[VerseType.Other].upper() + verse_tag = verse_tag[0].lower() + for num, tag in enumerate(VerseType.Tags): + if verse_tag == tag: + return VerseType.TranslatedTags[num].upper() + return not_found_value + + @staticmethod + def translated_name(verse_tag, strict=False): + """ + Return the translated name for a given tag + + ``verse_tag`` + The string to return a VerseType for + + ``strict`` + Determines if the default Other or None should be returned + """ + if strict: + not_found_value = None + else: + not_found_value = VerseType.TranslatedNames[VerseType.Other] + verse_tag = verse_tag[0].lower() + for num, tag in enumerate(VerseType.Tags): + if verse_tag == tag: + return VerseType.TranslatedNames[num] + return not_found_value + + @staticmethod + def from_tag(verse_tag, strict=False): """ Return the VerseType for a given tag - ``verse_type`` + ``verse_tag`` + The string to return a VerseType for + + ``strict`` + Determines if the default Other or None should be returned + """ + if strict: + no_return_value = None + else: + no_return_value = VerseType.Other + verse_tag = verse_tag[0].lower() + for num, tag in enumerate(VerseType.Tags): + if verse_tag == tag: + return num + return no_return_value + + @staticmethod + def from_translated_tag(verse_tag): + """ + Return the VerseType for a given tag + + ``verse_tag`` The string to return a VerseType for """ - verse_type = verse_type[0].lower() - for num, string in enumerate(VerseType.Tags): - if verse_type == string: + verse_tag = verse_tag[0].lower() + for num, tag in enumerate(VerseType.TranslatedTags): + if verse_tag == tag: return num @staticmethod - def from_translated_tag(verse_type): - """ - Return the VerseType for a given tag - - ``verse_type`` - The string to return a VerseType for - """ - verse_type = verse_type[0].lower() - for vtypeIndex, vtypeTag in enumerate(VerseType.TranslatedTags): - if verse_type == vtypeTag: - return vtypeIndex - - @staticmethod - def from_string(verse_type): + def from_string(verse_name): """ Return the VerseType for a given string - ``verse_type`` + ``verse_name`` The string to return a VerseType for """ - verse_type = verse_type.lower() - for vtypeIndex, vtypeName in enumerate(VerseType.Names): - if verse_type == vtypeName.lower(): - return vtypeIndex + verse_name = verse_name.lower() + for num, name in enumerate(VerseType.Names): + if verse_name == name.lower(): + return num @staticmethod - def from_translated_string(verse_type): + def from_translated_string(verse_name): """ Return the VerseType for a given string - ``verse_type`` + ``verse_name`` The string to return a VerseType for """ - verse_type = verse_type.lower() + verse_name = verse_name.lower() for num, translation in enumerate(VerseType.TranslatedNames): - if verse_type == translation.lower(): + if verse_name == translation.lower(): return num @staticmethod - def from_loose_input(verse_type): + def from_loose_input(verse_name): """ Return the VerseType for a given string, Other if not found - ``verse_type`` + ``verse_name`` The string to return a VerseType for """ - verseIndex = None - if len(verse_type) > 1: - verseIndex = VerseType.from_translated_string(verse_type) - if verseIndex is None: - verseIndex = VerseType.from_string(verse_type) - if verseIndex is None: - verseIndex = VerseType.from_translated_tag(verse_type) - elif verseIndex is None: - verseIndex = VerseType.from_tag(verse_type) - return verseIndex + verse_index = None + if len(verse_name) > 1: + verse_index = VerseType.from_translated_string(verse_name) + if verse_index is None: + verseIndex = VerseType.from_string(verse_name) + if verse_index is None: + verse_index = VerseType.from_translated_tag(verse_name) + elif verse_index is None: + verse_index = VerseType.from_tag(verse_name) + return verse_index def retrieve_windows_encoding(recommendation=None): """ diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 147450efd..c7e9bae3b 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -344,40 +344,49 @@ class SongMediaItem(MediaManagerItem): if song.lyrics.startswith(u' 1: - verseIndex = \ - VerseType.from_translated_string(verse_type) - if verseIndex is None: - verseIndex = VerseType.from_string(verse_type) - if verseIndex is None: - verseIndex = VerseType.from_tag(verse_type) - if verseIndex is None: - verseIndex = VerseType.Other - versetype = VerseType.TranslatedTags[verseIndex].upper() - verseTag = u'%s%s' % (versetype, verse[0][u'label']) + verse_tag = verse[0][u'type'] + verse_index = None + if len(verse_tag) > 1: + verse_index = \ + VerseType.from_translated_string(verse_tag) + if verse_index is None: + verse_index = VerseType.from_string(verse_tag) + if verse_index is None: + verse_index = VerseType.from_tag(verse_tag) + verse_tag = VerseType.TranslatedTags[verse_index].upper() + verse_def = u'%s%s' % (verse_tag, verse[0][u'label']) service_item.add_from_text( - verse[1][:30], unicode(verse[1]), verseTag) + verse[1][:30], unicode(verse[1]), verse_def) else: # Loop through the verse list and expand the song accordingly. for order in song.verse_order.lower().split(): if len(order) == 0: break for verse in verseList: - if verse[0][u'type'][0] == order[0] and \ - (verse[0][u'label'] == order[1:] or not order[1:]): - verseindex = VerseType.from_tag(verse[0][u'type']) - versetype = VerseType.TranslatedTags[verseindex]\ - .upper() - verseTag = u'%s%s' % (versetype, + if verse[0][u'type'][0].lower() == order[0] and \ + (verse[0][u'label'].lower() == order[1:] or \ + not order[1:]): + if verse_tags_translated: + verse_index = VerseType.from_translated_tag( + verse[0][u'type']) + else: + verse_index = VerseType.from_tag( + verse[0][u'type']) + if verse_index is None: + verse_index = VerseType.Other + verse_tag = VerseType.TranslatedTags[verse_index] + verse_def = u'%s%s' % (verse_tag, verse[0][u'label']) service_item.add_from_text( - verse[1][:30], verse[1], verseTag) + verse[1][:30], verse[1], verse_def) else: verses = song.lyrics.split(u'\n\n') for slide in verses: diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index bfae14db7..e5c3963c0 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -465,8 +465,6 @@ class OpenLyrics(object): text += u'\n'.join([unicode(line) for line in lines.line]) verse_name = self._get(verse, u'name') verse_type_index = VerseType.from_tag(verse_name[0]) - if verse_type_index is None: - verse_type_index = VerseType.Other verse_type = VerseType.Names[verse_type_index] verse_number = re.compile(u'[a-zA-Z]*').sub(u'', verse_name) verse_part = re.compile(u'[0-9]*').sub(u'', verse_name[1:]) From 0d498bc3f09f8bc28d39aa56b86a5f1e80761be5 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Fri, 18 Feb 2011 01:07:55 +0000 Subject: [PATCH 163/243] UiStrings --- openlp/core/lib/ui.py | 4 +++- openlp/core/ui/generaltab.py | 4 ++-- openlp/core/ui/printserviceorderdialog.py | 2 +- openlp/core/ui/themeform.py | 2 +- openlp/core/ui/thememanager.py | 5 ++--- openlp/core/ui/themewizard.py | 8 ++++---- openlp/plugins/songs/forms/editsongdialog.py | 6 ++---- openlp/plugins/songs/songsplugin.py | 4 ++-- 8 files changed, 17 insertions(+), 18 deletions(-) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index e77ad2f10..006e2c9f5 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -45,7 +45,8 @@ class UiStrings(object): Advanced = translate('OpenLP.Ui', 'Advanced') AllFiles = translate('OpenLP.Ui', 'All Files') Browse = translate('OpenLP.Ui', 'Browse...') - Authors = translate('OpenLP.Ui', 'Authors') + Cancel = translate('OpenLP.Ui', 'Cancel') + CCLINumberLabel = translate('OpenLP.Ui', 'CCLI number:') CreateService = translate('OpenLP.Ui', 'Create a new service.') Delete = translate('OpenLP.Ui', '&Delete') Edit = translate('OpenLP.Ui', '&Edit') @@ -63,6 +64,7 @@ class UiStrings(object): Load = translate('OpenLP.Ui', 'Load') New = translate('OpenLP.Ui', 'New') NewService = translate('OpenLP.Ui', 'New Service') + NewTheme = translate('OpenLP.Ui', 'New Theme') NFSs = translate('OpenLP.Ui', 'No File Selected', 'Singular') NFSp = translate('OpenLP.Ui', 'No Files Selected', 'Plural') NISs = translate('OpenLP.Ui', 'No Item Selected', 'Singular') diff --git a/openlp/core/ui/generaltab.py b/openlp/core/ui/generaltab.py index 12353fed8..2b95088ab 100644 --- a/openlp/core/ui/generaltab.py +++ b/openlp/core/ui/generaltab.py @@ -28,6 +28,7 @@ import logging from PyQt4 import QtCore, QtGui from openlp.core.lib import SettingsTab, Receiver, translate +from openlp.core.lib.ui import UiStrings log = logging.getLogger(__name__) @@ -267,8 +268,7 @@ class GeneralTab(SettingsTab): translate('OpenLP.GeneralTab', ' sec')) self.ccliGroupBox.setTitle( translate('OpenLP.GeneralTab', 'CCLI Details')) - self.numberLabel.setText( - translate('OpenLP.GeneralTab', 'CCLI number:')) + self.numberLabel.setText(UiStrings.CCLINumberLabel) self.usernameLabel.setText( translate('OpenLP.GeneralTab', 'SongSelect username:')) self.passwordLabel.setText( diff --git a/openlp/core/ui/printserviceorderdialog.py b/openlp/core/ui/printserviceorderdialog.py index 22f8e9292..c27035fda 100644 --- a/openlp/core/ui/printserviceorderdialog.py +++ b/openlp/core/ui/printserviceorderdialog.py @@ -132,6 +132,6 @@ class Ui_PrintServiceOrderDialog(object): self.serviceTitleLineEdit.setText(translate('OpenLP.ServiceManager', 'Service Order Sheet')) self.printButton.setText(translate('OpenLP.ServiceManager', 'Print')) - self.cancelButton.setText(translate('OpenLP.ServiceManager', 'Cancel')) + self.cancelButton.setText(UiStrings.Cancel) self.customNotesLabel.setText( translate('OpenLP.ServiceManager', 'Custom Service Notes:')) diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index f34e2b8d2..1b6d8d524 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -301,7 +301,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): 'Edit Theme - %s')) % self.theme.theme_name) self.next() else: - self.setWindowTitle(translate('OpenLP.ThemeWizard', 'New Theme')) + self.setWindowTitle(UiStrings.NewTheme) return QtGui.QWizard.exec_(self) def initializePage(self, id): diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 5c996f688..981058408 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -36,7 +36,7 @@ from openlp.core.lib import OpenLPToolbar, ThemeXML, get_text_file_string, \ build_icon, Receiver, SettingsManager, translate, check_item_selected, \ BackgroundType, BackgroundGradientType, check_directory_exists, \ VerticalType -from openlp.core.lib.ui import critical_error_message_box +from openlp.core.lib.ui import UiStrings, critical_error_message_box from openlp.core.theme import Theme from openlp.core.ui import FileRenameForm, ThemeForm from openlp.core.utils import AppLocation, delete_file, file_is_unicode, \ @@ -62,8 +62,7 @@ class ThemeManager(QtGui.QWidget): self.layout.setMargin(0) self.layout.setObjectName(u'layout') self.toolbar = OpenLPToolbar(self) - self.toolbar.addToolbarButton( - translate('OpenLP.ThemeManager', 'New Theme'), + self.toolbar.addToolbarButton(UiStrings.NewTheme, u':/themes/theme_new.png', translate('OpenLP.ThemeManager', 'Create a new theme.'), self.onAddTheme) diff --git a/openlp/core/ui/themewizard.py b/openlp/core/ui/themewizard.py index fc25e11fa..c968db821 100644 --- a/openlp/core/ui/themewizard.py +++ b/openlp/core/ui/themewizard.py @@ -448,17 +448,17 @@ class Ui_ThemeWizard(object): self.mainFontLabel.setText(translate('OpenLP.ThemeWizard', 'Font:')) self.mainColorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:')) self.mainSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:')) - self.mainSizeSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt')) + self.mainSizeSpinBox.setSuffix(UiStrings.FontSizePtUnit) self.lineSpacingLabel.setText( translate('OpenLP.ThemeWizard', 'Line Spacing:')) - self.lineSpacingSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt')) + self.lineSpacingSpinBox.setSuffix(UiStrings.FontSizePtUnit) self.outlineCheckBox.setText( translate('OpenLP.ThemeWizard', '&Outline:')) self.outlineSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:')) - self.outlineSizeSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt')) + self.outlineSizeSpinBox.setSuffix(UiStrings.FontSizePtUnit) self.shadowCheckBox.setText(translate('OpenLP.ThemeWizard', '&Shadow:')) self.shadowSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:')) - self.shadowSizeSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt')) + self.shadowSizeSpinBox.setSuffix(UiStrings.FontSizePtUnit) self.mainBoldCheckBox.setText(translate('OpenLP.ThemeWizard', 'Bold')) self.mainItalicsCheckBox.setText( translate('OpenLP.ThemeWizard', 'Italic')) diff --git a/openlp/plugins/songs/forms/editsongdialog.py b/openlp/plugins/songs/forms/editsongdialog.py index 491f4fa74..bcc075574 100644 --- a/openlp/plugins/songs/forms/editsongdialog.py +++ b/openlp/plugins/songs/forms/editsongdialog.py @@ -292,10 +292,8 @@ class Ui_EditSongDialog(object): translate('SongsPlugin.EditSongForm', 'New &Theme')) self.rightsGroupBox.setTitle( translate('SongsPlugin.EditSongForm', 'Copyright Information')) - self.copyrightInsertButton.setText( - translate('SongsPlugin.EditSongForm', '\xa9')) - self.CCLILabel.setText( - translate('SongsPlugin.EditSongForm', 'CCLI number:')) + self.copyrightInsertButton.setText(SongStrings.CopyrightSymbol) + self.CCLILabel.setText(UiStrings.CCLINumberLabel) self.commentsGroupBox.setTitle( translate('SongsPlugin.EditSongForm', 'Comments')) self.songTabWidget.setTabText( diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 887ddb7b2..bf33cd56e 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -31,6 +31,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import Plugin, StringContent, build_icon, translate from openlp.core.lib.db import Manager +from openlp.core.lib.ui import UiStrings from openlp.plugins.songs.lib import SongMediaItem, SongsTab, SongXML from openlp.plugins.songs.lib.db import init_schema, Song from openlp.plugins.songs.lib.importer import SongFormat @@ -137,8 +138,7 @@ class SongsPlugin(Plugin): """ maxSongs = self.manager.get_object_count(Song) progressDialog = QtGui.QProgressDialog( - translate('SongsPlugin', 'Reindexing songs...'), - translate('SongsPlugin', 'Cancel'), + translate('SongsPlugin', 'Reindexing songs...'), UiStrings.Cancel, 0, maxSongs + 1, self.formparent) progressDialog.setWindowModality(QtCore.Qt.WindowModal) songs = self.manager.get_all_objects(Song) From dc41ce5ab404b9e24c11f747bf12b33824779feb Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Fri, 18 Feb 2011 03:15:09 +0000 Subject: [PATCH 164/243] Enumerations and magic numbers --- openlp/core/lib/__init__.py | 2 -- openlp/core/lib/htmlbuilder.py | 15 +++----- openlp/core/lib/rendermanager.py | 3 +- openlp/core/lib/theme.py | 34 ++++++------------- openlp/core/lib/ui.py | 9 +++-- openlp/core/ui/servicemanager.py | 4 +-- openlp/core/ui/themeform.py | 4 +-- openlp/core/ui/thememanager.py | 9 ++--- openlp/core/ui/themestab.py | 3 +- openlp/core/ui/themewizard.py | 25 ++++++++------ .../plugins/bibles/forms/bibleimportform.py | 33 ++++-------------- openlp/plugins/bibles/lib/__init__.py | 19 +++++++++++ openlp/plugins/bibles/lib/biblestab.py | 15 ++++---- openlp/plugins/bibles/lib/mediaitem.py | 24 +++++++------ .../presentations/lib/presentationtab.py | 2 +- 15 files changed, 96 insertions(+), 105 deletions(-) diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index 80bf4a67b..ab4c8e26f 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -321,8 +321,6 @@ def check_directory_exists(dir): os.makedirs(dir) from listwidgetwithdnd import ListWidgetWithDnD -from theme import ThemeLevel, ThemeXML, BackgroundGradientType, \ - BackgroundType, HorizontalType, VerticalType from displaytags import DisplayTags from spelltextedit import SpellTextEdit from eventreceiver import Receiver diff --git a/openlp/core/lib/htmlbuilder.py b/openlp/core/lib/htmlbuilder.py index 34d583181..720b4b3f8 100644 --- a/openlp/core/lib/htmlbuilder.py +++ b/openlp/core/lib/htmlbuilder.py @@ -28,8 +28,8 @@ import logging from PyQt4 import QtWebKit -from openlp.core.lib import BackgroundType, BackgroundGradientType, \ - VerticalType +from openlp.core.lib.theme import BackgroundType, BackgroundGradientType, \ + VerticalType, HorizontalType log = logging.getLogger(__name__) @@ -531,13 +531,8 @@ def build_lyrics_format_css(theme, width, height): Height of the lyrics block """ - if theme.display_horizontal_align == 2: - align = u'center' - elif theme.display_horizontal_align == 1: - align = u'right' - else: - align = u'left' - valign = VerticalType.to_string(theme.display_vertical_align) + align = HorizontalType.Names[theme.display_horizontal_align] + valign = VerticalType.Names[theme.display_vertical_align] if theme.font_main_outline: left_margin = int(theme.font_main_outline_size) * 2 else: @@ -630,7 +625,7 @@ def build_alert_css(alertTab, width): """ if not alertTab: return u'' - align = VerticalType.to_string(alertTab.location) + align = VerticalType.Names[alertTab.location] alert = style % (width, align, alertTab.font_face, alertTab.font_size, alertTab.font_color, alertTab.bg_color) return alert diff --git a/openlp/core/lib/rendermanager.py b/openlp/core/lib/rendermanager.py index 4c50b856a..7d579f7a4 100644 --- a/openlp/core/lib/rendermanager.py +++ b/openlp/core/lib/rendermanager.py @@ -28,7 +28,8 @@ import logging from PyQt4 import QtCore -from openlp.core.lib import Renderer, ThemeLevel, ServiceItem, ImageManager +from openlp.core.lib import Renderer, ServiceItem, ImageManager +from openlp.core.lib.theme import ThemeLevel from openlp.core.ui import MainDisplay log = logging.getLogger(__name__) diff --git a/openlp/core/lib/theme.py b/openlp/core/lib/theme.py index 225e1335c..67ddde72d 100644 --- a/openlp/core/lib/theme.py +++ b/openlp/core/lib/theme.py @@ -33,7 +33,8 @@ import logging from xml.dom.minidom import Document from lxml import etree, objectify -from openlp.core.lib import str_to_bool +from openlp.core.lib import str_to_bool, translate +from openlp.core.lib.ui import UiStrings log = logging.getLogger(__name__) @@ -170,20 +171,14 @@ class HorizontalType(object): Type enumeration for horizontal alignment. """ Left = 0 - Center = 2 Right = 1 + Center = 2 - @staticmethod - def to_string(horizontal_type): - """ - Return a string representation of a horizontal type. - """ - if horizontal_type == HorizontalType.Right: - return u'right' - elif horizontal_type == HorizontalType.Center: - return u'center' - else: - return u'left' + Names = [u'left', u'right', u'center'] + TranslatedNames = [ + translate('OpenLP.ThemeWizard', 'Left'), + translate('OpenLP.ThemeWizard', 'Right'), + translate('OpenLP.ThemeWizard', 'Center')] class VerticalType(object): @@ -194,17 +189,8 @@ class VerticalType(object): Middle = 1 Bottom = 2 - @staticmethod - def to_string(vertical_type): - """ - Return a string representation of a vertical type. - """ - if vertical_type == VerticalType.Bottom: - return u'bottom' - elif vertical_type == VerticalType.Middle: - return u'middle' - else: - return u'top' + Names = [u'top', u'middle', u'bottom'] + TranslatedNames = [UiStrings.Top, UiStrings.Middle, UiStrings.Bottom] BOOLEAN_LIST = [u'bold', u'italics', u'override', u'outline', u'shadow', diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 006e2c9f5..2cdda13ac 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -44,6 +44,7 @@ class UiStrings(object): Add = translate('OpenLP.Ui', '&Add') Advanced = translate('OpenLP.Ui', 'Advanced') AllFiles = translate('OpenLP.Ui', 'All Files') + Bottom = translate('OpenLP.Ui', 'Bottom') Browse = translate('OpenLP.Ui', 'Browse...') Cancel = translate('OpenLP.Ui', 'Cancel') CCLINumberLabel = translate('OpenLP.Ui', 'CCLI number:') @@ -62,6 +63,7 @@ class UiStrings(object): LiveBGError = translate('OpenLP.Ui', 'Live Background Error') LivePanel = translate('OpenLP.Ui', 'Live Panel') Load = translate('OpenLP.Ui', 'Load') + Middle = translate('OpenLP.Ui', 'Middle') New = translate('OpenLP.Ui', 'New') NewService = translate('OpenLP.Ui', 'New Service') NewTheme = translate('OpenLP.Ui', 'New Theme') @@ -89,6 +91,7 @@ class UiStrings(object): StartTimeCode = unicode(translate('OpenLP.Ui', 'Start %s')) Theme = translate('OpenLP.Ui', 'Theme', 'Singular') Themes = translate('OpenLP.Ui', 'Themes', 'Plural') + Top = translate('OpenLP.Ui', 'Top') Version = translate('OpenLP.Ui', 'Version') def add_welcome_page(parent, image): @@ -302,8 +305,8 @@ def create_valign_combo(form, parent, layout): verticalLabel.setText(translate('OpenLP.Ui', '&Vertical Align:')) form.verticalComboBox = QtGui.QComboBox(parent) form.verticalComboBox.setObjectName(u'VerticalComboBox') - form.verticalComboBox.addItem(translate('OpenLP.Ui', 'Top')) - form.verticalComboBox.addItem(translate('OpenLP.Ui', 'Middle')) - form.verticalComboBox.addItem(translate('OpenLP.Ui', 'Bottom')) + form.verticalComboBox.addItem(UiStrings.Top) + form.verticalComboBox.addItem(UiStrings.Middle) + form.verticalComboBox.addItem(UiStrings.Bottom) verticalLabel.setBuddy(form.verticalComboBox) layout.addRow(verticalLabel, form.verticalComboBox) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 3dfcb6ded..5568ba431 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -33,8 +33,8 @@ log = logging.getLogger(__name__) from PyQt4 import QtCore, QtGui from openlp.core.lib import OpenLPToolbar, ServiceItem, context_menu_action, \ - Receiver, build_icon, ItemCapabilities, SettingsManager, translate, \ - ThemeLevel + Receiver, build_icon, ItemCapabilities, SettingsManager, translate +from openlp.core.lib.theme import ThemeLevel from openlp.core.lib.ui import UiStrings, critical_error_message_box from openlp.core.ui import ServiceNoteForm, ServiceItemEditForm, StartTimeForm from openlp.core.ui.printserviceorderform import PrintServiceOrderForm diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index 1b6d8d524..17572f530 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -29,8 +29,8 @@ import os from PyQt4 import QtCore, QtGui -from openlp.core.lib import translate, BackgroundType, BackgroundGradientType, \ - Receiver +from openlp.core.lib import Receiver, translate +from openlp.core.lib.theme import BackgroundType, BackgroundGradientType from openlp.core.lib.ui import UiStrings, critical_error_message_box from openlp.core.utils import get_images_filter from themewizard import Ui_ThemeWizard diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 981058408..378f5b365 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -32,10 +32,11 @@ import logging from xml.etree.ElementTree import ElementTree, XML from PyQt4 import QtCore, QtGui -from openlp.core.lib import OpenLPToolbar, ThemeXML, get_text_file_string, \ - build_icon, Receiver, SettingsManager, translate, check_item_selected, \ - BackgroundType, BackgroundGradientType, check_directory_exists, \ - VerticalType +from openlp.core.lib import OpenLPToolbar, get_text_file_string, build_icon, \ + Receiver, SettingsManager, translate, check_item_selected, \ + check_directory_exists +from openlp.core.lib.theme import ThemeXML, BackgroundType, VerticalType, \ + BackgroundGradientType from openlp.core.lib.ui import UiStrings, critical_error_message_box from openlp.core.theme import Theme from openlp.core.ui import FileRenameForm, ThemeForm diff --git a/openlp/core/ui/themestab.py b/openlp/core/ui/themestab.py index 20bd9a183..6a3505e93 100644 --- a/openlp/core/ui/themestab.py +++ b/openlp/core/ui/themestab.py @@ -26,7 +26,8 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import SettingsTab, Receiver, ThemeLevel, translate +from openlp.core.lib import SettingsTab, Receiver, translate +from openlp.core.lib.theme import ThemeLevel from openlp.core.lib.ui import UiStrings class ThemesTab(SettingsTab): diff --git a/openlp/core/ui/themewizard.py b/openlp/core/ui/themewizard.py index c968db821..a482e2703 100644 --- a/openlp/core/ui/themewizard.py +++ b/openlp/core/ui/themewizard.py @@ -27,6 +27,8 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate, build_icon +from openlp.core.lib.theme import HorizontalType, BackgroundType, \ + BackgroundGradientType from openlp.core.lib.ui import UiStrings, add_welcome_page, create_valign_combo class Ui_ThemeWizard(object): @@ -417,11 +419,12 @@ class Ui_ThemeWizard(object): 'according to the parameters below.')) self.backgroundLabel.setText( translate('OpenLP.ThemeWizard', 'Background type:')) - self.backgroundComboBox.setItemText(0, + self.backgroundComboBox.setItemText(BackgroundType.Solid, translate('OpenLP.ThemeWizard', 'Solid Color')) - self.backgroundComboBox.setItemText(1, + self.backgroundComboBox.setItemText(BackgroundType.Gradient, translate('OpenLP.ThemeWizard', 'Gradient')) - self.backgroundComboBox.setItemText(2, UiStrings.Image) + self.backgroundComboBox.setItemText( + BackgroundType.Image, UiStrings.Image) self.colorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:')) self.gradientStartLabel.setText( translate(u'OpenLP.ThemeWizard', 'Starting color:')) @@ -429,15 +432,15 @@ class Ui_ThemeWizard(object): translate(u'OpenLP.ThemeWizard', 'Ending color:')) self.gradientTypeLabel.setText( translate('OpenLP.ThemeWizard', 'Gradient:')) - self.gradientComboBox.setItemText(0, + self.gradientComboBox.setItemText(BackgroundGradientType.Horizontal, translate('OpenLP.ThemeWizard', 'Horizontal')) - self.gradientComboBox.setItemText(1, + self.gradientComboBox.setItemText(BackgroundGradientType.Vertical, translate('OpenLP.ThemeWizard', 'Vertical')) - self.gradientComboBox.setItemText(2, + self.gradientComboBox.setItemText(BackgroundGradientType.Circular, translate('OpenLP.ThemeWizard', 'Circular')) - self.gradientComboBox.setItemText(3, + self.gradientComboBox.setItemText(BackgroundGradientType.LeftTop, translate('OpenLP.ThemeWizard', 'Top Left - Bottom Right')) - self.gradientComboBox.setItemText(4, + self.gradientComboBox.setItemText(BackgroundGradientType.LeftBottom, translate('OpenLP.ThemeWizard', 'Bottom Left - Top Right')) self.imageLabel.setText(u'%s:' % UiStrings.Image) self.mainAreaPage.setTitle( @@ -478,11 +481,11 @@ class Ui_ThemeWizard(object): 'formatting information to be defined')) self.horizontalLabel.setText( translate('OpenLP.ThemeWizard', 'Horizontal Align:')) - self.horizontalComboBox.setItemText(0, + self.horizontalComboBox.setItemText(HorizontalType.Left, translate('OpenLP.ThemeWizard', 'Left')) - self.horizontalComboBox.setItemText(1, + self.horizontalComboBox.setItemText(HorizontalType.Right, translate('OpenLP.ThemeWizard', 'Right')) - self.horizontalComboBox.setItemText(2, + self.horizontalComboBox.setItemText(HorizontalType.Center, translate('OpenLP.ThemeWizard', 'Center')) self.transitionsLabel.setText( translate('OpenLP.ThemeWizard', 'Transitions:')) diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index 83e7065ac..7ec8e1394 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -51,18 +51,7 @@ class WebDownload(object): BibleGateway = 1 Bibleserver = 2 - Names = { - 0: u'Crosswalk', - 1: u'BibleGateway', - 2: u'Bibleserver' - } - - @classmethod - def get_name(cls, name): - """ - Get the web bible type name. - """ - return cls.Names[name] + Names = [u'Crosswalk', u'BibleGateway', u'Bibleserver'] class BibleImportForm(OpenLPWizard): @@ -393,11 +382,11 @@ class BibleImportForm(OpenLPWizard): translate('BiblesPlugin.ImportWizardForm', 'Bible file:')) self.webSourceLabel.setText( translate('BiblesPlugin.ImportWizardForm', 'Location:')) - self.webSourceComboBox.setItemText(0, + self.webSourceComboBox.setItemText(WebDownload.Crosswalk, translate('BiblesPlugin.ImportWizardForm', 'Crosswalk')) - self.webSourceComboBox.setItemText(1, + self.webSourceComboBox.setItemText(WebDownload.BibleGateway, translate('BiblesPlugin.ImportWizardForm', 'BibleGateway')) - self.webSourceComboBox.setItemText(2, + self.webSourceComboBox.setItemText(WebDownload.Bibleserver, translate('BiblesPlugin.ImportWizardForm', 'Bibleserver')) self.webTranslationLabel.setText( translate('BiblesPlugin.ImportWizardForm', 'Bible:')) @@ -680,7 +669,7 @@ class BibleImportForm(OpenLPWizard): self.web_bible_list[download_type][ver] = name.strip() except IOError: log.exception(u'%s resources missing' % - WebDownload.get_name(download_type)) + WebDownload.Names[download_type]) finally: if books_file: books_file.close() @@ -734,18 +723,10 @@ class BibleImportForm(OpenLPWizard): self.progressBar.setMaximum(1) download_location = self.field(u'web_location').toInt()[0] bible_version = unicode(self.webTranslationComboBox.currentText()) - if download_location == WebDownload.Crosswalk: - bible = \ - self.web_bible_list[WebDownload.Crosswalk][bible_version] - elif download_location == WebDownload.BibleGateway: - bible = \ - self.web_bible_list[WebDownload.BibleGateway][bible_version] - elif download_location == WebDownload.Bibleserver: - bible = \ - self.web_bible_list[WebDownload.Bibleserver][bible_version] + bible = self.web_bible_list[download_location][bible_version] importer = self.manager.import_bible( BibleFormat.WebDownload, name=license_version, - download_source=WebDownload.get_name(download_location), + download_source=WebDownload.Names[download_location], download_name=bible, proxy_server=unicode(self.field(u'proxy_server').toString()), proxy_username=\ diff --git a/openlp/plugins/bibles/lib/__init__.py b/openlp/plugins/bibles/lib/__init__.py index 314651ced..78cb6b645 100644 --- a/openlp/plugins/bibles/lib/__init__.py +++ b/openlp/plugins/bibles/lib/__init__.py @@ -32,6 +32,25 @@ import re log = logging.getLogger(__name__) +class LayoutStyle(object): + """ + An enumeration for bible screen layout styles. + """ + VersePerSlide = 0 + VersePerLine = 1 + Continuous = 2 + + +class DisplayStyle(object): + """ + An enumeration for bible text bracket display styles. + """ + NoBrackets = 0 + Round = 1 + Curly = 2 + Square = 3 + + def get_reference_match(match_type): """ Provides the regexes and matches to use while parsing strings for bible diff --git a/openlp/plugins/bibles/lib/biblestab.py b/openlp/plugins/bibles/lib/biblestab.py index f6bd27324..09e32ad8c 100644 --- a/openlp/plugins/bibles/lib/biblestab.py +++ b/openlp/plugins/bibles/lib/biblestab.py @@ -29,6 +29,7 @@ import logging from PyQt4 import QtCore, QtGui from openlp.core.lib import Receiver, SettingsTab, translate +from openlp.plugins.bibles.lib import LayoutStyle, DisplayStyle log = logging.getLogger(__name__) @@ -122,19 +123,19 @@ class BiblesTab(SettingsTab): translate('BiblesPlugin.BiblesTab', 'Display style:')) self.BibleThemeLabel.setText( translate('BiblesPlugin.BiblesTab', 'Bible theme:')) - self.LayoutStyleComboBox.setItemText(0, + self.LayoutStyleComboBox.setItemText(LayoutStyle.VersePerSlide, translate('BiblesPlugin.BiblesTab', 'Verse Per Slide')) - self.LayoutStyleComboBox.setItemText(1, + self.LayoutStyleComboBox.setItemText(LayoutStyle.VersePerLine, translate('BiblesPlugin.BiblesTab', 'Verse Per Line')) - self.LayoutStyleComboBox.setItemText(2, + self.LayoutStyleComboBox.setItemText(LayoutStyle.Continuous, translate('BiblesPlugin.BiblesTab', 'Continuous')) - self.DisplayStyleComboBox.setItemText(0, + self.DisplayStyleComboBox.setItemText(DisplayStyle.NoBrackets, translate('BiblesPlugin.BiblesTab', 'No Brackets')) - self.DisplayStyleComboBox.setItemText(1, + self.DisplayStyleComboBox.setItemText(DisplayStyle.Round, translate('BiblesPlugin.BiblesTab', '( And )')) - self.DisplayStyleComboBox.setItemText(2, + self.DisplayStyleComboBox.setItemText(DisplayStyle.Curly, translate('BiblesPlugin.BiblesTab', '{ And }')) - self.DisplayStyleComboBox.setItemText(3, + self.DisplayStyleComboBox.setItemText(DisplayStyle.Square, translate('BiblesPlugin.BiblesTab', '[ And ]')) self.ChangeNoteLabel.setText(translate('BiblesPlugin.BiblesTab', 'Note:\nChanges do not affect verses already in the service.')) diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index 5dbe9655d..deae98fcb 100644 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -34,7 +34,8 @@ from openlp.core.lib.searchedit import SearchEdit from openlp.core.lib.ui import UiStrings, add_widget_completer, \ media_item_combo_box, critical_error_message_box from openlp.plugins.bibles.forms import BibleImportForm -from openlp.plugins.bibles.lib import get_reference_match +from openlp.plugins.bibles.lib import LayoutStyle, DisplayStyle, \ + get_reference_match log = logging.getLogger(__name__) @@ -56,6 +57,7 @@ class BibleMediaItem(MediaManagerItem): self.IconPath = u'songs/song' MediaManagerItem.__init__(self, parent, plugin, icon) # Place to store the search results for both bibles. + self.settings = self.parent.settings_tab self.search_results = {} self.second_search_results = {} QtCore.QObject.connect(Receiver.get_receiver(), @@ -666,12 +668,12 @@ class BibleMediaItem(MediaManagerItem): raw_slides.append(bible_text.rstrip()) bible_text = u'' # If we are 'Verse Per Slide' then create a new slide. - elif self.parent.settings_tab.layout_style == 0: + elif self.settings.layout_style == LayoutStyle.VersePerSlide: bible_text = u'%s %s' % (verse_text, text) raw_slides.append(bible_text.rstrip()) bible_text = u'' # If we are 'Verse Per Line' then force a new line. - elif self.parent.settings_tab.layout_style == 1: + elif self.settings.layout_style == LayoutStyle.VersePerLine: bible_text = u'%s %s %s\n' % (bible_text, verse_text, text) # We have to be 'Continuous'. else: @@ -689,7 +691,8 @@ class BibleMediaItem(MediaManagerItem): raw_slides.append(bible_text.lstrip()) bible_text = u'' # Service Item: Capabilities - if self.parent.settings_tab.layout_style == 2 and not second_bible: + if self.settings.layout_style == LayoutStyle.Continuous and \ + not second_bible: # Split the line but do not replace line breaks in renderer. service_item.add_capability(ItemCapabilities.NoLineBreaks) service_item.add_capability(ItemCapabilities.AllowsPreview) @@ -701,10 +704,10 @@ class BibleMediaItem(MediaManagerItem): else: service_item.title += u', ' + title # Service Item: Theme - if len(self.parent.settings_tab.bible_theme) == 0: + if len(self.settings.bible_theme) == 0: service_item.theme = None else: - service_item.theme = self.parent.settings_tab.bible_theme + service_item.theme = self.settings.bible_theme for slide in raw_slides: service_item.add_from_text(slide[:30], slide) if service_item.raw_footer: @@ -813,16 +816,15 @@ class BibleMediaItem(MediaManagerItem): The verse number (int). """ verse_separator = get_reference_match(u'sep_v_display') - if not self.parent.settings_tab.show_new_chapters or \ - old_chapter != chapter: + if not self.settings.show_new_chapters or old_chapter != chapter: verse_text = unicode(chapter) + verse_separator + unicode(verse) else: verse_text = unicode(verse) - if self.parent.settings_tab.display_style == 1: + if self.settings.display_style == DisplayStyle.Round: verse_text = u'{su}(' + verse_text + u'){/su}' - elif self.parent.settings_tab.display_style == 2: + elif self.settings.display_style == DisplayStyle.Curly: verse_text = u'{su}{' + verse_text + u'}{/su}' - elif self.parent.settings_tab.display_style == 3: + elif self.settings.display_style == DisplayStyle.Square: verse_text = u'{su}[' + verse_text + u']{/su}' else: verse_text = u'{su}' + verse_text + u'{/su}' diff --git a/openlp/plugins/presentations/lib/presentationtab.py b/openlp/plugins/presentations/lib/presentationtab.py index fdb66c511..8bcb7474a 100644 --- a/openlp/plugins/presentations/lib/presentationtab.py +++ b/openlp/plugins/presentations/lib/presentationtab.py @@ -85,7 +85,7 @@ class PresentationTab(SettingsTab): else: checkbox.setText( unicode(translate('PresentationPlugin.PresentationTab', - '%s (unvailable)')) % controller.name) + '%s (unavailable)')) % controller.name) self.AdvancedGroupBox.setTitle(UiStrings.Advanced) self.OverrideAppCheckBox.setText( translate('PresentationPlugin.PresentationTab', From 1651e42bcada1aa44b2aaa5cd2160445ae436fa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Fri, 18 Feb 2011 09:53:40 +0200 Subject: [PATCH 165/243] more variable name changes --- openlp/plugins/songs/forms/editsongform.py | 2 +- openlp/plugins/songs/forms/editverseform.py | 5 +- openlp/plugins/songs/lib/__init__.py | 2 +- openlp/plugins/songs/lib/opensongimport.py | 116 ++++++++++---------- openlp/plugins/songs/lib/songimport.py | 64 +++++------ 5 files changed, 94 insertions(+), 95 deletions(-) diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index a9c5bac86..0470a2d32 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -787,7 +787,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): verseId = unicode(item.data(QtCore.Qt.UserRole).toString()) verse_tag = verseId[0] verse_num = verseId[1:] - sxml.add_verse_to_lyrics(verse_type, verse_num, + sxml.add_verse_to_lyrics(verse_tag, verse_num, unicode(item.text())) text = text + self.whitespace.sub(u' ', unicode(self.verseListWidget.item(i, 0).text())) + u' ' diff --git a/openlp/plugins/songs/forms/editverseform.py b/openlp/plugins/songs/forms/editverseform.py index ada612c43..a5b8e2696 100644 --- a/openlp/plugins/songs/forms/editverseform.py +++ b/openlp/plugins/songs/forms/editverseform.py @@ -127,11 +127,10 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): if match: verse_type = match.group(1) verse_type_index = VerseType.from_loose_input(verse_type) - regex = re.compile(r'(\d+)') - verse_num = int(match.group(2)) + verse_number = int(match.group(2)) if verse_type_index is not None: self.verseTypeComboBox.setCurrentIndex(verse_type_index) - self.verseNumberBox.setValue(verse_num) + self.verseNumberBox.setValue(verse_number) def setVerse(self, text, single=False, tag=u'%s1' % VerseType.Tags[VerseType.Verse]): diff --git a/openlp/plugins/songs/lib/__init__.py b/openlp/plugins/songs/lib/__init__.py index a1cc7e19d..8b64618c0 100644 --- a/openlp/plugins/songs/lib/__init__.py +++ b/openlp/plugins/songs/lib/__init__.py @@ -175,7 +175,7 @@ class VerseType(object): if len(verse_name) > 1: verse_index = VerseType.from_translated_string(verse_name) if verse_index is None: - verseIndex = VerseType.from_string(verse_name) + verse_index = VerseType.from_string(verse_name) if verse_index is None: verse_index = VerseType.from_translated_tag(verse_name) elif verse_index is None: diff --git a/openlp/plugins/songs/lib/opensongimport.py b/openlp/plugins/songs/lib/opensongimport.py index 36d46b903..00fdbf044 100644 --- a/openlp/plugins/songs/lib/opensongimport.py +++ b/openlp/plugins/songs/lib/opensongimport.py @@ -161,8 +161,8 @@ class OpenSongImport(SongImport): self.import_wizard.incrementProgressBar( unicode(translate('SongsPlugin.ImportWizardForm', 'Importing %s...')) % os.path.split(filename)[-1]) - songfile = open(filename) - if self.do_import_file(songfile) and self.commit and \ + song_file = open(filename) + if self.do_import_file(song_file) and self.commit and \ not self.stop_import_flag: self.finish() else: @@ -209,92 +209,92 @@ class OpenSongImport(SongImport): verses = {} # keep track of verses appearance order our_verse_order = [] - # default versetype - versetype = u'v' - versenum = u'1' + # default verse + verse_tag = u'v' + verse_num = u'1' # for the case where song has several sections with same marker inst = 1 lyrics = unicode(root.lyrics) - for thisline in lyrics.split(u'\n'): + for this_line in lyrics.split(u'\n'): # remove comments - semicolon = thisline.find(u';') + semicolon = this_line.find(u';') if semicolon >= 0: - thisline = thisline[:semicolon] - thisline = thisline.strip() - if not len(thisline): + this_line = this_line[:semicolon] + this_line = this_line.strip() + if not len(this_line): continue # skip guitar chords and page and column breaks - if thisline.startswith(u'.') or thisline.startswith(u'---') \ - or thisline.startswith(u'-!!'): + if this_line.startswith(u'.') or this_line.startswith(u'---') \ + or this_line.startswith(u'-!!'): continue # verse/chorus/etc. marker - if thisline.startswith(u'['): + if this_line.startswith(u'['): # drop the square brackets - right_bracket = thisline.find(u']') - content = thisline[1:right_bracket].lower() + right_bracket = this_line.find(u']') + content = this_line[1:right_bracket].lower() # have we got any digits? - # If so, versenumber is everything from the digits + # If so, verse number is everything from the digits # to the end (even if there are some alpha chars on the end) match = re.match(u'(.*)(\d+.*)', content) if match is not None: - versetype = match.group(1) - versenum = match.group(2) + verse_tag = match.group(1) + verse_num = match.group(2) else: # otherwise we assume number 1 and take the whole prefix as - # the versetype - versetype = content - versenum = u'1' + # the verse tag + verse_tag = content + verse_num = u'1' inst = 1 - if [versetype, versenum, inst] in our_verse_order \ - and verses.has_key(versetype) \ - and verses[versetype].has_key(versenum): - inst = len(verses[versetype][versenum])+1 - our_verse_order.append([versetype, versenum, inst]) + if [verse_tag, verse_num, inst] in our_verse_order \ + and verses.has_key(verse_tag) \ + and verses[verse_tag].has_key(verse_num): + inst = len(verses[verse_tag][verse_num])+1 + our_verse_order.append([verse_tag, verse_num, inst]) continue # number at start of line.. it's verse number - if thisline[0].isdigit(): - versenum = thisline[0] - thisline = thisline[1:].strip() - our_verse_order.append([versetype, versenum, inst]) - if not verses.has_key(versetype): - verses[versetype] = {} - if not verses[versetype].has_key(versenum): - verses[versetype][versenum] = {} - if not verses[versetype][versenum].has_key(inst): - verses[versetype][versenum][inst] = [] + if this_line[0].isdigit(): + verse_num = this_line[0] + this_line = this_line[1:].strip() + our_verse_order.append([verse_tag, verse_num, inst]) + if not verses.has_key(verse_tag): + verses[verse_tag] = {} + if not verses[verse_tag].has_key(verse_num): + verses[verse_tag][verse_num] = {} + if not verses[verse_tag][verse_num].has_key(inst): + verses[verse_tag][verse_num][inst] = [] # Tidy text and remove the ____s from extended words - thisline = self.tidy_text(thisline) - thisline = thisline.replace(u'_', u'') - thisline = thisline.replace(u'|', u'\n') - verses[versetype][versenum][inst].append(thisline) + this_line = self.tidy_text(this_line) + this_line = this_line.replace(u'_', u'') + this_line = this_line.replace(u'|', u'\n') + verses[verse_tag][verse_num][inst].append(this_line) # done parsing # add verses in original order - for (versetype, versenum, inst) in our_verse_order: - vtag = u'%s%s' % (versetype, versenum) - lines = u'\n'.join(verses[versetype][versenum][inst]) - self.add_verse(lines, vtag) + for (verse_tag, verse_num, inst) in our_verse_order: + verse_def = u'%s%s' % (verse_tag, verse_num) + lines = u'\n'.join(verses[verse_tag][verse_num][inst]) + self.add_verse(lines, verse_def) # figure out the presentation order, if present if u'presentation' in fields and root.presentation != u'': order = unicode(root.presentation) # We make all the tags in the lyrics lower case, so match that here # and then split into a list on the whitespace order = order.lower().split() - for tag in order: - match = re.match(u'(.*)(\d+.*)', tag) + for verse_def in order: + match = re.match(u'(.*)(\d+.*)', verse_def) if match is not None: - versetype = match.group(1) - versenum = match.group(2) - if not len(versetype): - versetype = u'v' + verse_tag = match.group(1) + verse_num = match.group(2) + if not len(verse_tag): + verse_tag = u'v' else: # Assume it's no.1 if there are no digits - versetype = tag - versenum = u'1' - vtagString = u'%s%s' % (versetype, versenum) - if verses.has_key(versetype) \ - and verses[versetype].has_key(versenum): - self.verse_order_list.append(vtagString) + verse_tag = verse_def + verse_num = u'1' + verse_def = u'%s%s' % (verse_tag, verse_num) + if verses.has_key(verse_tag) \ + and verses[verse_tag].has_key(verse_num): + self.verse_order_list.append(verse_def) else: - log.info(u'Got order %s but not in versetags, dropping' - u'this item from presentation order', vtagString) + log.info(u'Got order %s but not in verse tags, dropping' + u'this item from presentation order', verse_def) return True diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index f4a43c3b4..f1f4b4249 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -200,39 +200,38 @@ class SongImport(QtCore.QObject): return self.media_files.append(filename) - def add_verse(self, versetext, versetag=u'v', lang=None): + def add_verse(self, verse_text, verse_def=u'v', lang=None): """ Add a verse. This is the whole verse, lines split by \\n. It will also attempt to detect duplicates. In this case it will just add to the verse order. - ``versetext`` + ``verse_text`` The text of the verse. - ``versetag`` - The verse tag can be V1/C1/B etc, or 'V' and 'C' (will count the + ``verse_def`` + The verse tag can be v1/c1/b etc, or 'v' and 'c' (will count the verses/choruses itself) or None, where it will assume verse. ``lang`` The language code (ISO-639) of the verse, for example *en* or *de*. """ - for (oldversetag, oldverse, oldlang) in self.verses: - if oldverse.strip() == versetext.strip(): - # this verse is already present - self.verse_order_list_generated.append(oldversetag) + for (old_verse_def, old_verse, old_lang) in self.verses: + if old_verse.strip() == verse_text.strip(): + self.verse_order_list_generated.append(old_verse_def) self.verse_order_list_generated_useful = True return - if versetag[0] in self.versecounts: - self.versecounts[versetag[0]] += 1 + if verse_def[0] in self.verse_counts: + self.verse_counts[verse_def[0]] += 1 else: - self.versecounts[versetag[0]] = 1 - if len(versetag) == 1: - versetag += unicode(self.versecounts[versetag[0]]) - elif int(versetag[1:]) > self.versecounts[versetag[0]]: - self.versecounts[versetag[0]] = int(versetag[1:]) - self.verses.append([versetag, versetext.rstrip(), lang]) - self.verse_order_list_generated.append(versetag) + self.verse_counts[verse_def[0]] = 1 + if len(verse_def) == 1: + verse_def += unicode(self.versecounts[verse_def[0]]) + elif int(verse_def[1:]) > self.versecounts[verse_def[0]]: + self.versecounts[verse_def[0]] = int(verse_def[1:]) + self.verses.append([verse_def, versetext.rstrip(), lang]) + self.verse_order_list_generated.append(verse_def) def repeat_verse(self): """ @@ -277,28 +276,29 @@ class SongImport(QtCore.QObject): verses_changed_to_other = {} sxml = SongXML() other_count = 1 - for (versetag, versetext, lang) in self.verses: - if versetag[0].lower() in VerseType.Tags: - versetype = versetag[0].lower() + for (verse_def, verse_text, lang) in self.verses: + if verse_def[0].lower() in VerseType.Tags: + verse_def = verse_def[0].lower() else: - newversetag = u'%s%d' % (VerseType.Tags[VerseType.Other], + new_verse_def = u'%s%d' % (VerseType.Tags[VerseType.Other], other_count) - verses_changed_to_other[versetag] = newversetag + verses_changed_to_other[verse_def] = new_verse_def other_count += 1 - versetype = VerseType.Tags[VerseType.Other] - log.info(u'Versetype %s changing to %s' , versetag, newversetag) - versetag = newversetag - sxml.add_verse_to_lyrics(versetype, versetag[1:], versetext, lang) - song.search_lyrics += u' ' + self.remove_punctuation(versetext) + verse_tag = VerseType.Tags[VerseType.Other] + log.info(u'Versetype %s changing to %s' , verse_def, + new_verse_def) + verse_def = new_verse_def + sxml.add_verse_to_lyrics(verse_tag, verse_def[1:], verse_text, lang) + song.search_lyrics += u' ' + self.remove_punctuation(verse_text) song.search_lyrics = song.search_lyrics.lower() song.lyrics = unicode(sxml.extract_xml(), u'utf-8') if not len(self.verse_order_list) and \ self.verse_order_list_generated_useful: self.verse_order_list = self.verse_order_list_generated - for i, current_verse_tag in enumerate(self.verse_order_list): - if verses_changed_to_other.has_key(current_verse_tag): + for i, current_verse_def in enumerate(self.verse_order_list): + if verses_changed_to_other.has_key(current_verse_def): self.verse_order_list[i] = \ - verses_changed_to_other[current_verse_tag] + verses_changed_to_other[current_verse_def] song.verse_order = u' '.join(self.verse_order_list) song.copyright = self.copyright song.comments = self.comments @@ -343,8 +343,8 @@ class SongImport(QtCore.QObject): + u'========================================' print u'TITLE: ' + self.title print u'ALT TITLE: ' + self.alternate_title - for (versetag, versetext, lang) in self.verses: - print u'VERSE ' + versetag + u': ' + versetext + for (verse_def, verse_text, lang) in self.verses: + print u'VERSE ' + verse_def + u': ' + verse_text print u'ORDER: ' + u' '.join(self.verse_order_list) print u'GENERATED ORDER: ' + u' '.join(self.verse_order_list_generated) for author in self.authors: From 62091b92fe01f0f05c6166d1f597f80149725c94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Fri, 18 Feb 2011 10:25:43 +0200 Subject: [PATCH 166/243] These would have been left behind. 2% less typos now. --- openlp/plugins/songs/forms/editsongform.py | 2 +- openlp/plugins/songs/forms/editverseform.py | 2 +- openlp/plugins/songs/lib/__init__.py | 2 +- openlp/plugins/songs/lib/songimport.py | 20 ++++++++++---------- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 0470a2d32..77caf012e 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -448,7 +448,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): if self.verse_form.exec_(): after_text, verse_tag, verse_num = self.verse_form.getVerse() verse_def = u'%s%s' % (verse_tag, verse_num) - item = QtGui.QTableWidgetItem(afterText) + item = QtGui.QTableWidgetItem(after_text) item.setData(QtCore.Qt.UserRole, QtCore.QVariant(verse_def)) item.setText(after_text) self.verseListWidget.setRowCount( diff --git a/openlp/plugins/songs/forms/editverseform.py b/openlp/plugins/songs/forms/editverseform.py index a5b8e2696..6156e6821 100644 --- a/openlp/plugins/songs/forms/editverseform.py +++ b/openlp/plugins/songs/forms/editverseform.py @@ -57,7 +57,7 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): QtCore.QObject.connect(self.verseTypeComboBox, QtCore.SIGNAL(u'currentIndexChanged(int)'), self.onVerseTypeComboBoxChanged) - self.verse_regex = re.compile(r'---\[(.+):\D*(\d.)\D*\]---') + self.verse_regex = re.compile(r'---\[(.+):\D*(\d*)\D*.*\]---') def contextMenu(self, point): item = self.serviceManagerList.itemAt(point) diff --git a/openlp/plugins/songs/lib/__init__.py b/openlp/plugins/songs/lib/__init__.py index 8b64618c0..95fae92a8 100644 --- a/openlp/plugins/songs/lib/__init__.py +++ b/openlp/plugins/songs/lib/__init__.py @@ -178,7 +178,7 @@ class VerseType(object): verse_index = VerseType.from_string(verse_name) if verse_index is None: verse_index = VerseType.from_translated_tag(verse_name) - elif verse_index is None: + if verse_index is None: verse_index = VerseType.from_tag(verse_name) return verse_index diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index f1f4b4249..e0e078c43 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -79,7 +79,7 @@ class SongImport(QtCore.QObject): self.verse_order_list_generated = [] self.verse_order_list = [] self.verses = [] - self.versecounts = {} + self.verse_counts = {} self.copyright_string = unicode(translate( 'SongsPlugin.SongImport', 'copyright')) self.copyright_symbol = unicode(translate( @@ -130,10 +130,10 @@ class SongImport(QtCore.QObject): return text def process_song_text(self, text): - versetexts = text.split(u'\n\n') - for versetext in versetexts: - if versetext.strip() != u'': - self.process_verse_text(versetext.strip()) + verse_texts = text.split(u'\n\n') + for verse_text in verse_texts: + if verse_text.strip() != u'': + self.process_verse_text(verse_text.strip()) def process_verse_text(self, text): lines = text.split(u'\n') @@ -227,10 +227,10 @@ class SongImport(QtCore.QObject): else: self.verse_counts[verse_def[0]] = 1 if len(verse_def) == 1: - verse_def += unicode(self.versecounts[verse_def[0]]) - elif int(verse_def[1:]) > self.versecounts[verse_def[0]]: - self.versecounts[verse_def[0]] = int(verse_def[1:]) - self.verses.append([verse_def, versetext.rstrip(), lang]) + verse_def += unicode(self.verse_counts[verse_def[0]]) + elif int(verse_def[1:]) > self.verse_counts[verse_def[0]]: + self.verse_counts[verse_def[0]] = int(verse_def[1:]) + self.verses.append([verse_def, verse_text.rstrip(), lang]) self.verse_order_list_generated.append(verse_def) def repeat_verse(self): @@ -278,7 +278,7 @@ class SongImport(QtCore.QObject): other_count = 1 for (verse_def, verse_text, lang) in self.verses: if verse_def[0].lower() in VerseType.Tags: - verse_def = verse_def[0].lower() + verse_tag = verse_def[0].lower() else: new_verse_def = u'%s%d' % (VerseType.Tags[VerseType.Other], other_count) From 57ffb1758b74f35e1f2714ca5077de8b58cd860c Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Fri, 18 Feb 2011 15:23:33 +0000 Subject: [PATCH 167/243] Fix mime data string --- openlp/core/lib/mediamanageritem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index d4fdfff17..c2c2987c2 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -240,7 +240,7 @@ class MediaManagerItem(QtGui.QWidget): Creates the main widget for listing items the media item is tracking """ # Add the List widget - self.listView = ListWidgetWithDnD(self, self.title) + self.listView = ListWidgetWithDnD(self, self.plugin.name) self.listView.uniformItemSizes = True self.listView.setSpacing(1) self.listView.setSelectionMode( From 8fdfb299e04836c7cdc86944bcfd6cc7b134b837 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Fri, 18 Feb 2011 18:23:07 +0200 Subject: [PATCH 168/243] Fixed up the documentation. --- documentation/api/source/core/lib.rst | 2 +- documentation/api/source/plugins/songs.rst | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/documentation/api/source/core/lib.rst b/documentation/api/source/core/lib.rst index fa894875d..6be95de5f 100644 --- a/documentation/api/source/core/lib.rst +++ b/documentation/api/source/core/lib.rst @@ -13,7 +13,7 @@ Object Library :members: :mod:`ListWidgetWithDnD` ----------------------- +------------------------ .. autoclass:: openlp.core.lib.listwidgetwithdnd.ListWidgetWithDnD :members: diff --git a/documentation/api/source/plugins/songs.rst b/documentation/api/source/plugins/songs.rst index 1e86ce020..a9a3a8219 100644 --- a/documentation/api/source/plugins/songs.rst +++ b/documentation/api/source/plugins/songs.rst @@ -54,9 +54,6 @@ Helper Classes & Functions .. automodule:: openlp.plugins.songs.lib.mediaitem :members: -.. autoclass:: openlp.plugins.songs.lib.mediaitem.SongListView - :members: - .. automodule:: openlp.plugins.songs.lib.songimport :members: From bcf35bf54e2cb4d9db7e2fc0a9ba7cc2d9c1521f Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Fri, 18 Feb 2011 17:34:43 +0000 Subject: [PATCH 169/243] Sort out song importer initialisation --- openlp/plugins/songs/lib/cclifileimport.py | 11 +++-------- openlp/plugins/songs/lib/easislidesimport.py | 14 ++++++-------- openlp/plugins/songs/lib/ewimport.py | 3 +-- openlp/plugins/songs/lib/olp1import.py | 3 +-- openlp/plugins/songs/lib/olpimport.py | 5 ++--- openlp/plugins/songs/lib/oooimport.py | 9 ++------- openlp/plugins/songs/lib/openlyricsexport.py | 0 openlp/plugins/songs/lib/openlyricsimport.py | 9 ++------- openlp/plugins/songs/lib/opensongimport.py | 10 ++++------ openlp/plugins/songs/lib/songbeamerimport.py | 7 +------ openlp/plugins/songs/lib/songimport.py | 12 ++++++++++-- openlp/plugins/songs/lib/songshowplusimport.py | 7 +------ openlp/plugins/songs/lib/wowimport.py | 7 +------ 13 files changed, 34 insertions(+), 63 deletions(-) mode change 100755 => 100644 openlp/plugins/songs/lib/openlyricsexport.py diff --git a/openlp/plugins/songs/lib/cclifileimport.py b/openlp/plugins/songs/lib/cclifileimport.py index 534cbeab7..ccd1dff9c 100644 --- a/openlp/plugins/songs/lib/cclifileimport.py +++ b/openlp/plugins/songs/lib/cclifileimport.py @@ -51,22 +51,17 @@ class CCLIFileImport(SongImport): ``filenames`` The files to be imported. """ - SongImport.__init__(self, manager) - if u'filenames' in kwargs: - self.filenames = kwargs[u'filenames'] - log.debug(self.filenames) - else: - raise KeyError(u'Keyword argument "filenames" not supplied.') + SongImport.__init__(self, manager, **kwargs) def do_import(self): """ Import either a .usr or a .txt SongSelect file """ log.debug(u'Starting CCLI File Import') - song_total = len(self.filenames) + song_total = len(self.import_source) self.import_wizard.progressBar.setMaximum(song_total) song_count = 1 - for filename in self.filenames: + for filename in self.import_source: self.import_wizard.incrementProgressBar(unicode(translate( 'SongsPlugin.CCLIFileImport', 'Importing song %d of %d')) % (song_count, song_total)) diff --git a/openlp/plugins/songs/lib/easislidesimport.py b/openlp/plugins/songs/lib/easislidesimport.py index df9aa98d6..bdf263a4b 100644 --- a/openlp/plugins/songs/lib/easislidesimport.py +++ b/openlp/plugins/songs/lib/easislidesimport.py @@ -46,32 +46,30 @@ class EasiSlidesImport(SongImport): """ Initialise the class. """ - SongImport.__init__(self, manager) - self.filename = kwargs[u'filename'] - self.song = None + SongImport.__init__(self, manager, **kwargs) self.commit = True def do_import(self): """ - Import either each of the files in self.filenames - each element of + Import either each of the files in self.import_sources - each element of which can be either a single opensong file, or a zipfile containing multiple opensong files. If `self.commit` is set False, the import will not be committed to the database (useful for test scripts). """ self.import_wizard.progressBar.setMaximum(1) - log.info(u'Importing EasiSlides XML file %s', self.filename) + log.info(u'Importing EasiSlides XML file %s', self.import_source) parser = etree.XMLParser(remove_blank_text=True) - file = etree.parse(self.filename, parser) + file = etree.parse(self.import_source, parser) xml = unicode(etree.tostring(file)) song_xml = objectify.fromstring(xml) self.import_wizard.incrementProgressBar( - WizardStrings.ImportingType % os.path.split(self.filename)[-1]) + WizardStrings.ImportingType % os.path.split(self.import_source)[-1]) self.import_wizard.progressBar.setMaximum(len(song_xml.Item)) for song in song_xml.Item: self.import_wizard.incrementProgressBar( unicode(translate('SongsPlugin.ImportWizardForm', u'Importing %s, song %s...')) % - (os.path.split(self.filename)[-1], song.Title1)) + (os.path.split(self.import_source)[-1], song.Title1)) success = self._parse_song(song) if not success or self.stop_import_flag: return False diff --git a/openlp/plugins/songs/lib/ewimport.py b/openlp/plugins/songs/lib/ewimport.py index df88f025b..c88238610 100644 --- a/openlp/plugins/songs/lib/ewimport.py +++ b/openlp/plugins/songs/lib/ewimport.py @@ -135,8 +135,7 @@ class EasyWorshipSongImport(SongImport): ability to import EasyWorship song files. """ def __init__(self, manager, **kwargs): - self.import_source = kwargs[u'filename'] - SongImport.__init__(self, manager) + SongImport.__init__(self, manager, **kwargs) def do_import(self): # Open the DB and MB files if they exist diff --git a/openlp/plugins/songs/lib/olp1import.py b/openlp/plugins/songs/lib/olp1import.py index a8fb29691..5e18c7ffa 100644 --- a/openlp/plugins/songs/lib/olp1import.py +++ b/openlp/plugins/songs/lib/olp1import.py @@ -55,8 +55,7 @@ class OpenLP1SongImport(SongImport): ``filename`` The database providing the data to import. """ - SongImport.__init__(self, manager) - self.import_source = kwargs[u'filename'] + SongImport.__init__(self, manager, **kwargs) def do_import(self): """ diff --git a/openlp/plugins/songs/lib/olpimport.py b/openlp/plugins/songs/lib/olpimport.py index d2a00447f..b3f03b951 100644 --- a/openlp/plugins/songs/lib/olpimport.py +++ b/openlp/plugins/songs/lib/olpimport.py @@ -86,9 +86,8 @@ class OpenLPSongImport(SongImport): ``source_db`` The database providing the data to import. """ - SongImport.__init__(self, manager) - self.import_source = u'sqlite:///%s' % kwargs[u'filename'] - log.debug(self.import_source) + SongImport.__init__(self, manager, **kwargs) + self.import_source = u'sqlite:///%s' % self.import_source self.source_session = None def do_import(self): diff --git a/openlp/plugins/songs/lib/oooimport.py b/openlp/plugins/songs/lib/oooimport.py index 32315130a..69852c922 100644 --- a/openlp/plugins/songs/lib/oooimport.py +++ b/openlp/plugins/songs/lib/oooimport.py @@ -56,20 +56,15 @@ class OooImport(SongImport): Initialise the class. Requires a songmanager class which is passed to SongImport for writing song to disk """ - SongImport.__init__(self, master_manager) - self.song = None - self.master_manager = master_manager + SongImport.__init__(self, master_manager, **kwargs) self.document = None self.process_started = False - self.filenames = kwargs[u'filenames'] - QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'openlp_stop_wizard'), self.stop_import) def do_import(self): self.stop_import_flag = False self.import_wizard.progressBar.setMaximum(0) self.start_ooo() - for filename in self.filenames: + for filename in self.import_source: if self.stop_import_flag: self.import_wizard.incrementProgressBar(u'Import cancelled', 0) return diff --git a/openlp/plugins/songs/lib/openlyricsexport.py b/openlp/plugins/songs/lib/openlyricsexport.py old mode 100755 new mode 100644 diff --git a/openlp/plugins/songs/lib/openlyricsimport.py b/openlp/plugins/songs/lib/openlyricsimport.py index f4506c2be..0396335b8 100644 --- a/openlp/plugins/songs/lib/openlyricsimport.py +++ b/openlp/plugins/songs/lib/openlyricsimport.py @@ -48,13 +48,8 @@ class OpenLyricsImport(SongImport): Initialise the import. """ log.debug(u'initialise OpenLyricsImport') - SongImport.__init__(self, master_manager) - self.master_manager = master_manager - self.openLyrics = OpenLyrics(master_manager) - if kwargs.has_key(u'filename'): - self.import_source = kwargs[u'filename'] - if kwargs.has_key(u'filenames'): - self.import_source = kwargs[u'filenames'] + SongImport.__init__(self, master_manager, **kwargs) + self.openLyrics = OpenLyrics(self.manager) def do_import(self): """ diff --git a/openlp/plugins/songs/lib/opensongimport.py b/openlp/plugins/songs/lib/opensongimport.py index cfbb31691..5214a0a24 100644 --- a/openlp/plugins/songs/lib/opensongimport.py +++ b/openlp/plugins/songs/lib/opensongimport.py @@ -105,21 +105,19 @@ class OpenSongImport(SongImport): """ Initialise the class. """ - SongImport.__init__(self, manager) - self.filenames = kwargs[u'filenames'] - self.song = None + SongImport.__init__(self, manager, **kwargs) self.commit = True def do_import(self): """ - Import either each of the files in self.filenames - each element of + Import either each of the files in self.import_source - each element of which can be either a single opensong file, or a zipfile containing multiple opensong files. If `self.commit` is set False, the import will not be committed to the database (useful for test scripts). """ success = True numfiles = 0 - for filename in self.filenames: + for filename in self.import_source: ext = os.path.splitext(filename)[1] if ext.lower() == u'.zip': z = ZipFile(filename, u'r') @@ -128,7 +126,7 @@ class OpenSongImport(SongImport): numfiles += 1 log.debug(u'Total number of files: %d', numfiles) self.import_wizard.progressBar.setMaximum(numfiles) - for filename in self.filenames: + for filename in self.import_source: if self.stop_import_flag: success = False break diff --git a/openlp/plugins/songs/lib/songbeamerimport.py b/openlp/plugins/songs/lib/songbeamerimport.py index 9b47b2c52..2adfb30b2 100644 --- a/openlp/plugins/songs/lib/songbeamerimport.py +++ b/openlp/plugins/songs/lib/songbeamerimport.py @@ -74,12 +74,7 @@ class SongBeamerImport(SongImport): ``master_manager`` The song manager for the running OpenLP installation. """ - SongImport.__init__(self, master_manager) - if kwargs.has_key(u'filename'): - self.import_source = kwargs[u'filename'] - if kwargs.has_key(u'filenames'): - self.import_source = kwargs[u'filenames'] - log.debug(self.import_source) + SongImport.__init__(self, master_manager, **kwargs) def do_import(self): """ diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index 9493dfdb2..b24b2699a 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -44,7 +44,7 @@ class SongImport(QtCore.QObject): whether the authors etc already exist and add them or refer to them as necessary """ - def __init__(self, manager): + def __init__(self, manager, **kwargs): """ Initialise and create defaults for properties @@ -54,6 +54,14 @@ class SongImport(QtCore.QObject): """ self.manager = manager + if kwargs.has_key(u'filename'): + self.import_source = kwargs[u'filename'] + elif kwargs.has_key(u'filenames'): + self.import_source = kwargs[u'filenames'] + else: + raise KeyError(u'Keyword arguments "filename[s]" not supplied.') + log.debug(self.import_source) + self.song = None self.stop_import_flag = False self.set_defaults() QtCore.QObject.connect(Receiver.get_receiver(), @@ -263,7 +271,7 @@ class SongImport(QtCore.QObject): """ if not self.authors: self.authors.append(SongStrings.AuthorUnknownUnT) - log.info(u'commiting song %s to database', self.title) + log.info(u'committing song %s to database', self.title) song = Song() song.title = self.title song.alternate_title = self.alternate_title diff --git a/openlp/plugins/songs/lib/songshowplusimport.py b/openlp/plugins/songs/lib/songshowplusimport.py index c3498b7e6..74040bcc0 100644 --- a/openlp/plugins/songs/lib/songshowplusimport.py +++ b/openlp/plugins/songs/lib/songshowplusimport.py @@ -93,12 +93,7 @@ class SongShowPlusImport(SongImport): ``master_manager`` The song manager for the running OpenLP installation. """ - SongImport.__init__(self, master_manager) - if kwargs.has_key(u'filename'): - self.import_source = kwargs[u'filename'] - if kwargs.has_key(u'filenames'): - self.import_source = kwargs[u'filenames'] - log.debug(self.import_source) + SongImport.__init__(self, master_manager, **kwargs) def do_import(self): """ diff --git a/openlp/plugins/songs/lib/wowimport.py b/openlp/plugins/songs/lib/wowimport.py index c7bd5d743..05c9704f6 100644 --- a/openlp/plugins/songs/lib/wowimport.py +++ b/openlp/plugins/songs/lib/wowimport.py @@ -99,12 +99,7 @@ class WowImport(SongImport): ``master_manager`` The song manager for the running OpenLP installation. """ - SongImport.__init__(self, master_manager) - if kwargs.has_key(u'filename'): - self.import_source = kwargs[u'filename'] - if kwargs.has_key(u'filenames'): - self.import_source = kwargs[u'filenames'] - log.debug(self.import_source) + SongImport.__init__(self, master_manager, **kwargs) def do_import(self): """ From e4876cd84cba4dc6d0b5e36203a8dff6d4d39085 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Fri, 18 Feb 2011 17:38:39 +0000 Subject: [PATCH 170/243] print changes --- openlp/core/lib/ui.py | 2 - openlp/core/ui/printserviceorderdialog.py | 18 +- openlp/core/ui/printserviceorderform.py | 27 +- resources/forms/printserviceorderdialog.ui | 396 +++++++++++---------- 4 files changed, 234 insertions(+), 209 deletions(-) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 27c510eb2..a98e2fb7f 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -44,8 +44,6 @@ class UiStrings(object): Advanced = translate('OpenLP.Ui', 'Advanced') AllFiles = translate('OpenLP.Ui', 'All Files') Authors = translate('OpenLP.Ui', 'Authors') - CopyToHtml = translate('OpenLP.Ui', 'Copy to HTML') - CopyToText = translate('OpenLP.Ui', 'Copy to Text') CreateService = translate('OpenLP.Ui', 'Create a new service.') Delete = translate('OpenLP.Ui', '&Delete') Edit = translate('OpenLP.Ui', '&Edit') diff --git a/openlp/core/ui/printserviceorderdialog.py b/openlp/core/ui/printserviceorderdialog.py index c464a7814..c8b47b3e3 100644 --- a/openlp/core/ui/printserviceorderdialog.py +++ b/openlp/core/ui/printserviceorderdialog.py @@ -32,6 +32,8 @@ from openlp.core.lib.ui import UiStrings class Ui_PrintServiceOrderDialog(object): def setupUi(self, printServiceOrderDialog): printServiceOrderDialog.setObjectName(u'printServiceOrderDialog') + self.verticalLayout = QtGui.QGridLayout(printServiceOrderDialog) + self.verticalLayout.setObjectName(u'verticalLayout') self.dialogLayout = QtGui.QGridLayout(printServiceOrderDialog) self.dialogLayout.setObjectName(u'dialogLayout') self.perviewLayout = QtGui.QVBoxLayout() @@ -76,9 +78,6 @@ class Ui_PrintServiceOrderDialog(object): self.printMetaDataCheckBox = QtGui.QCheckBox(printServiceOrderDialog) self.printMetaDataCheckBox.setObjectName(u'printMetaDataCheckBox') self.settingsLayout.addWidget(self.printMetaDataCheckBox) - self.copyMetaDataCheckBox = QtGui.QCheckBox(printServiceOrderDialog) - self.copyMetaDataCheckBox.setObjectName(u'copyMetaDataCheckBox') - self.settingsLayout.addWidget(self.copyMetaDataCheckBox) spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.settingsLayout.addItem(spacerItem) @@ -94,6 +93,9 @@ class Ui_PrintServiceOrderDialog(object): spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.buttonLayout.addItem(spacerItem) + self.copyHtmlButton = QtGui.QPushButton(printServiceOrderDialog) + self.copyHtmlButton.setObjectName(u'copyHtmlButton') + self.buttonLayout.addWidget(self.copyHtmlButton) self.copyTextButton = QtGui.QPushButton(printServiceOrderDialog) self.copyTextButton.setObjectName(u'copyTextButton') self.buttonLayout.addWidget(self.copyTextButton) @@ -103,7 +105,7 @@ class Ui_PrintServiceOrderDialog(object): self.cancelButton = QtGui.QPushButton(printServiceOrderDialog) self.cancelButton.setObjectName(u'cancelButton') self.buttonLayout.addWidget(self.cancelButton) - self.dialogLayout.addLayout(self.buttonLayout, 1, 3, 1, 1) + self.dialogLayout.addLayout(self.buttonLayout, 2, 2, 1, 1) self.zoomButtonLayout = QtGui.QHBoxLayout() self.zoomButtonLayout.setObjectName(u'zoomButtonLayout') spacerItem = QtGui.QSpacerItem(40, 20, @@ -134,14 +136,14 @@ class Ui_PrintServiceOrderDialog(object): self.printMetaDataCheckBox.setText( translate('OpenLP.PrintServiceOrderForm', 'Include play length of media items')) - self.copyMetaDataCheckBox.setText( - translate('OpenLP.PrintServiceOrderForm', - 'Copy output as HTML')) self.serviceTitleLabel.setText(translate( 'OpenLP.PrintServiceOrderForm', 'Title:')) self.serviceTitleLineEdit.setText(translate('OpenLP.ServiceManager', 'Service Order Sheet')) - self.copyTextButton.setText(UiStrings.CopyToText) + self.copyTextButton.setText(translate('OpenLP.ServiceManager', + 'Copy to Clipboard as Text')) + self.copyHtmlButton.setText(translate('OpenLP.ServiceManager', + 'Copy to Clipboard as Html')) self.printButton.setText(translate('OpenLP.ServiceManager', 'Print')) self.cancelButton.setText(translate('OpenLP.ServiceManager', 'Cancel')) self.customNotesLabel.setText( diff --git a/openlp/core/ui/printserviceorderform.py b/openlp/core/ui/printserviceorderform.py index cfd0f7a52..48cd606d0 100644 --- a/openlp/core/ui/printserviceorderform.py +++ b/openlp/core/ui/printserviceorderform.py @@ -53,10 +53,6 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): u'print file meta data', QtCore.QVariant(False)).toBool()) self.printNotesCheckBox.setChecked(settings.value( u'print notes', QtCore.QVariant(False)).toBool()) - self.copyMetaDataCheckBox.setChecked(settings.value( - u'html copy', QtCore.QVariant(False)).toBool()) - if self.copyMetaDataCheckBox.isChecked(): - self.copyTextButton.setText(UiStrings.CopyToHtml) settings.endGroup() # Signals QtCore.QObject.connect(self.printButton, @@ -82,8 +78,8 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): QtCore.SIGNAL(u'clicked()'), self.reject) QtCore.QObject.connect(self.copyTextButton, QtCore.SIGNAL(u'clicked()'), self.copyText) - QtCore.QObject.connect(self.copyMetaDataCheckBox, - QtCore.SIGNAL(u'stateChanged(int)'), self.updateTextFormat) + QtCore.QObject.connect(self.copyHtmlButton, + QtCore.SIGNAL(u'clicked()'), self.copyHtmlText) self.updatePreviewText() def updatePreviewText(self): @@ -150,11 +146,18 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): self.document.print_(printer) def copyText(self): - if self.copyMetaDataCheckBox.isChecked(): - self.parent.clipboard.setText(self.document.toHtml()) - else: - self.parent.clipboard.setText(self.document.toPlainText()) - self.accept() + """ + Copies the display text to the clipboard as plain text + """ + self.parent.clipboard.setText(self.document.toPlainText()) + + + def copyHtmlText(self): + """ + Copies the display text to the clipboard as Html + """ + self.parent.clipboard.setText(self.document.toHtml()) + def printServiceOrder(self): """ @@ -200,8 +203,6 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): QtCore.QVariant(self.printMetaDataCheckBox.isChecked())) settings.setValue(u'print notes', QtCore.QVariant(self.printNotesCheckBox.isChecked())) - settings.setValue(u'html copy', - QtCore.QVariant(self.copyMetaDataCheckBox.isChecked())) settings.endGroup() # Close the dialog. return QtGui.QDialog.accept(self) diff --git a/resources/forms/printserviceorderdialog.ui b/resources/forms/printserviceorderdialog.ui index 131979b65..f95aff17b 100644 --- a/resources/forms/printserviceorderdialog.ui +++ b/resources/forms/printserviceorderdialog.ui @@ -7,197 +7,221 @@ 0 0 494 - 426 + 434 Dialog - - - - - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - Service Title: - - - - - - - - - Include slide text if avaialbe - - - - - - - Include service item notes - - - - - - - Include play lenght of media items - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - <b>Custom Notes:</b> - - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Cancel - - - - - - - Print - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - ... - - - - :/general/general_zoom_out.png:/general/general_zoom_out.png - - - - - - - - :/general/general_zoom_in.png:/general/general_zoom_in.png - - - - - - - - - - - - 0 - 0 - - - - Preview: - - - - - - - true - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - - + + + + 4 + 4 + 491 + 432 + + + + + + + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + Service Title: + + + + + + + + + Include slide text if avaialbe + + + + + + + Include service item notes + + + + + + + Include play lenght of media items + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + <b>Custom Notes:</b> + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + ... + + + + :/general/general_zoom_out.png:/general/general_zoom_out.png + + + + + + + + :/general/general_zoom_in.png:/general/general_zoom_in.png + + + + + + + + + + + + 0 + 0 + + + + Preview: + + + + + + + true + + + + 0 + 0 + + + + + 0 + 0 + + + spacer_3 + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Cancel + + + + + + + Cancel + + + + + + + Cancel + + + + + + + Print + + + + + + + From 23d57bb5baf90a5a0be1f0fd7e751b3e08222d33 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Fri, 18 Feb 2011 17:45:14 +0000 Subject: [PATCH 171/243] Import fix --- openlp/plugins/songs/lib/oooimport.py | 1 - 1 file changed, 1 deletion(-) diff --git a/openlp/plugins/songs/lib/oooimport.py b/openlp/plugins/songs/lib/oooimport.py index 69852c922..863fec2b8 100644 --- a/openlp/plugins/songs/lib/oooimport.py +++ b/openlp/plugins/songs/lib/oooimport.py @@ -28,7 +28,6 @@ import os from PyQt4 import QtCore -from openlp.core.lib import Receiver from openlp.core.utils import get_uno_command, get_uno_instance from songimport import SongImport From e192ea438b80d7262ce9c991f8f2ffbe37c3bf0c Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Fri, 18 Feb 2011 18:48:06 +0000 Subject: [PATCH 172/243] Cleanup mistakes --- openlp/plugins/songs/forms/songimportform.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index eef0a7004..d7a575de4 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -466,7 +466,7 @@ class SongImportForm(OpenLPWizard): """ Get OpenLyrics song database files """ - self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.OL, + self.getFiles(WizardStrings.OpenTypeFile % WizardStrings.OL, self.openLyricsFileListWidget) def onOpenLyricsRemoveButtonClicked(self): @@ -479,7 +479,7 @@ class SongImportForm(OpenLPWizard): """ Get OpenSong song database files """ - self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.OS, + self.getFiles(WizardStrings.OpenTypeFile % WizardStrings.OS, self.openSongFileListWidget) def onOpenSongRemoveButtonClicked(self): @@ -492,7 +492,7 @@ class SongImportForm(OpenLPWizard): """ Get Words of Worship song database files """ - self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.WoW, + self.getFiles(WizardStrings.OpenTypeFile % WizardStrings.WoW, self.wordsOfWorshipFileListWidget, u'%s (*.wsg *.wow-song)' % translate('SongsPlugin.ImportWizardForm', 'Words Of Worship Song Files') @@ -508,7 +508,7 @@ class SongImportForm(OpenLPWizard): """ Get CCLI song database files """ - self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.CCLI, + self.getFiles(WizardStrings.OpenTypeFile % WizardStrings.CCLI, self.ccliFileListWidget) def onCCLIRemoveButtonClicked(self): @@ -521,7 +521,7 @@ class SongImportForm(OpenLPWizard): """ Get Songs of Fellowship song database files """ - self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.SoF, + self.getFiles(WizardStrings.OpenTypeFile % WizardStrings.SoF, self.songsOfFellowshipFileListWidget, u'%s (*.rtf)' % translate('SongsPlugin.ImportWizardForm', 'Songs Of Fellowship Song Files') @@ -537,7 +537,7 @@ class SongImportForm(OpenLPWizard): """ Get song database files """ - self.getFileName( + self.getFiles( translate('SongsPlugin.ImportWizardForm', 'Select Document/Presentation Files'), self.genericFileListWidget @@ -564,7 +564,7 @@ class SongImportForm(OpenLPWizard): """ Get SongBeamer song database files """ - self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.SB, + self.getFiles(WizardStrings.OpenTypeFile % WizardStrings.SB, self.songBeamerFileListWidget, u'%s (*.sng)' % translate('SongsPlugin.ImportWizardForm', 'SongBeamer Files') ) From 1f7d6b635d3b245b390ada8ea24ed2567d1ec206 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Fri, 18 Feb 2011 19:13:37 +0000 Subject: [PATCH 173/243] Preview Edit now works --- openlp/plugins/songs/forms/editsongform.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 77caf012e..c541f5a1e 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -678,8 +678,8 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): A button (QPushButton). """ log.debug(u'onPreview') - if unicode(button.objectName()) == u'previewButton' and \ - self.saveSong(True): + if unicode(button.objectName()) == u'previewButton': + self.saveSong(True) Receiver.send_message(u'songs_preview') def clearCaches(self): From e75c24bdd785d060e35a6e9ddd3121ab239b70ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20K=C3=B6hler?= Date: Fri, 18 Feb 2011 21:40:07 +0100 Subject: [PATCH 174/243] Changed 18.02.2011 --- openlp/plugins/songs/forms/songimportform.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index b6c7286bc..361a076da 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -256,7 +256,7 @@ class SongImportForm(OpenLPWizard): self.formatComboBox.setItemText(11, translate('SongsPlugin.ImportWizardForm', 'SongShow Plus')) self.formatComboBox.setItemText(12, - translate('SongsPlugin.ImportWizardForm', 'FoilPresenter')) + translate('SongsPlugin.ImportWizardForm', 'Foilpresenter')) # self.formatComboBox.setItemText(11, # translate('SongsPlugin.ImportWizardForm', 'CSV')) self.openLP2FilenameLabel.setText( @@ -711,7 +711,9 @@ class SongImportForm(OpenLPWizard): self.getFiles( translate('SongsPlugin.ImportWizardForm', 'Select FoilPresenter Files'), - self.foilPresenterFileListWidget + self.foilPresenterFileListWidget, u'%s (*.foil)' + % translate('SongsPlugin.ImportWizardForm', + 'Foilpresenter Song Files') ) def onFoilPresenterRemoveButtonClicked(self): From 31b217571cd683d5f4b9d3a769f2929ae0f1c814 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 19 Feb 2011 08:36:24 +0000 Subject: [PATCH 175/243] Print Dialog updates --- openlp/core/ui/printserviceorderdialog.py | 237 +++++++++++---------- openlp/core/ui/printserviceorderform.py | 90 ++++---- resources/images/general_print.png | Bin 0 -> 880 bytes resources/images/general_zoom_in.png | Bin 716 -> 1191 bytes resources/images/general_zoom_original.png | Bin 0 -> 1182 bytes resources/images/general_zoom_out.png | Bin 662 -> 1173 bytes resources/images/openlp-2.qrc | 4 + resources/images/system_configure.png | Bin 0 -> 1101 bytes resources/images/system_edit_copy.png | Bin 0 -> 515 bytes 9 files changed, 178 insertions(+), 153 deletions(-) create mode 100644 resources/images/general_print.png create mode 100644 resources/images/general_zoom_original.png create mode 100644 resources/images/system_configure.png create mode 100644 resources/images/system_edit_copy.png diff --git a/openlp/core/ui/printserviceorderdialog.py b/openlp/core/ui/printserviceorderdialog.py index c8b47b3e3..ea3df1dba 100644 --- a/openlp/core/ui/printserviceorderdialog.py +++ b/openlp/core/ui/printserviceorderdialog.py @@ -30,121 +30,136 @@ from openlp.core.lib import build_icon, translate, SpellTextEdit from openlp.core.lib.ui import UiStrings class Ui_PrintServiceOrderDialog(object): - def setupUi(self, printServiceOrderDialog): - printServiceOrderDialog.setObjectName(u'printServiceOrderDialog') - self.verticalLayout = QtGui.QGridLayout(printServiceOrderDialog) - self.verticalLayout.setObjectName(u'verticalLayout') - self.dialogLayout = QtGui.QGridLayout(printServiceOrderDialog) - self.dialogLayout.setObjectName(u'dialogLayout') - self.perviewLayout = QtGui.QVBoxLayout() - self.perviewLayout.setObjectName(u'perviewLayout') - self.previewLabel = QtGui.QLabel(printServiceOrderDialog) - self.previewLabel.setSizePolicy( - QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred) - self.previewLabel.setObjectName(u'previewLabel') - self.perviewLayout.addWidget(self.previewLabel) - self.previewWidget = QtGui.QPrintPreviewWidget( - self.printer, self, QtCore.Qt.Widget) - self.previewWidget.setEnabled(True) - self.previewWidget.setSizePolicy( - QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Expanding) - self.previewWidget.setObjectName(u'previewWidget') - # Give the previewWidget a fixed size, to prevent resizing when clicking - # the zoom buttons. - self.previewWidget.setFixedWidth(350) - self.perviewLayout.addWidget(self.previewWidget) - self.dialogLayout.addLayout(self.perviewLayout, 0, 0, 1, 1) - self.settingsLayout = QtGui.QVBoxLayout() - self.settingsLayout.setObjectName(u'settingsLayout') - self.serviceTitleLayout = QtGui.QGridLayout() - self.serviceTitleLayout.setObjectName(u'serviceTitleLayout') - self.serviceTitleLineEdit = QtGui.QLineEdit(printServiceOrderDialog) - self.serviceTitleLineEdit.setSizePolicy( - QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Preferred) - self.serviceTitleLineEdit.setObjectName(u'serviceTitleLineEdit') - self.serviceTitleLayout.addWidget(self.serviceTitleLineEdit, 1, 1, 1, 1) - self.serviceTitleLabel = QtGui.QLabel(printServiceOrderDialog) - self.serviceTitleLabel.setSizePolicy( - QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred) - self.serviceTitleLabel.setObjectName(u'serviceTitleLabel') - self.serviceTitleLayout.addWidget(self.serviceTitleLabel, 1, 0, 1, 1) - self.settingsLayout.addLayout(self.serviceTitleLayout) - self.printSlideTextCheckBox = QtGui.QCheckBox(printServiceOrderDialog) - self.printSlideTextCheckBox.setObjectName(u'printSlideTextCheckBox') - self.settingsLayout.addWidget(self.printSlideTextCheckBox) - self.printNotesCheckBox = QtGui.QCheckBox(printServiceOrderDialog) - self.printNotesCheckBox.setObjectName(u'printNotesCheckBox') - self.settingsLayout.addWidget(self.printNotesCheckBox) - self.printMetaDataCheckBox = QtGui.QCheckBox(printServiceOrderDialog) - self.printMetaDataCheckBox.setObjectName(u'printMetaDataCheckBox') - self.settingsLayout.addWidget(self.printMetaDataCheckBox) - spacerItem = QtGui.QSpacerItem(20, 40, - QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.settingsLayout.addItem(spacerItem) - self.customNotesLabel = QtGui.QLabel(self) - self.customNotesLabel.setObjectName(u'customNotesLabel') - self.settingsLayout.addWidget(self.customNotesLabel) - self.customNoteEdit = SpellTextEdit(self) - self.customNoteEdit.setObjectName(u'customNoteEdit') - self.settingsLayout.addWidget(self.customNoteEdit) - self.dialogLayout.addLayout(self.settingsLayout, 0, 3, 1, 1) - self.buttonLayout = QtGui.QHBoxLayout() - self.buttonLayout.setObjectName(u'buttonLayout') - spacerItem = QtGui.QSpacerItem(40, 20, - QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.buttonLayout.addItem(spacerItem) - self.copyHtmlButton = QtGui.QPushButton(printServiceOrderDialog) - self.copyHtmlButton.setObjectName(u'copyHtmlButton') - self.buttonLayout.addWidget(self.copyHtmlButton) - self.copyTextButton = QtGui.QPushButton(printServiceOrderDialog) - self.copyTextButton.setObjectName(u'copyTextButton') - self.buttonLayout.addWidget(self.copyTextButton) - self.printButton = QtGui.QPushButton(printServiceOrderDialog) - self.printButton.setObjectName(u'printButton') - self.buttonLayout.addWidget(self.printButton) - self.cancelButton = QtGui.QPushButton(printServiceOrderDialog) - self.cancelButton.setObjectName(u'cancelButton') - self.buttonLayout.addWidget(self.cancelButton) - self.dialogLayout.addLayout(self.buttonLayout, 2, 2, 1, 1) - self.zoomButtonLayout = QtGui.QHBoxLayout() - self.zoomButtonLayout.setObjectName(u'zoomButtonLayout') - spacerItem = QtGui.QSpacerItem(40, 20, - QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.zoomButtonLayout.addItem(spacerItem) - self.zoomOutButton = QtGui.QToolButton(printServiceOrderDialog) - self.zoomOutButton.setIcon( - build_icon(u':/general/general_zoom_out.png')) - self.zoomOutButton.setObjectName(u'zoomOutButton') - self.zoomButtonLayout.addWidget(self.zoomOutButton) - self.zoomInButton = QtGui.QToolButton(printServiceOrderDialog) - self.zoomInButton.setIcon(build_icon(u':/general/general_zoom_in.png')) + def setupUi(self, printServiceDialog): + printServiceDialog.setObjectName(u'printServiceDialog') + printServiceDialog.resize(664, 594) + self.mainLayout = QtGui.QVBoxLayout(printServiceDialog) + self.mainLayout.setSpacing(0) + self.mainLayout.setMargin(0) + self.mainLayout.setObjectName(u'mainLayout') + self.toolbar = QtGui.QToolBar(printServiceDialog) + self.toolbar.setIconSize(QtCore.QSize(22, 22)) + self.toolbar.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon) + self.toolbar.addAction( + QtGui.QIcon(build_icon(u':/general/general_print.png')), 'Print') + self.optionsButton = QtGui.QToolButton(self.toolbar) + self.optionsButton.setText(u'Options') + self.optionsButton.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon) + self.optionsButton.setIcon(QtGui.QIcon( + build_icon(u':/system/system_configure.png'))) + self.optionsButton.setCheckable(True) + self.toolbar.addWidget(self.optionsButton) + self.toolbar.addAction( + QtGui.QIcon(build_icon(u':/system/system_close.png')), + 'Close') + self.toolbar.addSeparator() + self.toolbar.addAction( + QtGui.QIcon(build_icon(u':/system/system_edit_copy.png')), + 'Copy') + self.toolbar.addAction( + QtGui.QIcon(build_icon(u':/system/system_edit_copy.png')), + 'Copy as HTML') + self.toolbar.addSeparator() + self.zoomInButton = QtGui.QToolButton(self.toolbar) + self.zoomInButton.setIcon(QtGui.QIcon( + build_icon(u':/general/general_zoom_in.png'))) + self.zoomInButton.setToolTip(u'Zoom In') self.zoomInButton.setObjectName(u'zoomInButton') - self.zoomButtonLayout.addWidget(self.zoomInButton) - self.dialogLayout.addLayout(self.zoomButtonLayout, 1, 0, 1, 1) - self.retranslateUi(printServiceOrderDialog) - QtCore.QMetaObject.connectSlotsByName(printServiceOrderDialog) + self.zoomInButton.setIconSize(QtCore.QSize(22, 22)) + self.toolbar.addWidget(self.zoomInButton) + self.zoomOutButton = QtGui.QToolButton(self.toolbar) + self.zoomOutButton.setIcon(QtGui.QIcon( + build_icon(u':/general/general_zoom_out.png'))) + self.zoomOutButton.setToolTip(u'Zoom Out') + self.zoomOutButton.setObjectName(u'zoomOutButton') + self.zoomOutButton.setIconSize(QtCore.QSize(22, 22)) + self.toolbar.addWidget(self.zoomOutButton) + self.zoomOriginalButton = QtGui.QToolButton(self.toolbar) + self.zoomOriginalButton.setIcon(QtGui.QIcon( + build_icon(u':/general/general_zoom_original.png'))) + self.zoomOriginalButton.setToolTip(u'Zoom Original') + self.zoomOriginalButton.setObjectName(u'zoomOriginalButton') + self.zoomOriginalButton.setIconSize(QtCore.QSize(22, 22)) + self.toolbar.addWidget(self.zoomOriginalButton) + self.zoomComboBox = QtGui.QComboBox(printServiceDialog) + self.zoomComboBox.setObjectName((u'zoomComboBox')) + self.zoomComboBox.addItem(u'Fit Page') + self.zoomComboBox.addItem(u'Fit Width') + self.zoomComboBox.addItem(u'100%') + self.zoomComboBox.addItem(u'75%') + self.zoomComboBox.addItem(u'50%') + self.zoomComboBox.addItem(u'25%') + self.toolbar.addWidget(self.zoomComboBox) + self.mainLayout.addWidget(self.toolbar) + self.scrollArea = QtGui.QScrollArea(printServiceDialog) + self.scrollArea.setWidgetResizable(True) + self.scrollArea.setObjectName(u'scrollArea') + self.scrollAreaWidgetContents = QtGui.QWidget() + self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 227, 473)) + self.scrollAreaWidgetContents.setObjectName(u'scrollAreaWidgetContents') + self.scrollArea.setWidget(self.scrollAreaWidgetContents) + self.mainLayout.addWidget(self.scrollArea) + self.optionsWidget = QtGui.QWidget(printServiceDialog) + self.optionsWidget.hide() + self.optionsWidget.resize(400, 300) + self.optionsWidget.setAutoFillBackground(True) + self.optionsLayout = QtGui.QVBoxLayout(self.optionsWidget) + self.optionsLayout.setContentsMargins(8, 8, 8, 8) + self.titleLabel = QtGui.QLabel(self.optionsWidget) + self.titleLabel.setObjectName((u'titleLabel')) + self.titleLabel.setText(u'Title:') + self.optionsLayout.addWidget(self.titleLabel) + self.titleLineEdit = QtGui.QLineEdit(self.optionsWidget) + self.titleLineEdit.setObjectName(u'titleLineEdit') + self.optionsLayout.addWidget(self.titleLineEdit) + self.footerLabel = QtGui.QLabel(self.optionsWidget) + self.footerLabel.setObjectName(u'footerLabel') + self.footerLabel.setText(u'Custom Footer Text:') + self.optionsLayout.addWidget(self.footerLabel) + self.footerTextEdit = QtGui.QTextEdit(self.optionsWidget) + self.footerTextEdit.setObjectName(u'footerTextEdit') + self.optionsLayout.addWidget(self.footerTextEdit) + self.optionsGroupBox = QtGui.QGroupBox(u'Other Options') + self.groupLayout = QtGui.QVBoxLayout() + self.slideTextCheckBox = QtGui.QCheckBox() + self.groupLayout.addWidget(self.slideTextCheckBox) + self.notesCheckBox = QtGui.QCheckBox('Include service item notes') + self.groupLayout.addWidget(self.notesCheckBox) + self.metaDataCheckBox = QtGui.QCheckBox() + self.groupLayout.addWidget(self.metaDataCheckBox) + self.groupLayout.addStretch(1) + self.optionsGroupBox.setLayout(self.groupLayout) + self.optionsLayout.addWidget(self.optionsGroupBox) - def retranslateUi(self, printServiceOrderDialog): - printServiceOrderDialog.setWindowTitle( + self.retranslateUi(printServiceDialog) + QtCore.QMetaObject.connectSlotsByName(printServiceDialog) + QtCore.QObject.connect(self.optionsButton, + QtCore.SIGNAL(u'toggled(bool)'), self.toggleOptions) + + self.retranslateUi(printServiceDialog) + QtCore.QMetaObject.connectSlotsByName(printServiceDialog) + + def retranslateUi(self, printServiceDialog): + printServiceDialog.setWindowTitle( translate('OpenLP.PrintServiceOrderForm', 'Print Service Order')) - self.previewLabel.setText( - translate('OpenLP.PrintServiceOrderForm', 'Preview:')) - self.printSlideTextCheckBox.setText(translate( +# self.previewLabel.setText( +# translate('OpenLP.PrintServiceOrderForm', 'Preview:')) + self.slideTextCheckBox.setText(translate( 'OpenLP.PrintServiceOrderForm', 'Include slide text if available')) - self.printNotesCheckBox.setText(translate( + self.notesCheckBox.setText(translate( 'OpenLP.PrintServiceOrderForm', 'Include service item notes')) - self.printMetaDataCheckBox.setText( + self.metaDataCheckBox.setText( translate('OpenLP.PrintServiceOrderForm', 'Include play length of media items')) - self.serviceTitleLabel.setText(translate( - 'OpenLP.PrintServiceOrderForm', 'Title:')) - self.serviceTitleLineEdit.setText(translate('OpenLP.ServiceManager', - 'Service Order Sheet')) - self.copyTextButton.setText(translate('OpenLP.ServiceManager', - 'Copy to Clipboard as Text')) - self.copyHtmlButton.setText(translate('OpenLP.ServiceManager', - 'Copy to Clipboard as Html')) - self.printButton.setText(translate('OpenLP.ServiceManager', 'Print')) - self.cancelButton.setText(translate('OpenLP.ServiceManager', 'Cancel')) - self.customNotesLabel.setText( - translate('OpenLP.ServiceManager', 'Custom Service Notes:')) +# self.serviceTitleLabel.setText(translate( +# 'OpenLP.PrintServiceOrderForm', 'Title:')) +# self.serviceTitleLineEdit.setText(translate('OpenLP.ServiceManager', +# 'Service Order Sheet')) +# self.copyTextButton.setText(translate('OpenLP.ServiceManager', +# 'Copy to Clipboard as Text')) +# self.copyHtmlButton.setText(translate('OpenLP.ServiceManager', +# 'Copy to Clipboard as Html')) +# self.printButton.setText(translate('OpenLP.ServiceManager', 'Print')) +# self.cancelButton.setText(translate('OpenLP.ServiceManager', 'Cancel')) +# self.customNotesLabel.setText( +# translate('OpenLP.ServiceManager', 'Custom Service Notes:')) diff --git a/openlp/core/ui/printserviceorderform.py b/openlp/core/ui/printserviceorderform.py index 48cd606d0..2bce1e837 100644 --- a/openlp/core/ui/printserviceorderform.py +++ b/openlp/core/ui/printserviceorderform.py @@ -47,40 +47,50 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): # Load the settings for the dialog. settings = QtCore.QSettings() settings.beginGroup(u'advanced') - self.printSlideTextCheckBox.setChecked(settings.value( + self.slideTextCheckBox.setChecked(settings.value( u'print slide text', QtCore.QVariant(False)).toBool()) - self.printMetaDataCheckBox.setChecked(settings.value( + self.metaDataCheckBox.setChecked(settings.value( u'print file meta data', QtCore.QVariant(False)).toBool()) - self.printNotesCheckBox.setChecked(settings.value( + self.notesCheckBox.setChecked(settings.value( u'print notes', QtCore.QVariant(False)).toBool()) settings.endGroup() # Signals - QtCore.QObject.connect(self.printButton, - QtCore.SIGNAL(u'clicked()'), self.printServiceOrder) - QtCore.QObject.connect(self.zoomOutButton, - QtCore.SIGNAL(u'clicked()'), self.zoomOut) - QtCore.QObject.connect(self.zoomInButton, - QtCore.SIGNAL(u'clicked()'), self.zoomIn) - QtCore.QObject.connect(self.previewWidget, - QtCore.SIGNAL(u'paintRequested(QPrinter *)'), self.paintRequested) - QtCore.QObject.connect(self.serviceTitleLineEdit, - QtCore.SIGNAL(u'textChanged(const QString)'), - self.updatePreviewText) - QtCore.QObject.connect(self.printSlideTextCheckBox, - QtCore.SIGNAL(u'stateChanged(int)'), self.updatePreviewText) - QtCore.QObject.connect(self.printNotesCheckBox, - QtCore.SIGNAL(u'stateChanged(int)'), self.updatePreviewText) - QtCore.QObject.connect(self.printMetaDataCheckBox, - QtCore.SIGNAL(u'stateChanged(int)'), self.updatePreviewText) - QtCore.QObject.connect(self.customNoteEdit, - QtCore.SIGNAL(u'textChanged()'), self.updatePreviewText) - QtCore.QObject.connect(self.cancelButton, - QtCore.SIGNAL(u'clicked()'), self.reject) - QtCore.QObject.connect(self.copyTextButton, - QtCore.SIGNAL(u'clicked()'), self.copyText) - QtCore.QObject.connect(self.copyHtmlButton, - QtCore.SIGNAL(u'clicked()'), self.copyHtmlText) - self.updatePreviewText() +# QtCore.QObject.connect(self.printButton, +# QtCore.SIGNAL(u'clicked()'), self.printServiceOrder) +# QtCore.QObject.connect(self.zoomOutButton, +# QtCore.SIGNAL(u'clicked()'), self.zoomOut) +# QtCore.QObject.connect(self.zoomInButton, +# QtCore.SIGNAL(u'clicked()'), self.zoomIn) +# QtCore.QObject.connect(self.previewWidget, +# QtCore.SIGNAL(u'paintRequested(QPrinter *)'), self.paintRequested) +# QtCore.QObject.connect(self.serviceTitleLineEdit, +# QtCore.SIGNAL(u'textChanged(const QString)'), +# self.updatePreviewText) +# QtCore.QObject.connect(self.slideTextCheckBox, +# QtCore.SIGNAL(u'stateChanged(int)'), self.updatePreviewText) +# QtCore.QObject.connect(self.notesCheckBox, +# QtCore.SIGNAL(u'stateChanged(int)'), self.updatePreviewText) +# QtCore.QObject.connect(self.metaDataCheckBox, +# QtCore.SIGNAL(u'stateChanged(int)'), self.updatePreviewText) +# QtCore.QObject.connect(self.customNoteEdit, +# QtCore.SIGNAL(u'textChanged()'), self.updatePreviewText) +# QtCore.QObject.connect(self.cancelButton, +# QtCore.SIGNAL(u'clicked()'), self.reject) +# QtCore.QObject.connect(self.copyTextButton, +# QtCore.SIGNAL(u'clicked()'), self.copyText) +# QtCore.QObject.connect(self.copyHtmlButton, +# QtCore.SIGNAL(u'clicked()'), self.copyHtmlText) +# self.updatePreviewText() + + def toggleOptions(self, checked): + self.optionsWidget.setVisible(checked) + if checked: + left = self.optionsButton.pos().x() + top = self.toolbar.height() + self.optionsWidget.move(left, top) + self.titleLineEdit.setFocus() + else: + self.saveOptions() def updatePreviewText(self): """ @@ -95,7 +105,7 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): text += u'

      %s

      ' % (item.icon, item.get_display_title()) # Add slide text of the service item. - if self.printSlideTextCheckBox.isChecked(): + if self.slideTextCheckBox.isChecked(): if item.is_text(): # Add the text of the service item. verse = None @@ -120,13 +130,13 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): # add footer text += u'

      %s

      ' % item.foot_text # Add service items' notes. - if self.printNotesCheckBox.isChecked(): + if self.notesCheckBox.isChecked(): if item.notes: text += u'

      %s

      %s' % (translate( 'OpenLP.ServiceManager', 'Notes:'), item.notes.replace(u'\n', u'
      ')) # Add play length of media files. - if item.is_media() and self.printMetaDataCheckBox.isChecked(): + if item.is_media() and self.metaDataCheckBox.isChecked(): text += u'

      %s %s

      ' % (translate( 'OpenLP.ServiceManager', u'Playing time:'), unicode(datetime.timedelta(seconds=item.media_length))) @@ -167,7 +177,6 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): return # Print the document. self.document.print_(self.printer) - self.accept() def zoomIn(self): """ @@ -190,7 +199,7 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): else: self.copyTextButton.setText(UiStrings.CopyToText) - def accept(self): + def saveOptions(self): """ Save the settings and close the dialog. """ @@ -198,17 +207,14 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): settings = QtCore.QSettings() settings.beginGroup(u'advanced') settings.setValue(u'print slide text', - QtCore.QVariant(self.printSlideTextCheckBox.isChecked())) + QtCore.QVariant(self.slideTextCheckBox.isChecked())) settings.setValue(u'print file meta data', - QtCore.QVariant(self.printMetaDataCheckBox.isChecked())) + QtCore.QVariant(self.metaDataCheckBox.isChecked())) settings.setValue(u'print notes', - QtCore.QVariant(self.printNotesCheckBox.isChecked())) + QtCore.QVariant(self.notesCheckBox.isChecked())) settings.endGroup() + + def close(self): # Close the dialog. return QtGui.QDialog.accept(self) - def reject(self): - """ - Close the dialog, do not print the service and do not save the settings. - """ - return QtGui.QDialog.reject(self) diff --git a/resources/images/general_print.png b/resources/images/general_print.png new file mode 100644 index 0000000000000000000000000000000000000000..8eb1c6741b62ad70bdaf4fd75d2a535d93d6d03d GIT binary patch literal 880 zcmV-$1CRWPP)-)OT5&Bd)01nK7JB8bqz-B}zf9U63KHEki(1pi_*xiLTH^n0(~c)j8uv@d*IIQhv03tcxPJZvice5)F3M!lMp}vot>R17K_;3-9@2r z#EQfUKYTvR4hNV!Ij@+xoYULeYcDDbo~8&+c|4w0wWU%Cp->1jGas0E<*ZYLGi*sN z?L$XL2P>yV?9-T$8haHVdio5u_V)JB-`|giC>o8Tr>6(Dwlm-3MzF0-w(5f|ZcF^a zLo_utg}%N%*b*k2?Q??Zk@#DHEjBG24m+)&uiUb8&J_lk+SbP0o*Ffs8SD=RC==kqO})9D|Z#^GVX8l-sOBasLn7Ib$%mdjx^mgkhg z_rmtF)sNB9q_tQsm$NPtMW*{7L@J$80|SF)1t&h;b!2t*jg&qm?I@oPRS67$DId}dwiC$+izl!n*DbuVd@mGLZP?+=%wwwy}kcD4|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%gNQ5 z*_oaupUEwSm-D4h9>s$Zt=pn?5l< z{-`ck@oL>6cjeTQB=I!OA&SsM6%ZRqjfruxO`M5&npvTx#F@+9>`;}buQW+Z8ZGa?y5e|wqE^ZZ?h!-0!}@M0p7z-nvj8vTBsJr;}o zFgrV|r4grRS8g2lSeE4}iaNfyu!vP1sS4IqR~IXaa&v5KOvS-}Bp#20@$vDW3knLB zT`t$_;i)P7aB*>|A+Kc^rXPYmpuN5Qw9%3tQ52a#AOJK?`w4A)+M!H6p5T&Nou2ls*m+1{3V;?A$gCqhPTp zuWeUcZyoNLdZ*c#Z8nZ0rqRCxAQ6wpcgF(da@i|M(!sRDfB&i$J{)cO^`#a%Vf9Cx z^R-wk_SYmb0C+r}hq9u+gLAQcc22%gz~&EkrX-ZeJYNTp{s&ML5}u?#gq$ryid( zwmb=_$*#8NTT4BAa&P4g06_!@0Ej@}oBcE4v^~!lt4#tbp00kKtKQbvX1_-S4uE74 z3K1XxUghLxfH77X1w;U-*XtYa_xBduLTg455F(CiL zkjZ3p##rLjvuz*g2bQ4P^=Ni;ZeHyMr`Si=i>F&5P1B||O)E)~6c`4C;a5(l(_X_c z)&blCuneFEpi-??w>jsfY&NSEi^b3ReEx=Mnm_)WiRePgeneral_new.png general_zoom_out.png general_zoom_in.png + general_zoom_original.png + general_print.png general_open.png general_save.png general_email.png @@ -114,6 +116,8 @@ system_exit.png settings_plugin_list.png system_settings.png + system_configure.png + system_edit_copy.png system_configure_shortcuts.png diff --git a/resources/images/system_configure.png b/resources/images/system_configure.png new file mode 100644 index 0000000000000000000000000000000000000000..45b8fae8b8666fbf77bb3f906a6ea7b1ddb620f9 GIT binary patch literal 1101 zcmV-T1hV^yP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L02{9W02{9XUK)`c00007bV*G`2iXAx z12Qe)4)6T{00YfQL_t(|+MSbYOp|96$IsjLZ7HMDl|)KuRd9<5th6H|V}`kQqcbDR zT*5G0HZLI{F58gxqBdEC#2ZoEvH_ctm{K$`CIp)Z*aA^hKFon8SQ#1}pk&sr7wAft zweRKG!Gy#QGqyd+KY4P_Kfm|9=R6MusRw1XTJ$E9sWCG%vz+5OaWwk(gHR}V-r;bb zy*hd=0qH=Sn-A3bp7;_R$C5}SLT2Y?$<136r0+s6Z?S#bjvi6U)ORb5>o2(n{|N*G zB>r!lEX9^cYwJ<2tn7{ZG)@12mN!vCNR=*oDQio1woJ-#958GGD2jqXxBJZa_=FwH z0TjF96{Nrw%3qehH8V2@gb-jD23Y)nN~xU2+LIM%I$&v0QBm3S^zXp342lJoVPV_$ zZIx@+t)-tenypRQ!eps$Z>o5$s;bHs42CFah7?pP72pCPBU4(44 zyW!Bn!s6j%JEjZMs=e-;Nu0*UL7&V{qK@ z-l_I@JdmTv!8xu0WuB7n?ELw+_V)IR*x60A&Z2^-B@}}q@Vu~C&969n9Fto<{)lMS zXoya)BSxc<3=R(Pdz$w2qNNZeeBolAJ=^wLHWw5YoOO2hSQL0s(HGV>!^ht^=00000NkvXXu0mjfA3OQ4 literal 0 HcmV?d00001 diff --git a/resources/images/system_edit_copy.png b/resources/images/system_edit_copy.png new file mode 100644 index 0000000000000000000000000000000000000000..d34cdcd32f09d66b88ae0133c6379e7d7be5afcc GIT binary patch literal 515 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H3?x5i&EW)6%*9TgAsieWw;%dH0CG7CJR*yM zqGce=SbMeU3{X(A#5JNMI6tkVJh3R1p}f3YFEcN@I61K(RWH9NefB#WDWIas0X`wF z|Ns97G9iG4g;`KgP)tlrRaFHdqNb*%p`ig}3kwVH+__`Vp52EIA3Ad6@X=#O)~#E& ze*O9l8#Zj*xN*~_O_wfRx_tTa_3PJf+_-V~-o2;Ko;`p5{N>A+@87@w^5x6duV23b z!FMqD0R}(8;1>w|{{8#UpFe;9{{8pwAJ9GFA|gP~FbJ0f`2{lwOQ@(D7@GU|rlvMe z{`B?duis_ima0JM!=5gVAr-e``y4khDe|~jujPKuwCn4?@J)AW?(W(o;_7L4S=385 zqQz#GIM23&->X;{)@;1FpK}(Y*?Z?kgH^LP7PB$2sic*7CH4JJm{z?lZFS~1?)9h2 z9=?}&a!J2a|L-BUpEp;Z)L-NBz4)VWuVU!cUXv%=pUf0XxU}biMMqYQ#@w7GcePvF z1GY>Rllx_Ecdm@{!?#yIDp@iX?wEe#=*lg9f7yJR4D!XESD&4D`2E$N;qxRaPQ1MS iDMVM4h`MnzV%zfAl3T#hTKbLh*2~7ZZD)ig{ literal 0 HcmV?d00001 From b5e369ba4dbdad7d98850bca2f98f46c8c0bcd48 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 19 Feb 2011 17:33:24 +0000 Subject: [PATCH 177/243] More Print Work --- ...ceorderdialog.py => printservicedialog.py} | 72 ++++++++++--------- ...erviceorderform.py => printserviceform.py} | 72 +++++++++++++------ openlp/core/ui/servicemanager.py | 4 +- 3 files changed, 90 insertions(+), 58 deletions(-) rename openlp/core/ui/{printserviceorderdialog.py => printservicedialog.py} (81%) rename openlp/core/ui/{printserviceorderform.py => printserviceform.py} (79%) diff --git a/openlp/core/ui/printserviceorderdialog.py b/openlp/core/ui/printservicedialog.py similarity index 81% rename from openlp/core/ui/printserviceorderdialog.py rename to openlp/core/ui/printservicedialog.py index ea3df1dba..8eb1c3d45 100644 --- a/openlp/core/ui/printserviceorderdialog.py +++ b/openlp/core/ui/printservicedialog.py @@ -29,7 +29,23 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import build_icon, translate, SpellTextEdit from openlp.core.lib.ui import UiStrings -class Ui_PrintServiceOrderDialog(object): +class ZoomSize(): + """ + Type enumeration for Combo Box sizes + """ + Page = 0 + Width = 1 + OneHundred = 2 + SeventyFive = 3 + Fifty = 4 + TwentyFive = 5 + + Sizes = [ + translate('OpenLP.PrintServiceDialog', 'Fit Page'), + translate('OpenLP.PrintServiceDialog', 'Fit Width'), + u'100%', u'75%', u'50%', u'25%'] + +class Ui_PrintServiceDialog(object): def setupUi(self, printServiceDialog): printServiceDialog.setObjectName(u'printServiceDialog') printServiceDialog.resize(664, 594) @@ -40,23 +56,24 @@ class Ui_PrintServiceOrderDialog(object): self.toolbar = QtGui.QToolBar(printServiceDialog) self.toolbar.setIconSize(QtCore.QSize(22, 22)) self.toolbar.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon) - self.toolbar.addAction( + self.printButton = self.toolbar.addAction( QtGui.QIcon(build_icon(u':/general/general_print.png')), 'Print') self.optionsButton = QtGui.QToolButton(self.toolbar) self.optionsButton.setText(u'Options') - self.optionsButton.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon) + self.optionsButton.setToolButtonStyle( + QtCore.Qt.ToolButtonTextBesideIcon) self.optionsButton.setIcon(QtGui.QIcon( build_icon(u':/system/system_configure.png'))) self.optionsButton.setCheckable(True) self.toolbar.addWidget(self.optionsButton) - self.toolbar.addAction( + self.closeButton = self.toolbar.addAction( QtGui.QIcon(build_icon(u':/system/system_close.png')), 'Close') self.toolbar.addSeparator() - self.toolbar.addAction( + self.plainCopy = self.toolbar.addAction( QtGui.QIcon(build_icon(u':/system/system_edit_copy.png')), 'Copy') - self.toolbar.addAction( + self.htmlCopy = self.toolbar.addAction( QtGui.QIcon(build_icon(u':/system/system_edit_copy.png')), 'Copy as HTML') self.toolbar.addSeparator() @@ -83,22 +100,10 @@ class Ui_PrintServiceOrderDialog(object): self.toolbar.addWidget(self.zoomOriginalButton) self.zoomComboBox = QtGui.QComboBox(printServiceDialog) self.zoomComboBox.setObjectName((u'zoomComboBox')) - self.zoomComboBox.addItem(u'Fit Page') - self.zoomComboBox.addItem(u'Fit Width') - self.zoomComboBox.addItem(u'100%') - self.zoomComboBox.addItem(u'75%') - self.zoomComboBox.addItem(u'50%') - self.zoomComboBox.addItem(u'25%') self.toolbar.addWidget(self.zoomComboBox) self.mainLayout.addWidget(self.toolbar) - self.scrollArea = QtGui.QScrollArea(printServiceDialog) - self.scrollArea.setWidgetResizable(True) - self.scrollArea.setObjectName(u'scrollArea') - self.scrollAreaWidgetContents = QtGui.QWidget() - self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 227, 473)) - self.scrollAreaWidgetContents.setObjectName(u'scrollAreaWidgetContents') - self.scrollArea.setWidget(self.scrollAreaWidgetContents) - self.mainLayout.addWidget(self.scrollArea) + self.previewWidget = QtGui.QPrintPreviewWidget(printServiceDialog) + self.mainLayout.addWidget(self.previewWidget) self.optionsWidget = QtGui.QWidget(printServiceDialog) self.optionsWidget.hide() self.optionsWidget.resize(400, 300) @@ -123,7 +128,7 @@ class Ui_PrintServiceOrderDialog(object): self.groupLayout = QtGui.QVBoxLayout() self.slideTextCheckBox = QtGui.QCheckBox() self.groupLayout.addWidget(self.slideTextCheckBox) - self.notesCheckBox = QtGui.QCheckBox('Include service item notes') + self.notesCheckBox = QtGui.QCheckBox() self.groupLayout.addWidget(self.notesCheckBox) self.metaDataCheckBox = QtGui.QCheckBox() self.groupLayout.addWidget(self.metaDataCheckBox) @@ -136,21 +141,22 @@ class Ui_PrintServiceOrderDialog(object): QtCore.QObject.connect(self.optionsButton, QtCore.SIGNAL(u'toggled(bool)'), self.toggleOptions) - self.retranslateUi(printServiceDialog) - QtCore.QMetaObject.connectSlotsByName(printServiceDialog) - def retranslateUi(self, printServiceDialog): printServiceDialog.setWindowTitle( - translate('OpenLP.PrintServiceOrderForm', 'Print Service Order')) -# self.previewLabel.setText( -# translate('OpenLP.PrintServiceOrderForm', 'Preview:')) - self.slideTextCheckBox.setText(translate( - 'OpenLP.PrintServiceOrderForm', 'Include slide text if available')) - self.notesCheckBox.setText(translate( - 'OpenLP.PrintServiceOrderForm', 'Include service item notes')) - self.metaDataCheckBox.setText( - translate('OpenLP.PrintServiceOrderForm', + translate('OpenLP.PrintServiceForm', 'Print Service Order')) + self.slideTextCheckBox.setText(translate('OpenLP.PrintServiceForm', + 'Include slide text if available')) + self.notesCheckBox.setText(translate('OpenLP.PrintServiceForm', + 'Include service item notes')) + self.metaDataCheckBox.setText(translate('OpenLP.PrintServiceForm', 'Include play length of media items')) + self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.Page]) + self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.Width]) + self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.OneHundred]) + self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.SeventyFive]) + self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.Fifty]) + self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.TwentyFive]) + # self.serviceTitleLabel.setText(translate( # 'OpenLP.PrintServiceOrderForm', 'Title:')) # self.serviceTitleLineEdit.setText(translate('OpenLP.ServiceManager', diff --git a/openlp/core/ui/printserviceorderform.py b/openlp/core/ui/printserviceform.py similarity index 79% rename from openlp/core/ui/printserviceorderform.py rename to openlp/core/ui/printserviceform.py index 2bce1e837..479928dfa 100644 --- a/openlp/core/ui/printserviceorderform.py +++ b/openlp/core/ui/printserviceform.py @@ -29,9 +29,9 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate from openlp.core.lib.ui import UiStrings -from openlp.core.ui.printserviceorderdialog import Ui_PrintServiceOrderDialog +from openlp.core.ui.printservicedialog import Ui_PrintServiceDialog, ZoomSize -class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): +class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): def __init__(self, parent, serviceManager): """ @@ -55,14 +55,20 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): u'print notes', QtCore.QVariant(False)).toBool()) settings.endGroup() # Signals -# QtCore.QObject.connect(self.printButton, -# QtCore.SIGNAL(u'clicked()'), self.printServiceOrder) -# QtCore.QObject.connect(self.zoomOutButton, -# QtCore.SIGNAL(u'clicked()'), self.zoomOut) -# QtCore.QObject.connect(self.zoomInButton, -# QtCore.SIGNAL(u'clicked()'), self.zoomIn) -# QtCore.QObject.connect(self.previewWidget, -# QtCore.SIGNAL(u'paintRequested(QPrinter *)'), self.paintRequested) + QtCore.QObject.connect(self.printButton, + QtCore.SIGNAL(u'triggered()'), self.printServiceOrder) + QtCore.QObject.connect(self.closeButton, + QtCore.SIGNAL(u'triggered()'), self.accept) + QtCore.QObject.connect(self.zoomOutButton, + QtCore.SIGNAL(u'clicked()'), self.zoomOut) + QtCore.QObject.connect(self.zoomInButton, + QtCore.SIGNAL(u'clicked()'), self.zoomIn) + QtCore.QObject.connect(self.zoomOriginalButton, + QtCore.SIGNAL(u'clicked()'), self.zoomOriginal) + QtCore.QObject.connect(self.previewWidget, + QtCore.SIGNAL(u'paintRequested(QPrinter *)'), self.paintRequested) + QtCore.QObject.connect(self.zoomComboBox, + QtCore.SIGNAL(u'currentIndexChanged(int)'), self.displaySizeChanged) # QtCore.QObject.connect(self.serviceTitleLineEdit, # QtCore.SIGNAL(u'textChanged(const QString)'), # self.updatePreviewText) @@ -72,7 +78,7 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): # QtCore.SIGNAL(u'stateChanged(int)'), self.updatePreviewText) # QtCore.QObject.connect(self.metaDataCheckBox, # QtCore.SIGNAL(u'stateChanged(int)'), self.updatePreviewText) -# QtCore.QObject.connect(self.customNoteEdit, +# QtCore.QObject.connect(self.footerTextEdit, # QtCore.SIGNAL(u'textChanged()'), self.updatePreviewText) # QtCore.QObject.connect(self.cancelButton, # QtCore.SIGNAL(u'clicked()'), self.reject) @@ -80,7 +86,7 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): # QtCore.SIGNAL(u'clicked()'), self.copyText) # QtCore.QObject.connect(self.copyHtmlButton, # QtCore.SIGNAL(u'clicked()'), self.copyHtmlText) -# self.updatePreviewText() + self.updatePreviewText() def toggleOptions(self, checked): self.optionsWidget.setVisible(checked) @@ -97,8 +103,8 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): Creates the html text and updates the html of *self.document*. """ text = u'' - if self.serviceTitleLineEdit.text(): - text += u'

      %s

      ' % unicode(self.serviceTitleLineEdit.text()) + if self.titleLineEdit.text(): + text += u'

      %s

      ' % unicode(self.titleLineEdit.text()) for item in self.serviceManager.serviceItems: item = item[u'service_item'] # Add the title of the service item. @@ -140,9 +146,9 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): text += u'

      %s %s

      ' % (translate( 'OpenLP.ServiceManager', u'Playing time:'), unicode(datetime.timedelta(seconds=item.media_length))) - if self.customNoteEdit.toPlainText(): + if self.footerTextEdit.toPlainText(): text += u'

      %s

      %s' % (translate('OpenLP.ServiceManager', - u'Custom Service Notes:'), self.customNoteEdit.toPlainText()) + u'Custom Service Notes:'), self.footerTextEdit.toPlainText()) self.document.setHtml(text) self.previewWidget.updatePreview() @@ -155,20 +161,39 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): """ self.document.print_(printer) + def displaySizeChanged(self, display): + """ + The Zoom Combo box has changed so set up the size. + """ + if display == ZoomSize.Page: + self.previewWidget.fitInView() + elif display == ZoomSize.Width: + self.previewWidget.fitToWidth() + elif display == ZoomSize.OneHundred: + self.previewWidget.fitToWidth() + elif display == ZoomSize.SeventyFive: + self.previewWidget.fitToWidth() + elif display == ZoomSize.Fifty: + self.previewWidget.fitToWidth() + elif display == ZoomSize.TwentyFive: + self.previewWidget.fitToWidth() + settings = QtCore.QSettings() + settings.beginGroup(u'advanced') + settings.setValue(u'display size',QtCore.QVariant(display)) + settings.endGroup() + def copyText(self): """ Copies the display text to the clipboard as plain text """ self.parent.clipboard.setText(self.document.toPlainText()) - def copyHtmlText(self): """ Copies the display text to the clipboard as Html """ self.parent.clipboard.setText(self.document.toHtml()) - def printServiceOrder(self): """ Called, when the *printButton* is clicked. Opens the *printDialog*. @@ -190,6 +215,12 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): """ self.previewWidget.zoomOut() + def zoomOriginal(self): + """ + Called when *zoomOutButton* is clicked. + """ + self.previewWidget.fitInView() + def updateTextFormat(self, value): """ Called when html copy check box is selected. @@ -213,8 +244,3 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog): settings.setValue(u'print notes', QtCore.QVariant(self.notesCheckBox.isChecked())) settings.endGroup() - - def close(self): - # Close the dialog. - return QtGui.QDialog.accept(self) - diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 623c2d641..f5faa22dd 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -37,7 +37,7 @@ from openlp.core.lib import OpenLPToolbar, ServiceItem, context_menu_action, \ ThemeLevel from openlp.core.lib.ui import UiStrings, critical_error_message_box from openlp.core.ui import ServiceNoteForm, ServiceItemEditForm, StartTimeForm -from openlp.core.ui.printserviceorderform import PrintServiceOrderForm +from openlp.core.ui.printserviceform import PrintServiceForm from openlp.core.utils import AppLocation, delete_file, file_is_unicode, \ split_filename @@ -1208,5 +1208,5 @@ class ServiceManager(QtGui.QWidget): """ Print a Service Order Sheet. """ - settingDialog = PrintServiceOrderForm(self.mainwindow, self) + settingDialog = PrintServiceForm(self.mainwindow, self) settingDialog.exec_() From ac8e435f93d22cab32c66fe722a68f2b15396963 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sat, 19 Feb 2011 19:25:14 +0100 Subject: [PATCH 178/243] --- openlp/plugins/songs/songsplugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 3620fcf82..ef89212f1 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -35,6 +35,7 @@ from openlp.core.lib.ui import UiStrings from openlp.plugins.songs.lib import SongMediaItem, SongsTab, SongXML from openlp.plugins.songs.lib.db import Author, init_schema, Song from openlp.plugins.songs.lib.importer import SongFormat +from openlp.plugins.songs.lib.ui import SongStrings log = logging.getLogger(__name__) @@ -147,8 +148,7 @@ class SongsPlugin(Plugin): counter += 1 # The song does not have any author, add one. if not song.authors: - name = unicode(translate('SongsPlugin', 'Author unknown', - 'Translation must contain a blank character!')) + name = unicode(SongStrings.AuthorUnknownUnT) author = self.manager.get_object_filtered(Author, Author.display_name == name) if author is None: From 1f5d896fc1cf617f7978a5c086784e6846a7fcf7 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sat, 19 Feb 2011 19:49:08 +0000 Subject: [PATCH 179/243] Fix CCLI author import --- openlp/plugins/songs/lib/cclifileimport.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/plugins/songs/lib/cclifileimport.py b/openlp/plugins/songs/lib/cclifileimport.py index ccd1dff9c..60652ef14 100644 --- a/openlp/plugins/songs/lib/cclifileimport.py +++ b/openlp/plugins/songs/lib/cclifileimport.py @@ -200,7 +200,7 @@ class CCLIFileImport(SongImport): author_list = song_author.split(u'|') for author in author_list: seperated = author.split(u',') - self.add_author(seperated[1].strip() + u' ' + seperated[0].strip()) + self.add_author(u' '.join(seperated)) self.title = song_name self.copyright = song_copyright self.ccli_number = song_ccli From d5a82b9290c3411ffc8f8d31cfd868f7ebe8d243 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Sat, 19 Feb 2011 22:06:15 +0200 Subject: [PATCH 180/243] Added the README.txt file for Python distribution. --- README.txt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 README.txt diff --git a/README.txt b/README.txt new file mode 100644 index 000000000..15f58e6d0 --- /dev/null +++ b/README.txt @@ -0,0 +1,20 @@ +OpenLP 2.0 +========== + +You're probably reading this because you've just downloaded the source code for +OpenLP 2.0. If you are looking for the installer file, please go to the download +page on the web site:: + + http://openlp.org/en/download.html + +If you're looking for how to contribute to OpenLP, then please look at the +contribution page on the web site:: + + http://openlp.org/en/documentation/introduction/contributing.html + +If you've looked at that page, and are wanting to help develop, test or +translate OpenLP, have a look at the OpenLP wiki:: + + http://wiki.openlp.org/ + +Thanks for downloading OpenLP 2.0! \ No newline at end of file From 282c81326ca0d740b542b827a825cfc7b912d506 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 19 Feb 2011 20:23:23 +0000 Subject: [PATCH 181/243] Print Dialog complete --- openlp/core/ui/printservicedialog.py | 42 ++++++++++++---------------- openlp/core/ui/printserviceform.py | 34 +++++++++++----------- 2 files changed, 34 insertions(+), 42 deletions(-) diff --git a/openlp/core/ui/printservicedialog.py b/openlp/core/ui/printservicedialog.py index 8eb1c3d45..aac5a3e44 100644 --- a/openlp/core/ui/printservicedialog.py +++ b/openlp/core/ui/printservicedialog.py @@ -59,7 +59,8 @@ class Ui_PrintServiceDialog(object): self.printButton = self.toolbar.addAction( QtGui.QIcon(build_icon(u':/general/general_print.png')), 'Print') self.optionsButton = QtGui.QToolButton(self.toolbar) - self.optionsButton.setText(u'Options') + self.optionsButton.setText(translate('OpenLP.PrintServiceForm', + 'Options')) self.optionsButton.setToolButtonStyle( QtCore.Qt.ToolButtonTextBesideIcon) self.optionsButton.setIcon(QtGui.QIcon( @@ -68,38 +69,41 @@ class Ui_PrintServiceDialog(object): self.toolbar.addWidget(self.optionsButton) self.closeButton = self.toolbar.addAction( QtGui.QIcon(build_icon(u':/system/system_close.png')), - 'Close') + translate('OpenLP.PrintServiceForm', 'Close')) self.toolbar.addSeparator() self.plainCopy = self.toolbar.addAction( QtGui.QIcon(build_icon(u':/system/system_edit_copy.png')), - 'Copy') + translate('OpenLP.PrintServiceForm', 'Copy')) self.htmlCopy = self.toolbar.addAction( QtGui.QIcon(build_icon(u':/system/system_edit_copy.png')), - 'Copy as HTML') + translate('OpenLP.PrintServiceForm', 'Copy as HTML')) self.toolbar.addSeparator() self.zoomInButton = QtGui.QToolButton(self.toolbar) self.zoomInButton.setIcon(QtGui.QIcon( build_icon(u':/general/general_zoom_in.png'))) - self.zoomInButton.setToolTip(u'Zoom In') + self.zoomInButton.setToolTip(translate('OpenLP.PrintServiceForm', + 'Zoom In')) self.zoomInButton.setObjectName(u'zoomInButton') self.zoomInButton.setIconSize(QtCore.QSize(22, 22)) self.toolbar.addWidget(self.zoomInButton) self.zoomOutButton = QtGui.QToolButton(self.toolbar) self.zoomOutButton.setIcon(QtGui.QIcon( build_icon(u':/general/general_zoom_out.png'))) - self.zoomOutButton.setToolTip(u'Zoom Out') + self.zoomOutButton.setToolTip(translate('OpenLP.PrintServiceForm', + 'Zoom Out')) self.zoomOutButton.setObjectName(u'zoomOutButton') self.zoomOutButton.setIconSize(QtCore.QSize(22, 22)) self.toolbar.addWidget(self.zoomOutButton) self.zoomOriginalButton = QtGui.QToolButton(self.toolbar) self.zoomOriginalButton.setIcon(QtGui.QIcon( build_icon(u':/general/general_zoom_original.png'))) - self.zoomOriginalButton.setToolTip(u'Zoom Original') + self.zoomOriginalButton.setToolTip(translate('OpenLP.PrintServiceForm', + 'Zoom Original')) self.zoomOriginalButton.setObjectName(u'zoomOriginalButton') self.zoomOriginalButton.setIconSize(QtCore.QSize(22, 22)) self.toolbar.addWidget(self.zoomOriginalButton) self.zoomComboBox = QtGui.QComboBox(printServiceDialog) - self.zoomComboBox.setObjectName((u'zoomComboBox')) + self.zoomComboBox.setObjectName(u'zoomComboBox') self.toolbar.addWidget(self.zoomComboBox) self.mainLayout.addWidget(self.toolbar) self.previewWidget = QtGui.QPrintPreviewWidget(printServiceDialog) @@ -111,7 +115,7 @@ class Ui_PrintServiceDialog(object): self.optionsLayout = QtGui.QVBoxLayout(self.optionsWidget) self.optionsLayout.setContentsMargins(8, 8, 8, 8) self.titleLabel = QtGui.QLabel(self.optionsWidget) - self.titleLabel.setObjectName((u'titleLabel')) + self.titleLabel.setObjectName(u'titleLabel') self.titleLabel.setText(u'Title:') self.optionsLayout.addWidget(self.titleLabel) self.titleLineEdit = QtGui.QLineEdit(self.optionsWidget) @@ -121,10 +125,11 @@ class Ui_PrintServiceDialog(object): self.footerLabel.setObjectName(u'footerLabel') self.footerLabel.setText(u'Custom Footer Text:') self.optionsLayout.addWidget(self.footerLabel) - self.footerTextEdit = QtGui.QTextEdit(self.optionsWidget) + self.footerTextEdit = SpellTextEdit(self.optionsWidget) self.footerTextEdit.setObjectName(u'footerTextEdit') self.optionsLayout.addWidget(self.footerTextEdit) - self.optionsGroupBox = QtGui.QGroupBox(u'Other Options') + self.optionsGroupBox = QtGui.QGroupBox( + translate('OpenLP.PrintServiceForm','Other Options')) self.groupLayout = QtGui.QVBoxLayout() self.slideTextCheckBox = QtGui.QCheckBox() self.groupLayout.addWidget(self.slideTextCheckBox) @@ -150,22 +155,11 @@ class Ui_PrintServiceDialog(object): 'Include service item notes')) self.metaDataCheckBox.setText(translate('OpenLP.PrintServiceForm', 'Include play length of media items')) + self.titleLineEdit.setText(translate('OpenLP.PrintServiceForm', + 'Service Order Sheet')) self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.Page]) self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.Width]) self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.OneHundred]) self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.SeventyFive]) self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.Fifty]) self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.TwentyFive]) - -# self.serviceTitleLabel.setText(translate( -# 'OpenLP.PrintServiceOrderForm', 'Title:')) -# self.serviceTitleLineEdit.setText(translate('OpenLP.ServiceManager', -# 'Service Order Sheet')) -# self.copyTextButton.setText(translate('OpenLP.ServiceManager', -# 'Copy to Clipboard as Text')) -# self.copyHtmlButton.setText(translate('OpenLP.ServiceManager', -# 'Copy to Clipboard as Html')) -# self.printButton.setText(translate('OpenLP.ServiceManager', 'Print')) -# self.cancelButton.setText(translate('OpenLP.ServiceManager', 'Cancel')) -# self.customNotesLabel.setText( -# translate('OpenLP.ServiceManager', 'Custom Service Notes:')) diff --git a/openlp/core/ui/printserviceform.py b/openlp/core/ui/printserviceform.py index 479928dfa..66d23f80a 100644 --- a/openlp/core/ui/printserviceform.py +++ b/openlp/core/ui/printserviceform.py @@ -43,6 +43,7 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): self.printer = QtGui.QPrinter() self.printDialog = QtGui.QPrintDialog(self.printer, self) self.document = QtGui.QTextDocument() + self.zoom = 0 self.setupUi(self) # Load the settings for the dialog. settings = QtCore.QSettings() @@ -53,6 +54,8 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): u'print file meta data', QtCore.QVariant(False)).toBool()) self.notesCheckBox.setChecked(settings.value( u'print notes', QtCore.QVariant(False)).toBool()) + self.zoomComboBox.setCurrentIndex(settings.value( + u'display size', QtCore.QVariant(0)).toInt()[0]) settings.endGroup() # Signals QtCore.QObject.connect(self.printButton, @@ -69,23 +72,10 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): QtCore.SIGNAL(u'paintRequested(QPrinter *)'), self.paintRequested) QtCore.QObject.connect(self.zoomComboBox, QtCore.SIGNAL(u'currentIndexChanged(int)'), self.displaySizeChanged) -# QtCore.QObject.connect(self.serviceTitleLineEdit, -# QtCore.SIGNAL(u'textChanged(const QString)'), -# self.updatePreviewText) -# QtCore.QObject.connect(self.slideTextCheckBox, -# QtCore.SIGNAL(u'stateChanged(int)'), self.updatePreviewText) -# QtCore.QObject.connect(self.notesCheckBox, -# QtCore.SIGNAL(u'stateChanged(int)'), self.updatePreviewText) -# QtCore.QObject.connect(self.metaDataCheckBox, -# QtCore.SIGNAL(u'stateChanged(int)'), self.updatePreviewText) -# QtCore.QObject.connect(self.footerTextEdit, -# QtCore.SIGNAL(u'textChanged()'), self.updatePreviewText) -# QtCore.QObject.connect(self.cancelButton, -# QtCore.SIGNAL(u'clicked()'), self.reject) -# QtCore.QObject.connect(self.copyTextButton, -# QtCore.SIGNAL(u'clicked()'), self.copyText) -# QtCore.QObject.connect(self.copyHtmlButton, -# QtCore.SIGNAL(u'clicked()'), self.copyHtmlText) + QtCore.QObject.connect(self.plainCopy, + QtCore.SIGNAL(u'triggered()'), self.copyText) + QtCore.QObject.connect(self.htmlCopy, + QtCore.SIGNAL(u'triggered()'), self.copyHtmlText) self.updatePreviewText() def toggleOptions(self, checked): @@ -97,6 +87,7 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): self.titleLineEdit.setFocus() else: self.saveOptions() + self.updatePreviewText() def updatePreviewText(self): """ @@ -171,12 +162,16 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): self.previewWidget.fitToWidth() elif display == ZoomSize.OneHundred: self.previewWidget.fitToWidth() + self.previewWidget.zoomIn(1) elif display == ZoomSize.SeventyFive: self.previewWidget.fitToWidth() + self.previewWidget.zoomIn(0.75) elif display == ZoomSize.Fifty: self.previewWidget.fitToWidth() + self.previewWidget.zoomIn(0.5) elif display == ZoomSize.TwentyFive: self.previewWidget.fitToWidth() + self.previewWidget.zoomIn(0.25) settings = QtCore.QSettings() settings.beginGroup(u'advanced') settings.setValue(u'display size',QtCore.QVariant(display)) @@ -208,18 +203,21 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): Called when *zoomInButton* is clicked. """ self.previewWidget.zoomIn() + self.zoom -= 0.1 def zoomOut(self): """ Called when *zoomOutButton* is clicked. """ self.previewWidget.zoomOut() + self.zoom += 0.1 def zoomOriginal(self): """ Called when *zoomOutButton* is clicked. """ - self.previewWidget.fitInView() + self.previewWidget.zoomIn(1 + self.zoom) + self.zoom = 0 def updateTextFormat(self, value): """ From bb39617b3b2000995d9d180c1c1ab341cbf2c65c Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sat, 19 Feb 2011 20:31:21 +0000 Subject: [PATCH 182/243] Try again --- openlp/plugins/songs/lib/cclifileimport.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/songs/lib/cclifileimport.py b/openlp/plugins/songs/lib/cclifileimport.py index 60652ef14..3d08584d0 100644 --- a/openlp/plugins/songs/lib/cclifileimport.py +++ b/openlp/plugins/songs/lib/cclifileimport.py @@ -199,8 +199,11 @@ class CCLIFileImport(SongImport): if len(author_list) < 2: author_list = song_author.split(u'|') for author in author_list: - seperated = author.split(u',') - self.add_author(u' '.join(seperated)) + separated = author.split(u',') + if len(separated) > 1: + self.add_author(u' '.join(reversed(separated))) + else: + self.add_author(author) self.title = song_name self.copyright = song_copyright self.ccli_number = song_ccli From 6208587b939333766412500d6552f2394598ed99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20K=C3=B6hler?= Date: Sat, 19 Feb 2011 22:34:51 +0100 Subject: [PATCH 183/243] foilpresenterimport - some changes --- openlp/core/ui/wizard.py | 1 + openlp/plugins/songs/forms/songimportform.py | 12 ++----- .../plugins/songs/lib/foilpresenterimport.py | 36 +++++++++---------- 3 files changed, 20 insertions(+), 29 deletions(-) diff --git a/openlp/core/ui/wizard.py b/openlp/core/ui/wizard.py index 2960607e4..fc1edeecb 100644 --- a/openlp/core/ui/wizard.py +++ b/openlp/core/ui/wizard.py @@ -54,6 +54,7 @@ class WizardStrings(object): SoF = u'Songs of Fellowship' SSP = u'SongShow Plus' WoW = u'Words of Worship' + FP = u'Foilpresenter' # These strings should need a good reason to be retranslated elsewhere. FinishedImport = translate('OpenLP.Ui', 'Finished import.') FormatLabel = translate('OpenLP.Ui', 'Format:') diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index bc3e28a33..06de08a93 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -410,12 +410,8 @@ class SongImportForm(OpenLPWizard): return False elif source_format == SongFormat.FoilPresenter: if self.foilPresenterFileListWidget.count() == 0: - criticalErrorMessageBox( - translate('SongsPlugin.ImportWizardForm', - 'No Foilpresenter Files Selected'), - translate('SongsPlugin.ImportWizardForm', - 'You need to add at least one Foilpresenter ' - 'song file to import from.')) + critical_error_message_box(UiStrings.NFSp, + WizardStrings.YouSpecifyFile % WizardStrings.FP) self.foilPresenterAddButton.setFocus() return False return True @@ -613,9 +609,7 @@ class SongImportForm(OpenLPWizard): """ Get FoilPresenter song database files """ - self.getFiles( - translate('SongsPlugin.ImportWizardForm', - 'Select FoilPresenter Files'), + self.getFiles(WizardStrings.OpenTypeFile % WizardStrings.FP, self.foilPresenterFileListWidget, u'%s (*.foil)' % translate('SongsPlugin.ImportWizardForm', 'Foilpresenter Song Files') diff --git a/openlp/plugins/songs/lib/foilpresenterimport.py b/openlp/plugins/songs/lib/foilpresenterimport.py index 919901694..635137b00 100644 --- a/openlp/plugins/songs/lib/foilpresenterimport.py +++ b/openlp/plugins/songs/lib/foilpresenterimport.py @@ -94,6 +94,7 @@ import os from lxml import etree, objectify from openlp.core.lib import translate +from openlp.core.ui.wizard import WizardStrings from openlp.plugins.songs.lib import VerseType from openlp.plugins.songs.lib.songimport import SongImport from openlp.plugins.songs.lib.db import Author, Book, Song, Topic @@ -110,32 +111,27 @@ class FoilPresenterImport(SongImport): Initialise the import. """ log.debug(u'initialise FoilPresenterImport') - SongImport.__init__(self, master_manager) - self.master_manager = master_manager - self.FoilPresenter = FoilPresenter(master_manager) - if kwargs.has_key(u'filename'): - self.import_source = kwargs[u'filename'] - if kwargs.has_key(u'filenames'): - self.import_source = kwargs[u'filenames'] + SongImport.__init__(self, master_manager, **kwargs) + self.FoilPresenter = FoilPresenter(self.manager) def do_import(self): """ Imports the songs. """ self.import_wizard.progressBar.setMaximum(len(self.import_source)) + parser = etree.XMLParser(remove_blank_text=True) for file_path in self.import_source: if self.stop_import_flag: return False - self.import_wizard.incrementProgressBar(unicode(translate( - 'SongsPlugin.FoilPresenterImport', 'Importing %s...')) % - os.path.basename(file_path)) - parser = etree.XMLParser(remove_blank_text=True) - parsed_file = etree.parse(file_path, parser) - xml = unicode(etree.tostring(parsed_file)) - if self.FoilPresenter.xml_to_song(xml) is None: - log.debug(u'File could not be imported: %s' % file_path) - # Importing this song failed! For now we stop import. - return False + self.import_wizard.incrementProgressBar( + WizardStrings.ImportingType % os.path.basename(file_path)) + try: + parsed_file = etree.parse(file_path, parser) + xml = unicode(etree.tostring(parsed_file)) + if self.FoilPresenter.xml_to_song(xml) is None: + log.debug(u'File could not be imported: %s' % file_path) + except etree.XMLSyntaxError: + log.exception(u'XML syntax error in file %s' % file_path) return True class FoilPresenter(object): @@ -325,9 +321,9 @@ class FoilPresenter(object): for test_temp in test: author_temp.append(test_temp) for author in author_temp: - author = re.compile( - u'^[\/,;\-\s]+|[\/,;\-\s]+$|\s*[0-9]{4}\s*[\-\/]?\s*([0-9]{4})?[\/,;\-\s]*$' - ).sub(u'', author) + regex = u'^[\/,;\-\s]+|[\/,;\-\s]+$|'\ + '\s*[0-9]{4}\s*[\-\/]?\s*([0-9]{4})?[\/,;\-\s]*$' + author = re.compile(regex).sub(u'', author) author = re.compile( u'[0-9]{1,2}\.\s?J(ahr)?h\.|um\s*$|vor\s*$').sub(u'', author) From 5d947476ac9877b607238781475702c02c27045a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Sun, 20 Feb 2011 02:05:50 +0200 Subject: [PATCH 184/243] two missing qobject init's --- openlp/core/lib/imagemanager.py | 1 + openlp/plugins/songs/lib/songimport.py | 1 + 2 files changed, 2 insertions(+) diff --git a/openlp/core/lib/imagemanager.py b/openlp/core/lib/imagemanager.py index 0a76ce834..23005e992 100644 --- a/openlp/core/lib/imagemanager.py +++ b/openlp/core/lib/imagemanager.py @@ -69,6 +69,7 @@ class ImageManager(QtCore.QObject): log.info(u'Image Manager loaded') def __init__(self): + QtCore.QObject.__init__(self) self._cache = {} self._thread_running = False self._cache_dirty = False diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index b24b2699a..40be1675e 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -54,6 +54,7 @@ class SongImport(QtCore.QObject): """ self.manager = manager + QtCore.QObject.__init__(self) if kwargs.has_key(u'filename'): self.import_source = kwargs[u'filename'] elif kwargs.has_key(u'filenames'): From de66d53e73c06b11cbf1bf41aa6f37bb7f625609 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 20 Feb 2011 07:37:44 +0000 Subject: [PATCH 185/243] Review fixes --- README.txt | 3 ++- openlp/core/ui/printservicedialog.py | 11 +++++------ openlp/core/ui/printserviceform.py | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.txt b/README.txt index 15f58e6d0..0b26d74fc 100644 --- a/README.txt +++ b/README.txt @@ -17,4 +17,5 @@ translate OpenLP, have a look at the OpenLP wiki:: http://wiki.openlp.org/ -Thanks for downloading OpenLP 2.0! \ No newline at end of file +Thanks for downloading OpenLP 2.0! + diff --git a/openlp/core/ui/printservicedialog.py b/openlp/core/ui/printservicedialog.py index aac5a3e44..ec4e054c3 100644 --- a/openlp/core/ui/printservicedialog.py +++ b/openlp/core/ui/printservicedialog.py @@ -57,7 +57,7 @@ class Ui_PrintServiceDialog(object): self.toolbar.setIconSize(QtCore.QSize(22, 22)) self.toolbar.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon) self.printButton = self.toolbar.addAction( - QtGui.QIcon(build_icon(u':/general/general_print.png')), 'Print') + build_icon(u':/general/general_print.png'), 'Print') self.optionsButton = QtGui.QToolButton(self.toolbar) self.optionsButton.setText(translate('OpenLP.PrintServiceForm', 'Options')) @@ -68,14 +68,14 @@ class Ui_PrintServiceDialog(object): self.optionsButton.setCheckable(True) self.toolbar.addWidget(self.optionsButton) self.closeButton = self.toolbar.addAction( - QtGui.QIcon(build_icon(u':/system/system_close.png')), + build_icon(u':/system/system_close.png'), translate('OpenLP.PrintServiceForm', 'Close')) self.toolbar.addSeparator() self.plainCopy = self.toolbar.addAction( - QtGui.QIcon(build_icon(u':/system/system_edit_copy.png')), + build_icon(u':/system/system_edit_copy.png'), translate('OpenLP.PrintServiceForm', 'Copy')) self.htmlCopy = self.toolbar.addAction( - QtGui.QIcon(build_icon(u':/system/system_edit_copy.png')), + build_icon(u':/system/system_edit_copy.png'), translate('OpenLP.PrintServiceForm', 'Copy as HTML')) self.toolbar.addSeparator() self.zoomInButton = QtGui.QToolButton(self.toolbar) @@ -147,8 +147,7 @@ class Ui_PrintServiceDialog(object): QtCore.SIGNAL(u'toggled(bool)'), self.toggleOptions) def retranslateUi(self, printServiceDialog): - printServiceDialog.setWindowTitle( - translate('OpenLP.PrintServiceForm', 'Print Service Order')) + printServiceDialog.setWindowTitle(UiStrings.PrintServiceOrder) self.slideTextCheckBox.setText(translate('OpenLP.PrintServiceForm', 'Include slide text if available')) self.notesCheckBox.setText(translate('OpenLP.PrintServiceForm', diff --git a/openlp/core/ui/printserviceform.py b/openlp/core/ui/printserviceform.py index 66d23f80a..882e39fca 100644 --- a/openlp/core/ui/printserviceform.py +++ b/openlp/core/ui/printserviceform.py @@ -129,12 +129,12 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): # Add service items' notes. if self.notesCheckBox.isChecked(): if item.notes: - text += u'

      %s

      %s' % (translate( + text += u'

      %s

      %s' % (translate( 'OpenLP.ServiceManager', 'Notes:'), item.notes.replace(u'\n', u'
      ')) # Add play length of media files. if item.is_media() and self.metaDataCheckBox.isChecked(): - text += u'

      %s %s

      ' % (translate( + text += u'

      %s %s

      ' % (translate( 'OpenLP.ServiceManager', u'Playing time:'), unicode(datetime.timedelta(seconds=item.media_length))) if self.footerTextEdit.toPlainText(): From af6c792354e68cb4c275ced6e4bc31700dcd9a17 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Sun, 20 Feb 2011 14:25:14 +0000 Subject: [PATCH 186/243] Cleanups --- openlp/core/ui/printservicedialog.py | 3 ++- openlp/core/ui/printserviceform.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/openlp/core/ui/printservicedialog.py b/openlp/core/ui/printservicedialog.py index ec4e054c3..87a8276f4 100644 --- a/openlp/core/ui/printservicedialog.py +++ b/openlp/core/ui/printservicedialog.py @@ -29,7 +29,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import build_icon, translate, SpellTextEdit from openlp.core.lib.ui import UiStrings -class ZoomSize(): +class ZoomSize(object): """ Type enumeration for Combo Box sizes """ @@ -45,6 +45,7 @@ class ZoomSize(): translate('OpenLP.PrintServiceDialog', 'Fit Width'), u'100%', u'75%', u'50%', u'25%'] + class Ui_PrintServiceDialog(object): def setupUi(self, printServiceDialog): printServiceDialog.setObjectName(u'printServiceDialog') diff --git a/openlp/core/ui/printserviceform.py b/openlp/core/ui/printserviceform.py index 882e39fca..f4ad81884 100644 --- a/openlp/core/ui/printserviceform.py +++ b/openlp/core/ui/printserviceform.py @@ -174,7 +174,7 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): self.previewWidget.zoomIn(0.25) settings = QtCore.QSettings() settings.beginGroup(u'advanced') - settings.setValue(u'display size',QtCore.QVariant(display)) + settings.setValue(u'display size', QtCore.QVariant(display)) settings.endGroup() def copyText(self): From 29088db51633403762ca8cd0a55387b551e25fbd Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 20 Feb 2011 15:35:52 +0000 Subject: [PATCH 187/243] Start to move DisplayTag dialog --- openlp/core/ui/__init__.py | 1 + openlp/core/ui/displaytagdialog.py | 51 +++++++++++++++++++ .../{displaytagtab.py => displaytagform.py} | 7 +-- openlp/core/ui/mainwindow.py | 18 ++++++- openlp/core/ui/settingsform.py | 22 ++++---- 5 files changed, 83 insertions(+), 16 deletions(-) create mode 100644 openlp/core/ui/displaytagdialog.py rename openlp/core/ui/{displaytagtab.py => displaytagform.py} (98%) diff --git a/openlp/core/ui/__init__.py b/openlp/core/ui/__init__.py index 45218802e..5763b3470 100644 --- a/openlp/core/ui/__init__.py +++ b/openlp/core/ui/__init__.py @@ -67,6 +67,7 @@ from displaytagtab import DisplayTagTab from aboutform import AboutForm from pluginform import PluginForm from settingsform import SettingsForm +from displaytagform import DisplayTagForm from shortcutlistform import ShortcutListForm from mediadockmanager import MediaDockManager from servicemanager import ServiceManager diff --git a/openlp/core/ui/displaytagdialog.py b/openlp/core/ui/displaytagdialog.py new file mode 100644 index 000000000..f7d4b5175 --- /dev/null +++ b/openlp/core/ui/displaytagdialog.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 + +############################################################################### +# OpenLP - Open Source Lyrics Projection # +# --------------------------------------------------------------------------- # +# Copyright (c) 2008-2011 Raoul Snyman # +# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # +# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # +# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # +# Carsten Tinggaard, Frode Woldsund # +# --------------------------------------------------------------------------- # +# This program is free software; you can redistribute it and/or modify it # +# under the terms of the GNU General Public License as published by the Free # +# Software Foundation; version 2 of the License. # +# # +# This program is distributed in the hope that it will be useful, but WITHOUT # +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # +# more details. # +# # +# You should have received a copy of the GNU General Public License along # +# with this program; if not, write to the Free Software Foundation, Inc., 59 # +# Temple Place, Suite 330, Boston, MA 02111-1307 USA # +############################################################################### + +from PyQt4 import QtCore, QtGui + +from openlp.core.lib import translate, build_icon +from openlp.core.lib.ui import create_accept_reject_button_box + +class Ui_DisplayTagDialog(object): + def setupUi(self, settingsDialog): + settingsDialog.setObjectName(u'settingsDialog') + settingsDialog.resize(700, 500) + settingsDialog.setWindowIcon( + build_icon(u':/system/system_settings.png')) + self.settingsLayout = QtGui.QVBoxLayout(settingsDialog) + self.settingsLayout.setObjectName(u'settingsLayout') + self.settingsTabWidget = QtGui.QTabWidget(settingsDialog) + self.settingsTabWidget.setObjectName(u'settingsTabWidget') + self.settingsLayout.addWidget(self.settingsTabWidget) + + self.buttonBox = create_accept_reject_button_box(settingsDialog, True) + self.settingsLayout.addWidget(self.buttonBox) + self.retranslateUi(settingsDialog) + QtCore.QMetaObject.connectSlotsByName(settingsDialog) + + def retranslateUi(self, settingsDialog): + settingsDialog.setWindowTitle(translate('OpenLP.SettingsForm', + 'Configure OpenLP')) diff --git a/openlp/core/ui/displaytagtab.py b/openlp/core/ui/displaytagform.py similarity index 98% rename from openlp/core/ui/displaytagtab.py rename to openlp/core/ui/displaytagform.py index 30c593d36..5216fcd61 100644 --- a/openlp/core/ui/displaytagtab.py +++ b/openlp/core/ui/displaytagform.py @@ -33,10 +33,11 @@ import cPickle from PyQt4 import QtCore, QtGui -from openlp.core.lib import SettingsTab, translate, DisplayTags +from openlp.core.lib import translate, DisplayTags from openlp.core.lib.ui import UiStrings, critical_error_message_box +from openlp.core.ui.displaytagdialog import Ui_DisplayTagDialog -class DisplayTagTab(SettingsTab): +class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): """ The :class:`DisplayTagTab` manages the settings tab . """ @@ -44,7 +45,7 @@ class DisplayTagTab(SettingsTab): """ Initialise the settings tab """ - SettingsTab.__init__(self, u'Display Tags') + #SettingsTab.__init__(self, u'Display Tags') def resizeEvent(self, event=None): pass diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index aedd9cf4f..82d95dd40 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -34,7 +34,7 @@ from openlp.core.lib.ui import UiStrings, base_action, checkable_action, \ icon_action from openlp.core.ui import AboutForm, SettingsForm, ServiceManager, \ ThemeManager, SlideController, PluginForm, MediaDockManager, \ - ShortcutListForm + ShortcutListForm, DisplayTagForm from openlp.core.utils import AppLocation, add_actions, LanguageManager, \ ActionList @@ -242,6 +242,8 @@ class Ui_MainWindow(object): self.SettingsShortcutsItem = icon_action(mainWindow, u'SettingsShortcutsItem', u':/system/system_configure_shortcuts.png') + self.DisplayTagItem = icon_action(mainWindow, + u'DisplayTagItem', u':/system/system_settings.png') self.SettingsConfigureItem = icon_action(mainWindow, u'SettingsConfigureItem', u':/system/system_settings.png') mainWindow.actionList.add_action(self.SettingsShortcutsItem, @@ -277,7 +279,8 @@ class Ui_MainWindow(object): add_actions(self.SettingsLanguageMenu, self.LanguageGroup.actions()) add_actions(self.SettingsMenu, (self.settingsPluginListItem, self.SettingsLanguageMenu.menuAction(), None, - self.SettingsShortcutsItem, self.SettingsConfigureItem)) + self.SettingsShortcutsItem, self.DisplayTagItem, + self.SettingsConfigureItem)) add_actions(self.ToolsMenu, (self.ToolsAddToolItem, None)) add_actions(self.ToolsMenu, (self.ToolsOpenDataFolder, None)) add_actions(self.HelpMenu, (self.HelpDocumentationItem, @@ -361,6 +364,8 @@ class Ui_MainWindow(object): translate('OpenLP.MainWindow', '&Language')) self.SettingsShortcutsItem.setText( translate('OpenLP.MainWindow', 'Configure &Shortcuts...')) + self.DisplayTagItem.setText( + translate('OpenLP.MainWindow', '&Configure Display Tags')) self.SettingsConfigureItem.setText( translate('OpenLP.MainWindow', '&Configure OpenLP...')) self.ViewMediaManagerItem.setText( @@ -476,6 +481,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): self.settingsmanager = SettingsManager(screens) self.aboutForm = AboutForm(self, applicationVersion) self.settingsForm = SettingsForm(self.screens, self, self) + self.displayTagForm = DisplayTagForm() self.shortcutForm = ShortcutListForm(self) self.recentFiles = QtCore.QStringList() # Set up the path with plugins @@ -523,6 +529,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): QtCore.SIGNAL(u'triggered()'), self.onToolsOpenDataFolderClicked) QtCore.QObject.connect(self.settingsPluginListItem, QtCore.SIGNAL(u'triggered()'), self.onPluginItemClicked) + QtCore.QObject.connect(self.DisplayTagItem, + QtCore.SIGNAL(u'triggered()'), self.onDisplayTagItemClicked) QtCore.QObject.connect(self.SettingsConfigureItem, QtCore.SIGNAL(u'triggered()'), self.onSettingsConfigureItemClicked) QtCore.QObject.connect(self.SettingsShortcutsItem, @@ -716,6 +724,12 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): path = AppLocation.get_data_path() QtGui.QDesktopServices.openUrl(QtCore.QUrl("file:///" + path)) + def onDisplayTagItemClicked(self): + """ + Show the Settings dialog + """ + self.displayTagForm.exec_() + def onSettingsConfigureItemClicked(self): """ Show the Settings dialog diff --git a/openlp/core/ui/settingsform.py b/openlp/core/ui/settingsform.py index afea928b6..3fd640acd 100644 --- a/openlp/core/ui/settingsform.py +++ b/openlp/core/ui/settingsform.py @@ -47,17 +47,17 @@ class SettingsForm(QtGui.QDialog, Ui_SettingsDialog): QtGui.QDialog.__init__(self, parent) self.setupUi(self) # General tab - self.generalTab = GeneralTab(screens) - self.addTab(u'General', self.generalTab) + generalTab = GeneralTab(screens) + self.addTab(u'General', generalTab) # Themes tab - self.themesTab = ThemesTab(mainWindow) - self.addTab(u'Themes', self.themesTab) + themesTab = ThemesTab(mainWindow) + self.addTab(u'Themes', themesTab) # Advanced tab - self.advancedTab = AdvancedTab() - self.addTab(u'Advanced', self.advancedTab) - # Edit Display Tags tab - self.displayTagTab = DisplayTagTab() - self.addTab(u'Display Tags', self.displayTagTab) + advancedTab = AdvancedTab() + self.addTab(u'Advanced', advancedTab) + ## Edit Display Tags tab + #self.displayTagTab = DisplayTagTab() + #self.addTab(u'Display Tags', self.displayTagTab) def addTab(self, name, tab): """ @@ -71,9 +71,9 @@ class SettingsForm(QtGui.QDialog, Ui_SettingsDialog): Add a tab to the form at a specific location """ log.debug(u'Inserting %s tab' % tab.tabTitle) - # 15 : There are 4 tables currently and locations starts at -10 + # 14 : There are 3 tables currently and locations starts at -10 self.settingsTabWidget.insertTab( - location + 15, tab, tab.tabTitleVisible) + location + 14, tab, tab.tabTitleVisible) def removeTab(self, tab): """ From 264c7fb585547a2d57c0128acddc3681ce54560f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Sun, 20 Feb 2011 18:45:58 +0200 Subject: [PATCH 188/243] Handled extensions to log. --- openlp/plugins/media/mediaplugin.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index ee413aa8c..274bce2b4 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -62,6 +62,8 @@ class MediaPlugin(Plugin): type = mimetype.split(u'video/') self.video_list, mimetype = self._addToList(self.video_list, type, mimetype) + log.info(u'MediaPlugin handles audio extensions: %s', self.audio_list) + log.info(u'MediaPlugin handles video extensions: %s', self.video_list) def _addToList(self, list, value, mimetype): # Is it a media type From 338efdc54372f3cb803dbc8eefc8f71efa9aee5f Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 20 Feb 2011 17:06:58 +0000 Subject: [PATCH 189/243] DisplayTag Updates --- openlp/core/ui/displaytagdialog.py | 245 ++++++++++++++++-- openlp/core/ui/displaytagform.py | 155 ++--------- openlp/core/ui/mainwindow.py | 2 +- ...aytabeditdialog.ui => displaytabdialog.ui} | 56 ++-- 4 files changed, 287 insertions(+), 171 deletions(-) rename resources/forms/{displaytabeditdialog.ui => displaytabdialog.ui} (86%) diff --git a/openlp/core/ui/displaytagdialog.py b/openlp/core/ui/displaytagdialog.py index f7d4b5175..3e76b39d2 100644 --- a/openlp/core/ui/displaytagdialog.py +++ b/openlp/core/ui/displaytagdialog.py @@ -27,25 +27,234 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate, build_icon -from openlp.core.lib.ui import create_accept_reject_button_box +from openlp.core.lib.ui import UiStrings, create_accept_reject_button_box + +try: + _fromUtf8 = QtCore.QString.fromUtf8 +except AttributeError: + _fromUtf8 = lambda s: s class Ui_DisplayTagDialog(object): - def setupUi(self, settingsDialog): - settingsDialog.setObjectName(u'settingsDialog') - settingsDialog.resize(700, 500) - settingsDialog.setWindowIcon( - build_icon(u':/system/system_settings.png')) - self.settingsLayout = QtGui.QVBoxLayout(settingsDialog) - self.settingsLayout.setObjectName(u'settingsLayout') - self.settingsTabWidget = QtGui.QTabWidget(settingsDialog) - self.settingsTabWidget.setObjectName(u'settingsTabWidget') - self.settingsLayout.addWidget(self.settingsTabWidget) - self.buttonBox = create_accept_reject_button_box(settingsDialog, True) - self.settingsLayout.addWidget(self.buttonBox) - self.retranslateUi(settingsDialog) - QtCore.QMetaObject.connectSlotsByName(settingsDialog) + def setupUi(self, displayTagDialog): +# displayTagDialog.setObjectName(u'displayTagDialog') +# displayTagDialog.resize(700, 500) +# displayTagDialog.setWindowIcon( +# build_icon(u':/system/system_settings.png')) +# self.settingsLayout = QtGui.QVBoxLayout(displayTagDialog) +# self.settingsLayout.setObjectName(u'settingsLayout') +# self.editGroupBox = QtGui.QGroupBox(displayTagDialog) +# self.editGroupBox.setGeometry(QtCore.QRect(10, 220, 650, 181)) +# self.editGroupBox.setObjectName(u'editGroupBox') +# self.updatePushButton = QtGui.QPushButton(self.editGroupBox) +# self.updatePushButton.setGeometry(QtCore.QRect(550, 140, 71, 26)) +# self.updatePushButton.setObjectName(u'updatePushButton') +# self.layoutWidget = QtGui.QWidget(self.editGroupBox) +# self.layoutWidget.setGeometry(QtCore.QRect(5, 20, 571, 114)) +# self.layoutWidget.setObjectName(u'layoutWidget') +# self.formLayout = QtGui.QFormLayout(self.layoutWidget) +# self.formLayout.setObjectName(u'formLayout') +# self.descriptionLabel = QtGui.QLabel(self.layoutWidget) +# self.descriptionLabel.setAlignment(QtCore.Qt.AlignCenter) +# self.descriptionLabel.setObjectName(u'descriptionLabel') +# self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, +# self.descriptionLabel) +# self.descriptionLineEdit = QtGui.QLineEdit(self.layoutWidget) +# self.descriptionLineEdit.setObjectName(u'descriptionLineEdit') +# self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, +# self.descriptionLineEdit) +# self.tagLabel = QtGui.QLabel(self.layoutWidget) +# self.tagLabel.setAlignment(QtCore.Qt.AlignCenter) +# self.tagLabel.setObjectName(u'tagLabel') +# self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.tagLabel) +# self.tagLineEdit = QtGui.QLineEdit(self.layoutWidget) +# self.tagLineEdit.setMaximumSize(QtCore.QSize(50, 16777215)) +# self.tagLineEdit.setMaxLength(5) +# self.tagLineEdit.setObjectName(u'tagLineEdit') +# self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, +# self.tagLineEdit) +# self.startTagLabel = QtGui.QLabel(self.layoutWidget) +# self.startTagLabel.setAlignment(QtCore.Qt.AlignCenter) +# self.startTagLabel.setObjectName(u'startTagLabel') +# self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, +# self.startTagLabel) +# self.startTagLineEdit = QtGui.QLineEdit(self.layoutWidget) +# self.startTagLineEdit.setObjectName(u'startTagLineEdit') +# self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, +# self.startTagLineEdit) +# self.endTagLabel = QtGui.QLabel(self.layoutWidget) +# self.endTagLabel.setAlignment(QtCore.Qt.AlignCenter) +# self.endTagLabel.setObjectName(u'endTagLabel') +# self.formLayout.setWidget(3, QtGui.QFormLayout.LabelRole, +# self.endTagLabel) +# self.endTagLineEdit = QtGui.QLineEdit(self.layoutWidget) +# self.endTagLineEdit.setObjectName(u'endTagLineEdit') +# self.formLayout.setWidget(3, QtGui.QFormLayout.FieldRole, +# self.endTagLineEdit) +# self.defaultPushButton = QtGui.QPushButton(displayTagDialog) +# self.defaultPushButton.setGeometry(QtCore.QRect(430, 188, 71, 26)) +# self.defaultPushButton.setObjectName(u'updatePushButton') +# self.deletePushButton = QtGui.QPushButton(displayTagDialog) +# self.deletePushButton.setGeometry(QtCore.QRect(510, 188, 71, 26)) +# self.deletePushButton.setObjectName(u'deletePushButton') +# self.newPushButton = QtGui.QPushButton(displayTagDialog) +# self.newPushButton.setGeometry(QtCore.QRect(600, 188, 71, 26)) +# self.newPushButton.setObjectName(u'newPushButton') +# self.tagTableWidget = QtGui.QTableWidget(displayTagDialog) +# self.tagTableWidget.setGeometry(QtCore.QRect(10, 10, 650, 171)) +# self.tagTableWidget.setHorizontalScrollBarPolicy( +# QtCore.Qt.ScrollBarAlwaysOff) +# self.tagTableWidget.setEditTriggers( +# QtGui.QAbstractItemView.NoEditTriggers) +# self.tagTableWidget.setAlternatingRowColors(True) +# self.tagTableWidget.setSelectionMode( +# QtGui.QAbstractItemView.SingleSelection) +# self.tagTableWidget.setSelectionBehavior( +# QtGui.QAbstractItemView.SelectRows) +# self.tagTableWidget.setCornerButtonEnabled(False) +# self.tagTableWidget.setObjectName(u'tagTableWidget') +# self.tagTableWidget.setColumnCount(4) +# self.tagTableWidget.setRowCount(0) +# item = QtGui.QTableWidgetItem() +# self.tagTableWidget.setHorizontalHeaderItem(0, item) +# item = QtGui.QTableWidgetItem() +# self.tagTableWidget.setHorizontalHeaderItem(1, item) +# item = QtGui.QTableWidgetItem() +# self.tagTableWidget.setHorizontalHeaderItem(2, item) +# item = QtGui.QTableWidgetItem() +# self.tagTableWidget.setHorizontalHeaderItem(3, item) +# +# self.buttonBox = create_accept_reject_button_box(displayTagDialog, True) +# self.settingsLayout.addWidget(self.buttonBox) +# self.retranslateUi(displayTagDialog) +# QtCore.QMetaObject.connectSlotsByName(displayTagDialog) + displayTagDialog.setObjectName(_fromUtf8("displayTagDialog")) + displayTagDialog.resize(717, 554) + self.editGroupBox = QtGui.QGroupBox(displayTagDialog) + self.editGroupBox.setGeometry(QtCore.QRect(10, 320, 691, 181)) + self.editGroupBox.setObjectName(_fromUtf8("editGroupBox")) + self.updatePushButton = QtGui.QPushButton(self.editGroupBox) + self.updatePushButton.setGeometry(QtCore.QRect(600, 140, 73, 26)) + self.updatePushButton.setObjectName(_fromUtf8("updatePushButton")) + self.layoutWidget = QtGui.QWidget(self.editGroupBox) + self.layoutWidget.setGeometry(QtCore.QRect(20, 50, 571, 114)) + self.layoutWidget.setObjectName(_fromUtf8("layoutWidget")) + self.formLayout = QtGui.QFormLayout(self.layoutWidget) + self.formLayout.setMargin(0) + self.formLayout.setObjectName(_fromUtf8("formLayout")) + self.descriptionLabel = QtGui.QLabel(self.layoutWidget) + self.descriptionLabel.setAlignment(QtCore.Qt.AlignCenter) + self.descriptionLabel.setObjectName(_fromUtf8("descriptionLabel")) + self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.descriptionLabel) + self.descriptionLineEdit = QtGui.QLineEdit(self.layoutWidget) + self.descriptionLineEdit.setObjectName(_fromUtf8("descriptionLineEdit")) + self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.descriptionLineEdit) + self.tagLabel = QtGui.QLabel(self.layoutWidget) + self.tagLabel.setAlignment(QtCore.Qt.AlignCenter) + self.tagLabel.setObjectName(_fromUtf8("tagLabel")) + self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.tagLabel) + self.tagLineEdit = QtGui.QLineEdit(self.layoutWidget) + self.tagLineEdit.setMaximumSize(QtCore.QSize(50, 16777215)) + self.tagLineEdit.setMaxLength(5) + self.tagLineEdit.setObjectName(_fromUtf8("tagLineEdit")) + self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.tagLineEdit) + self.startTagLabel = QtGui.QLabel(self.layoutWidget) + self.startTagLabel.setAlignment(QtCore.Qt.AlignCenter) + self.startTagLabel.setObjectName(_fromUtf8("startTagLabel")) + self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.startTagLabel) + self.startTagLineEdit = QtGui.QLineEdit(self.layoutWidget) + self.startTagLineEdit.setObjectName(_fromUtf8("startTagLineEdit")) + self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.startTagLineEdit) + self.endTagLabel = QtGui.QLabel(self.layoutWidget) + self.endTagLabel.setAlignment(QtCore.Qt.AlignCenter) + self.endTagLabel.setObjectName(_fromUtf8("endTagLabel")) + self.formLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.endTagLabel) + self.endTagLineEdit = QtGui.QLineEdit(self.layoutWidget) + self.endTagLineEdit.setObjectName(_fromUtf8("endTagLineEdit")) + self.formLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.endTagLineEdit) + self.addPushButton = QtGui.QPushButton(self.editGroupBox) + self.addPushButton.setGeometry(QtCore.QRect(600, 40, 71, 26)) + self.addPushButton.setObjectName(_fromUtf8("addPushButton")) + self.newPushButton = QtGui.QPushButton(self.editGroupBox) + self.newPushButton.setGeometry(QtCore.QRect(600, 70, 71, 26)) + self.newPushButton.setObjectName(_fromUtf8("newPushButton")) + self.buttonBox = QtGui.QDialogButtonBox(displayTagDialog) + self.buttonBox.setGeometry(QtCore.QRect(540, 510, 162, 26)) + self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Save) + self.buttonBox.setObjectName(_fromUtf8("buttonBox")) + self.deletePushButton = QtGui.QPushButton(displayTagDialog) + self.deletePushButton.setGeometry(QtCore.QRect(630, 280, 71, 26)) + self.deletePushButton.setObjectName(_fromUtf8("deletePushButton")) + self.tagTableWidget = QtGui.QTableWidget(displayTagDialog) + self.tagTableWidget.setGeometry(QtCore.QRect(10, 10, 691, 271)) + self.tagTableWidget.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) + self.tagTableWidget.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers) + self.tagTableWidget.setAlternatingRowColors(True) + self.tagTableWidget.setSelectionMode(QtGui.QAbstractItemView.SingleSelection) + self.tagTableWidget.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) + self.tagTableWidget.setCornerButtonEnabled(False) + self.tagTableWidget.setObjectName(_fromUtf8("tagTableWidget")) + self.tagTableWidget.setColumnCount(4) + self.tagTableWidget.setRowCount(0) + item = QtGui.QTableWidgetItem() + self.tagTableWidget.setHorizontalHeaderItem(0, item) + item = QtGui.QTableWidgetItem() + self.tagTableWidget.setHorizontalHeaderItem(1, item) + item = QtGui.QTableWidgetItem() + self.tagTableWidget.setHorizontalHeaderItem(2, item) + item = QtGui.QTableWidgetItem() + self.tagTableWidget.setHorizontalHeaderItem(3, item) + self.defaultPushButton = QtGui.QPushButton(displayTagDialog) + self.defaultPushButton.setGeometry(QtCore.QRect(550, 280, 71, 26)) + self.defaultPushButton.setObjectName(_fromUtf8("defaultPushButton")) + + self.retranslateUi(displayTagDialog) + QtCore.QMetaObject.connectSlotsByName(displayTagDialog) + + def retranslateUi(self, displayTagDialog): + displayTagDialog.setWindowTitle(translate('OpenLP.displayTagForm', + 'Configure Display Tags')) + self.editGroupBox.setTitle( + translate('OpenLP.DisplayTagTab', 'Edit Selection')) + self.updatePushButton.setText( + translate('OpenLP.DisplayTagTab', 'Update')) + self.descriptionLabel.setText( + translate('OpenLP.DisplayTagTab', 'Description')) + self.tagLabel.setText(translate('OpenLP.DisplayTagTab', 'Tag')) + self.startTagLabel.setText( + translate('OpenLP.DisplayTagTab', 'Start tag')) + self.endTagLabel.setText(translate('OpenLP.DisplayTagTab', 'End tag')) + self.deletePushButton.setText(UiStrings.Delete) + self.defaultPushButton.setText( + translate('OpenLP.DisplayTagTab', 'Default')) + self.newPushButton.setText(UiStrings.New) + self.tagTableWidget.horizontalHeaderItem(0)\ + .setText(translate('OpenLP.DisplayTagTab', 'Description')) + self.tagTableWidget.horizontalHeaderItem(1)\ + .setText(translate('OpenLP.DisplayTagTab', 'Tag id')) + self.tagTableWidget.horizontalHeaderItem(2)\ + .setText(translate('OpenLP.DisplayTagTab', 'Start Html')) + self.tagTableWidget.horizontalHeaderItem(3)\ + .setText(translate('OpenLP.DisplayTagTab', 'End Html')) + self.tagTableWidget.setColumnWidth(0, 120) + self.tagTableWidget.setColumnWidth(1, 40) + self.tagTableWidget.setColumnWidth(2, 240) + self.tagTableWidget.setColumnWidth(3, 200) + + displayTagDialog.setWindowTitle(QtGui.QApplication.translate("displayTagDialog", "Form", None, QtGui.QApplication.UnicodeUTF8)) + self.editGroupBox.setTitle(QtGui.QApplication.translate("displayTagDialog", "Edit Selection", None, QtGui.QApplication.UnicodeUTF8)) + self.updatePushButton.setText(QtGui.QApplication.translate("displayTagDialog", "Update", None, QtGui.QApplication.UnicodeUTF8)) + self.descriptionLabel.setText(QtGui.QApplication.translate("displayTagDialog", "Description", None, QtGui.QApplication.UnicodeUTF8)) + self.tagLabel.setText(QtGui.QApplication.translate("displayTagDialog", "Tag", None, QtGui.QApplication.UnicodeUTF8)) + self.startTagLabel.setText(QtGui.QApplication.translate("displayTagDialog", "Start tag", None, QtGui.QApplication.UnicodeUTF8)) + self.endTagLabel.setText(QtGui.QApplication.translate("displayTagDialog", "End tag", None, QtGui.QApplication.UnicodeUTF8)) + self.addPushButton.setText(QtGui.QApplication.translate("displayTagDialog", "Add", None, QtGui.QApplication.UnicodeUTF8)) + self.newPushButton.setText(QtGui.QApplication.translate("displayTagDialog", "New", None, QtGui.QApplication.UnicodeUTF8)) + self.deletePushButton.setText(QtGui.QApplication.translate("displayTagDialog", "Delete", None, QtGui.QApplication.UnicodeUTF8)) + self.tagTableWidget.horizontalHeaderItem(0).setText(QtGui.QApplication.translate("displayTagDialog", "Description", None, QtGui.QApplication.UnicodeUTF8)) + self.tagTableWidget.horizontalHeaderItem(1).setText(QtGui.QApplication.translate("displayTagDialog", "Key", None, QtGui.QApplication.UnicodeUTF8)) + self.tagTableWidget.horizontalHeaderItem(2).setText(QtGui.QApplication.translate("displayTagDialog", "Start Tag", None, QtGui.QApplication.UnicodeUTF8)) + self.tagTableWidget.horizontalHeaderItem(3).setText(QtGui.QApplication.translate("displayTagDialog", "End Tag", None, QtGui.QApplication.UnicodeUTF8)) + self.defaultPushButton.setText(QtGui.QApplication.translate("displayTagDialog", "Default", None, QtGui.QApplication.UnicodeUTF8)) + - def retranslateUi(self, settingsDialog): - settingsDialog.setWindowTitle(translate('OpenLP.SettingsForm', - 'Configure OpenLP')) diff --git a/openlp/core/ui/displaytagform.py b/openlp/core/ui/displaytagform.py index 5216fcd61..491c60693 100644 --- a/openlp/core/ui/displaytagform.py +++ b/openlp/core/ui/displaytagform.py @@ -41,18 +41,26 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): """ The :class:`DisplayTagTab` manages the settings tab . """ - def __init__(self): + def __init__(self, parent): """ - Initialise the settings tab + Constructor """ - #SettingsTab.__init__(self, u'Display Tags') + QtGui.QDialog.__init__(self, parent) + self.setupUi(self) + QtCore.QObject.connect(self.tagTableWidget, + QtCore.SIGNAL(u'clicked(QModelIndex)'), self.onRowSelected) + QtCore.QObject.connect(self.defaultPushButton, + QtCore.SIGNAL(u'pressed()'), self.onDefaultPushed) + QtCore.QObject.connect(self.newPushButton, + QtCore.SIGNAL(u'pressed()'), self.onNewPushed) + QtCore.QObject.connect(self.updatePushButton, + QtCore.SIGNAL(u'pressed()'), self.onUpdatePushed) + QtCore.QObject.connect(self.deletePushButton, + QtCore.SIGNAL(u'pressed()'), self.onDeletePushed) - def resizeEvent(self, event=None): - pass - - def preLoad(self): + def exec_(self): """ - Initialise values before the Load takes place + Load Display and set field state. """ # Create initial copy from master DisplayTags.reset_html_tags() @@ -66,137 +74,10 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): for t in user_tags: DisplayTags.add_html_tag(t) self.selected = -1 - - def setupUi(self): - """ - Configure the UI elements for the tab. - """ - self.setObjectName(u'DisplayTagTab') - self.tabTitleVisible = \ - translate(u'OpenLP.DisplayTagTab', 'Display Tags') - self.displayTagEdit = QtGui.QWidget(self) - self.editGroupBox = QtGui.QGroupBox(self.displayTagEdit) - self.editGroupBox.setGeometry(QtCore.QRect(10, 220, 650, 181)) - self.editGroupBox.setObjectName(u'editGroupBox') - self.updatePushButton = QtGui.QPushButton(self.editGroupBox) - self.updatePushButton.setGeometry(QtCore.QRect(550, 140, 71, 26)) - self.updatePushButton.setObjectName(u'updatePushButton') - self.layoutWidget = QtGui.QWidget(self.editGroupBox) - self.layoutWidget.setGeometry(QtCore.QRect(5, 20, 571, 114)) - self.layoutWidget.setObjectName(u'layoutWidget') - self.formLayout = QtGui.QFormLayout(self.layoutWidget) - self.formLayout.setObjectName(u'formLayout') - self.descriptionLabel = QtGui.QLabel(self.layoutWidget) - self.descriptionLabel.setAlignment(QtCore.Qt.AlignCenter) - self.descriptionLabel.setObjectName(u'descriptionLabel') - self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, - self.descriptionLabel) - self.descriptionLineEdit = QtGui.QLineEdit(self.layoutWidget) - self.descriptionLineEdit.setObjectName(u'descriptionLineEdit') - self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, - self.descriptionLineEdit) - self.tagLabel = QtGui.QLabel(self.layoutWidget) - self.tagLabel.setAlignment(QtCore.Qt.AlignCenter) - self.tagLabel.setObjectName(u'tagLabel') - self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.tagLabel) - self.tagLineEdit = QtGui.QLineEdit(self.layoutWidget) - self.tagLineEdit.setMaximumSize(QtCore.QSize(50, 16777215)) - self.tagLineEdit.setMaxLength(5) - self.tagLineEdit.setObjectName(u'tagLineEdit') - self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, - self.tagLineEdit) - self.startTagLabel = QtGui.QLabel(self.layoutWidget) - self.startTagLabel.setAlignment(QtCore.Qt.AlignCenter) - self.startTagLabel.setObjectName(u'startTagLabel') - self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, - self.startTagLabel) - self.startTagLineEdit = QtGui.QLineEdit(self.layoutWidget) - self.startTagLineEdit.setObjectName(u'startTagLineEdit') - self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, - self.startTagLineEdit) - self.endTagLabel = QtGui.QLabel(self.layoutWidget) - self.endTagLabel.setAlignment(QtCore.Qt.AlignCenter) - self.endTagLabel.setObjectName(u'endTagLabel') - self.formLayout.setWidget(3, QtGui.QFormLayout.LabelRole, - self.endTagLabel) - self.endTagLineEdit = QtGui.QLineEdit(self.layoutWidget) - self.endTagLineEdit.setObjectName(u'endTagLineEdit') - self.formLayout.setWidget(3, QtGui.QFormLayout.FieldRole, - self.endTagLineEdit) - self.defaultPushButton = QtGui.QPushButton(self.displayTagEdit) - self.defaultPushButton.setGeometry(QtCore.QRect(430, 188, 71, 26)) - self.defaultPushButton.setObjectName(u'updatePushButton') - self.deletePushButton = QtGui.QPushButton(self.displayTagEdit) - self.deletePushButton.setGeometry(QtCore.QRect(510, 188, 71, 26)) - self.deletePushButton.setObjectName(u'deletePushButton') - self.newPushButton = QtGui.QPushButton(self.displayTagEdit) - self.newPushButton.setGeometry(QtCore.QRect(600, 188, 71, 26)) - self.newPushButton.setObjectName(u'newPushButton') - self.tagTableWidget = QtGui.QTableWidget(self.displayTagEdit) - self.tagTableWidget.setGeometry(QtCore.QRect(10, 10, 650, 171)) - self.tagTableWidget.setHorizontalScrollBarPolicy( - QtCore.Qt.ScrollBarAlwaysOff) - self.tagTableWidget.setEditTriggers( - QtGui.QAbstractItemView.NoEditTriggers) - self.tagTableWidget.setAlternatingRowColors(True) - self.tagTableWidget.setSelectionMode( - QtGui.QAbstractItemView.SingleSelection) - self.tagTableWidget.setSelectionBehavior( - QtGui.QAbstractItemView.SelectRows) - self.tagTableWidget.setCornerButtonEnabled(False) - self.tagTableWidget.setObjectName(u'tagTableWidget') - self.tagTableWidget.setColumnCount(4) - self.tagTableWidget.setRowCount(0) - item = QtGui.QTableWidgetItem() - self.tagTableWidget.setHorizontalHeaderItem(0, item) - item = QtGui.QTableWidgetItem() - self.tagTableWidget.setHorizontalHeaderItem(1, item) - item = QtGui.QTableWidgetItem() - self.tagTableWidget.setHorizontalHeaderItem(2, item) - item = QtGui.QTableWidgetItem() - self.tagTableWidget.setHorizontalHeaderItem(3, item) - self.editGroupBox.setTitle( - translate('OpenLP.DisplayTagTab', 'Edit Selection')) - self.updatePushButton.setText( - translate('OpenLP.DisplayTagTab', 'Update')) - self.descriptionLabel.setText( - translate('OpenLP.DisplayTagTab', 'Description')) - self.tagLabel.setText(translate('OpenLP.DisplayTagTab', 'Tag')) - self.startTagLabel.setText( - translate('OpenLP.DisplayTagTab', 'Start tag')) - self.endTagLabel.setText(translate('OpenLP.DisplayTagTab', 'End tag')) - self.deletePushButton.setText(UiStrings.Delete) - self.defaultPushButton.setText( - translate('OpenLP.DisplayTagTab', 'Default')) - self.newPushButton.setText(UiStrings.New) - self.tagTableWidget.horizontalHeaderItem(0)\ - .setText(translate('OpenLP.DisplayTagTab', 'Description')) - self.tagTableWidget.horizontalHeaderItem(1)\ - .setText(translate('OpenLP.DisplayTagTab', 'Tag id')) - self.tagTableWidget.horizontalHeaderItem(2)\ - .setText(translate('OpenLP.DisplayTagTab', 'Start Html')) - self.tagTableWidget.horizontalHeaderItem(3)\ - .setText(translate('OpenLP.DisplayTagTab', 'End Html')) - QtCore.QMetaObject.connectSlotsByName(self.displayTagEdit) - self.tagTableWidget.setColumnWidth(0, 120) - self.tagTableWidget.setColumnWidth(1, 40) - self.tagTableWidget.setColumnWidth(2, 240) - self.tagTableWidget.setColumnWidth(3, 200) - QtCore.QObject.connect(self.tagTableWidget, - QtCore.SIGNAL(u'clicked(QModelIndex)'), self.onRowSelected) - QtCore.QObject.connect(self.defaultPushButton, - QtCore.SIGNAL(u'pressed()'), self.onDefaultPushed) - QtCore.QObject.connect(self.newPushButton, - QtCore.SIGNAL(u'pressed()'), self.onNewPushed) - QtCore.QObject.connect(self.updatePushButton, - QtCore.SIGNAL(u'pressed()'), self.onUpdatePushed) - QtCore.QObject.connect(self.deletePushButton, - QtCore.SIGNAL(u'pressed()'), self.onDeletePushed) + self.load() + return QtGui.QDialog.exec_(self) def load(self): - """ - Load Display and set field state. - """ self.newPushButton.setEnabled(True) self.updatePushButton.setEnabled(False) self.deletePushButton.setEnabled(False) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 82d95dd40..f899a23ce 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -481,7 +481,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): self.settingsmanager = SettingsManager(screens) self.aboutForm = AboutForm(self, applicationVersion) self.settingsForm = SettingsForm(self.screens, self, self) - self.displayTagForm = DisplayTagForm() + self.displayTagForm = DisplayTagForm(self) self.shortcutForm = ShortcutListForm(self) self.recentFiles = QtCore.QStringList() # Set up the path with plugins diff --git a/resources/forms/displaytabeditdialog.ui b/resources/forms/displaytabdialog.ui similarity index 86% rename from resources/forms/displaytabeditdialog.ui rename to resources/forms/displaytabdialog.ui index 3c748594f..2e9c09c01 100644 --- a/resources/forms/displaytabeditdialog.ui +++ b/resources/forms/displaytabdialog.ui @@ -112,6 +112,32 @@ + + + + 600 + 40 + 71 + 26 + + + + Add + + + + + + 600 + 70 + 71 + 26 + + + + New + + @@ -123,13 +149,13 @@ - QDialogButtonBox::Cancel|QDialogButtonBox::Ok + QDialogButtonBox::Cancel|QDialogButtonBox::Save - 530 + 630 280 71 26 @@ -139,19 +165,6 @@ Delete - - - - 610 - 280 - 71 - 26 - - - - Add - - @@ -203,6 +216,19 @@ + + + + 550 + 280 + 71 + 26 + + + + Default + + From 54f42cb52b88615379b08ae228fdbbf873f0df12 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sun, 20 Feb 2011 18:34:57 +0100 Subject: [PATCH 190/243] added new property, replaced try --- openlp/plugins/songs/lib/songbeamerimport.py | 2 + openlp/plugins/songs/lib/xml.py | 41 +++++++------------- 2 files changed, 15 insertions(+), 28 deletions(-) diff --git a/openlp/plugins/songs/lib/songbeamerimport.py b/openlp/plugins/songs/lib/songbeamerimport.py index 2adfb30b2..afb9f5646 100644 --- a/openlp/plugins/songs/lib/songbeamerimport.py +++ b/openlp/plugins/songs/lib/songbeamerimport.py @@ -245,6 +245,8 @@ class SongBeamerImport(SongImport): self.song_number = u'' elif tag_val[0] == u'#Speed': pass + elif tag_val[0] == u'Tempo': + pass elif tag_val[0] == u'#TextAlign': pass elif tag_val[0] == u'#Title': diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index 231080831..a552a42a1 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -299,9 +299,9 @@ class OpenLyrics(object): # Remove chords from xml. xml = re.compile(u'').sub(u'', xml) song_xml = objectify.fromstring(xml) - try: + if hasattr(song_xml, u'properties'): properties = song_xml.properties - except AttributeError: + else: return None song = Song() self._process_copyright(properties, song) @@ -369,13 +369,11 @@ class OpenLyrics(object): The song object. """ authors = [] - try: + if hasattr(properties, u'authors'): for author in properties.authors.author: display_name = self._text(author) if display_name: authors.append(display_name) - except AttributeError: - pass if not authors: authors.append(SongStrings.AuthorUnknownUnT) for display_name in authors: @@ -399,10 +397,8 @@ class OpenLyrics(object): ``song`` The song object. """ - try: + if hasattr(properties, u'ccliNo'): song.ccli_number = self._text(properties.ccliNo) - except AttributeError: - song.ccli_number = u'' def _process_comments(self, properties, song): """ @@ -414,15 +410,13 @@ class OpenLyrics(object): ``song`` The song object. """ - try: - comments_list = [] + if hasattr(properties, u'comments'): + comments_list = [] for comment in properties.comments.comment: commenttext = self._text(comment) if commenttext: comments_list.append(commenttext) song.comments = u'\n'.join(comments_list) - except AttributeError: - song.comments = u'' def _process_copyright(self, properties, song): """ @@ -434,10 +428,8 @@ class OpenLyrics(object): ``song`` The song object. """ - try: + if hasattr(properties, u'copyright'): song.copyright = self._text(properties.copyright) - except AttributeError: - song.copyright = u'' def _process_lyrics(self, properties, lyrics, song): """ @@ -478,9 +470,9 @@ class OpenLyrics(object): song.search_lyrics = search_text.lower() song.lyrics = unicode(sxml.extract_xml(), u'utf-8') # Process verse order - try: + if hasattr(properties, u'verseOrder'): song.verse_order = self._text(properties.verseOrder) - except AttributeError: + else: # We have to process the temp_verse_order, as the verseOrder # property is not present. previous_type = u'' @@ -511,7 +503,7 @@ class OpenLyrics(object): """ song.song_book_id = 0 song.song_number = u'' - try: + if hasattr(properties, u'songbooks'): for songbook in properties.songbooks.songbook: bookname = self._get(songbook, u'name') if bookname: @@ -522,15 +514,10 @@ class OpenLyrics(object): book = Book.populate(name=bookname, publisher=u'') self.manager.save_object(book) song.song_book_id = book.id - try: - if self._get(songbook, u'entry'): - song.song_number = self._get(songbook, u'entry') - except AttributeError: - pass + if hasattr(songbook, u'entry'): + song.song_number = self._get(songbook, u'entry') # We only support one song book, so take the first one. break - except AttributeError: - pass def _process_titles(self, properties, song): """ @@ -563,7 +550,7 @@ class OpenLyrics(object): ``song`` The song object. """ - try: + if hasattr(properties, u'themes'): for topictext in properties.themes.theme: topictext = self._text(topictext) if topictext: @@ -574,8 +561,6 @@ class OpenLyrics(object): topic = Topic.populate(name=topictext) self.manager.save_object(topic) song.topics.append(topic) - except AttributeError: - pass def _dump_xml(self, xml): """ From 72dd290d6b5d1f34ce50890b62be5de4bf866f9c Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sun, 20 Feb 2011 18:52:22 +0100 Subject: [PATCH 191/243] fixed enumeration --- openlp/plugins/songs/lib/mediaitem.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 0f3e97926..1df63d0b5 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -254,9 +254,9 @@ class SongMediaItem(MediaManagerItem): """ if self.searchAsYouType: search_length = 1 - if self.searchTextEdit.currentSearchType() == 1: + if self.searchTextEdit.currentSearchType() == SongSearch.Entire: search_length = 3 - elif self.searchTextEdit.currentSearchType() == 3: + elif self.searchTextEdit.currentSearchType() == SongSearch.Lyrics: search_length = 7 if len(text) > search_length: self.onSearchTextButtonClick() From 31247240d022933990f43b738477b23481a6d292 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Sun, 20 Feb 2011 20:12:55 +0200 Subject: [PATCH 192/243] fix possible leaving out of extensions, hopefully neater approach --- openlp/plugins/media/lib/mediaitem.py | 5 ++-- openlp/plugins/media/mediaplugin.py | 43 ++++++++++----------------- 2 files changed, 19 insertions(+), 29 deletions(-) diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index fd98cdefa..9f3f98636 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -60,8 +60,9 @@ class MediaMediaItem(MediaManagerItem): def retranslateUi(self): self.onNewPrompt = translate('MediaPlugin.MediaItem', 'Select Media') self.onNewFileMasks = unicode(translate('MediaPlugin.MediaItem', - 'Videos (%s);;Audio (%s);;%s (*)')) % (self.parent.video_list, - self.parent.audio_list, UiStrings.AllFiles) + 'Videos (%s);;Audio (%s);;%s (*)')) % ( + u' '.join(self.parent.video_list), + u' '.join(self.parent.audio_list), UiStrings.AllFiles) self.replaceAction.setText(UiStrings.ReplaceBG) self.replaceAction.setToolTip(UiStrings.ReplaceLiveBG) self.resetAction.setText(UiStrings.ResetBG) diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index 274bce2b4..1f6284d61 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -45,38 +45,27 @@ class MediaPlugin(Plugin): self.icon = build_icon(self.icon_path) # passed with drag and drop messages self.dnd_id = u'Media' - self.audio_list = u'' - self.video_list = u'' + self.audio_list = [] + self.video_list = [] mimetypes.init() for mimetype in Phonon.BackendCapabilities.availableMimeTypes(): mimetype = unicode(mimetype) - type = mimetype.split(u'audio/x-') - self.audio_list, mimetype = self._addToList(self.audio_list, - type, mimetype) - type = mimetype.split(u'audio/') - self.audio_list, mimetype = self._addToList(self.audio_list, - type, mimetype) - type = mimetype.split(u'video/x-') - self.video_list, mimetype = self._addToList(self.video_list, - type, mimetype) - type = mimetype.split(u'video/') - self.video_list, mimetype = self._addToList(self.video_list, - type, mimetype) - log.info(u'MediaPlugin handles audio extensions: %s', self.audio_list) - log.info(u'MediaPlugin handles video extensions: %s', self.video_list) + if mimetype.startswith(u'audio/'): + self._addToList(self.audio_list, mimetype) + elif mimetype.startswith(u'video/'): + self._addToList(self.video_list, mimetype) + log.info(u'MediaPlugin handles audio extensions: %s', + u' '.join(self.audio_list)) + log.info(u'MediaPlugin handles video extensions: %s', + u' '.join(self.video_list)) - def _addToList(self, list, value, mimetype): + def _addToList(self, list, mimetype): # Is it a media type - if len(value) == 2: - extensions = mimetypes.guess_all_extensions(unicode(mimetype)) - # we have an extension - if extensions: - for extension in extensions: - if list.find(extension) == -1: - list += u'*%s ' % extension - self.serviceManager.supportedSuffixes(extension[1:]) - mimetype = u'' - return list, mimetype + extensions = mimetypes.guess_all_extensions(unicode(mimetype)) + for extension in extensions: + if extension not in list: + list.append(u'*%s' % extension) + self.serviceManager.supportedSuffixes(extension[1:]) def about(self): about_text = translate('MediaPlugin', 'Media Plugin' From 09b515350ba641b51189c527b9fe48f983ed60f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Sun, 20 Feb 2011 20:49:59 +0200 Subject: [PATCH 193/243] oops --- openlp/plugins/media/mediaplugin.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index 1f6284d61..12887a76c 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -63,8 +63,9 @@ class MediaPlugin(Plugin): # Is it a media type extensions = mimetypes.guess_all_extensions(unicode(mimetype)) for extension in extensions: - if extension not in list: - list.append(u'*%s' % extension) + ext = u'*%s' % extension + if ext not in list: + list.append(ext) self.serviceManager.supportedSuffixes(extension[1:]) def about(self): From 7e4b644f781612d9c21fcfdbc514ac3aab11deef Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 20 Feb 2011 20:23:33 +0000 Subject: [PATCH 194/243] Finished moving Display Tags --- openlp/core/ui/displaytagdialog.py | 265 ++++++------------- openlp/core/ui/displaytagform.py | 10 +- openlp/core/ui/mainwindow.py | 2 +- resources/forms/displaytabdialog.ui | 393 +++++++++++++--------------- resources/images/openlp-2.qrc | 1 + 5 files changed, 269 insertions(+), 402 deletions(-) diff --git a/openlp/core/ui/displaytagdialog.py b/openlp/core/ui/displaytagdialog.py index 3e76b39d2..5da529302 100644 --- a/openlp/core/ui/displaytagdialog.py +++ b/openlp/core/ui/displaytagdialog.py @@ -29,171 +29,29 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate, build_icon from openlp.core.lib.ui import UiStrings, create_accept_reject_button_box -try: - _fromUtf8 = QtCore.QString.fromUtf8 -except AttributeError: - _fromUtf8 = lambda s: s - class Ui_DisplayTagDialog(object): def setupUi(self, displayTagDialog): -# displayTagDialog.setObjectName(u'displayTagDialog') -# displayTagDialog.resize(700, 500) -# displayTagDialog.setWindowIcon( -# build_icon(u':/system/system_settings.png')) -# self.settingsLayout = QtGui.QVBoxLayout(displayTagDialog) -# self.settingsLayout.setObjectName(u'settingsLayout') -# self.editGroupBox = QtGui.QGroupBox(displayTagDialog) -# self.editGroupBox.setGeometry(QtCore.QRect(10, 220, 650, 181)) -# self.editGroupBox.setObjectName(u'editGroupBox') -# self.updatePushButton = QtGui.QPushButton(self.editGroupBox) -# self.updatePushButton.setGeometry(QtCore.QRect(550, 140, 71, 26)) -# self.updatePushButton.setObjectName(u'updatePushButton') -# self.layoutWidget = QtGui.QWidget(self.editGroupBox) -# self.layoutWidget.setGeometry(QtCore.QRect(5, 20, 571, 114)) -# self.layoutWidget.setObjectName(u'layoutWidget') -# self.formLayout = QtGui.QFormLayout(self.layoutWidget) -# self.formLayout.setObjectName(u'formLayout') -# self.descriptionLabel = QtGui.QLabel(self.layoutWidget) -# self.descriptionLabel.setAlignment(QtCore.Qt.AlignCenter) -# self.descriptionLabel.setObjectName(u'descriptionLabel') -# self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, -# self.descriptionLabel) -# self.descriptionLineEdit = QtGui.QLineEdit(self.layoutWidget) -# self.descriptionLineEdit.setObjectName(u'descriptionLineEdit') -# self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, -# self.descriptionLineEdit) -# self.tagLabel = QtGui.QLabel(self.layoutWidget) -# self.tagLabel.setAlignment(QtCore.Qt.AlignCenter) -# self.tagLabel.setObjectName(u'tagLabel') -# self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.tagLabel) -# self.tagLineEdit = QtGui.QLineEdit(self.layoutWidget) -# self.tagLineEdit.setMaximumSize(QtCore.QSize(50, 16777215)) -# self.tagLineEdit.setMaxLength(5) -# self.tagLineEdit.setObjectName(u'tagLineEdit') -# self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, -# self.tagLineEdit) -# self.startTagLabel = QtGui.QLabel(self.layoutWidget) -# self.startTagLabel.setAlignment(QtCore.Qt.AlignCenter) -# self.startTagLabel.setObjectName(u'startTagLabel') -# self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, -# self.startTagLabel) -# self.startTagLineEdit = QtGui.QLineEdit(self.layoutWidget) -# self.startTagLineEdit.setObjectName(u'startTagLineEdit') -# self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, -# self.startTagLineEdit) -# self.endTagLabel = QtGui.QLabel(self.layoutWidget) -# self.endTagLabel.setAlignment(QtCore.Qt.AlignCenter) -# self.endTagLabel.setObjectName(u'endTagLabel') -# self.formLayout.setWidget(3, QtGui.QFormLayout.LabelRole, -# self.endTagLabel) -# self.endTagLineEdit = QtGui.QLineEdit(self.layoutWidget) -# self.endTagLineEdit.setObjectName(u'endTagLineEdit') -# self.formLayout.setWidget(3, QtGui.QFormLayout.FieldRole, -# self.endTagLineEdit) -# self.defaultPushButton = QtGui.QPushButton(displayTagDialog) -# self.defaultPushButton.setGeometry(QtCore.QRect(430, 188, 71, 26)) -# self.defaultPushButton.setObjectName(u'updatePushButton') -# self.deletePushButton = QtGui.QPushButton(displayTagDialog) -# self.deletePushButton.setGeometry(QtCore.QRect(510, 188, 71, 26)) -# self.deletePushButton.setObjectName(u'deletePushButton') -# self.newPushButton = QtGui.QPushButton(displayTagDialog) -# self.newPushButton.setGeometry(QtCore.QRect(600, 188, 71, 26)) -# self.newPushButton.setObjectName(u'newPushButton') -# self.tagTableWidget = QtGui.QTableWidget(displayTagDialog) -# self.tagTableWidget.setGeometry(QtCore.QRect(10, 10, 650, 171)) -# self.tagTableWidget.setHorizontalScrollBarPolicy( -# QtCore.Qt.ScrollBarAlwaysOff) -# self.tagTableWidget.setEditTriggers( -# QtGui.QAbstractItemView.NoEditTriggers) -# self.tagTableWidget.setAlternatingRowColors(True) -# self.tagTableWidget.setSelectionMode( -# QtGui.QAbstractItemView.SingleSelection) -# self.tagTableWidget.setSelectionBehavior( -# QtGui.QAbstractItemView.SelectRows) -# self.tagTableWidget.setCornerButtonEnabled(False) -# self.tagTableWidget.setObjectName(u'tagTableWidget') -# self.tagTableWidget.setColumnCount(4) -# self.tagTableWidget.setRowCount(0) -# item = QtGui.QTableWidgetItem() -# self.tagTableWidget.setHorizontalHeaderItem(0, item) -# item = QtGui.QTableWidgetItem() -# self.tagTableWidget.setHorizontalHeaderItem(1, item) -# item = QtGui.QTableWidgetItem() -# self.tagTableWidget.setHorizontalHeaderItem(2, item) -# item = QtGui.QTableWidgetItem() -# self.tagTableWidget.setHorizontalHeaderItem(3, item) -# -# self.buttonBox = create_accept_reject_button_box(displayTagDialog, True) -# self.settingsLayout.addWidget(self.buttonBox) -# self.retranslateUi(displayTagDialog) -# QtCore.QMetaObject.connectSlotsByName(displayTagDialog) - displayTagDialog.setObjectName(_fromUtf8("displayTagDialog")) - displayTagDialog.resize(717, 554) - self.editGroupBox = QtGui.QGroupBox(displayTagDialog) - self.editGroupBox.setGeometry(QtCore.QRect(10, 320, 691, 181)) - self.editGroupBox.setObjectName(_fromUtf8("editGroupBox")) - self.updatePushButton = QtGui.QPushButton(self.editGroupBox) - self.updatePushButton.setGeometry(QtCore.QRect(600, 140, 73, 26)) - self.updatePushButton.setObjectName(_fromUtf8("updatePushButton")) - self.layoutWidget = QtGui.QWidget(self.editGroupBox) - self.layoutWidget.setGeometry(QtCore.QRect(20, 50, 571, 114)) - self.layoutWidget.setObjectName(_fromUtf8("layoutWidget")) - self.formLayout = QtGui.QFormLayout(self.layoutWidget) - self.formLayout.setMargin(0) - self.formLayout.setObjectName(_fromUtf8("formLayout")) - self.descriptionLabel = QtGui.QLabel(self.layoutWidget) - self.descriptionLabel.setAlignment(QtCore.Qt.AlignCenter) - self.descriptionLabel.setObjectName(_fromUtf8("descriptionLabel")) - self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.descriptionLabel) - self.descriptionLineEdit = QtGui.QLineEdit(self.layoutWidget) - self.descriptionLineEdit.setObjectName(_fromUtf8("descriptionLineEdit")) - self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.descriptionLineEdit) - self.tagLabel = QtGui.QLabel(self.layoutWidget) - self.tagLabel.setAlignment(QtCore.Qt.AlignCenter) - self.tagLabel.setObjectName(_fromUtf8("tagLabel")) - self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.tagLabel) - self.tagLineEdit = QtGui.QLineEdit(self.layoutWidget) - self.tagLineEdit.setMaximumSize(QtCore.QSize(50, 16777215)) - self.tagLineEdit.setMaxLength(5) - self.tagLineEdit.setObjectName(_fromUtf8("tagLineEdit")) - self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.tagLineEdit) - self.startTagLabel = QtGui.QLabel(self.layoutWidget) - self.startTagLabel.setAlignment(QtCore.Qt.AlignCenter) - self.startTagLabel.setObjectName(_fromUtf8("startTagLabel")) - self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.startTagLabel) - self.startTagLineEdit = QtGui.QLineEdit(self.layoutWidget) - self.startTagLineEdit.setObjectName(_fromUtf8("startTagLineEdit")) - self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.startTagLineEdit) - self.endTagLabel = QtGui.QLabel(self.layoutWidget) - self.endTagLabel.setAlignment(QtCore.Qt.AlignCenter) - self.endTagLabel.setObjectName(_fromUtf8("endTagLabel")) - self.formLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.endTagLabel) - self.endTagLineEdit = QtGui.QLineEdit(self.layoutWidget) - self.endTagLineEdit.setObjectName(_fromUtf8("endTagLineEdit")) - self.formLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.endTagLineEdit) - self.addPushButton = QtGui.QPushButton(self.editGroupBox) - self.addPushButton.setGeometry(QtCore.QRect(600, 40, 71, 26)) - self.addPushButton.setObjectName(_fromUtf8("addPushButton")) - self.newPushButton = QtGui.QPushButton(self.editGroupBox) - self.newPushButton.setGeometry(QtCore.QRect(600, 70, 71, 26)) - self.newPushButton.setObjectName(_fromUtf8("newPushButton")) - self.buttonBox = QtGui.QDialogButtonBox(displayTagDialog) - self.buttonBox.setGeometry(QtCore.QRect(540, 510, 162, 26)) - self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Save) - self.buttonBox.setObjectName(_fromUtf8("buttonBox")) - self.deletePushButton = QtGui.QPushButton(displayTagDialog) - self.deletePushButton.setGeometry(QtCore.QRect(630, 280, 71, 26)) - self.deletePushButton.setObjectName(_fromUtf8("deletePushButton")) - self.tagTableWidget = QtGui.QTableWidget(displayTagDialog) - self.tagTableWidget.setGeometry(QtCore.QRect(10, 10, 691, 271)) - self.tagTableWidget.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) - self.tagTableWidget.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers) + displayTagDialog.setObjectName(u'displayTagDialog') + displayTagDialog.resize(725, 548) + self.widget = QtGui.QWidget(displayTagDialog) + self.widget.setGeometry(QtCore.QRect(10, 10, 701, 521)) + self.widget.setObjectName(u'widget') + self.listdataGridLayout = QtGui.QGridLayout(self.widget) + self.listdataGridLayout.setMargin(0) + self.listdataGridLayout.setObjectName(u'listdataGridLayout') + self.tagTableWidget = QtGui.QTableWidget(self.widget) + self.tagTableWidget.setHorizontalScrollBarPolicy( + QtCore.Qt.ScrollBarAlwaysOff) + self.tagTableWidget.setEditTriggers( + QtGui.QAbstractItemView.NoEditTriggers) self.tagTableWidget.setAlternatingRowColors(True) - self.tagTableWidget.setSelectionMode(QtGui.QAbstractItemView.SingleSelection) - self.tagTableWidget.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) + self.tagTableWidget.setSelectionMode( + QtGui.QAbstractItemView.SingleSelection) + self.tagTableWidget.setSelectionBehavior( + QtGui.QAbstractItemView.SelectRows) self.tagTableWidget.setCornerButtonEnabled(False) - self.tagTableWidget.setObjectName(_fromUtf8("tagTableWidget")) + self.tagTableWidget.setObjectName(u'tagTableWidget') self.tagTableWidget.setColumnCount(4) self.tagTableWidget.setRowCount(0) item = QtGui.QTableWidgetItem() @@ -204,9 +62,62 @@ class Ui_DisplayTagDialog(object): self.tagTableWidget.setHorizontalHeaderItem(2, item) item = QtGui.QTableWidgetItem() self.tagTableWidget.setHorizontalHeaderItem(3, item) - self.defaultPushButton = QtGui.QPushButton(displayTagDialog) - self.defaultPushButton.setGeometry(QtCore.QRect(550, 280, 71, 26)) - self.defaultPushButton.setObjectName(_fromUtf8("defaultPushButton")) + self.listdataGridLayout.addWidget(self.tagTableWidget, 0, 0, 1, 1) + self.horizontalLayout = QtGui.QHBoxLayout() + self.horizontalLayout.setObjectName(u'horizontalLayout') + spacerItem = QtGui.QSpacerItem(40, 20, + QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.horizontalLayout.addItem(spacerItem) + self.defaultPushButton = QtGui.QPushButton(self.widget) + self.defaultPushButton.setObjectName(u'defaultPushButton') + self.horizontalLayout.addWidget(self.defaultPushButton) + self.deletePushButton = QtGui.QPushButton(self.widget) + self.deletePushButton.setObjectName(u'deletePushButton') + self.horizontalLayout.addWidget(self.deletePushButton) + self.listdataGridLayout.addLayout(self.horizontalLayout, 1, 0, 1, 1) + self.editGroupBox = QtGui.QGroupBox(self.widget) + self.editGroupBox.setObjectName(u'editGroupBox') + self.dataGridLayout = QtGui.QGridLayout(self.editGroupBox) + self.dataGridLayout.setObjectName(u'dataGridLayout') + self.descriptionLabel = QtGui.QLabel(self.editGroupBox) + self.descriptionLabel.setAlignment(QtCore.Qt.AlignCenter) + self.descriptionLabel.setObjectName(u'descriptionLabel') + self.dataGridLayout.addWidget(self.descriptionLabel, 0, 0, 1, 1) + self.descriptionLineEdit = QtGui.QLineEdit(self.editGroupBox) + self.descriptionLineEdit.setObjectName(u'descriptionLineEdit') + self.dataGridLayout.addWidget(self.descriptionLineEdit, 0, 1, 2, 1) + self.newPushButton = QtGui.QPushButton(self.editGroupBox) + self.newPushButton.setObjectName(u'newPushButton') + self.dataGridLayout.addWidget(self.newPushButton, 0, 2, 2, 1) + self.tagLabel = QtGui.QLabel(self.editGroupBox) + self.tagLabel.setAlignment(QtCore.Qt.AlignCenter) + self.tagLabel.setObjectName(u'tagLabel') + self.dataGridLayout.addWidget(self.tagLabel, 2, 0, 1, 1) + self.tagLineEdit = QtGui.QLineEdit(self.editGroupBox) + self.tagLineEdit.setMaximumSize(QtCore.QSize(50, 16777215)) + self.tagLineEdit.setMaxLength(5) + self.tagLineEdit.setObjectName(u'tagLineEdit') + self.dataGridLayout.addWidget(self.tagLineEdit, 2, 1, 1, 1) + self.startTagLabel = QtGui.QLabel(self.editGroupBox) + self.startTagLabel.setAlignment(QtCore.Qt.AlignCenter) + self.startTagLabel.setObjectName(u'startTagLabel') + self.dataGridLayout.addWidget(self.startTagLabel, 3, 0, 1, 1) + self.startTagLineEdit = QtGui.QLineEdit(self.editGroupBox) + self.startTagLineEdit.setObjectName(u'startTagLineEdit') + self.dataGridLayout.addWidget(self.startTagLineEdit, 3, 1, 1, 1) + self.endTagLabel = QtGui.QLabel(self.editGroupBox) + self.endTagLabel.setAlignment(QtCore.Qt.AlignCenter) + self.endTagLabel.setObjectName(u'endTagLabel') + self.dataGridLayout.addWidget(self.endTagLabel, 4, 0, 1, 1) + self.endTagLineEdit = QtGui.QLineEdit(self.editGroupBox) + self.endTagLineEdit.setObjectName(u'endTagLineEdit') + self.dataGridLayout.addWidget(self.endTagLineEdit, 4, 1, 1, 1) + self.updatePushButton = QtGui.QPushButton(self.editGroupBox) + self.updatePushButton.setObjectName(u'updatePushButton') + self.dataGridLayout.addWidget(self.updatePushButton, 4, 2, 1, 1) + self.listdataGridLayout.addWidget(self.editGroupBox, 2, 0, 1, 1) + self.buttonBox = create_accept_reject_button_box(displayTagDialog) + self.listdataGridLayout.addWidget(self.buttonBox, 3, 0, 1, 1) self.retranslateUi(displayTagDialog) QtCore.QMetaObject.connectSlotsByName(displayTagDialog) @@ -228,33 +139,15 @@ class Ui_DisplayTagDialog(object): self.defaultPushButton.setText( translate('OpenLP.DisplayTagTab', 'Default')) self.newPushButton.setText(UiStrings.New) - self.tagTableWidget.horizontalHeaderItem(0)\ + self.tagTableWidget.horizontalHeaderItem(0) \ .setText(translate('OpenLP.DisplayTagTab', 'Description')) - self.tagTableWidget.horizontalHeaderItem(1)\ + self.tagTableWidget.horizontalHeaderItem(1) \ .setText(translate('OpenLP.DisplayTagTab', 'Tag id')) - self.tagTableWidget.horizontalHeaderItem(2)\ + self.tagTableWidget.horizontalHeaderItem(2) \ .setText(translate('OpenLP.DisplayTagTab', 'Start Html')) - self.tagTableWidget.horizontalHeaderItem(3)\ + self.tagTableWidget.horizontalHeaderItem(3) \ .setText(translate('OpenLP.DisplayTagTab', 'End Html')) self.tagTableWidget.setColumnWidth(0, 120) self.tagTableWidget.setColumnWidth(1, 40) self.tagTableWidget.setColumnWidth(2, 240) - self.tagTableWidget.setColumnWidth(3, 200) - - displayTagDialog.setWindowTitle(QtGui.QApplication.translate("displayTagDialog", "Form", None, QtGui.QApplication.UnicodeUTF8)) - self.editGroupBox.setTitle(QtGui.QApplication.translate("displayTagDialog", "Edit Selection", None, QtGui.QApplication.UnicodeUTF8)) - self.updatePushButton.setText(QtGui.QApplication.translate("displayTagDialog", "Update", None, QtGui.QApplication.UnicodeUTF8)) - self.descriptionLabel.setText(QtGui.QApplication.translate("displayTagDialog", "Description", None, QtGui.QApplication.UnicodeUTF8)) - self.tagLabel.setText(QtGui.QApplication.translate("displayTagDialog", "Tag", None, QtGui.QApplication.UnicodeUTF8)) - self.startTagLabel.setText(QtGui.QApplication.translate("displayTagDialog", "Start tag", None, QtGui.QApplication.UnicodeUTF8)) - self.endTagLabel.setText(QtGui.QApplication.translate("displayTagDialog", "End tag", None, QtGui.QApplication.UnicodeUTF8)) - self.addPushButton.setText(QtGui.QApplication.translate("displayTagDialog", "Add", None, QtGui.QApplication.UnicodeUTF8)) - self.newPushButton.setText(QtGui.QApplication.translate("displayTagDialog", "New", None, QtGui.QApplication.UnicodeUTF8)) - self.deletePushButton.setText(QtGui.QApplication.translate("displayTagDialog", "Delete", None, QtGui.QApplication.UnicodeUTF8)) - self.tagTableWidget.horizontalHeaderItem(0).setText(QtGui.QApplication.translate("displayTagDialog", "Description", None, QtGui.QApplication.UnicodeUTF8)) - self.tagTableWidget.horizontalHeaderItem(1).setText(QtGui.QApplication.translate("displayTagDialog", "Key", None, QtGui.QApplication.UnicodeUTF8)) - self.tagTableWidget.horizontalHeaderItem(2).setText(QtGui.QApplication.translate("displayTagDialog", "Start Tag", None, QtGui.QApplication.UnicodeUTF8)) - self.tagTableWidget.horizontalHeaderItem(3).setText(QtGui.QApplication.translate("displayTagDialog", "End Tag", None, QtGui.QApplication.UnicodeUTF8)) - self.defaultPushButton.setText(QtGui.QApplication.translate("displayTagDialog", "Default", None, QtGui.QApplication.UnicodeUTF8)) - - + self.tagTableWidget.setColumnWidth(3, 240) diff --git a/openlp/core/ui/displaytagform.py b/openlp/core/ui/displaytagform.py index 491c60693..48924759f 100644 --- a/openlp/core/ui/displaytagform.py +++ b/openlp/core/ui/displaytagform.py @@ -63,6 +63,7 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): Load Display and set field state. """ # Create initial copy from master + self._resetTable() DisplayTags.reset_html_tags() user_expands = QtCore.QSettings().value(u'displayTags/html_tags', QtCore.QVariant(u'')).toString() @@ -102,7 +103,7 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): self.startTagLineEdit.setEnabled(False) self.endTagLineEdit.setEnabled(False) - def save(self): + def accept(self): """ Save Custom tags in a pickle . """ @@ -117,13 +118,14 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): else: QtCore.QSettings().setValue(u'displayTags/html_tags', QtCore.QVariant(u'')) + return QtGui.QDialog.accept(self) - def cancel(self): + def reject(self): """ Reset Custom tags from Settings. """ - self.preLoad() self._resetTable() + return QtGui.QDialog.reject(self) def onRowSelected(self): """ @@ -170,6 +172,7 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): self._resetTable() # Highlight new row self.tagTableWidget.selectRow(self.tagTableWidget.rowCount() - 1) + self.onRowSelected() def onDefaultPushed(self): """ @@ -217,7 +220,6 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): """ self.tagTableWidget.clearContents() self.tagTableWidget.setRowCount(0) - self.load() def _strip(self, tag): """ diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index f899a23ce..9071016e8 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -243,7 +243,7 @@ class Ui_MainWindow(object): u'SettingsShortcutsItem', u':/system/system_configure_shortcuts.png') self.DisplayTagItem = icon_action(mainWindow, - u'DisplayTagItem', u':/system/system_settings.png') + u'DisplayTagItem', u':/system/tag_editor.png') self.SettingsConfigureItem = icon_action(mainWindow, u'SettingsConfigureItem', u':/system/system_settings.png') mainWindow.actionList.add_action(self.SettingsShortcutsItem, diff --git a/resources/forms/displaytabdialog.ui b/resources/forms/displaytabdialog.ui index 2e9c09c01..b181635be 100644 --- a/resources/forms/displaytabdialog.ui +++ b/resources/forms/displaytabdialog.ui @@ -6,228 +6,199 @@ 0 0 - 717 - 554 + 725 + 548 Form - - - - 10 - 320 - 691 - 181 - - - - Edit Selection - - - - - 600 - 140 - 73 - 26 - - - - Update - - - - - - 20 - 50 - 571 - 114 - - - - - - - Description - - - Qt::AlignCenter - - - - - - - - - - Tag - - - Qt::AlignCenter - - - - - - - - 50 - 16777215 - - - - 5 - - - - - - - Start tag - - - Qt::AlignCenter - - - - - - - - - - End tag - - - Qt::AlignCenter - - - - - - - - - - - - 600 - 40 - 71 - 26 - - - - Add - - - - - - 600 - 70 - 71 - 26 - - - - New - - - - - - - 540 - 510 - 162 - 26 - - - - QDialogButtonBox::Cancel|QDialogButtonBox::Save - - - - - - 630 - 280 - 71 - 26 - - - - Delete - - - + 10 10 - 691 - 271 + 701 + 521 - - Qt::ScrollBarAlwaysOff - - - QAbstractItemView::NoEditTriggers - - - true - - - QAbstractItemView::SingleSelection - - - QAbstractItemView::SelectRows - - - false - - - - Description - - - - - Key - - - AlignHCenter|AlignVCenter|AlignCenter - - - - - Start Tag - - - - - End Tag - - - - - - - 550 - 280 - 71 - 26 - - - - Default - + + + + + Qt::ScrollBarAlwaysOff + + + QAbstractItemView::NoEditTriggers + + + true + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + false + + + + Description + + + + + Key + + + AlignHCenter|AlignVCenter|AlignCenter + + + + + Start Tag + + + + + End Tag + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Default + + + + + + + Delete + + + + + + + + + Edit Selection + + + + + + Description + + + Qt::AlignCenter + + + + + + + + + + Add + + + + + + + New + + + + + + + Tag + + + Qt::AlignCenter + + + + + + + + 50 + 16777215 + + + + 5 + + + + + + + Start tag + + + Qt::AlignCenter + + + + + + + + + + End tag + + + Qt::AlignCenter + + + + + + + + + + Update + + + + + + + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Save + + + + diff --git a/resources/images/openlp-2.qrc b/resources/images/openlp-2.qrc index 745f20ebf..794e006d9 100644 --- a/resources/images/openlp-2.qrc +++ b/resources/images/openlp-2.qrc @@ -116,6 +116,7 @@ system_exit.png settings_plugin_list.png system_settings.png + tag_editor.png system_configure.png system_edit_copy.png system_configure_shortcuts.png From 69bfe2ab9ccb84e425d035b1b44ae40b81254461 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 20 Feb 2011 20:34:33 +0000 Subject: [PATCH 195/243] Post merge request fixes --- openlp/core/ui/settingsform.py | 5 +- resources/forms/displaytabdialog.py | 125 ++++++++++++++++++++++++++++ resources/images/tag_editor.png | Bin 0 -> 1131 bytes 3 files changed, 126 insertions(+), 4 deletions(-) create mode 100644 resources/forms/displaytabdialog.py create mode 100644 resources/images/tag_editor.png diff --git a/openlp/core/ui/settingsform.py b/openlp/core/ui/settingsform.py index 3fd640acd..8ea9b0dea 100644 --- a/openlp/core/ui/settingsform.py +++ b/openlp/core/ui/settingsform.py @@ -31,7 +31,7 @@ import logging from PyQt4 import QtGui from openlp.core.lib import Receiver -from openlp.core.ui import AdvancedTab, GeneralTab, ThemesTab, DisplayTagTab +from openlp.core.ui import AdvancedTab, GeneralTab, ThemesTab from settingsdialog import Ui_SettingsDialog log = logging.getLogger(__name__) @@ -55,9 +55,6 @@ class SettingsForm(QtGui.QDialog, Ui_SettingsDialog): # Advanced tab advancedTab = AdvancedTab() self.addTab(u'Advanced', advancedTab) - ## Edit Display Tags tab - #self.displayTagTab = DisplayTagTab() - #self.addTab(u'Display Tags', self.displayTagTab) def addTab(self, name, tab): """ diff --git a/resources/forms/displaytabdialog.py b/resources/forms/displaytabdialog.py new file mode 100644 index 000000000..7e3be55cd --- /dev/null +++ b/resources/forms/displaytabdialog.py @@ -0,0 +1,125 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'displaytabdialog.ui' +# +# Created: Sun Feb 20 17:37:30 2011 +# by: PyQt4 UI code generator 4.8.3 +# +# WARNING! All changes made in this file will be lost! + +from PyQt4 import QtCore, QtGui + +try: + _fromUtf8 = QtCore.QString.fromUtf8 +except AttributeError: + _fromUtf8 = lambda s: s + +class Ui_displayTagEdit(object): + def setupUi(self, displayTagEdit): + displayTagEdit.setObjectName(_fromUtf8("displayTagEdit")) + displayTagEdit.resize(725, 548) + self.widget = QtGui.QWidget(displayTagEdit) + self.widget.setGeometry(QtCore.QRect(10, 10, 701, 521)) + self.widget.setObjectName(_fromUtf8("widget")) + self.gridLayout_2 = QtGui.QGridLayout(self.widget) + self.gridLayout_2.setMargin(0) + self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2")) + self.tagTableWidget = QtGui.QTableWidget(self.widget) + self.tagTableWidget.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) + self.tagTableWidget.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers) + self.tagTableWidget.setAlternatingRowColors(True) + self.tagTableWidget.setSelectionMode(QtGui.QAbstractItemView.SingleSelection) + self.tagTableWidget.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) + self.tagTableWidget.setCornerButtonEnabled(False) + self.tagTableWidget.setObjectName(_fromUtf8("tagTableWidget")) + self.tagTableWidget.setColumnCount(4) + self.tagTableWidget.setRowCount(0) + item = QtGui.QTableWidgetItem() + self.tagTableWidget.setHorizontalHeaderItem(0, item) + item = QtGui.QTableWidgetItem() + self.tagTableWidget.setHorizontalHeaderItem(1, item) + item = QtGui.QTableWidgetItem() + self.tagTableWidget.setHorizontalHeaderItem(2, item) + item = QtGui.QTableWidgetItem() + self.tagTableWidget.setHorizontalHeaderItem(3, item) + self.gridLayout_2.addWidget(self.tagTableWidget, 0, 0, 1, 1) + self.horizontalLayout = QtGui.QHBoxLayout() + self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) + spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.horizontalLayout.addItem(spacerItem) + self.defaultPushButton = QtGui.QPushButton(self.widget) + self.defaultPushButton.setObjectName(_fromUtf8("defaultPushButton")) + self.horizontalLayout.addWidget(self.defaultPushButton) + self.deletePushButton = QtGui.QPushButton(self.widget) + self.deletePushButton.setObjectName(_fromUtf8("deletePushButton")) + self.horizontalLayout.addWidget(self.deletePushButton) + self.gridLayout_2.addLayout(self.horizontalLayout, 1, 0, 1, 1) + self.editGroupBox = QtGui.QGroupBox(self.widget) + self.editGroupBox.setObjectName(_fromUtf8("editGroupBox")) + self.gridLayout = QtGui.QGridLayout(self.editGroupBox) + self.gridLayout.setObjectName(_fromUtf8("gridLayout")) + self.descriptionLabel = QtGui.QLabel(self.editGroupBox) + self.descriptionLabel.setAlignment(QtCore.Qt.AlignCenter) + self.descriptionLabel.setObjectName(_fromUtf8("descriptionLabel")) + self.gridLayout.addWidget(self.descriptionLabel, 0, 0, 1, 1) + self.descriptionLineEdit = QtGui.QLineEdit(self.editGroupBox) + self.descriptionLineEdit.setObjectName(_fromUtf8("descriptionLineEdit")) + self.gridLayout.addWidget(self.descriptionLineEdit, 0, 1, 2, 1) + self.addPushButton = QtGui.QPushButton(self.editGroupBox) + self.addPushButton.setObjectName(_fromUtf8("addPushButton")) + self.gridLayout.addWidget(self.addPushButton, 0, 2, 1, 1) + self.newPushButton = QtGui.QPushButton(self.editGroupBox) + self.newPushButton.setObjectName(_fromUtf8("newPushButton")) + self.gridLayout.addWidget(self.newPushButton, 1, 2, 2, 1) + self.tagLabel = QtGui.QLabel(self.editGroupBox) + self.tagLabel.setAlignment(QtCore.Qt.AlignCenter) + self.tagLabel.setObjectName(_fromUtf8("tagLabel")) + self.gridLayout.addWidget(self.tagLabel, 2, 0, 1, 1) + self.tagLineEdit = QtGui.QLineEdit(self.editGroupBox) + self.tagLineEdit.setMaximumSize(QtCore.QSize(50, 16777215)) + self.tagLineEdit.setMaxLength(5) + self.tagLineEdit.setObjectName(_fromUtf8("tagLineEdit")) + self.gridLayout.addWidget(self.tagLineEdit, 2, 1, 1, 1) + self.startTagLabel = QtGui.QLabel(self.editGroupBox) + self.startTagLabel.setAlignment(QtCore.Qt.AlignCenter) + self.startTagLabel.setObjectName(_fromUtf8("startTagLabel")) + self.gridLayout.addWidget(self.startTagLabel, 3, 0, 1, 1) + self.startTagLineEdit = QtGui.QLineEdit(self.editGroupBox) + self.startTagLineEdit.setObjectName(_fromUtf8("startTagLineEdit")) + self.gridLayout.addWidget(self.startTagLineEdit, 3, 1, 1, 1) + self.endTagLabel = QtGui.QLabel(self.editGroupBox) + self.endTagLabel.setAlignment(QtCore.Qt.AlignCenter) + self.endTagLabel.setObjectName(_fromUtf8("endTagLabel")) + self.gridLayout.addWidget(self.endTagLabel, 4, 0, 1, 1) + self.endTagLineEdit = QtGui.QLineEdit(self.editGroupBox) + self.endTagLineEdit.setObjectName(_fromUtf8("endTagLineEdit")) + self.gridLayout.addWidget(self.endTagLineEdit, 4, 1, 1, 1) + self.updatePushButton = QtGui.QPushButton(self.editGroupBox) + self.updatePushButton.setObjectName(_fromUtf8("updatePushButton")) + self.gridLayout.addWidget(self.updatePushButton, 4, 2, 1, 1) + self.gridLayout_2.addWidget(self.editGroupBox, 2, 0, 1, 1) + self.buttonBox = QtGui.QDialogButtonBox(self.widget) + self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Save) + self.buttonBox.setObjectName(_fromUtf8("buttonBox")) + self.gridLayout_2.addWidget(self.buttonBox, 3, 0, 1, 1) + + self.retranslateUi(displayTagEdit) + QtCore.QMetaObject.connectSlotsByName(displayTagEdit) + + def retranslateUi(self, displayTagEdit): + displayTagEdit.setWindowTitle(QtGui.QApplication.translate("displayTagEdit", "Form", None, QtGui.QApplication.UnicodeUTF8)) + self.tagTableWidget.horizontalHeaderItem(0).setText(QtGui.QApplication.translate("displayTagEdit", "Description", None, QtGui.QApplication.UnicodeUTF8)) + self.tagTableWidget.horizontalHeaderItem(1).setText(QtGui.QApplication.translate("displayTagEdit", "Key", None, QtGui.QApplication.UnicodeUTF8)) + self.tagTableWidget.horizontalHeaderItem(2).setText(QtGui.QApplication.translate("displayTagEdit", "Start Tag", None, QtGui.QApplication.UnicodeUTF8)) + self.tagTableWidget.horizontalHeaderItem(3).setText(QtGui.QApplication.translate("displayTagEdit", "End Tag", None, QtGui.QApplication.UnicodeUTF8)) + self.defaultPushButton.setText(QtGui.QApplication.translate("displayTagEdit", "Default", None, QtGui.QApplication.UnicodeUTF8)) + self.deletePushButton.setText(QtGui.QApplication.translate("displayTagEdit", "Delete", None, QtGui.QApplication.UnicodeUTF8)) + self.editGroupBox.setTitle(QtGui.QApplication.translate("displayTagEdit", "Edit Selection", None, QtGui.QApplication.UnicodeUTF8)) + self.descriptionLabel.setText(QtGui.QApplication.translate("displayTagEdit", "Description", None, QtGui.QApplication.UnicodeUTF8)) + self.addPushButton.setText(QtGui.QApplication.translate("displayTagEdit", "Add", None, QtGui.QApplication.UnicodeUTF8)) + self.newPushButton.setText(QtGui.QApplication.translate("displayTagEdit", "New", None, QtGui.QApplication.UnicodeUTF8)) + self.tagLabel.setText(QtGui.QApplication.translate("displayTagEdit", "Tag", None, QtGui.QApplication.UnicodeUTF8)) + self.startTagLabel.setText(QtGui.QApplication.translate("displayTagEdit", "Start tag", None, QtGui.QApplication.UnicodeUTF8)) + self.endTagLabel.setText(QtGui.QApplication.translate("displayTagEdit", "End tag", None, QtGui.QApplication.UnicodeUTF8)) + self.updatePushButton.setText(QtGui.QApplication.translate("displayTagEdit", "Update", None, QtGui.QApplication.UnicodeUTF8)) + diff --git a/resources/images/tag_editor.png b/resources/images/tag_editor.png new file mode 100644 index 0000000000000000000000000000000000000000..d03963448a44afac47fb33551416dad2ba58168a GIT binary patch literal 1131 zcmV-x1eE)UP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01ejw01ejxLMWSf00007bV*G`2iXS| z0U#KwC`vg100ZkuL_t(|+MSbsXjNqx$3O4AclUVjox`y$&8BUxbQOe^TKQ{+=&BWr z7Fn<*nL+<#2~s4Hgb-F%N~ckVsE?m17# zgV#&zI;#)7yyrdd^E`a{p6^jC2ljA@_V#x10idO&MR6J0+S&v_DMfR0bG~jFuon~n zbu@*H&=T*AXUVVftn0dj!(r6T>PlR`Fs+6 zBD%^xX4AX4S4`Jbv7%ymJ-JEM*Dsf#KMUWX{v^X&*0CZIO(vt3)&*EB38W zkur^Yf4*nm_6N5vZ5`O*Dgfs3v1(QiM?wllJrcf($#IPtv&t!nYLvt@;zdPRuFIHV zk+LmLo=BpnEp*qxD}k4WVr<-Mu;BIu?&3v@t0Uxa!SjT8sXt^=l(?p0nJxxd6d_F8 z#q|Wk&SF|w5@j*m;xLY3(K>YlQ@ov&m3wmN(9zJr0|&c9v~@_P2=3MV5$9Hk*}y!|16#kzdxy{VQ*g z>6NqO{mnPYpWi$rz+GGQ&`3V@0QVIm3oMOdw{XF&BFo%B{Wlckf`UMW< z^LGLrCVBFTZQGWKuro>VzF#g|H`e(|tL4!LX3HO6-Y4gN|1P)(?kuP{5{VR49EkPc z?#eB+_oaB_LyH@$!o2ci5#Cjg`O%w8j)ICU%aY4s99$@STC3%nnYD7;-0NlNi&_~z z`ay7Kn&y=icXxLa3Wf5%hT_z!O&I3~S^aV;G0mfGqsfmWOR(K(e0#i$#>U2p6&r>j z;~6~CBPTkGrKYAvW>(FX{qL5^;ht5JC+NGf;;yc)U?(^i5q8g!8rwiB-Nrl5jBwtW zPByfLq0f5&!Sg&C8X6dnBCmMB_Xkw4jt&3-002ovPDHLkV1m$-7>ED> literal 0 HcmV?d00001 From 265aeebf4bbca34afe5c157ba689d710a4acdb17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20K=C3=B6hler?= Date: Mon, 21 Feb 2011 14:45:14 +0100 Subject: [PATCH 196/243] sort WizardStrings in alphapetical order --- openlp/core/ui/wizard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/wizard.py b/openlp/core/ui/wizard.py index fc1edeecb..209f3f212 100644 --- a/openlp/core/ui/wizard.py +++ b/openlp/core/ui/wizard.py @@ -47,6 +47,7 @@ class WizardStrings(object): CSV = u'CSV' EW = u'EasyWorship' ES = u'EasiSlides' + FP = u'Foilpresenter' OL = u'OpenLyrics' OS = u'OpenSong' OSIS = u'OSIS' @@ -54,7 +55,6 @@ class WizardStrings(object): SoF = u'Songs of Fellowship' SSP = u'SongShow Plus' WoW = u'Words of Worship' - FP = u'Foilpresenter' # These strings should need a good reason to be retranslated elsewhere. FinishedImport = translate('OpenLP.Ui', 'Finished import.') FormatLabel = translate('OpenLP.Ui', 'Format:') From 4aa69e53bbf0c70615bafa929a987273322799b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20K=C3=B6hler?= Date: Mon, 21 Feb 2011 15:59:01 +0100 Subject: [PATCH 197/243] removed duplicate method registerFields() and sort some lines --- openlp/plugins/songs/forms/songimportform.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index 06de08a93..3eecac4ba 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -604,6 +604,12 @@ class SongImportForm(OpenLPWizard): % translate('SongsPlugin.ImportWizardForm', 'SongShow Plus Song Files') ) + + def onSongShowPlusRemoveButtonClicked(self): + """ + Remove selected SongShow Plus files from the import list + """ + self.removeSelectedItems(self.songShowPlusFileListWidget) def onFoilPresenterAddButtonClicked(self): """ @@ -621,18 +627,6 @@ class SongImportForm(OpenLPWizard): """ self.removeSelectedItems(self.foilPresenterFileListWidget) - def registerFields(self): - """ - Register song import wizard fields. - """ - pass - - def onSongShowPlusRemoveButtonClicked(self): - """ - Remove selected SongShow Plus files from the import list - """ - self.removeSelectedItems(self.songShowPlusFileListWidget) - def setDefaults(self): """ Set default form values for the song import wizard. From 7d7f9a7d98172d4cf26ecc1e5f0f9a889fb8acde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Mon, 21 Feb 2011 17:16:56 +0200 Subject: [PATCH 198/243] fix #99 --- openlp/plugins/songs/lib/cclifileimport.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/openlp/plugins/songs/lib/cclifileimport.py b/openlp/plugins/songs/lib/cclifileimport.py index 3d08584d0..28c487a78 100644 --- a/openlp/plugins/songs/lib/cclifileimport.py +++ b/openlp/plugins/songs/lib/cclifileimport.py @@ -78,7 +78,20 @@ class CCLIFileImport(SongImport): details = chardet.detect(detect_content) detect_file.close() infile = codecs.open(filename, u'r', details['encoding']) - lines = infile.readlines() + try: + lines = infile.readlines() + infile.close() + except UnicodeDecodeError: + # First 2kB were not sufficient to detect file encoding. + # This time we read entire file. + detect_file = open(filename, u'r') + detect_content = detect_file.read() + details = chardet.detect(detect_content) + detect_file.close() + # We read the contents again. Should it be a try as well? + infile = codecs.open(filename, u'r', details['encoding']) + lines = infile.readlines() + infile.close() ext = os.path.splitext(filename)[1] if ext.lower() == u'.usr': log.info(u'SongSelect .usr format file found %s: ', From 24519832dfb8ebf8b70a88d5af494013bd9639d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Mon, 21 Feb 2011 17:49:09 +0200 Subject: [PATCH 199/243] More informational noise to debug log, extensions by mimetype. To justify: it seems that extension list is an important thing. --- openlp/plugins/media/mediaplugin.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index 12887a76c..bfe9dbff0 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -54,19 +54,16 @@ class MediaPlugin(Plugin): self._addToList(self.audio_list, mimetype) elif mimetype.startswith(u'video/'): self._addToList(self.video_list, mimetype) - log.info(u'MediaPlugin handles audio extensions: %s', - u' '.join(self.audio_list)) - log.info(u'MediaPlugin handles video extensions: %s', - u' '.join(self.video_list)) def _addToList(self, list, mimetype): - # Is it a media type extensions = mimetypes.guess_all_extensions(unicode(mimetype)) for extension in extensions: ext = u'*%s' % extension if ext not in list: list.append(ext) self.serviceManager.supportedSuffixes(extension[1:]) + log.info(u'MediaPlugin: %s extensions: %s' % (mimetype, + u' '.join(extensions))) def about(self): about_text = translate('MediaPlugin', 'Media Plugin' From e8b6bbe14179ff37a6da5aa3b4c4bb1ad430f939 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Mon, 21 Feb 2011 17:56:23 +0200 Subject: [PATCH 200/243] revert a change --- openlp/plugins/songs/lib/cclifileimport.py | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/openlp/plugins/songs/lib/cclifileimport.py b/openlp/plugins/songs/lib/cclifileimport.py index 28c487a78..3d08584d0 100644 --- a/openlp/plugins/songs/lib/cclifileimport.py +++ b/openlp/plugins/songs/lib/cclifileimport.py @@ -78,20 +78,7 @@ class CCLIFileImport(SongImport): details = chardet.detect(detect_content) detect_file.close() infile = codecs.open(filename, u'r', details['encoding']) - try: - lines = infile.readlines() - infile.close() - except UnicodeDecodeError: - # First 2kB were not sufficient to detect file encoding. - # This time we read entire file. - detect_file = open(filename, u'r') - detect_content = detect_file.read() - details = chardet.detect(detect_content) - detect_file.close() - # We read the contents again. Should it be a try as well? - infile = codecs.open(filename, u'r', details['encoding']) - lines = infile.readlines() - infile.close() + lines = infile.readlines() ext = os.path.splitext(filename)[1] if ext.lower() == u'.usr': log.info(u'SongSelect .usr format file found %s: ', From 1e041d9158d72aa1f7ad177f38c756f55da07c5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20K=C3=B6hler?= Date: Mon, 21 Feb 2011 17:02:28 +0100 Subject: [PATCH 201/243] remove some whitespaces --- openlp/plugins/songs/forms/songimportform.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index 3eecac4ba..16c0f9edb 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -594,7 +594,7 @@ class SongImportForm(OpenLPWizard): Remove selected SongBeamer files from the import list """ self.removeSelectedItems(self.songBeamerFileListWidget) - + def onSongShowPlusAddButtonClicked(self): """ Get SongShow Plus song database files @@ -604,7 +604,7 @@ class SongImportForm(OpenLPWizard): % translate('SongsPlugin.ImportWizardForm', 'SongShow Plus Song Files') ) - + def onSongShowPlusRemoveButtonClicked(self): """ Remove selected SongShow Plus files from the import list From e2699eab3cadc2fd719a853a1586d69fe64618a2 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Mon, 21 Feb 2011 17:12:36 +0000 Subject: [PATCH 202/243] Review Fixes --- openlp/core/ui/displaytagdialog.py | 16 ++-- openlp/core/ui/displaytagform.py | 3 + resources/forms/displaytabdialog.py | 125 ---------------------------- 3 files changed, 11 insertions(+), 133 deletions(-) delete mode 100644 resources/forms/displaytabdialog.py diff --git a/openlp/core/ui/displaytagdialog.py b/openlp/core/ui/displaytagdialog.py index 5da529302..ab3363058 100644 --- a/openlp/core/ui/displaytagdialog.py +++ b/openlp/core/ui/displaytagdialog.py @@ -139,14 +139,14 @@ class Ui_DisplayTagDialog(object): self.defaultPushButton.setText( translate('OpenLP.DisplayTagTab', 'Default')) self.newPushButton.setText(UiStrings.New) - self.tagTableWidget.horizontalHeaderItem(0) \ - .setText(translate('OpenLP.DisplayTagTab', 'Description')) - self.tagTableWidget.horizontalHeaderItem(1) \ - .setText(translate('OpenLP.DisplayTagTab', 'Tag id')) - self.tagTableWidget.horizontalHeaderItem(2) \ - .setText(translate('OpenLP.DisplayTagTab', 'Start Html')) - self.tagTableWidget.horizontalHeaderItem(3) \ - .setText(translate('OpenLP.DisplayTagTab', 'End Html')) + self.tagTableWidget.horizontalHeaderItem(0).setText( + translate('OpenLP.DisplayTagTab', 'Description')) + self.tagTableWidget.horizontalHeaderItem(1).setText( + translate('OpenLP.DisplayTagTab', 'Tag id')) + self.tagTableWidget.horizontalHeaderItem(2).setText( + translate('OpenLP.DisplayTagTab', 'Start Html')) + self.tagTableWidget.horizontalHeaderItem(3).setText( + translate('OpenLP.DisplayTagTab', 'End Html')) self.tagTableWidget.setColumnWidth(0, 120) self.tagTableWidget.setColumnWidth(1, 40) self.tagTableWidget.setColumnWidth(2, 240) diff --git a/openlp/core/ui/displaytagform.py b/openlp/core/ui/displaytagform.py index 48924759f..f7a8e7740 100644 --- a/openlp/core/ui/displaytagform.py +++ b/openlp/core/ui/displaytagform.py @@ -79,6 +79,9 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): return QtGui.QDialog.exec_(self) def load(self): + """ + Load the form with data and set the initial state of the buttons + """ self.newPushButton.setEnabled(True) self.updatePushButton.setEnabled(False) self.deletePushButton.setEnabled(False) diff --git a/resources/forms/displaytabdialog.py b/resources/forms/displaytabdialog.py deleted file mode 100644 index 7e3be55cd..000000000 --- a/resources/forms/displaytabdialog.py +++ /dev/null @@ -1,125 +0,0 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file 'displaytabdialog.ui' -# -# Created: Sun Feb 20 17:37:30 2011 -# by: PyQt4 UI code generator 4.8.3 -# -# WARNING! All changes made in this file will be lost! - -from PyQt4 import QtCore, QtGui - -try: - _fromUtf8 = QtCore.QString.fromUtf8 -except AttributeError: - _fromUtf8 = lambda s: s - -class Ui_displayTagEdit(object): - def setupUi(self, displayTagEdit): - displayTagEdit.setObjectName(_fromUtf8("displayTagEdit")) - displayTagEdit.resize(725, 548) - self.widget = QtGui.QWidget(displayTagEdit) - self.widget.setGeometry(QtCore.QRect(10, 10, 701, 521)) - self.widget.setObjectName(_fromUtf8("widget")) - self.gridLayout_2 = QtGui.QGridLayout(self.widget) - self.gridLayout_2.setMargin(0) - self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2")) - self.tagTableWidget = QtGui.QTableWidget(self.widget) - self.tagTableWidget.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) - self.tagTableWidget.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers) - self.tagTableWidget.setAlternatingRowColors(True) - self.tagTableWidget.setSelectionMode(QtGui.QAbstractItemView.SingleSelection) - self.tagTableWidget.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) - self.tagTableWidget.setCornerButtonEnabled(False) - self.tagTableWidget.setObjectName(_fromUtf8("tagTableWidget")) - self.tagTableWidget.setColumnCount(4) - self.tagTableWidget.setRowCount(0) - item = QtGui.QTableWidgetItem() - self.tagTableWidget.setHorizontalHeaderItem(0, item) - item = QtGui.QTableWidgetItem() - self.tagTableWidget.setHorizontalHeaderItem(1, item) - item = QtGui.QTableWidgetItem() - self.tagTableWidget.setHorizontalHeaderItem(2, item) - item = QtGui.QTableWidgetItem() - self.tagTableWidget.setHorizontalHeaderItem(3, item) - self.gridLayout_2.addWidget(self.tagTableWidget, 0, 0, 1, 1) - self.horizontalLayout = QtGui.QHBoxLayout() - self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) - spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.horizontalLayout.addItem(spacerItem) - self.defaultPushButton = QtGui.QPushButton(self.widget) - self.defaultPushButton.setObjectName(_fromUtf8("defaultPushButton")) - self.horizontalLayout.addWidget(self.defaultPushButton) - self.deletePushButton = QtGui.QPushButton(self.widget) - self.deletePushButton.setObjectName(_fromUtf8("deletePushButton")) - self.horizontalLayout.addWidget(self.deletePushButton) - self.gridLayout_2.addLayout(self.horizontalLayout, 1, 0, 1, 1) - self.editGroupBox = QtGui.QGroupBox(self.widget) - self.editGroupBox.setObjectName(_fromUtf8("editGroupBox")) - self.gridLayout = QtGui.QGridLayout(self.editGroupBox) - self.gridLayout.setObjectName(_fromUtf8("gridLayout")) - self.descriptionLabel = QtGui.QLabel(self.editGroupBox) - self.descriptionLabel.setAlignment(QtCore.Qt.AlignCenter) - self.descriptionLabel.setObjectName(_fromUtf8("descriptionLabel")) - self.gridLayout.addWidget(self.descriptionLabel, 0, 0, 1, 1) - self.descriptionLineEdit = QtGui.QLineEdit(self.editGroupBox) - self.descriptionLineEdit.setObjectName(_fromUtf8("descriptionLineEdit")) - self.gridLayout.addWidget(self.descriptionLineEdit, 0, 1, 2, 1) - self.addPushButton = QtGui.QPushButton(self.editGroupBox) - self.addPushButton.setObjectName(_fromUtf8("addPushButton")) - self.gridLayout.addWidget(self.addPushButton, 0, 2, 1, 1) - self.newPushButton = QtGui.QPushButton(self.editGroupBox) - self.newPushButton.setObjectName(_fromUtf8("newPushButton")) - self.gridLayout.addWidget(self.newPushButton, 1, 2, 2, 1) - self.tagLabel = QtGui.QLabel(self.editGroupBox) - self.tagLabel.setAlignment(QtCore.Qt.AlignCenter) - self.tagLabel.setObjectName(_fromUtf8("tagLabel")) - self.gridLayout.addWidget(self.tagLabel, 2, 0, 1, 1) - self.tagLineEdit = QtGui.QLineEdit(self.editGroupBox) - self.tagLineEdit.setMaximumSize(QtCore.QSize(50, 16777215)) - self.tagLineEdit.setMaxLength(5) - self.tagLineEdit.setObjectName(_fromUtf8("tagLineEdit")) - self.gridLayout.addWidget(self.tagLineEdit, 2, 1, 1, 1) - self.startTagLabel = QtGui.QLabel(self.editGroupBox) - self.startTagLabel.setAlignment(QtCore.Qt.AlignCenter) - self.startTagLabel.setObjectName(_fromUtf8("startTagLabel")) - self.gridLayout.addWidget(self.startTagLabel, 3, 0, 1, 1) - self.startTagLineEdit = QtGui.QLineEdit(self.editGroupBox) - self.startTagLineEdit.setObjectName(_fromUtf8("startTagLineEdit")) - self.gridLayout.addWidget(self.startTagLineEdit, 3, 1, 1, 1) - self.endTagLabel = QtGui.QLabel(self.editGroupBox) - self.endTagLabel.setAlignment(QtCore.Qt.AlignCenter) - self.endTagLabel.setObjectName(_fromUtf8("endTagLabel")) - self.gridLayout.addWidget(self.endTagLabel, 4, 0, 1, 1) - self.endTagLineEdit = QtGui.QLineEdit(self.editGroupBox) - self.endTagLineEdit.setObjectName(_fromUtf8("endTagLineEdit")) - self.gridLayout.addWidget(self.endTagLineEdit, 4, 1, 1, 1) - self.updatePushButton = QtGui.QPushButton(self.editGroupBox) - self.updatePushButton.setObjectName(_fromUtf8("updatePushButton")) - self.gridLayout.addWidget(self.updatePushButton, 4, 2, 1, 1) - self.gridLayout_2.addWidget(self.editGroupBox, 2, 0, 1, 1) - self.buttonBox = QtGui.QDialogButtonBox(self.widget) - self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Save) - self.buttonBox.setObjectName(_fromUtf8("buttonBox")) - self.gridLayout_2.addWidget(self.buttonBox, 3, 0, 1, 1) - - self.retranslateUi(displayTagEdit) - QtCore.QMetaObject.connectSlotsByName(displayTagEdit) - - def retranslateUi(self, displayTagEdit): - displayTagEdit.setWindowTitle(QtGui.QApplication.translate("displayTagEdit", "Form", None, QtGui.QApplication.UnicodeUTF8)) - self.tagTableWidget.horizontalHeaderItem(0).setText(QtGui.QApplication.translate("displayTagEdit", "Description", None, QtGui.QApplication.UnicodeUTF8)) - self.tagTableWidget.horizontalHeaderItem(1).setText(QtGui.QApplication.translate("displayTagEdit", "Key", None, QtGui.QApplication.UnicodeUTF8)) - self.tagTableWidget.horizontalHeaderItem(2).setText(QtGui.QApplication.translate("displayTagEdit", "Start Tag", None, QtGui.QApplication.UnicodeUTF8)) - self.tagTableWidget.horizontalHeaderItem(3).setText(QtGui.QApplication.translate("displayTagEdit", "End Tag", None, QtGui.QApplication.UnicodeUTF8)) - self.defaultPushButton.setText(QtGui.QApplication.translate("displayTagEdit", "Default", None, QtGui.QApplication.UnicodeUTF8)) - self.deletePushButton.setText(QtGui.QApplication.translate("displayTagEdit", "Delete", None, QtGui.QApplication.UnicodeUTF8)) - self.editGroupBox.setTitle(QtGui.QApplication.translate("displayTagEdit", "Edit Selection", None, QtGui.QApplication.UnicodeUTF8)) - self.descriptionLabel.setText(QtGui.QApplication.translate("displayTagEdit", "Description", None, QtGui.QApplication.UnicodeUTF8)) - self.addPushButton.setText(QtGui.QApplication.translate("displayTagEdit", "Add", None, QtGui.QApplication.UnicodeUTF8)) - self.newPushButton.setText(QtGui.QApplication.translate("displayTagEdit", "New", None, QtGui.QApplication.UnicodeUTF8)) - self.tagLabel.setText(QtGui.QApplication.translate("displayTagEdit", "Tag", None, QtGui.QApplication.UnicodeUTF8)) - self.startTagLabel.setText(QtGui.QApplication.translate("displayTagEdit", "Start tag", None, QtGui.QApplication.UnicodeUTF8)) - self.endTagLabel.setText(QtGui.QApplication.translate("displayTagEdit", "End tag", None, QtGui.QApplication.UnicodeUTF8)) - self.updatePushButton.setText(QtGui.QApplication.translate("displayTagEdit", "Update", None, QtGui.QApplication.UnicodeUTF8)) - From eb4f7deea8620e8d880a956f9c456f165277ef6a Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Mon, 21 Feb 2011 20:30:01 +0100 Subject: [PATCH 203/243] added apocrypha --- openlp/plugins/bibles/resources/osisbooks.csv | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/openlp/plugins/bibles/resources/osisbooks.csv b/openlp/plugins/bibles/resources/osisbooks.csv index c14f76ded..372cbd92d 100644 --- a/openlp/plugins/bibles/resources/osisbooks.csv +++ b/openlp/plugins/bibles/resources/osisbooks.csv @@ -64,3 +64,13 @@ Jas,James,Jas 3John,3 John,3John Jude,Jude,Jude Rev,Revelation,Rev +Jdt,Judith,Jdt +Wis,Wisdom,Wis +Tob,Tobit,Tob +Sir,Sirach,Sir +Bar,Baruch,Bar +1Macc,1 Maccabees,1Macc +2Macc,2 Maccabees,2Macc +AddDan,Rest of Daniel,AddDan +AddEsth,Rest of Esther,AddEsth +PrMan,Prayer of Manasses,PrMan From 0935af3cfb527cf972619af8e34f7ecf7a637bb8 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Mon, 21 Feb 2011 20:43:04 +0100 Subject: [PATCH 204/243] fix db --- openlp/plugins/bibles/lib/osis.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/plugins/bibles/lib/osis.py b/openlp/plugins/bibles/lib/osis.py index d21227090..347730bf4 100644 --- a/openlp/plugins/bibles/lib/osis.py +++ b/openlp/plugins/bibles/lib/osis.py @@ -126,7 +126,7 @@ class OSISBible(BibleDB): verse_text = match.group(4) if not db_book or db_book.name != self.books[book][0]: log.debug(u'New book: "%s"', self.books[book][0]) - if book == u'Matt': + if book == u'Matt' or book == u'Jdt': testament += 1 db_book = self.create_book( unicode(self.books[book][0]), From d486547abd5cfa3e248e471fe86cf62d58eb5c2f Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Mon, 21 Feb 2011 20:06:55 +0000 Subject: [PATCH 205/243] Fixes from last merge --- openlp/core/ui/__init__.py | 1 - openlp/core/ui/displaytagdialog.py | 24 +++++------ openlp/core/ui/displaytagform.py | 66 ++++++++++++++++-------------- 3 files changed, 47 insertions(+), 44 deletions(-) diff --git a/openlp/core/ui/__init__.py b/openlp/core/ui/__init__.py index 5763b3470..0f62a6dcf 100644 --- a/openlp/core/ui/__init__.py +++ b/openlp/core/ui/__init__.py @@ -63,7 +63,6 @@ from splashscreen import SplashScreen from generaltab import GeneralTab from themestab import ThemesTab from advancedtab import AdvancedTab -from displaytagtab import DisplayTagTab from aboutform import AboutForm from pluginform import PluginForm from settingsform import SettingsForm diff --git a/openlp/core/ui/displaytagdialog.py b/openlp/core/ui/displaytagdialog.py index ab3363058..edb8567cf 100644 --- a/openlp/core/ui/displaytagdialog.py +++ b/openlp/core/ui/displaytagdialog.py @@ -123,30 +123,30 @@ class Ui_DisplayTagDialog(object): QtCore.QMetaObject.connectSlotsByName(displayTagDialog) def retranslateUi(self, displayTagDialog): - displayTagDialog.setWindowTitle(translate('OpenLP.displayTagForm', + displayTagDialog.setWindowTitle(translate('OpenLP.displayTagDialog', 'Configure Display Tags')) self.editGroupBox.setTitle( - translate('OpenLP.DisplayTagTab', 'Edit Selection')) + translate('OpenLP.DisplayTagDialog', 'Edit Selection')) self.updatePushButton.setText( - translate('OpenLP.DisplayTagTab', 'Update')) + translate('OpenLP.DisplayTagDialog', 'Update')) self.descriptionLabel.setText( - translate('OpenLP.DisplayTagTab', 'Description')) - self.tagLabel.setText(translate('OpenLP.DisplayTagTab', 'Tag')) + translate('OpenLP.DisplayTagDialog', 'Description')) + self.tagLabel.setText(translate('OpenLP.DisplayTagDialog', 'Tag')) self.startTagLabel.setText( - translate('OpenLP.DisplayTagTab', 'Start tag')) - self.endTagLabel.setText(translate('OpenLP.DisplayTagTab', 'End tag')) + translate('OpenLP.DisplayTagDialog', 'Start tag')) + self.endTagLabel.setText(translate('OpenLP.DisplayTagDialog', 'End tag')) self.deletePushButton.setText(UiStrings.Delete) self.defaultPushButton.setText( - translate('OpenLP.DisplayTagTab', 'Default')) + translate('OpenLP.DisplayTagDialog', 'Default')) self.newPushButton.setText(UiStrings.New) self.tagTableWidget.horizontalHeaderItem(0).setText( - translate('OpenLP.DisplayTagTab', 'Description')) + translate('OpenLP.DisplayTagDialog', 'Description')) self.tagTableWidget.horizontalHeaderItem(1).setText( - translate('OpenLP.DisplayTagTab', 'Tag id')) + translate('OpenLP.DisplayTagDialog', 'Tag id')) self.tagTableWidget.horizontalHeaderItem(2).setText( - translate('OpenLP.DisplayTagTab', 'Start Html')) + translate('OpenLP.DisplayTagDialog', 'Start Html')) self.tagTableWidget.horizontalHeaderItem(3).setText( - translate('OpenLP.DisplayTagTab', 'End Html')) + translate('OpenLP.DisplayTagDialog', 'End Html')) self.tagTableWidget.setColumnWidth(0, 120) self.tagTableWidget.setColumnWidth(1, 40) self.tagTableWidget.setColumnWidth(2, 240) diff --git a/openlp/core/ui/displaytagform.py b/openlp/core/ui/displaytagform.py index f7a8e7740..fa05c578a 100644 --- a/openlp/core/ui/displaytagform.py +++ b/openlp/core/ui/displaytagform.py @@ -47,6 +47,7 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): """ QtGui.QDialog.__init__(self, parent) self.setupUi(self) + self.preLoad() QtCore.QObject.connect(self.tagTableWidget, QtCore.SIGNAL(u'clicked(QModelIndex)'), self.onRowSelected) QtCore.QObject.connect(self.defaultPushButton, @@ -63,7 +64,18 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): Load Display and set field state. """ # Create initial copy from master + self.preLoad() self._resetTable() + self.selected = -1 + return QtGui.QDialog.exec_(self) + + def preLoad(self): + """ + Load the Tags from store so can be used in the system or used to + update the display. If Cancel was selected this is needed to reset the + dsiplay to the correct version. + """ + # Initial Load of the Tags DisplayTags.reset_html_tags() user_expands = QtCore.QSettings().value(u'displayTags/html_tags', QtCore.QVariant(u'')).toString() @@ -74,37 +86,6 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): # If we have some user ones added them as well for t in user_tags: DisplayTags.add_html_tag(t) - self.selected = -1 - self.load() - return QtGui.QDialog.exec_(self) - - def load(self): - """ - Load the form with data and set the initial state of the buttons - """ - self.newPushButton.setEnabled(True) - self.updatePushButton.setEnabled(False) - self.deletePushButton.setEnabled(False) - for linenumber, html in enumerate(DisplayTags.get_html_tags()): - self.tagTableWidget.setRowCount( - self.tagTableWidget.rowCount() + 1) - self.tagTableWidget.setItem(linenumber, 0, - QtGui.QTableWidgetItem(html[u'desc'])) - self.tagTableWidget.setItem(linenumber, 1, - QtGui.QTableWidgetItem(self._strip(html[u'start tag']))) - self.tagTableWidget.setItem(linenumber, 2, - QtGui.QTableWidgetItem(html[u'start html'])) - self.tagTableWidget.setItem(linenumber, 3, - QtGui.QTableWidgetItem(html[u'end html'])) - self.tagTableWidget.resizeRowsToContents() - self.descriptionLineEdit.setText(u'') - self.tagLineEdit.setText(u'') - self.startTagLineEdit.setText(u'') - self.endTagLineEdit.setText(u'') - self.descriptionLineEdit.setEnabled(False) - self.tagLineEdit.setEnabled(False) - self.startTagLineEdit.setEnabled(False) - self.endTagLineEdit.setEnabled(False) def accept(self): """ @@ -223,6 +204,29 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): """ self.tagTableWidget.clearContents() self.tagTableWidget.setRowCount(0) + self.newPushButton.setEnabled(True) + self.updatePushButton.setEnabled(False) + self.deletePushButton.setEnabled(False) + for linenumber, html in enumerate(DisplayTags.get_html_tags()): + self.tagTableWidget.setRowCount( + self.tagTableWidget.rowCount() + 1) + self.tagTableWidget.setItem(linenumber, 0, + QtGui.QTableWidgetItem(html[u'desc'])) + self.tagTableWidget.setItem(linenumber, 1, + QtGui.QTableWidgetItem(self._strip(html[u'start tag']))) + self.tagTableWidget.setItem(linenumber, 2, + QtGui.QTableWidgetItem(html[u'start html'])) + self.tagTableWidget.setItem(linenumber, 3, + QtGui.QTableWidgetItem(html[u'end html'])) + self.tagTableWidget.resizeRowsToContents() + self.descriptionLineEdit.setText(u'') + self.tagLineEdit.setText(u'') + self.startTagLineEdit.setText(u'') + self.endTagLineEdit.setText(u'') + self.descriptionLineEdit.setEnabled(False) + self.tagLineEdit.setEnabled(False) + self.startTagLineEdit.setEnabled(False) + self.endTagLineEdit.setEnabled(False) def _strip(self, tag): """ From fdb5c574683b755b99f5aaa29f192040ef381fdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Mon, 21 Feb 2011 22:37:18 +0200 Subject: [PATCH 206/243] Additional extensions hack. --- openlp/plugins/media/lib/mediaitem.py | 4 ++-- openlp/plugins/media/mediaplugin.py | 20 ++++++++++++++++---- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index 9f3f98636..8bf201180 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -61,8 +61,8 @@ class MediaMediaItem(MediaManagerItem): self.onNewPrompt = translate('MediaPlugin.MediaItem', 'Select Media') self.onNewFileMasks = unicode(translate('MediaPlugin.MediaItem', 'Videos (%s);;Audio (%s);;%s (*)')) % ( - u' '.join(self.parent.video_list), - u' '.join(self.parent.audio_list), UiStrings.AllFiles) + u' '.join(self.parent.video_extensions_list), + u' '.join(self.parent.audio_extensions_list), UiStrings.AllFiles) self.replaceAction.setText(UiStrings.ReplaceBG) self.replaceAction.setToolTip(UiStrings.ReplaceLiveBG) self.resetAction.setText(UiStrings.ResetBG) diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index bfe9dbff0..1514b6cb2 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -45,15 +45,19 @@ class MediaPlugin(Plugin): self.icon = build_icon(self.icon_path) # passed with drag and drop messages self.dnd_id = u'Media' - self.audio_list = [] - self.video_list = [] + # This is yet a dummy example: + self.additional_extensions = { + 'audio/msaudio': ['.mp3', '.aac'], + 'video/msvideo': ['.wmv', '.avi']} + self.audio_extensions_list = [] + self.video_extensions_list = [] mimetypes.init() for mimetype in Phonon.BackendCapabilities.availableMimeTypes(): mimetype = unicode(mimetype) if mimetype.startswith(u'audio/'): - self._addToList(self.audio_list, mimetype) + self._addToList(self.audio_extensions_list, mimetype) elif mimetype.startswith(u'video/'): - self._addToList(self.video_list, mimetype) + self._addToList(self.video_extensions_list, mimetype) def _addToList(self, list, mimetype): extensions = mimetypes.guess_all_extensions(unicode(mimetype)) @@ -64,6 +68,14 @@ class MediaPlugin(Plugin): self.serviceManager.supportedSuffixes(extension[1:]) log.info(u'MediaPlugin: %s extensions: %s' % (mimetype, u' '.join(extensions))) + if mimetype in self.additional_extensions.keys(): + for extension in self.additional_extensions[mimetype]: + ext = u'*%s' % extensions + if ext not in list: + list.append(ext) + self.serviceManager.supportedSuffixes(extension[1:]) + log.info(u'MediaPlugin: %s additional extensions: %s' % (mimetype, + u' '.join(self.additional_extensions[mimetype]))) def about(self): about_text = translate('MediaPlugin', 'Media Plugin' From 0ecc3c2dc9e5924559ed9222f0229526163c5bb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20K=C3=B6hler?= Date: Mon, 21 Feb 2011 23:03:09 +0100 Subject: [PATCH 207/243] adapt "Author unknown" similar to xml.py correct some whitespaces and quotation marks --- .../plugins/songs/lib/foilpresenterimport.py | 85 +++++++++---------- 1 file changed, 42 insertions(+), 43 deletions(-) diff --git a/openlp/plugins/songs/lib/foilpresenterimport.py b/openlp/plugins/songs/lib/foilpresenterimport.py index 635137b00..963561cb5 100644 --- a/openlp/plugins/songs/lib/foilpresenterimport.py +++ b/openlp/plugins/songs/lib/foilpresenterimport.py @@ -99,6 +99,7 @@ from openlp.plugins.songs.lib import VerseType from openlp.plugins.songs.lib.songimport import SongImport from openlp.plugins.songs.lib.db import Author, Book, Song, Topic from openlp.plugins.songs.lib.xml import SongXML +from openlp.plugins.songs.lib.ui import SongStrings log = logging.getLogger(__name__) @@ -261,40 +262,40 @@ class FoilPresenter(object): if copyright: strings = [] author_temp = [] - if copyright.find(u"Copyright") != -1: - test = copyright.partition(u"Copyright") + if copyright.find(u'Copyright') != -1: + test = copyright.partition(u'Copyright') copyright = test[0] - elif copyright.find(u"copyright") != -1: - test = copyright.partition(u"copyright") + elif copyright.find(u'copyright') != -1: + test = copyright.partition(u'copyright') copyright = test[0] - elif copyright.find(u"©") != -1: - test = copyright.partition(u"©") + elif copyright.find(u'©') != -1: + test = copyright.partition(u'©') copyright = test[0] - elif copyright.find(u"(c)") != -1: - test = copyright.partition(u"(c)") + elif copyright.find(u'(c)') != -1: + test = copyright.partition(u'(c)') copyright = test[0] - elif copyright.find(u"(C)") != -1: - test = copyright.partition(u"(C)") + elif copyright.find(u'(C)') != -1: + test = copyright.partition(u'(C)') copyright = test[0] - elif copyright.find(u"c)") != -1: - test = copyright.partition(u"c)") + elif copyright.find(u'c)') != -1: + test = copyright.partition(u'c)') copyright = test[0] - elif copyright.find(u"C)") != -1: - test = copyright.partition(u"C)") + elif copyright.find(u'C)') != -1: + test = copyright.partition(u'C)') copyright = test[0] - elif copyright.find(u"C:") != -1: - test = copyright.partition(u"C:") + elif copyright.find(u'C:') != -1: + test = copyright.partition(u'C:') copyright = test[0] - elif copyright.find(u"C,)") != -1: - test = copyright.partition(u"C,)") + elif copyright.find(u'C,)') != -1: + test = copyright.partition(u'C,)') copyright = test[0] copyright = re.compile(u'\\n').sub(u' ', copyright) copyright = re.compile(u'\(.*\)').sub(u'', copyright) - if copyright.find(u"Rechte") != -1: - test = copyright.partition(u"Rechte") + if copyright.find(u'Rechte') != -1: + test = copyright.partition(u'Rechte') copyright = test[0] markers = [u'Text +u\.?n?d? +Melodie[a-zA-Z0-9\,\. ]*:', - u'Text +u\.?n?d? +Musik', u"T & M", u'Melodie und Satz', + u'Text +u\.?n?d? +Musik', u'T & M', u'Melodie und Satz', u'Text[a-zA-Z0-9\,\. ]*:', u'Melodie', u'Musik', u'Satz', u'Weise', u'[dD]eutsch', u'[dD]t[\.\:]', u'Englisch', u'[oO]riginal', u'Bearbeitung', u'[R|r]efrain'] @@ -304,9 +305,9 @@ class FoilPresenter(object): i = 0 x = 0 while i != 1: - if copyright.find(u"") != -1: - test = copyright.partition(u"") - if (test[0].strip() != u"") & (x > 0): + if copyright.find(u'') != -1: + test = copyright.partition(u'') + if (test[0].strip() != u'') & (x > 0): strings.append(test[0]) copyright = test[2] x += 1 @@ -316,7 +317,7 @@ class FoilPresenter(object): else: i = 1 for author in strings: - test = re.split(u",(?=\D{2})|(?<=\D),|\/(?=\D{3,})|(?<=\D);", + test = re.split(u',(?=\D{2})|(?<=\D),|\/(?=\D{3,})|(?<=\D);', author) for test_temp in test: author_temp.append(test_temp) @@ -332,16 +333,14 @@ class FoilPresenter(object): if re.search( u'\w+\.?\s+\w{3,}\s+[a|u]nd\s|\w+\.?\s+\w{3,}\s+&\s', author, re.U) != None: - temp = re.split(u'\s[a|u]nd\s|\s&\s',author) + temp = re.split(u'\s[a|u]nd\s|\s&\s', author) for temp_temp in temp: temp_temp = temp_temp.strip() authors.append(temp_temp) elif (len(author) > 2): authors.append(author) if not authors: - # Add "Author unknown" (can be translated). - authors.append((unicode(translate('SongsPlugin.XML', - 'Author unknown')))) + authors.append(SongStrings.AuthorUnknownUnT) for display_name in authors: author = self.manager.get_object_filtered(Author, Author.display_name == display_name) @@ -415,18 +414,18 @@ class FoilPresenter(object): search_text = u'' temp_verse_order = {} temp_verse_order_backup = [] - temp_verse_sort= [] + temp_verse_sort = [] temp_sortnr_backup = 1 temp_sortnr_liste = [] - versenumber = {u"V":1, u"C": 1, u"B": 1, u"E": 1, u"O": 1, u"I": 1, - u"P": 1 } + versenumber = {u'V': 1, u'C': 1, u'B': 1, u'E': 1, u'O': 1, u'I': 1, + u'P': 1 } for strophe in foilpresenterfolie.strophen.strophe: text = self._child(strophe.text_) verse_name = self._child(strophe.key) children = strophe.getchildren() sortnr = 0 for child in children: - if child.tag == "sortnr": + if child.tag == 'sortnr': verse_sortnr = self._child(strophe.sortnr) sortnr = 1 # In older Version there is no sortnr, but we need one @@ -437,26 +436,26 @@ class FoilPresenter(object): temp_sortnr_liste.append(verse_sortnr) temp_verse_name = re.compile(u'[0-9].*').sub(u'', verse_name) temp_verse_name = temp_verse_name[:3].lower() - if temp_verse_name == u"ref": + if temp_verse_name == u'ref': verse_type = u'C' - elif temp_verse_name == u"r": + elif temp_verse_name == u'r': verse_type = u'C' - elif temp_verse_name == u"": + elif temp_verse_name == u'': verse_type = u'V' - elif temp_verse_name == u"v": + elif temp_verse_name == u'v': verse_type = u'V' - elif temp_verse_name == u"bri": + elif temp_verse_name == u'bri': verse_type = u'B' - elif temp_verse_name == u"cod": + elif temp_verse_name == u'cod': verse_type = u'E' - elif temp_verse_name == u"sch": + elif temp_verse_name == u'sch': verse_type = u'E' - elif temp_verse_name == u"pre": + elif temp_verse_name == u'pre': verse_type = u'P' - elif temp_verse_name == u"int": + elif temp_verse_name == u'int': verse_type = u'I' else: - verse_type = u"O" + verse_type = u'O' verse_number = re.compile(u'[a-zA-Z.+-_ ]*').sub(u'', verse_name) verse_part = re.compile(u'[0-9]*').sub(u'', verse_name[1:]) # Foilpresenter allows e. g. "C", but we need "C1". From fb120858e01f25822fd636d5d8f2af22fc15849f Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 21 Feb 2011 22:10:08 +0000 Subject: [PATCH 208/243] Cleanups --- openlp/core/ui/displaytagdialog.py | 5 +++-- openlp/core/ui/displaytagform.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/openlp/core/ui/displaytagdialog.py b/openlp/core/ui/displaytagdialog.py index edb8567cf..7e3d21856 100644 --- a/openlp/core/ui/displaytagdialog.py +++ b/openlp/core/ui/displaytagdialog.py @@ -26,7 +26,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import translate, build_icon +from openlp.core.lib import translate from openlp.core.lib.ui import UiStrings, create_accept_reject_button_box class Ui_DisplayTagDialog(object): @@ -134,7 +134,8 @@ class Ui_DisplayTagDialog(object): self.tagLabel.setText(translate('OpenLP.DisplayTagDialog', 'Tag')) self.startTagLabel.setText( translate('OpenLP.DisplayTagDialog', 'Start tag')) - self.endTagLabel.setText(translate('OpenLP.DisplayTagDialog', 'End tag')) + self.endTagLabel.setText( + translate('OpenLP.DisplayTagDialog', 'End tag')) self.deletePushButton.setText(UiStrings.Delete) self.defaultPushButton.setText( translate('OpenLP.DisplayTagDialog', 'Default')) diff --git a/openlp/core/ui/displaytagform.py b/openlp/core/ui/displaytagform.py index fa05c578a..82f475338 100644 --- a/openlp/core/ui/displaytagform.py +++ b/openlp/core/ui/displaytagform.py @@ -34,7 +34,7 @@ import cPickle from PyQt4 import QtCore, QtGui from openlp.core.lib import translate, DisplayTags -from openlp.core.lib.ui import UiStrings, critical_error_message_box +from openlp.core.lib.ui import critical_error_message_box from openlp.core.ui.displaytagdialog import Ui_DisplayTagDialog class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): From 4d1f1e933ebe11247c478eebbccc55aff76fd75f Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 21 Feb 2011 22:27:27 +0000 Subject: [PATCH 209/243] Make importer inits consistent --- openlp/plugins/songs/lib/oooimport.py | 4 ++-- openlp/plugins/songs/lib/openlyricsimport.py | 6 +++--- openlp/plugins/songs/lib/sofimport.py | 4 ++-- openlp/plugins/songs/lib/songbeamerimport.py | 9 +++------ openlp/plugins/songs/lib/songshowplusimport.py | 9 +++------ openlp/plugins/songs/lib/wowimport.py | 9 +++------ 6 files changed, 16 insertions(+), 25 deletions(-) diff --git a/openlp/plugins/songs/lib/oooimport.py b/openlp/plugins/songs/lib/oooimport.py index 863fec2b8..29ab60a22 100644 --- a/openlp/plugins/songs/lib/oooimport.py +++ b/openlp/plugins/songs/lib/oooimport.py @@ -50,12 +50,12 @@ class OooImport(SongImport): """ Import songs from Impress/Powerpoint docs using Impress """ - def __init__(self, master_manager, **kwargs): + def __init__(self, manager, **kwargs): """ Initialise the class. Requires a songmanager class which is passed to SongImport for writing song to disk """ - SongImport.__init__(self, master_manager, **kwargs) + SongImport.__init__(self, manager, **kwargs) self.document = None self.process_started = False diff --git a/openlp/plugins/songs/lib/openlyricsimport.py b/openlp/plugins/songs/lib/openlyricsimport.py index 0396335b8..6dcb62699 100644 --- a/openlp/plugins/songs/lib/openlyricsimport.py +++ b/openlp/plugins/songs/lib/openlyricsimport.py @@ -43,12 +43,12 @@ class OpenLyricsImport(SongImport): """ This provides the Openlyrics import. """ - def __init__(self, master_manager, **kwargs): + def __init__(self, manager, **kwargs): """ - Initialise the import. + Initialise the Open Lyrics importer. """ log.debug(u'initialise OpenLyricsImport') - SongImport.__init__(self, master_manager, **kwargs) + SongImport.__init__(self, manager, **kwargs) self.openLyrics = OpenLyrics(self.manager) def do_import(self): diff --git a/openlp/plugins/songs/lib/sofimport.py b/openlp/plugins/songs/lib/sofimport.py index cfb80caa3..3f329947e 100644 --- a/openlp/plugins/songs/lib/sofimport.py +++ b/openlp/plugins/songs/lib/sofimport.py @@ -66,12 +66,12 @@ class SofImport(OooImport): It attempts to detect italiced verses, and treats these as choruses in the verse ordering. Again not perfect, but a start. """ - def __init__(self, master_manager, **kwargs): + def __init__(self, manager, **kwargs): """ Initialise the class. Requires a songmanager class which is passed to SongImport for writing song to disk """ - OooImport.__init__(self, master_manager, **kwargs) + OooImport.__init__(self, manager, **kwargs) def process_ooo_document(self): """ diff --git a/openlp/plugins/songs/lib/songbeamerimport.py b/openlp/plugins/songs/lib/songbeamerimport.py index afb9f5646..ccae6a8ea 100644 --- a/openlp/plugins/songs/lib/songbeamerimport.py +++ b/openlp/plugins/songs/lib/songbeamerimport.py @@ -67,14 +67,11 @@ class SongBeamerImport(SongImport): Song Beamer file format is text based in the beginning are one or more control tags written """ - def __init__(self, master_manager, **kwargs): + def __init__(self, manager, **kwargs): """ - Initialise the import. - - ``master_manager`` - The song manager for the running OpenLP installation. + Initialise the Song Beamer importer. """ - SongImport.__init__(self, master_manager, **kwargs) + SongImport.__init__(self, manager, **kwargs) def do_import(self): """ diff --git a/openlp/plugins/songs/lib/songshowplusimport.py b/openlp/plugins/songs/lib/songshowplusimport.py index 74040bcc0..757138966 100644 --- a/openlp/plugins/songs/lib/songshowplusimport.py +++ b/openlp/plugins/songs/lib/songshowplusimport.py @@ -86,14 +86,11 @@ class SongShowPlusImport(SongImport): otherList = {} otherCount = 0 - def __init__(self, master_manager, **kwargs): + def __init__(self, manager, **kwargs): """ - Initialise the import. - - ``master_manager`` - The song manager for the running OpenLP installation. + Initialise the SongShow Plus importer. """ - SongImport.__init__(self, master_manager, **kwargs) + SongImport.__init__(self, manager, **kwargs) def do_import(self): """ diff --git a/openlp/plugins/songs/lib/wowimport.py b/openlp/plugins/songs/lib/wowimport.py index 05c9704f6..5f5f4f289 100644 --- a/openlp/plugins/songs/lib/wowimport.py +++ b/openlp/plugins/songs/lib/wowimport.py @@ -92,14 +92,11 @@ class WowImport(SongImport): * .wow-song """ - def __init__(self, master_manager, **kwargs): + def __init__(self, manager, **kwargs): """ - Initialise the import. - - ``master_manager`` - The song manager for the running OpenLP installation. + Initialise the Words of Worship importer. """ - SongImport.__init__(self, master_manager, **kwargs) + SongImport.__init__(self, manager, **kwargs) def do_import(self): """ From 44a50b035177d10eead3132626ff279fce2d5072 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Tue, 22 Feb 2011 02:30:38 +0000 Subject: [PATCH 210/243] Naming --- openlp/plugins/bibles/lib/manager.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openlp/plugins/bibles/lib/manager.py b/openlp/plugins/bibles/lib/manager.py index 85204ac7a..e626462e0 100644 --- a/openlp/plugins/bibles/lib/manager.py +++ b/openlp/plugins/bibles/lib/manager.py @@ -40,9 +40,9 @@ from osis import OSISBible # Imports that might fail. try: from openlp1 import OpenLP1Bible - has_openlp1 = True + HAS_OPENLP1 = True except ImportError: - has_openlp1 = False + HAS_OPENLP1 = False log = logging.getLogger(__name__) @@ -367,6 +367,6 @@ class BibleManager(object): for bible in self.db_cache: self.db_cache[bible].finalise() -BibleFormat.set_availability(BibleFormat.OpenLP1, has_openlp1) +BibleFormat.set_availability(BibleFormat.OpenLP1, HAS_OPENLP1) __all__ = [u'BibleFormat'] From a5e8833132f1893069a76cf71d76da32b0af4c2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Tue, 22 Feb 2011 08:58:32 +0200 Subject: [PATCH 211/243] Remove bogus data. --- openlp/plugins/media/mediaplugin.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index 1514b6cb2..51cf1b9ad 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -47,8 +47,7 @@ class MediaPlugin(Plugin): self.dnd_id = u'Media' # This is yet a dummy example: self.additional_extensions = { - 'audio/msaudio': ['.mp3', '.aac'], - 'video/msvideo': ['.wmv', '.avi']} + 'video/msvideo': ['.avi']} # only an example line, unnecessary self.audio_extensions_list = [] self.video_extensions_list = [] mimetypes.init() From 29207d8dffe07417ae968e742928092be86dcf59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Tue, 22 Feb 2011 11:09:47 +0200 Subject: [PATCH 212/243] Added comments to code blocks. --- openlp/plugins/media/mediaplugin.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index 51cf1b9ad..d76df6897 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -45,9 +45,8 @@ class MediaPlugin(Plugin): self.icon = build_icon(self.icon_path) # passed with drag and drop messages self.dnd_id = u'Media' - # This is yet a dummy example: - self.additional_extensions = { - 'video/msvideo': ['.avi']} # only an example line, unnecessary + self.additional_extensions = {} + #'video/msvideo': ['.avi']} This is an example line. self.audio_extensions_list = [] self.video_extensions_list = [] mimetypes.init() @@ -59,6 +58,7 @@ class MediaPlugin(Plugin): self._addToList(self.video_extensions_list, mimetype) def _addToList(self, list, mimetype): + # Add all extensions which mimetypes provides us for supported types. extensions = mimetypes.guess_all_extensions(unicode(mimetype)) for extension in extensions: ext = u'*%s' % extension @@ -67,6 +67,8 @@ class MediaPlugin(Plugin): self.serviceManager.supportedSuffixes(extension[1:]) log.info(u'MediaPlugin: %s extensions: %s' % (mimetype, u' '.join(extensions))) + # Add all extensions listed in self.additional_extensions, to hack + # away mimetypes' shortcomings. if mimetype in self.additional_extensions.keys(): for extension in self.additional_extensions[mimetype]: ext = u'*%s' % extensions From 98d8b1f5902c481656ae9e6a850ad3f799403216 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Tue, 22 Feb 2011 17:01:07 +0200 Subject: [PATCH 213/243] More clear comment. Unfortunately there is no need to change few lines of code between these two changes, to include these into diff. That would be self-explanantory. --- openlp/plugins/media/mediaplugin.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index d76df6897..a92de5314 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -46,7 +46,7 @@ class MediaPlugin(Plugin): # passed with drag and drop messages self.dnd_id = u'Media' self.additional_extensions = {} - #'video/msvideo': ['.avi']} This is an example line. + # 'video/msvideo': ['.avi']} This is an example line. self.audio_extensions_list = [] self.video_extensions_list = [] mimetypes.init() @@ -67,8 +67,9 @@ class MediaPlugin(Plugin): self.serviceManager.supportedSuffixes(extension[1:]) log.info(u'MediaPlugin: %s extensions: %s' % (mimetype, u' '.join(extensions))) - # Add all extensions listed in self.additional_extensions, to hack - # away mimetypes' shortcomings. + # Add all extensions listed in self.additional_extensions, which + # have this mimetype, previously claimed to be supported by Phonon, + # to hack away mimetypes' shortcomings in providing some extensions. if mimetype in self.additional_extensions.keys(): for extension in self.additional_extensions[mimetype]: ext = u'*%s' % extensions From 642934a999f7dfc8a0d0e272de3ad50782e51530 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Tue, 22 Feb 2011 20:41:35 +0200 Subject: [PATCH 214/243] Fixed a bug where the settings for the remotes plugin were not actually used. --- openlp/plugins/remotes/lib/httpserver.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/openlp/plugins/remotes/lib/httpserver.py b/openlp/plugins/remotes/lib/httpserver.py index 6ec9476a8..7ced66103 100644 --- a/openlp/plugins/remotes/lib/httpserver.py +++ b/openlp/plugins/remotes/lib/httpserver.py @@ -68,11 +68,13 @@ class HttpServer(object): """ log.debug(u'Start TCP server') port = QtCore.QSettings().value( - self.parent.settingsSection + u'/remote port', + self.parent.settingsSection + u'/port', QtCore.QVariant(4316)).toInt()[0] + address = QtCore.QSettings().value( + self.parent.settingsSection + u'/ip address', + QtCore.QVariant(u'0.0.0.0')).toString() self.server = QtNetwork.QTcpServer() - self.server.listen(QtNetwork.QHostAddress(QtNetwork.QHostAddress.Any), - port) + self.server.listen(QtNetwork.QHostAddress(address), port) QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'slidecontroller_live_changed'), self.slide_change) @@ -347,4 +349,4 @@ class HttpConnection(object): log.debug(u'close socket') self.socket.close() self.socket = None - self.parent.close_connection(self) \ No newline at end of file + self.parent.close_connection(self) From 71068d4eb65eb8d214d0e0f8df7ec6c711fa1fef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20K=C3=B6hler?= Date: Tue, 22 Feb 2011 21:35:18 +0100 Subject: [PATCH 215/243] fix inconsistant field names, refer now to the xml file --- .../plugins/songs/lib/foilpresenterimport.py | 91 +++++++++---------- 1 file changed, 44 insertions(+), 47 deletions(-) diff --git a/openlp/plugins/songs/lib/foilpresenterimport.py b/openlp/plugins/songs/lib/foilpresenterimport.py index 963561cb5..30c94303b 100644 --- a/openlp/plugins/songs/lib/foilpresenterimport.py +++ b/openlp/plugins/songs/lib/foilpresenterimport.py @@ -105,7 +105,7 @@ log = logging.getLogger(__name__) class FoilPresenterImport(SongImport): """ - This provides the Openlyrics import. + This provides the Foilpresenter import. """ def __init__(self, master_manager, **kwargs): """ @@ -263,37 +263,37 @@ class FoilPresenter(object): strings = [] author_temp = [] if copyright.find(u'Copyright') != -1: - test = copyright.partition(u'Copyright') - copyright = test[0] + temp = copyright.partition(u'Copyright') + copyright = temp[0] elif copyright.find(u'copyright') != -1: - test = copyright.partition(u'copyright') - copyright = test[0] + temp = copyright.partition(u'copyright') + copyright = temp[0] elif copyright.find(u'©') != -1: - test = copyright.partition(u'©') - copyright = test[0] + temp = copyright.partition(u'©') + copyright = temp[0] elif copyright.find(u'(c)') != -1: - test = copyright.partition(u'(c)') - copyright = test[0] + temp = copyright.partition(u'(c)') + copyright = temp[0] elif copyright.find(u'(C)') != -1: - test = copyright.partition(u'(C)') - copyright = test[0] + temp = copyright.partition(u'(C)') + copyright = temp[0] elif copyright.find(u'c)') != -1: - test = copyright.partition(u'c)') - copyright = test[0] + temp = copyright.partition(u'c)') + copyright = temp[0] elif copyright.find(u'C)') != -1: - test = copyright.partition(u'C)') - copyright = test[0] + temp = copyright.partition(u'C)') + copyright = temp[0] elif copyright.find(u'C:') != -1: - test = copyright.partition(u'C:') - copyright = test[0] + temp = copyright.partition(u'C:') + copyright = temp[0] elif copyright.find(u'C,)') != -1: - test = copyright.partition(u'C,)') - copyright = test[0] + temp = copyright.partition(u'C,)') + copyright = temp[0] copyright = re.compile(u'\\n').sub(u' ', copyright) copyright = re.compile(u'\(.*\)').sub(u'', copyright) if copyright.find(u'Rechte') != -1: - test = copyright.partition(u'Rechte') - copyright = test[0] + temp = copyright.partition(u'Rechte') + copyright = temp[0] markers = [u'Text +u\.?n?d? +Melodie[a-zA-Z0-9\,\. ]*:', u'Text +u\.?n?d? +Musik', u'T & M', u'Melodie und Satz', u'Text[a-zA-Z0-9\,\. ]*:', u'Melodie', u'Musik', u'Satz', @@ -306,10 +306,10 @@ class FoilPresenter(object): x = 0 while i != 1: if copyright.find(u'') != -1: - test = copyright.partition(u'') - if (test[0].strip() != u'') & (x > 0): - strings.append(test[0]) - copyright = test[2] + temp = copyright.partition(u'') + if (temp[0].strip() != u'') & (x > 0): + strings.append(temp[0]) + copyright = temp[2] x += 1 elif x > 0: strings.append(copyright) @@ -317,10 +317,10 @@ class FoilPresenter(object): else: i = 1 for author in strings: - test = re.split(u',(?=\D{2})|(?<=\D),|\/(?=\D{3,})|(?<=\D);', + temp = re.split(u',(?=\D{2})|(?<=\D),|\/(?=\D{3,})|(?<=\D);', author) - for test_temp in test: - author_temp.append(test_temp) + for tempx in temp: + author_temp.append(tempx) for author in author_temp: regex = u'^[\/,;\-\s]+|[\/,;\-\s]+$|'\ '\s*[0-9]{4}\s*[\-\/]?\s*([0-9]{4})?[\/,;\-\s]*$' @@ -334,9 +334,9 @@ class FoilPresenter(object): u'\w+\.?\s+\w{3,}\s+[a|u]nd\s|\w+\.?\s+\w{3,}\s+&\s', author, re.U) != None: temp = re.split(u'\s[a|u]nd\s|\s&\s', author) - for temp_temp in temp: - temp_temp = temp_temp.strip() - authors.append(temp_temp) + for tempx in temp: + tempx = tempx.strip() + authors.append(tempx) elif (len(author) > 2): authors.append(author) if not authors: @@ -347,8 +347,8 @@ class FoilPresenter(object): if author is None: # We need to create a new author, as the author does not exist. author = Author.populate(display_name=display_name, - last_name=display_name.split(u' ')[-1], - first_name=u' '.join(display_name.split(u' ')[:-1])) + last_name = display_name.split(u' ')[-1], + first_name = u' '.join(display_name.split(u' ')[:-1])) self.manager.save_object(author) song.authors.append(author) @@ -404,9 +404,6 @@ class FoilPresenter(object): ``foilpresenterfolie`` The foilpresenterfolie object (lxml.objectify.ObjectifiedElement). - ``lyrics`` - The lyrics object (lxml.objectify.ObjectifiedElement). - ``song`` The song object. """ @@ -418,14 +415,14 @@ class FoilPresenter(object): temp_sortnr_backup = 1 temp_sortnr_liste = [] versenumber = {u'V': 1, u'C': 1, u'B': 1, u'E': 1, u'O': 1, u'I': 1, - u'P': 1 } + u'P': 1} for strophe in foilpresenterfolie.strophen.strophe: text = self._child(strophe.text_) verse_name = self._child(strophe.key) children = strophe.getchildren() sortnr = 0 for child in children: - if child.tag == 'sortnr': + if child.tag == u'sortnr': verse_sortnr = self._child(strophe.sortnr) sortnr = 1 # In older Version there is no sortnr, but we need one @@ -506,8 +503,8 @@ class FoilPresenter(object): song.song_book_id = 0 song.song_number = u'' try: - for songbook in foilpresenterfolie.buch.bucheintrag: - bookname = self._child(songbook.name) + for bucheintrag in foilpresenterfolie.buch.bucheintrag: + bookname = self._child(bucheintrag.name) if bookname: book = self.manager.get_object_filtered(Book, Book.name == bookname) @@ -517,8 +514,8 @@ class FoilPresenter(object): self.manager.save_object(book) song.song_book_id = book.id try: - if self._child(songbook.nummer): - song.song_number = self._child(songbook.nummer) + if self._child(bucheintrag.nummer): + song.song_number = self._child(bucheintrag.nummer) except AttributeError: pass # We only support one song book, so take the first one. @@ -536,13 +533,13 @@ class FoilPresenter(object): ``song`` The song object. """ - for title in foilpresenterfolie.titel.titelstring: + for titelstring in foilpresenterfolie.titel.titelstring: if not song.title: - song.title = self._child(title) + song.title = self._child(titelstring) song.search_title = unicode(song.title) song.alternate_title = u'' else: - song.alternate_title = self._child(title) + song.alternate_title = self._child(titelstring) song.search_title += u'@' + song.alternate_title song.search_title = re.sub(r'[\'"`,;:(){}?]+', u'', unicode(song.search_title)).lower() @@ -558,8 +555,8 @@ class FoilPresenter(object): The song object. """ try: - for topictext in foilpresenterfolie.kategorien.name: - topictext = self._child(topictext) + for name in foilpresenterfolie.kategorien.name: + topictext = self._child(name) if topictext: topic = self.manager.get_object_filtered(Topic, Topic.name == topictext) From 9f9720e3682fa6cdc2aa4a78dbdc6313e42e2868 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Tue, 22 Feb 2011 23:32:07 +0200 Subject: [PATCH 216/243] Added some extensions. --- openlp/plugins/media/mediaplugin.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index a92de5314..08d21e6ce 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -45,8 +45,16 @@ class MediaPlugin(Plugin): self.icon = build_icon(self.icon_path) # passed with drag and drop messages self.dnd_id = u'Media' - self.additional_extensions = {} - # 'video/msvideo': ['.avi']} This is an example line. + self.additional_extensions = { + u'audio/ac3': [u'.ac3'], + u'audio/qcelp': [u'.qcp'], + u'audio/riff-midi': [u'.rmi'], + u'audio/x-alaw': [u'.alaw'], + u'audio/x-m4a': [u'.m4a'], + u'audio/x-mp3': [u'.mp3'], + u'audio/x-wma': [u'.wma'], + u'video/x-wmv': [u'.wmv'], + u'video/x-xvid': [u'.xvid']} self.audio_extensions_list = [] self.video_extensions_list = [] mimetypes.init() @@ -65,7 +73,7 @@ class MediaPlugin(Plugin): if ext not in list: list.append(ext) self.serviceManager.supportedSuffixes(extension[1:]) - log.info(u'MediaPlugin: %s extensions: %s' % (mimetype, + log.info(u'MediaPlugin: %s extensions: %s' % (mimetype, u' '.join(extensions))) # Add all extensions listed in self.additional_extensions, which # have this mimetype, previously claimed to be supported by Phonon, @@ -76,7 +84,7 @@ class MediaPlugin(Plugin): if ext not in list: list.append(ext) self.serviceManager.supportedSuffixes(extension[1:]) - log.info(u'MediaPlugin: %s additional extensions: %s' % (mimetype, + log.info(u'MediaPlugin: %s additional extensions: %s' % (mimetype, u' '.join(self.additional_extensions[mimetype]))) def about(self): From 158b358bae2ae16b96782847ea0e183249ca981a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20P=C3=B5ldaru?= Date: Tue, 22 Feb 2011 23:35:25 +0200 Subject: [PATCH 217/243] Removed hack, leave only more detailed logging. --- openlp/plugins/media/mediaplugin.py | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index 08d21e6ce..74a8f3f2e 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -45,16 +45,6 @@ class MediaPlugin(Plugin): self.icon = build_icon(self.icon_path) # passed with drag and drop messages self.dnd_id = u'Media' - self.additional_extensions = { - u'audio/ac3': [u'.ac3'], - u'audio/qcelp': [u'.qcp'], - u'audio/riff-midi': [u'.rmi'], - u'audio/x-alaw': [u'.alaw'], - u'audio/x-m4a': [u'.m4a'], - u'audio/x-mp3': [u'.mp3'], - u'audio/x-wma': [u'.wma'], - u'video/x-wmv': [u'.wmv'], - u'video/x-xvid': [u'.xvid']} self.audio_extensions_list = [] self.video_extensions_list = [] mimetypes.init() @@ -75,17 +65,6 @@ class MediaPlugin(Plugin): self.serviceManager.supportedSuffixes(extension[1:]) log.info(u'MediaPlugin: %s extensions: %s' % (mimetype, u' '.join(extensions))) - # Add all extensions listed in self.additional_extensions, which - # have this mimetype, previously claimed to be supported by Phonon, - # to hack away mimetypes' shortcomings in providing some extensions. - if mimetype in self.additional_extensions.keys(): - for extension in self.additional_extensions[mimetype]: - ext = u'*%s' % extensions - if ext not in list: - list.append(ext) - self.serviceManager.supportedSuffixes(extension[1:]) - log.info(u'MediaPlugin: %s additional extensions: %s' % (mimetype, - u' '.join(self.additional_extensions[mimetype]))) def about(self): about_text = translate('MediaPlugin', 'Media Plugin' From a5b278b87129b65d7e1ab9d671e1806ee8588c7e Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Wed, 23 Feb 2011 08:42:33 +0200 Subject: [PATCH 218/243] Added a setting in the advanced tab to give the users the option of changing the default display screen. --- openlp/core/ui/advancedtab.py | 86 +++++++++++++++++++---------------- openlp/core/ui/maindisplay.py | 12 ++++- 2 files changed, 56 insertions(+), 42 deletions(-) diff --git a/openlp/core/ui/advancedtab.py b/openlp/core/ui/advancedtab.py index 39fec1f9d..5395e59ef 100644 --- a/openlp/core/ui/advancedtab.py +++ b/openlp/core/ui/advancedtab.py @@ -41,6 +41,8 @@ class AdvancedTab(SettingsTab): Initialise the settings tab """ SettingsTab.__init__(self, u'Advanced') + self.default_image = u':/graphics/openlp-splash-screen.png' + self.default_color = u'#ffffff' def setupUi(self): """ @@ -81,33 +83,28 @@ class AdvancedTab(SettingsTab): self.hideMouseCheckBox.setObjectName(u'hideMouseCheckBox') self.hideMouseLayout.addWidget(self.hideMouseCheckBox) self.leftLayout.addWidget(self.hideMouseGroupBox) -# self.sharedDirGroupBox = QtGui.QGroupBox(self.leftColumn) -# self.sharedDirGroupBox.setObjectName(u'sharedDirGroupBox') -# self.sharedDirLayout = QtGui.QFormLayout(self.sharedDirGroupBox) -# self.sharedCheckBox = QtGui.QCheckBox(self.sharedDirGroupBox) -# self.sharedCheckBox.setObjectName(u'sharedCheckBox') -# self.sharedDirLayout.addRow(self.sharedCheckBox) -# self.sharedLabel = QtGui.QLabel(self.sharedDirGroupBox) -# self.sharedLabel.setObjectName(u'sharedLabel') -# self.sharedSubLayout = QtGui.QHBoxLayout() -# self.sharedSubLayout.setObjectName(u'sharedSubLayout') -# self.sharedLineEdit = QtGui.QLineEdit(self.sharedDirGroupBox) -# self.sharedLineEdit.setObjectName(u'sharedLineEdit') -# self.sharedSubLayout.addWidget(self.sharedLineEdit) -# self.sharedPushButton = QtGui.QPushButton(self.sharedDirGroupBox) -# self.sharedPushButton.setObjectName(u'sharedPushButton') -# self.sharedSubLayout.addWidget(self.sharedPushButton) -# self.sharedDirLayout.addRow(self.sharedLabel, self.sharedSubLayout) -# self.leftLayout.addWidget(self.sharedDirGroupBox) self.leftLayout.addStretch() -# self.databaseGroupBox = QtGui.QGroupBox(self.rightColumn) -# self.databaseGroupBox.setObjectName(u'databaseGroupBox') -# self.databaseGroupBox.setEnabled(False) -# self.databaseLayout = QtGui.QVBoxLayout(self.databaseGroupBox) -# self.rightLayout.addWidget(self.databaseGroupBox) + self.defaultImageGroupBox = QtGui.QGroupBox(self.rightColumn) + self.defaultImageGroupBox.setObjectName(u'defaultImageGroupBox') + self.defaultImageLayout = QtGui.QFormLayout(self.defaultImageGroupBox) + self.defaultImageLayout.setObjectName(u'defaultImageLayout') + self.defaultColorLabel = QtGui.QLabel(self.defaultImageGroupBox) + self.defaultColorLabel.setObjectName(u'defaultColorLabel') + self.defaultColorButton = QtGui.QPushButton(self.defaultImageGroupBox) + self.defaultColorButton.setObjectName(u'defaultColorButton') + self.defaultImageLayout.addRow(self.defaultColorLabel, + self.defaultColorButton) + self.defaultFileLabel = QtGui.QLabel(self.defaultImageGroupBox) + self.defaultFileLabel.setObjectName(u'defaultFileLabel') + self.defaultFileEdit = QtGui.QLineEdit(self.defaultImageGroupBox) + self.defaultFileEdit.setObjectName(u'defaultFileEdit') + self.defaultImageLayout.addRow(self.defaultFileLabel, + self.defaultFileEdit) + self.rightLayout.addWidget(self.defaultImageGroupBox) self.rightLayout.addStretch() -# QtCore.QObject.connect(self.sharedCheckBox, -# QtCore.SIGNAL(u'stateChanged(int)'), self.onSharedCheckBoxChanged) + + QtCore.QObject.connect(self.defaultColorButton, + QtCore.SIGNAL(u'pressed()'), self.onDefaultColorButtonPressed) def retranslateUi(self): """ @@ -129,14 +126,13 @@ class AdvancedTab(SettingsTab): self.hideMouseGroupBox.setTitle(translate('OpenLP.AdvancedTab', 'Mouse Cursor')) self.hideMouseCheckBox.setText(translate('OpenLP.AdvancedTab', - 'Hide the mouse cursor when moved over the display window')) -# self.sharedDirGroupBox.setTitle( -# translate('AdvancedTab', 'Central Data Store')) -# self.sharedCheckBox.setText( -# translate('AdvancedTab', 'Enable a shared data location')) -# self.sharedLabel.setText(translate('AdvancedTab', 'Store location:')) -# self.sharedPushButton.setText(UiStrings.Browse) -# self.databaseGroupBox.setTitle(translate('AdvancedTab', 'Databases')) + 'Hide mouse cursor when over display window')) + self.defaultImageGroupBox.setTitle(translate('OpenLP.AdvancedTab', + 'Default Image')) + self.defaultColorLabel.setText(translate('OpenLP.AdvancedTab', + 'Background color:')) + self.defaultFileLabel.setText(translate('OpenLP.AdvancedTab', + 'Image file:')) def load(self): """ @@ -165,7 +161,14 @@ class AdvancedTab(SettingsTab): QtCore.QVariant(True)).toBool()) self.hideMouseCheckBox.setChecked( settings.value(u'hide mouse', QtCore.QVariant(False)).toBool()) + self.default_color = settings.value(u'default color', + QtCore.QVariant(u'#ffffff')).toString() + self.defaultFileEdit.setText(settings.value(u'default image', + QtCore.QVariant(u':/graphics/openlp-splash-screen.png'))\ + .toString()) settings.endGroup() + self.defaultColorButton.setStyleSheet( + u'background-color: %s' % self.default_color) def save(self): """ @@ -185,12 +188,15 @@ class AdvancedTab(SettingsTab): QtCore.QVariant(self.enableAutoCloseCheckBox.isChecked())) settings.setValue(u'hide mouse', QtCore.QVariant(self.hideMouseCheckBox.isChecked())) + settings.setValue(u'default background color', self.default_color) + settings.setValue(u'default image', self.default_image) settings.endGroup() -# def onSharedCheckBoxChanged(self, checked): -# """ -# Enables the widgets to allow a shared data location -# """ -# self.sharedLabel.setEnabled(checked) -# self.sharedTextEdit.setEnabled(checked) -# self.sharedPushButton.setEnabled(checked) + def onDefaultColorButtonPressed(self): + new_color = QtGui.QColorDialog.getColor( + QtGui.QColor(self.default_color), self) + if new_color.isValid(): + self.default_color = new_color.name() + self.defaultColorButton.setStyleSheet( + u'background-color: %s' % self.default_color) + diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 90042f80b..91d61f1d7 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -132,14 +132,22 @@ class MainDisplay(DisplayWidget): painter_image.begin(self.black) painter_image.fillRect(self.black.rect(), QtCore.Qt.black) # Build the initial frame. + image_file = QtCore.QSettings().value(u'advanced/default image', + QtCore.QVariant(u':/graphics/openlp-splash-screen.png'))\ + .toString() + background_color = QtGui.QColor(QtCore.QSettings().value( + u'advanced/default color', + QtCore.QVariant(u'#ffffff')).toString()) + if not background_color.isValid(): + background_color = QtCore.Qt.white + splash_image = QtGui.QImage(image_file) initialFrame = QtGui.QImage( self.screens.current[u'size'].width(), self.screens.current[u'size'].height(), QtGui.QImage.Format_ARGB32_Premultiplied) - splash_image = QtGui.QImage(u':/graphics/openlp-splash-screen.png') painter_image = QtGui.QPainter() painter_image.begin(initialFrame) - painter_image.fillRect(initialFrame.rect(), QtCore.Qt.white) + painter_image.fillRect(initialFrame.rect(), background_color) painter_image.drawImage( (self.screens.current[u'size'].width() - splash_image.width()) / 2, From 99635299ead388ddd99b3a363564e41fc1d0cc5d Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Wed, 23 Feb 2011 15:55:36 +0200 Subject: [PATCH 219/243] Updated with browse button. --- openlp/core/ui/advancedtab.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/openlp/core/ui/advancedtab.py b/openlp/core/ui/advancedtab.py index 5395e59ef..35bc167c0 100644 --- a/openlp/core/ui/advancedtab.py +++ b/openlp/core/ui/advancedtab.py @@ -98,8 +98,14 @@ class AdvancedTab(SettingsTab): self.defaultFileLabel.setObjectName(u'defaultFileLabel') self.defaultFileEdit = QtGui.QLineEdit(self.defaultImageGroupBox) self.defaultFileEdit.setObjectName(u'defaultFileEdit') + self.defaultBrowseButton = QtGui.QToolButton(self.defaultImageGroupBox) + self.defaultBrowseButton.setObjectName(u'defaultBrowseButton') + self.defaultFileLayout = QtGui.QHBoxLayout() + self.defaultFileLayout.setObjectName(u'defaultFileLayout') + self.defaultFileLayout.addWidget(self.defaultFileEdit) + self.defaultFileLayout.addWidget(self.defaultBrowseButton) self.defaultImageLayout.addRow(self.defaultFileLabel, - self.defaultFileEdit) + self.defaultFileLayout) self.rightLayout.addWidget(self.defaultImageGroupBox) self.rightLayout.addStretch() @@ -133,6 +139,7 @@ class AdvancedTab(SettingsTab): 'Background color:')) self.defaultFileLabel.setText(translate('OpenLP.AdvancedTab', 'Image file:')) + self.defaultBrowseButton.setTitle('...') def load(self): """ From de584a8945e02f73d1a52c950caa8306912b15c1 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Wed, 23 Feb 2011 18:35:27 +0100 Subject: [PATCH 220/243] reworked author unknown --- openlp/plugins/songs/lib/songimport.py | 13 ++++++++++--- openlp/plugins/songs/lib/ui.py | 3 +-- openlp/plugins/songs/lib/xml.py | 11 ++++++++--- openlp/plugins/songs/songsplugin.py | 5 ++--- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index 40be1675e..a8ca5d7b3 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -270,8 +270,6 @@ class SongImport(QtCore.QObject): """ All fields have been set to this song. Write the song to disk. """ - if not self.authors: - self.authors.append(SongStrings.AuthorUnknownUnT) log.info(u'committing song %s to database', self.title) song = Song() song.title = self.title @@ -315,10 +313,19 @@ class SongImport(QtCore.QObject): author = self.manager.get_object_filtered(Author, Author.display_name == authortext) if not author: - author = Author.populate(display_name = authortext, + author = Author.populate(display_name=authortext, last_name=authortext.split(u' ')[-1], first_name=u' '.join(authortext.split(u' ')[:-1])) song.authors.append(author) + # No author, add the default author. + if not song.authors: + name = SongStrings.AuthorUnknown + author = self.manager.get_object_filtered( + Author, Author.display_name == name) + if not author: + author = Author.populate( + display_name=name, last_name=u'', first_name=u'') + song.authors.append(author) for filename in self.media_files: media_file = self.manager.get_object_filtered(MediaFile, MediaFile.file_name == filename) diff --git a/openlp/plugins/songs/lib/ui.py b/openlp/plugins/songs/lib/ui.py index 65f473e63..6415c48c9 100644 --- a/openlp/plugins/songs/lib/ui.py +++ b/openlp/plugins/songs/lib/ui.py @@ -36,8 +36,7 @@ class SongStrings(object): # These strings should need a good reason to be retranslated elsewhere. Author = translate('OpenLP.Ui', 'Author', 'Singular') Authors = translate('OpenLP.Ui', 'Authors', 'Plural') - AuthorUnknown = translate('OpenLP.Ui', 'Author Unknown') # Used in the UI. - AuthorUnknownUnT = u'Author Unknown' # Used to populate the database. + AuthorUnknown = u'Author Unknown' # Used to populate the database. CopyrightSymbol = translate('OpenLP.Ui', '\xa9', 'Copyright symbol.') SongBook = translate('OpenLP.Ui', 'Song Book', 'Singular') SongBooks = translate('OpenLP.Ui', 'Song Books', 'Plural') diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index a552a42a1..2aa51c99e 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -374,8 +374,6 @@ class OpenLyrics(object): display_name = self._text(author) if display_name: authors.append(display_name) - if not authors: - authors.append(SongStrings.AuthorUnknownUnT) for display_name in authors: author = self.manager.get_object_filtered(Author, Author.display_name == display_name) @@ -384,7 +382,14 @@ class OpenLyrics(object): author = Author.populate(display_name=display_name, last_name=display_name.split(u' ')[-1], first_name=u' '.join(display_name.split(u' ')[:-1])) - self.manager.save_object(author) + # The song does not have an author, add a default author. + if not song.authors: + name = SongStrings.AuthorUnknown + author = self.manager.get_object_filtered( + Author, Author.display_name == name) + if author is None: + author = Author.populate( + display_name=name, last_name=u'', first_name=u'') song.authors.append(author) def _process_cclinumber(self, properties, song): diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 3800d00dc..1932a8384 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -148,13 +148,12 @@ class SongsPlugin(Plugin): counter += 1 # The song does not have any author, add one. if not song.authors: - name = unicode(SongStrings.AuthorUnknownUnT) + name = SongStrings.AuthorUnknown author = self.manager.get_object_filtered(Author, Author.display_name == name) if author is None: author = Author.populate( - first_name=u' '.join(name.split(u' ', 1)[:-1]), - last_name=name.split(u' ', 1)[-1], display_name=name) + display_name=name, last_name=u'', first_name=u'') song.authors.append(author) if song.title is None: song.title = u'' From b4b6fef70a2e107c024f360f736f429412409a1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20K=C3=B6hler?= Date: Wed, 23 Feb 2011 20:48:37 +0100 Subject: [PATCH 221/243] change value to True/False --- openlp/plugins/songs/lib/foilpresenterimport.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openlp/plugins/songs/lib/foilpresenterimport.py b/openlp/plugins/songs/lib/foilpresenterimport.py index 30c94303b..2eded332f 100644 --- a/openlp/plugins/songs/lib/foilpresenterimport.py +++ b/openlp/plugins/songs/lib/foilpresenterimport.py @@ -420,13 +420,13 @@ class FoilPresenter(object): text = self._child(strophe.text_) verse_name = self._child(strophe.key) children = strophe.getchildren() - sortnr = 0 + sortnr = False for child in children: if child.tag == u'sortnr': verse_sortnr = self._child(strophe.sortnr) - sortnr = 1 + sortnr = True # In older Version there is no sortnr, but we need one - if sortnr == 0: + if sortnr == False: verse_sortnr = unicode(temp_sortnr_backup) temp_sortnr_backup += 1 # Foilpresenter allows e. g. "Ref" or "1", but we need "C1" or "V1". From 1eea1c97a498068933ee33aa3ea04e03db0700ea Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Wed, 23 Feb 2011 21:22:29 +0100 Subject: [PATCH 222/243] moved code --- openlp/plugins/songs/lib/__init__.py | 21 ++++++++++++++++ openlp/plugins/songs/lib/olpimport.py | 33 +++++++++++++------------- openlp/plugins/songs/lib/songimport.py | 10 ++------ openlp/plugins/songs/lib/xml.py | 11 ++------- openlp/plugins/songs/songsplugin.py | 14 ++++------- 5 files changed, 45 insertions(+), 44 deletions(-) diff --git a/openlp/plugins/songs/lib/__init__.py b/openlp/plugins/songs/lib/__init__.py index 95fae92a8..0396122f5 100644 --- a/openlp/plugins/songs/lib/__init__.py +++ b/openlp/plugins/songs/lib/__init__.py @@ -25,7 +25,10 @@ ############################################################################### from PyQt4 import QtGui + from openlp.core.lib import translate +from db import Author +from ui import SongStrings class VerseType(object): """ @@ -241,6 +244,24 @@ def retrieve_windows_encoding(recommendation=None): return None return filter(lambda item: item[1] == choice[0], encodings)[0][0] +def add_author_unknown(manager, song): + """ + Add the default author *Author Unknown* to the song. + + ``manager`` + The song's manager. + + ``song`` + The song object. + """ + name = SongStrings.AuthorUnknown + author = manager.get_object_filtered(Author, Author.display_name == name) + if author is None: + author = Author.populate( + display_name=name, last_name=u'', first_name=u'') + song.authors.append(author) + from xml import OpenLyrics, SongXML from songstab import SongsTab from mediaitem import SongMediaItem + diff --git a/openlp/plugins/songs/lib/olpimport.py b/openlp/plugins/songs/lib/olpimport.py index b3f03b951..fba518772 100644 --- a/openlp/plugins/songs/lib/olpimport.py +++ b/openlp/plugins/songs/lib/olpimport.py @@ -36,6 +36,7 @@ from sqlalchemy.orm.exc import UnmappedClassError from openlp.core.lib import translate from openlp.core.lib.db import BaseModel +from openlp.plugins.songs.lib import add_author_unknown from openlp.plugins.songs.lib.db import Author, Book, Song, Topic #, MediaFile from songimport import SongImport @@ -47,30 +48,35 @@ class OldAuthor(BaseModel): """ pass + class OldBook(BaseModel): """ Book model """ pass + class OldMediaFile(BaseModel): """ MediaFile model """ pass + class OldSong(BaseModel): """ Song model """ pass + class OldTopic(BaseModel): """ Topic model """ pass + class OpenLPSongImport(SongImport): """ The :class:`OpenLPSongImport` class provides OpenLP with the ability to @@ -170,25 +176,18 @@ class OpenLPSongImport(SongImport): new_song.comments = song.comments new_song.theme_name = song.theme_name new_song.ccli_number = song.ccli_number - if song.authors: - for author in song.authors: - existing_author = self.manager.get_object_filtered( - Author, Author.display_name == author.display_name) - if existing_author: - new_song.authors.append(existing_author) - else: - new_song.authors.append(Author.populate( - first_name=author.first_name, - last_name=author.last_name, - display_name=author.display_name)) - else: - au = self.manager.get_object_filtered(Author, - Author.display_name == u'Author Unknown') - if au: - new_song.authors.append(au) + for author in song.authors: + existing_author = self.manager.get_object_filtered( + Author, Author.display_name == author.display_name) + if existing_author: + new_song.authors.append(existing_author) else: new_song.authors.append(Author.populate( - display_name=u'Author Unknown')) + first_name=author.first_name, + last_name=author.last_name, + display_name=author.display_name)) + if not new_song.authors: + add_author_unknown(self.manager, new_song) if song.book: existing_song_book = self.manager.get_object_filtered( Book, Book.name == song.book.name) diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index a8ca5d7b3..36f2e3504 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -29,7 +29,7 @@ import re from PyQt4 import QtCore from openlp.core.lib import Receiver, translate -from openlp.plugins.songs.lib import VerseType +from openlp.plugins.songs.lib import add_author_unknown, VerseType from openlp.plugins.songs.lib.db import Song, Author, Topic, Book, MediaFile from openlp.plugins.songs.lib.ui import SongStrings from openlp.plugins.songs.lib.xml import SongXML @@ -319,13 +319,7 @@ class SongImport(QtCore.QObject): song.authors.append(author) # No author, add the default author. if not song.authors: - name = SongStrings.AuthorUnknown - author = self.manager.get_object_filtered( - Author, Author.display_name == name) - if not author: - author = Author.populate( - display_name=name, last_name=u'', first_name=u'') - song.authors.append(author) + add_author_unknown(self.manager, song) for filename in self.media_files: media_file = self.manager.get_object_filtered(MediaFile, MediaFile.file_name == filename) diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index 2aa51c99e..8f5c35c0a 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -66,7 +66,7 @@ import re from lxml import etree, objectify -from openlp.plugins.songs.lib import VerseType +from openlp.plugins.songs.lib import add_author_unknown, VerseType from openlp.plugins.songs.lib.db import Author, Book, Song, Topic from openlp.plugins.songs.lib.ui import SongStrings @@ -382,15 +382,8 @@ class OpenLyrics(object): author = Author.populate(display_name=display_name, last_name=display_name.split(u' ')[-1], first_name=u' '.join(display_name.split(u' ')[:-1])) - # The song does not have an author, add a default author. if not song.authors: - name = SongStrings.AuthorUnknown - author = self.manager.get_object_filtered( - Author, Author.display_name == name) - if author is None: - author = Author.populate( - display_name=name, last_name=u'', first_name=u'') - song.authors.append(author) + add_author_unknown(self.manager, song) def _process_cclinumber(self, properties, song): """ diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 1932a8384..609c1990d 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -32,10 +32,10 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import Plugin, StringContent, build_icon, translate from openlp.core.lib.db import Manager from openlp.core.lib.ui import UiStrings -from openlp.plugins.songs.lib import SongMediaItem, SongsTab, SongXML -from openlp.plugins.songs.lib.db import Author, init_schema, Song +from openlp.plugins.songs.lib import add_author_unknown, SongMediaItem, \ + SongsTab, SongXML +from openlp.plugins.songs.lib.db import init_schema, Song from openlp.plugins.songs.lib.importer import SongFormat -from openlp.plugins.songs.lib.ui import SongStrings log = logging.getLogger(__name__) @@ -148,13 +148,7 @@ class SongsPlugin(Plugin): counter += 1 # The song does not have any author, add one. if not song.authors: - name = SongStrings.AuthorUnknown - author = self.manager.get_object_filtered(Author, - Author.display_name == name) - if author is None: - author = Author.populate( - display_name=name, last_name=u'', first_name=u'') - song.authors.append(author) + add_author_unknown(self.manager, song) if song.title is None: song.title = u'' if song.alternate_title is None: From 8661c6e38e5bae6db0b9d8c599c6d8a1791d520f Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Wed, 23 Feb 2011 21:28:25 +0100 Subject: [PATCH 223/243] removed line --- openlp/plugins/songs/lib/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/openlp/plugins/songs/lib/__init__.py b/openlp/plugins/songs/lib/__init__.py index 0396122f5..70a47a239 100644 --- a/openlp/plugins/songs/lib/__init__.py +++ b/openlp/plugins/songs/lib/__init__.py @@ -264,4 +264,3 @@ def add_author_unknown(manager, song): from xml import OpenLyrics, SongXML from songstab import SongsTab from mediaitem import SongMediaItem - From c74b2fc964fa34d9c8fe84e7db6b74d12da9452e Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Wed, 23 Feb 2011 22:55:55 +0200 Subject: [PATCH 224/243] Updated the settings tab. --- openlp/core/ui/advancedtab.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/openlp/core/ui/advancedtab.py b/openlp/core/ui/advancedtab.py index 35bc167c0..5cb22cb8b 100644 --- a/openlp/core/ui/advancedtab.py +++ b/openlp/core/ui/advancedtab.py @@ -28,8 +28,9 @@ The :mod:`advancedtab` provides an advanced settings facility. """ from PyQt4 import QtCore, QtGui -from openlp.core.lib import SettingsTab, translate +from openlp.core.lib import SettingsTab, translate, build_icon from openlp.core.lib.ui import UiStrings +from openlp.core.utils import get_images_filter class AdvancedTab(SettingsTab): """ @@ -100,6 +101,8 @@ class AdvancedTab(SettingsTab): self.defaultFileEdit.setObjectName(u'defaultFileEdit') self.defaultBrowseButton = QtGui.QToolButton(self.defaultImageGroupBox) self.defaultBrowseButton.setObjectName(u'defaultBrowseButton') + self.defaultBrowseButton.setIcon( + build_icon(u':/general/general_open.png')) self.defaultFileLayout = QtGui.QHBoxLayout() self.defaultFileLayout.setObjectName(u'defaultFileLayout') self.defaultFileLayout.addWidget(self.defaultFileEdit) @@ -111,6 +114,8 @@ class AdvancedTab(SettingsTab): QtCore.QObject.connect(self.defaultColorButton, QtCore.SIGNAL(u'pressed()'), self.onDefaultColorButtonPressed) + QtCore.QObject.connect(self.defaultBrowseButton, + QtCore.SIGNAL(u'pressed()'), self.onDefaultBrowseButtonPressed) def retranslateUi(self): """ @@ -139,7 +144,6 @@ class AdvancedTab(SettingsTab): 'Background color:')) self.defaultFileLabel.setText(translate('OpenLP.AdvancedTab', 'Image file:')) - self.defaultBrowseButton.setTitle('...') def load(self): """ @@ -195,8 +199,8 @@ class AdvancedTab(SettingsTab): QtCore.QVariant(self.enableAutoCloseCheckBox.isChecked())) settings.setValue(u'hide mouse', QtCore.QVariant(self.hideMouseCheckBox.isChecked())) - settings.setValue(u'default background color', self.default_color) - settings.setValue(u'default image', self.default_image) + settings.setValue(u'default color', self.default_color) + settings.setValue(u'default image', self.defaultFileEdit.text()) settings.endGroup() def onDefaultColorButtonPressed(self): @@ -207,3 +211,12 @@ class AdvancedTab(SettingsTab): self.defaultColorButton.setStyleSheet( u'background-color: %s' % self.default_color) + def onDefaultBrowseButtonPressed(self): + file_filters = u'%s;;%s (*.*) (*)' % (get_images_filter(), + UiStrings.AllFiles) + filename = QtGui.QFileDialog.getOpenFileName(self, + translate('OpenLP.AdvancedTab', 'Open File'), '', + file_filters) + if filename: + self.defaultFileEdit.setText(filename) + self.defaultFileEdit.setFocus() From cca1064e42b81bdc456a878dfa1d15d9eabd3a70 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 24 Feb 2011 00:11:58 +0000 Subject: [PATCH 225/243] Cleanups --- openlp/plugins/songs/lib/foilpresenterimport.py | 4 +--- openlp/plugins/songs/lib/xml.py | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/openlp/plugins/songs/lib/foilpresenterimport.py b/openlp/plugins/songs/lib/foilpresenterimport.py index 2eded332f..46cf038be 100644 --- a/openlp/plugins/songs/lib/foilpresenterimport.py +++ b/openlp/plugins/songs/lib/foilpresenterimport.py @@ -93,7 +93,6 @@ import os from lxml import etree, objectify -from openlp.core.lib import translate from openlp.core.ui.wizard import WizardStrings from openlp.plugins.songs.lib import VerseType from openlp.plugins.songs.lib.songimport import SongImport @@ -411,7 +410,6 @@ class FoilPresenter(object): search_text = u'' temp_verse_order = {} temp_verse_order_backup = [] - temp_verse_sort = [] temp_sortnr_backup = 1 temp_sortnr_liste = [] versenumber = {u'V': 1, u'C': 1, u'B': 1, u'E': 1, u'O': 1, u'I': 1, @@ -454,7 +452,7 @@ class FoilPresenter(object): else: verse_type = u'O' verse_number = re.compile(u'[a-zA-Z.+-_ ]*').sub(u'', verse_name) - verse_part = re.compile(u'[0-9]*').sub(u'', verse_name[1:]) + #verse_part = re.compile(u'[0-9]*').sub(u'', verse_name[1:]) # Foilpresenter allows e. g. "C", but we need "C1". if not verse_number: verse_number = unicode(versenumber[verse_type]) diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index 8f5c35c0a..f2cf4ac03 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -68,7 +68,6 @@ from lxml import etree, objectify from openlp.plugins.songs.lib import add_author_unknown, VerseType from openlp.plugins.songs.lib.db import Author, Book, Song, Topic -from openlp.plugins.songs.lib.ui import SongStrings log = logging.getLogger(__name__) From 3b31186114ba8d2a241f16f89868342795b5e7e5 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 24 Feb 2011 00:32:27 +0000 Subject: [PATCH 226/243] Complete song import init cleanup --- openlp/plugins/songs/lib/foilpresenterimport.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/songs/lib/foilpresenterimport.py b/openlp/plugins/songs/lib/foilpresenterimport.py index 46cf038be..97aac379e 100644 --- a/openlp/plugins/songs/lib/foilpresenterimport.py +++ b/openlp/plugins/songs/lib/foilpresenterimport.py @@ -106,12 +106,12 @@ class FoilPresenterImport(SongImport): """ This provides the Foilpresenter import. """ - def __init__(self, master_manager, **kwargs): + def __init__(self, manager, **kwargs): """ Initialise the import. """ log.debug(u'initialise FoilPresenterImport') - SongImport.__init__(self, master_manager, **kwargs) + SongImport.__init__(self, manager, **kwargs) self.FoilPresenter = FoilPresenter(self.manager) def do_import(self): From 5e2a7e1cde4bb76f567b920bf555d1e9b69072e5 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 24 Feb 2011 02:38:42 +0000 Subject: [PATCH 227/243] Fixes to foilpresenter author handling --- openlp/plugins/songs/lib/foilpresenterimport.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/songs/lib/foilpresenterimport.py b/openlp/plugins/songs/lib/foilpresenterimport.py index 97aac379e..3a6ae1764 100644 --- a/openlp/plugins/songs/lib/foilpresenterimport.py +++ b/openlp/plugins/songs/lib/foilpresenterimport.py @@ -339,7 +339,7 @@ class FoilPresenter(object): elif (len(author) > 2): authors.append(author) if not authors: - authors.append(SongStrings.AuthorUnknownUnT) + authors.append(SongStrings.AuthorUnknown) for display_name in authors: author = self.manager.get_object_filtered(Author, Author.display_name == display_name) @@ -348,7 +348,7 @@ class FoilPresenter(object): author = Author.populate(display_name=display_name, last_name = display_name.split(u' ')[-1], first_name = u' '.join(display_name.split(u' ')[:-1])) - self.manager.save_object(author) + self.manager.save_object(author) song.authors.append(author) def _process_cclinumber(self, foilpresenterfolie, song): From 780a87e840b1a7d923b27b9aa9f8f6f6ab78b755 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Thu, 24 Feb 2011 07:47:38 +0200 Subject: [PATCH 228/243] Updated copyright information. Removed .eric4project directory from version control. --- LICENSE | 14 ++-- copyright.txt | 6 +- openlp.pyw | 6 +- openlp/__init__.py | 8 +- openlp/core/__init__.py | 8 +- openlp/core/lib/__init__.py | 6 +- openlp/core/lib/db.py | 6 +- openlp/core/lib/displaytags.py | 6 +- openlp/core/lib/dockwidget.py | 6 +- openlp/core/lib/eventreceiver.py | 6 +- openlp/core/lib/htmlbuilder.py | 6 +- openlp/core/lib/imagemanager.py | 6 +- openlp/core/lib/listwidgetwithdnd.py | 6 +- openlp/core/lib/mediamanageritem.py | 6 +- openlp/core/lib/plugin.py | 6 +- openlp/core/lib/pluginmanager.py | 8 +- openlp/core/lib/renderer.py | 8 +- openlp/core/lib/rendermanager.py | 6 +- openlp/core/lib/searchedit.py | 6 +- openlp/core/lib/serviceitem.py | 6 +- openlp/core/lib/settingsmanager.py | 8 +- openlp/core/lib/settingstab.py | 6 +- openlp/core/lib/spelltextedit.py | 6 +- openlp/core/lib/theme.py | 6 +- openlp/core/lib/toolbar.py | 6 +- openlp/core/lib/ui.py | 6 +- openlp/core/theme/__init__.py | 8 +- openlp/core/theme/theme.py | 6 +- openlp/core/ui/__init__.py | 6 +- openlp/core/ui/aboutdialog.py | 6 +- openlp/core/ui/aboutform.py | 8 +- openlp/core/ui/advancedtab.py | 6 +- openlp/core/ui/displaytagdialog.py | 6 +- openlp/core/ui/displaytagform.py | 6 +- openlp/core/ui/exceptiondialog.py | 6 +- openlp/core/ui/exceptionform.py | 6 +- openlp/core/ui/filerenamedialog.py | 6 +- openlp/core/ui/filerenameform.py | 6 +- openlp/core/ui/generaltab.py | 6 +- openlp/core/ui/maindisplay.py | 6 +- openlp/core/ui/mainwindow.py | 6 +- openlp/core/ui/mediadockmanager.py | 8 +- openlp/core/ui/plugindialog.py | 6 +- openlp/core/ui/pluginform.py | 6 +- openlp/core/ui/printservicedialog.py | 6 +- openlp/core/ui/printserviceform.py | 6 +- openlp/core/ui/screen.py | 6 +- openlp/core/ui/serviceitemeditdialog.py | 6 +- openlp/core/ui/serviceitemeditform.py | 6 +- openlp/core/ui/servicemanager.py | 6 +- openlp/core/ui/servicenoteform.py | 8 +- openlp/core/ui/settingsdialog.py | 6 +- openlp/core/ui/settingsform.py | 6 +- openlp/core/ui/shortcutlistdialog.py | 8 +- openlp/core/ui/shortcutlistform.py | 6 +- openlp/core/ui/slidecontroller.py | 6 +- openlp/core/ui/splashscreen.py | 6 +- openlp/core/ui/starttimedialog.py | 6 +- openlp/core/ui/starttimeform.py | 6 +- openlp/core/ui/themeform.py | 6 +- openlp/core/ui/thememanager.py | 6 +- openlp/core/ui/themestab.py | 6 +- openlp/core/ui/themewizard.py | 6 +- openlp/core/ui/wizard.py | 6 +- openlp/core/utils/__init__.py | 8 +- openlp/core/utils/actions.py | 6 +- openlp/core/utils/languagemanager.py | 6 +- openlp/plugins/__init__.py | 8 +- openlp/plugins/alerts/__init__.py | 8 +- openlp/plugins/alerts/alertsplugin.py | 6 +- openlp/plugins/alerts/forms/__init__.py | 8 +- openlp/plugins/alerts/forms/alertdialog.py | 6 +- openlp/plugins/alerts/forms/alertform.py | 6 +- openlp/plugins/alerts/lib/__init__.py | 8 +- openlp/plugins/alerts/lib/alertsmanager.py | 6 +- openlp/plugins/alerts/lib/alertstab.py | 6 +- openlp/plugins/alerts/lib/db.py | 8 +- openlp/plugins/bibles/__init__.py | 8 +- openlp/plugins/bibles/bibleplugin.py | 6 +- openlp/plugins/bibles/forms/__init__.py | 8 +- .../plugins/bibles/forms/bibleimportform.py | 6 +- openlp/plugins/bibles/lib/__init__.py | 20 ++--- openlp/plugins/bibles/lib/biblestab.py | 6 +- openlp/plugins/bibles/lib/csvbible.py | 6 +- openlp/plugins/bibles/lib/db.py | 6 +- openlp/plugins/bibles/lib/http.py | 6 +- openlp/plugins/bibles/lib/manager.py | 6 +- openlp/plugins/bibles/lib/mediaitem.py | 6 +- openlp/plugins/bibles/lib/openlp1.py | 6 +- openlp/plugins/bibles/lib/opensong.py | 6 +- openlp/plugins/bibles/lib/osis.py | 6 +- openlp/plugins/custom/__init__.py | 8 +- openlp/plugins/custom/customplugin.py | 6 +- openlp/plugins/custom/forms/__init__.py | 8 +- .../plugins/custom/forms/editcustomdialog.py | 6 +- openlp/plugins/custom/forms/editcustomform.py | 6 +- .../custom/forms/editcustomslidedialog.py | 6 +- .../custom/forms/editcustomslideform.py | 6 +- openlp/plugins/custom/lib/__init__.py | 8 +- openlp/plugins/custom/lib/customtab.py | 6 +- openlp/plugins/custom/lib/customxmlhandler.py | 8 +- openlp/plugins/custom/lib/db.py | 8 +- openlp/plugins/custom/lib/mediaitem.py | 6 +- openlp/plugins/images/__init__.py | 8 +- openlp/plugins/images/imageplugin.py | 6 +- openlp/plugins/images/lib/__init__.py | 8 +- openlp/plugins/images/lib/mediaitem.py | 6 +- openlp/plugins/media/__init__.py | 8 +- openlp/plugins/media/lib/__init__.py | 8 +- openlp/plugins/media/lib/mediaitem.py | 8 +- openlp/plugins/media/lib/mediatab.py | 6 +- openlp/plugins/media/mediaplugin.py | 6 +- openlp/plugins/presentations/__init__.py | 8 +- openlp/plugins/presentations/lib/__init__.py | 8 +- .../presentations/lib/impresscontroller.py | 6 +- openlp/plugins/presentations/lib/mediaitem.py | 6 +- .../presentations/lib/messagelistener.py | 6 +- .../presentations/lib/powerpointcontroller.py | 6 +- .../presentations/lib/pptviewcontroller.py | 6 +- .../presentations/lib/pptviewlib/ppttest.py | 8 +- .../lib/presentationcontroller.py | 6 +- .../presentations/lib/presentationtab.py | 6 +- .../presentations/presentationplugin.py | 6 +- openlp/plugins/remotes/__init__.py | 8 +- openlp/plugins/remotes/lib/__init__.py | 8 +- openlp/plugins/remotes/lib/httpserver.py | 6 +- openlp/plugins/remotes/lib/remotetab.py | 6 +- openlp/plugins/remotes/remoteplugin.py | 6 +- openlp/plugins/songs/__init__.py | 8 +- openlp/plugins/songs/forms/__init__.py | 6 +- openlp/plugins/songs/forms/authorsdialog.py | 6 +- openlp/plugins/songs/forms/authorsform.py | 6 +- openlp/plugins/songs/forms/editsongdialog.py | 6 +- openlp/plugins/songs/forms/editsongform.py | 6 +- openlp/plugins/songs/forms/editversedialog.py | 6 +- openlp/plugins/songs/forms/editverseform.py | 6 +- openlp/plugins/songs/forms/songbookdialog.py | 6 +- openlp/plugins/songs/forms/songbookform.py | 6 +- openlp/plugins/songs/forms/songexportform.py | 6 +- openlp/plugins/songs/forms/songimportform.py | 6 +- .../songs/forms/songmaintenancedialog.py | 6 +- .../songs/forms/songmaintenanceform.py | 6 +- openlp/plugins/songs/forms/topicsdialog.py | 6 +- openlp/plugins/songs/forms/topicsform.py | 6 +- openlp/plugins/songs/lib/__init__.py | 6 +- openlp/plugins/songs/lib/cclifileimport.py | 6 +- openlp/plugins/songs/lib/db.py | 6 +- openlp/plugins/songs/lib/easislidesimport.py | 6 +- openlp/plugins/songs/lib/ewimport.py | 6 +- .../plugins/songs/lib/foilpresenterimport.py | 74 +++++++++---------- openlp/plugins/songs/lib/importer.py | 6 +- openlp/plugins/songs/lib/mediaitem.py | 6 +- openlp/plugins/songs/lib/olp1import.py | 6 +- openlp/plugins/songs/lib/olpimport.py | 6 +- openlp/plugins/songs/lib/oooimport.py | 6 +- openlp/plugins/songs/lib/openlyricsexport.py | 6 +- openlp/plugins/songs/lib/openlyricsimport.py | 8 +- openlp/plugins/songs/lib/opensongimport.py | 6 +- openlp/plugins/songs/lib/sofimport.py | 6 +- openlp/plugins/songs/lib/songbeamerimport.py | 6 +- openlp/plugins/songs/lib/songimport.py | 8 +- .../plugins/songs/lib/songshowplusimport.py | 6 +- openlp/plugins/songs/lib/songstab.py | 6 +- .../songs/lib/test/test_import_file.py | 10 +-- .../songs/lib/test/test_importing_lots.py | 26 +++++++ .../songs/lib/test/test_opensongimport.py | 10 +-- openlp/plugins/songs/lib/ui.py | 6 +- openlp/plugins/songs/lib/wowimport.py | 6 +- openlp/plugins/songs/lib/xml.py | 8 +- openlp/plugins/songs/songsplugin.py | 6 +- openlp/plugins/songusage/__init__.py | 8 +- openlp/plugins/songusage/forms/__init__.py | 8 +- .../songusage/forms/songusagedeletedialog.py | 6 +- .../songusage/forms/songusagedeleteform.py | 6 +- .../songusage/forms/songusagedetaildialog.py | 6 +- .../songusage/forms/songusagedetailform.py | 6 +- openlp/plugins/songusage/lib/__init__.py | 8 +- openlp/plugins/songusage/lib/db.py | 8 +- openlp/plugins/songusage/songusageplugin.py | 6 +- ...lugins.presentations.presentationplugin.py | 10 +-- resources/pyinstaller/hook-openlp.py | 10 +-- scripts/generate_resources.sh | 9 ++- scripts/openlp-remoteclient.py | 10 +-- scripts/resources.patch | 24 +++--- scripts/translation_utils.py | 10 +-- scripts/windows-builder.py | 10 +-- setup.py | 8 +- 187 files changed, 696 insertions(+), 669 deletions(-) diff --git a/LICENSE b/LICENSE index d511905c1..fd94e166f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,12 +1,12 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - Preamble + Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public @@ -56,7 +56,7 @@ patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. - GNU GENERAL PUBLIC LICENSE + GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains @@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. - NO WARRANTY + NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN @@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - END OF TERMS AND CONDITIONS + END OF TERMS AND CONDITIONS - How to Apply These Terms to Your New Programs + How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it diff --git a/copyright.txt b/copyright.txt index 6882a7282..0e405e6e9 100644 --- a/copyright.txt +++ b/copyright.txt @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp.pyw b/openlp.pyw index d425a0b37..85ba81fba 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -7,9 +7,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/__init__.py b/openlp/__init__.py index b88547df6..9c22aab8b 100644 --- a/openlp/__init__.py +++ b/openlp/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -25,4 +25,4 @@ ############################################################################### """ The :mod:`openlp` module contains all the project produced OpenLP functionality -""" \ No newline at end of file +""" diff --git a/openlp/core/__init__.py b/openlp/core/__init__.py index 17db85184..00d8b78c0 100644 --- a/openlp/core/__init__.py +++ b/openlp/core/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -28,4 +28,4 @@ The :mod:`core` module provides all core application functions All the core functions of the OpenLP application including the GUI, settings, logging and a plugin framework are contained within the openlp.core module. -""" \ No newline at end of file +""" diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index ab4c8e26f..89ecaf3be 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/lib/db.py b/openlp/core/lib/db.py index d9d094949..62150cce3 100644 --- a/openlp/core/lib/db.py +++ b/openlp/core/lib/db.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/lib/displaytags.py b/openlp/core/lib/displaytags.py index d414f80bb..fc36bc090 100644 --- a/openlp/core/lib/displaytags.py +++ b/openlp/core/lib/displaytags.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/lib/dockwidget.py b/openlp/core/lib/dockwidget.py index 32d6ce765..efc0a3066 100644 --- a/openlp/core/lib/dockwidget.py +++ b/openlp/core/lib/dockwidget.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/lib/eventreceiver.py b/openlp/core/lib/eventreceiver.py index 6fa8e624a..78b0c6324 100644 --- a/openlp/core/lib/eventreceiver.py +++ b/openlp/core/lib/eventreceiver.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/lib/htmlbuilder.py b/openlp/core/lib/htmlbuilder.py index 720b4b3f8..4faf47ddc 100644 --- a/openlp/core/lib/htmlbuilder.py +++ b/openlp/core/lib/htmlbuilder.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/lib/imagemanager.py b/openlp/core/lib/imagemanager.py index 23005e992..31b41dc0f 100644 --- a/openlp/core/lib/imagemanager.py +++ b/openlp/core/lib/imagemanager.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/lib/listwidgetwithdnd.py b/openlp/core/lib/listwidgetwithdnd.py index a1a11217b..5cd8cf9e2 100644 --- a/openlp/core/lib/listwidgetwithdnd.py +++ b/openlp/core/lib/listwidgetwithdnd.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 782e041a9..c44b89534 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/lib/plugin.py b/openlp/core/lib/plugin.py index 39f13c37e..c1ff30281 100644 --- a/openlp/core/lib/plugin.py +++ b/openlp/core/lib/plugin.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/lib/pluginmanager.py b/openlp/core/lib/pluginmanager.py index 8081cbf71..d2b05ab7c 100644 --- a/openlp/core/lib/pluginmanager.py +++ b/openlp/core/lib/pluginmanager.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -221,4 +221,4 @@ class PluginManager(object): for plugin in self.plugins: if plugin.isActive(): plugin.finalise() - log.info(u'Finalisation Complete for %s ' % plugin.name) \ No newline at end of file + log.info(u'Finalisation Complete for %s ' % plugin.name) diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index fe118b76b..4df87a4df 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -144,4 +144,4 @@ class Renderer(object): html_text = html_text[:len(html_text)-4] formatted.append(html_text) log.debug(u'format_slide - End') - return formatted \ No newline at end of file + return formatted diff --git a/openlp/core/lib/rendermanager.py b/openlp/core/lib/rendermanager.py index 7d579f7a4..b68237b4a 100644 --- a/openlp/core/lib/rendermanager.py +++ b/openlp/core/lib/rendermanager.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/lib/searchedit.py b/openlp/core/lib/searchedit.py index 5e12dcefd..d2424d00e 100644 --- a/openlp/core/lib/searchedit.py +++ b/openlp/core/lib/searchedit.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index f5b606467..de4f2fd81 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/lib/settingsmanager.py b/openlp/core/lib/settingsmanager.py index 89d56cea2..3d8d8059e 100644 --- a/openlp/core/lib/settingsmanager.py +++ b/openlp/core/lib/settingsmanager.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -178,4 +178,4 @@ class SettingsManager(object): if extension == os.path.splitext(filename)[1]] else: # no filtering required - return files \ No newline at end of file + return files diff --git a/openlp/core/lib/settingstab.py b/openlp/core/lib/settingstab.py index 297185127..4f3748c8d 100644 --- a/openlp/core/lib/settingstab.py +++ b/openlp/core/lib/settingstab.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/lib/spelltextedit.py b/openlp/core/lib/spelltextedit.py index 44180a25c..493781ccc 100644 --- a/openlp/core/lib/spelltextedit.py +++ b/openlp/core/lib/spelltextedit.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/lib/theme.py b/openlp/core/lib/theme.py index 67ddde72d..6f97c0608 100644 --- a/openlp/core/lib/theme.py +++ b/openlp/core/lib/theme.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/lib/toolbar.py b/openlp/core/lib/toolbar.py index 6ae80045e..37fb67d52 100644 --- a/openlp/core/lib/toolbar.py +++ b/openlp/core/lib/toolbar.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 2cdda13ac..c127d810d 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/theme/__init__.py b/openlp/core/theme/__init__.py index 350b550a2..52f7120b1 100644 --- a/openlp/core/theme/__init__.py +++ b/openlp/core/theme/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -24,4 +24,4 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### -from openlp.core.theme.theme import Theme \ No newline at end of file +from openlp.core.theme.theme import Theme diff --git a/openlp/core/theme/theme.py b/openlp/core/theme/theme.py index c5d60e299..17217113a 100644 --- a/openlp/core/theme/theme.py +++ b/openlp/core/theme/theme.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/__init__.py b/openlp/core/ui/__init__.py index 0f62a6dcf..158f7f0cd 100644 --- a/openlp/core/ui/__init__.py +++ b/openlp/core/ui/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/aboutdialog.py b/openlp/core/ui/aboutdialog.py index 19a61b3f8..5ba5783ea 100644 --- a/openlp/core/ui/aboutdialog.py +++ b/openlp/core/ui/aboutdialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/aboutform.py b/openlp/core/ui/aboutform.py index f3fcc18a8..a6550b23c 100644 --- a/openlp/core/ui/aboutform.py +++ b/openlp/core/ui/aboutform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -61,4 +61,4 @@ class AboutForm(QtGui.QDialog, Ui_AboutDialog): import webbrowser url = u'http://www.openlp.org/en/documentation/introduction/' \ + u'contributing.html' - webbrowser.open_new(url) \ No newline at end of file + webbrowser.open_new(url) diff --git a/openlp/core/ui/advancedtab.py b/openlp/core/ui/advancedtab.py index 5cb22cb8b..a8e8b294e 100644 --- a/openlp/core/ui/advancedtab.py +++ b/openlp/core/ui/advancedtab.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/displaytagdialog.py b/openlp/core/ui/displaytagdialog.py index edb8567cf..32428731e 100644 --- a/openlp/core/ui/displaytagdialog.py +++ b/openlp/core/ui/displaytagdialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/displaytagform.py b/openlp/core/ui/displaytagform.py index fa05c578a..b02a41e64 100644 --- a/openlp/core/ui/displaytagform.py +++ b/openlp/core/ui/displaytagform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/exceptiondialog.py b/openlp/core/ui/exceptiondialog.py index ba7bab496..770913b01 100644 --- a/openlp/core/ui/exceptiondialog.py +++ b/openlp/core/ui/exceptiondialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/exceptionform.py b/openlp/core/ui/exceptionform.py index 023bb6b36..6fb2d3f84 100644 --- a/openlp/core/ui/exceptionform.py +++ b/openlp/core/ui/exceptionform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/filerenamedialog.py b/openlp/core/ui/filerenamedialog.py index 147207494..30c206d2c 100644 --- a/openlp/core/ui/filerenamedialog.py +++ b/openlp/core/ui/filerenamedialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/filerenameform.py b/openlp/core/ui/filerenameform.py index 8b37cbc86..69a1c3f6a 100644 --- a/openlp/core/ui/filerenameform.py +++ b/openlp/core/ui/filerenameform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/generaltab.py b/openlp/core/ui/generaltab.py index 2b95088ab..f2bcbbe7e 100644 --- a/openlp/core/ui/generaltab.py +++ b/openlp/core/ui/generaltab.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 91d61f1d7..06de73309 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 9071016e8..4ec1f91cc 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/mediadockmanager.py b/openlp/core/ui/mediadockmanager.py index ced3850ec..2d388faf4 100644 --- a/openlp/core/ui/mediadockmanager.py +++ b/openlp/core/ui/mediadockmanager.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -85,4 +85,4 @@ class MediaDockManager(object): if self.media_dock.widget(dock_index).settingsSection == \ media_item.plugin.name.lower(): self.media_dock.widget(dock_index).hide() - self.media_dock.removeItem(dock_index) \ No newline at end of file + self.media_dock.removeItem(dock_index) diff --git a/openlp/core/ui/plugindialog.py b/openlp/core/ui/plugindialog.py index 84f897a65..0f6ed9395 100644 --- a/openlp/core/ui/plugindialog.py +++ b/openlp/core/ui/plugindialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/pluginform.py b/openlp/core/ui/pluginform.py index f8bfe4713..15ac62e42 100644 --- a/openlp/core/ui/pluginform.py +++ b/openlp/core/ui/pluginform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/printservicedialog.py b/openlp/core/ui/printservicedialog.py index ec4e054c3..8d69dc9af 100644 --- a/openlp/core/ui/printservicedialog.py +++ b/openlp/core/ui/printservicedialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/printserviceform.py b/openlp/core/ui/printserviceform.py index 882e39fca..115d68858 100644 --- a/openlp/core/ui/printserviceform.py +++ b/openlp/core/ui/printserviceform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/screen.py b/openlp/core/ui/screen.py index 82238d738..4530cfd3c 100644 --- a/openlp/core/ui/screen.py +++ b/openlp/core/ui/screen.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/serviceitemeditdialog.py b/openlp/core/ui/serviceitemeditdialog.py index ef7e99a5f..f2909eabb 100644 --- a/openlp/core/ui/serviceitemeditdialog.py +++ b/openlp/core/ui/serviceitemeditdialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/serviceitemeditform.py b/openlp/core/ui/serviceitemeditform.py index ae09cb0b2..588bdbfd6 100644 --- a/openlp/core/ui/serviceitemeditform.py +++ b/openlp/core/ui/serviceitemeditform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 67fbeb0ea..f5a08d8b2 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/servicenoteform.py b/openlp/core/ui/servicenoteform.py index a12b693f8..200e12818 100644 --- a/openlp/core/ui/servicenoteform.py +++ b/openlp/core/ui/servicenoteform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -53,4 +53,4 @@ class ServiceNoteForm(QtGui.QDialog): def retranslateUi(self): self.setWindowTitle( - translate('OpenLP.ServiceNoteForm', 'Service Item Notes')) + translate('OpenLP.ServiceNoteForm', 'Service Item Notes')) diff --git a/openlp/core/ui/settingsdialog.py b/openlp/core/ui/settingsdialog.py index 41b6baccb..af8ba84ab 100644 --- a/openlp/core/ui/settingsdialog.py +++ b/openlp/core/ui/settingsdialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/settingsform.py b/openlp/core/ui/settingsform.py index 8ea9b0dea..872b37586 100644 --- a/openlp/core/ui/settingsform.py +++ b/openlp/core/ui/settingsform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/shortcutlistdialog.py b/openlp/core/ui/shortcutlistdialog.py index 4e20671c5..b4673f410 100644 --- a/openlp/core/ui/shortcutlistdialog.py +++ b/openlp/core/ui/shortcutlistdialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -78,7 +78,7 @@ class Ui_ShortcutListDialog(object): translate('OpenLP.ShortcutListDialog', 'Customize Shortcuts')) self.treeWidget.setHeaderLabels([ translate('OpenLP.ShortcutListDialog', 'Action'), - translate('OpenLP.ShortcutListDialog', 'Shortcut'), + translate('OpenLP.ShortcutListDialog', 'Shortcut'), translate('OpenLP.ShortcutListDialog', 'Alternate')]) self.defaultButton.setText( translate('OpenLP.ShortcutListDialog', 'Default: %s')) diff --git a/openlp/core/ui/shortcutlistform.py b/openlp/core/ui/shortcutlistform.py index 240bbf93c..4f770045c 100644 --- a/openlp/core/ui/shortcutlistform.py +++ b/openlp/core/ui/shortcutlistform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 2d3a7e61d..8d612676b 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/splashscreen.py b/openlp/core/ui/splashscreen.py index 8c2364ec2..88c6f09f9 100644 --- a/openlp/core/ui/splashscreen.py +++ b/openlp/core/ui/splashscreen.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/starttimedialog.py b/openlp/core/ui/starttimedialog.py index d87df71c4..14ef84aac 100644 --- a/openlp/core/ui/starttimedialog.py +++ b/openlp/core/ui/starttimedialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/starttimeform.py b/openlp/core/ui/starttimeform.py index 1280931d5..01800602f 100644 --- a/openlp/core/ui/starttimeform.py +++ b/openlp/core/ui/starttimeform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index 17572f530..cc490bf9b 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 378f5b365..974f98f61 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/themestab.py b/openlp/core/ui/themestab.py index 6a3505e93..c7442744f 100644 --- a/openlp/core/ui/themestab.py +++ b/openlp/core/ui/themestab.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/themewizard.py b/openlp/core/ui/themewizard.py index a482e2703..20cca69c6 100644 --- a/openlp/core/ui/themewizard.py +++ b/openlp/core/ui/themewizard.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/ui/wizard.py b/openlp/core/ui/wizard.py index 209f3f212..0b275733e 100644 --- a/openlp/core/ui/wizard.py +++ b/openlp/core/ui/wizard.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/utils/__init__.py b/openlp/core/utils/__init__.py index 3f5ee90c2..86372e080 100644 --- a/openlp/core/utils/__init__.py +++ b/openlp/core/utils/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -387,7 +387,7 @@ def get_uno_command(): if UNO_CONNECTION_TYPE == u'pipe': CONNECTION = u'"-accept=pipe,name=openlp_pipe;urp;"' else: - CONNECTION = u'"-accept=socket,host=localhost,port=2002;urp;"' + CONNECTION = u'"-accept=socket,host=localhost,port=2002;urp;"' return u'%s %s %s' % (COMMAND, OPTIONS, CONNECTION) def get_uno_instance(resolver): diff --git a/openlp/core/utils/actions.py b/openlp/core/utils/actions.py index e181dd2e1..30d1d7586 100644 --- a/openlp/core/utils/actions.py +++ b/openlp/core/utils/actions.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/core/utils/languagemanager.py b/openlp/core/utils/languagemanager.py index 454d14fa2..ced2fa843 100644 --- a/openlp/core/utils/languagemanager.py +++ b/openlp/core/utils/languagemanager.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/__init__.py b/openlp/plugins/__init__.py index 7bf441119..5fd39d572 100644 --- a/openlp/plugins/__init__.py +++ b/openlp/plugins/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -25,4 +25,4 @@ ############################################################################### """ The :mod:`plugins` module provides all the project produced plugins -""" \ No newline at end of file +""" diff --git a/openlp/plugins/alerts/__init__.py b/openlp/plugins/alerts/__init__.py index dafae0885..f3c629b25 100644 --- a/openlp/plugins/alerts/__init__.py +++ b/openlp/plugins/alerts/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -26,4 +26,4 @@ """ The :mod:`alerts` module provides the Alerts plugin for producing impromptu on-screen announcements during a service. -""" \ No newline at end of file +""" diff --git a/openlp/plugins/alerts/alertsplugin.py b/openlp/plugins/alerts/alertsplugin.py index 136d775a5..1d9bd4c61 100644 --- a/openlp/plugins/alerts/alertsplugin.py +++ b/openlp/plugins/alerts/alertsplugin.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/alerts/forms/__init__.py b/openlp/plugins/alerts/forms/__init__.py index da7ae6683..e2809ed73 100644 --- a/openlp/plugins/alerts/forms/__init__.py +++ b/openlp/plugins/alerts/forms/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -24,4 +24,4 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### -from alertform import AlertForm \ No newline at end of file +from alertform import AlertForm diff --git a/openlp/plugins/alerts/forms/alertdialog.py b/openlp/plugins/alerts/forms/alertdialog.py index 93f7ead06..27b0b0f7d 100644 --- a/openlp/plugins/alerts/forms/alertdialog.py +++ b/openlp/plugins/alerts/forms/alertdialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/alerts/forms/alertform.py b/openlp/plugins/alerts/forms/alertform.py index 0639f2bb1..75475d524 100644 --- a/openlp/plugins/alerts/forms/alertform.py +++ b/openlp/plugins/alerts/forms/alertform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/alerts/lib/__init__.py b/openlp/plugins/alerts/lib/__init__.py index f6a535b1b..3b446b67d 100644 --- a/openlp/plugins/alerts/lib/__init__.py +++ b/openlp/plugins/alerts/lib/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -25,4 +25,4 @@ ############################################################################### from alertsmanager import AlertsManager -from alertstab import AlertsTab \ No newline at end of file +from alertstab import AlertsTab diff --git a/openlp/plugins/alerts/lib/alertsmanager.py b/openlp/plugins/alerts/lib/alertsmanager.py index f69099bf1..a05a29575 100644 --- a/openlp/plugins/alerts/lib/alertsmanager.py +++ b/openlp/plugins/alerts/lib/alertsmanager.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/alerts/lib/alertstab.py b/openlp/plugins/alerts/lib/alertstab.py index ac7316df2..5b4f670a3 100644 --- a/openlp/plugins/alerts/lib/alertstab.py +++ b/openlp/plugins/alerts/lib/alertstab.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/alerts/lib/db.py b/openlp/plugins/alerts/lib/db.py index e324bc838..9cfa34846 100644 --- a/openlp/plugins/alerts/lib/db.py +++ b/openlp/plugins/alerts/lib/db.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -55,4 +55,4 @@ def init_schema(url): mapper(AlertItem, alerts_table) metadata.create_all(checkfirst=True) - return session \ No newline at end of file + return session diff --git a/openlp/plugins/bibles/__init__.py b/openlp/plugins/bibles/__init__.py index 59cd2afec..29364ab1a 100644 --- a/openlp/plugins/bibles/__init__.py +++ b/openlp/plugins/bibles/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -26,4 +26,4 @@ """ The :mod:`bibles` module provides the Bible plugin to enable OpenLP to display scripture. -""" \ No newline at end of file +""" diff --git a/openlp/plugins/bibles/bibleplugin.py b/openlp/plugins/bibles/bibleplugin.py index b992552f1..73a9b7e1d 100644 --- a/openlp/plugins/bibles/bibleplugin.py +++ b/openlp/plugins/bibles/bibleplugin.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/bibles/forms/__init__.py b/openlp/plugins/bibles/forms/__init__.py index 1365dc5e0..15f14de9e 100644 --- a/openlp/plugins/bibles/forms/__init__.py +++ b/openlp/plugins/bibles/forms/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -53,4 +53,4 @@ from the .ui files later if necessary. from bibleimportform import BibleImportForm -__all__ = ['BibleImportForm'] \ No newline at end of file +__all__ = ['BibleImportForm'] diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index 7ec8e1394..fc37fad58 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/bibles/lib/__init__.py b/openlp/plugins/bibles/lib/__init__.py index 78cb6b645..e8634c3a3 100644 --- a/openlp/plugins/bibles/lib/__init__.py +++ b/openlp/plugins/bibles/lib/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -100,37 +100,37 @@ def parse_reference(reference): this:: (book, chapter, from_verse, to_verse) - + For example:: - + [(u'John', 3, 16, 18), (u'John', 4, 1, 1)] **Reference string details:** Each reference starts with the book name and a chapter number. These are both mandatory. - + * ``John 3`` refers to Gospel of John chapter 3 A reference range can be given after a range separator. - + * ``John 3-5`` refers to John chapters 3 to 5 Single verses can be addressed after a verse separator. - + * ``John 3:16`` refers to John chapter 3 verse 16 * ``John 3:16-4:3`` refers to John chapter 3 verse 16 to chapter 4 verse 3 After a verse reference all further single values are treat as verse in the last selected chapter. - + * ``John 3:16-18`` refers to John chapter 3 verses 16 to 18 After a list separator it is possible to refer to additional verses. They are build analog to the first ones. This way it is possible to define each number of verse references. It is not possible to refer to verses in additional books. - + * ``John 3:16,18`` refers to John chapter 3 verses 16 and 18 * ``John 3:16-18,20`` refers to John chapter 3 verses 16 to 18 and 20 * ``John 3:16-18,4:1`` refers to John chapter 3 verses 16 to 18 and diff --git a/openlp/plugins/bibles/lib/biblestab.py b/openlp/plugins/bibles/lib/biblestab.py index 09e32ad8c..74be7145b 100644 --- a/openlp/plugins/bibles/lib/biblestab.py +++ b/openlp/plugins/bibles/lib/biblestab.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/bibles/lib/csvbible.py b/openlp/plugins/bibles/lib/csvbible.py index 82872e15b..f7b4aa8f5 100644 --- a/openlp/plugins/bibles/lib/csvbible.py +++ b/openlp/plugins/bibles/lib/csvbible.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/bibles/lib/db.py b/openlp/plugins/bibles/lib/db.py index b986b0d66..7b7c140e9 100644 --- a/openlp/plugins/bibles/lib/db.py +++ b/openlp/plugins/bibles/lib/db.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/bibles/lib/http.py b/openlp/plugins/bibles/lib/http.py index 7cba6facb..064a6064d 100644 --- a/openlp/plugins/bibles/lib/http.py +++ b/openlp/plugins/bibles/lib/http.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/bibles/lib/manager.py b/openlp/plugins/bibles/lib/manager.py index 85204ac7a..501c8c902 100644 --- a/openlp/plugins/bibles/lib/manager.py +++ b/openlp/plugins/bibles/lib/manager.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index deae98fcb..e7cf273c1 100644 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/bibles/lib/openlp1.py b/openlp/plugins/bibles/lib/openlp1.py index 73b7eb91a..30eb73481 100644 --- a/openlp/plugins/bibles/lib/openlp1.py +++ b/openlp/plugins/bibles/lib/openlp1.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/bibles/lib/opensong.py b/openlp/plugins/bibles/lib/opensong.py index 9a0fd110d..9c521fb3f 100644 --- a/openlp/plugins/bibles/lib/opensong.py +++ b/openlp/plugins/bibles/lib/opensong.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/bibles/lib/osis.py b/openlp/plugins/bibles/lib/osis.py index 347730bf4..11800ec13 100644 --- a/openlp/plugins/bibles/lib/osis.py +++ b/openlp/plugins/bibles/lib/osis.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/custom/__init__.py b/openlp/plugins/custom/__init__.py index fb86201a3..3a1e4461a 100644 --- a/openlp/plugins/custom/__init__.py +++ b/openlp/plugins/custom/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -27,4 +27,4 @@ The :mod:`custom` module provides the Custom plugin which allows custom, themed, text based items to be displayed without having to misuse another item type. -""" \ No newline at end of file +""" diff --git a/openlp/plugins/custom/customplugin.py b/openlp/plugins/custom/customplugin.py index 7894397db..c6c129e68 100644 --- a/openlp/plugins/custom/customplugin.py +++ b/openlp/plugins/custom/customplugin.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/custom/forms/__init__.py b/openlp/plugins/custom/forms/__init__.py index 60f1395fb..c12d29c07 100644 --- a/openlp/plugins/custom/forms/__init__.py +++ b/openlp/plugins/custom/forms/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -25,4 +25,4 @@ ############################################################################### from editcustomform import EditCustomForm -from editcustomslideform import EditCustomSlideForm \ No newline at end of file +from editcustomslideform import EditCustomSlideForm diff --git a/openlp/plugins/custom/forms/editcustomdialog.py b/openlp/plugins/custom/forms/editcustomdialog.py index 8746d5548..12ac3ed7e 100644 --- a/openlp/plugins/custom/forms/editcustomdialog.py +++ b/openlp/plugins/custom/forms/editcustomdialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/custom/forms/editcustomform.py b/openlp/plugins/custom/forms/editcustomform.py index a86b28489..232cb1e38 100644 --- a/openlp/plugins/custom/forms/editcustomform.py +++ b/openlp/plugins/custom/forms/editcustomform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/custom/forms/editcustomslidedialog.py b/openlp/plugins/custom/forms/editcustomslidedialog.py index b70e2bf5e..08610954f 100644 --- a/openlp/plugins/custom/forms/editcustomslidedialog.py +++ b/openlp/plugins/custom/forms/editcustomslidedialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/custom/forms/editcustomslideform.py b/openlp/plugins/custom/forms/editcustomslideform.py index 80141cfb3..2aea81482 100644 --- a/openlp/plugins/custom/forms/editcustomslideform.py +++ b/openlp/plugins/custom/forms/editcustomslideform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/custom/lib/__init__.py b/openlp/plugins/custom/lib/__init__.py index d3d8312d7..0c53505ac 100644 --- a/openlp/plugins/custom/lib/__init__.py +++ b/openlp/plugins/custom/lib/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -26,4 +26,4 @@ from customxmlhandler import CustomXMLBuilder, CustomXMLParser from mediaitem import CustomMediaItem -from customtab import CustomTab \ No newline at end of file +from customtab import CustomTab diff --git a/openlp/plugins/custom/lib/customtab.py b/openlp/plugins/custom/lib/customtab.py index 3c1b848aa..9b61f8f15 100644 --- a/openlp/plugins/custom/lib/customtab.py +++ b/openlp/plugins/custom/lib/customtab.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/custom/lib/customxmlhandler.py b/openlp/plugins/custom/lib/customxmlhandler.py index 1171ce6bd..5ea941e35 100644 --- a/openlp/plugins/custom/lib/customxmlhandler.py +++ b/openlp/plugins/custom/lib/customxmlhandler.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -153,4 +153,4 @@ class CustomXMLParser(object): """ Debugging aid to dump XML so that we can see what we have. """ - return dump(self.custom_xml) \ No newline at end of file + return dump(self.custom_xml) diff --git a/openlp/plugins/custom/lib/db.py b/openlp/plugins/custom/lib/db.py index 1fbc04980..74155ad96 100644 --- a/openlp/plugins/custom/lib/db.py +++ b/openlp/plugins/custom/lib/db.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -59,4 +59,4 @@ def init_schema(url): mapper(CustomSlide, custom_slide_table) metadata.create_all(checkfirst=True) - return session \ No newline at end of file + return session diff --git a/openlp/plugins/custom/lib/mediaitem.py b/openlp/plugins/custom/lib/mediaitem.py index 7ffdfd0b2..c0c7a7e86 100644 --- a/openlp/plugins/custom/lib/mediaitem.py +++ b/openlp/plugins/custom/lib/mediaitem.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/images/__init__.py b/openlp/plugins/images/__init__.py index 6ea473c72..13ea2592a 100644 --- a/openlp/plugins/images/__init__.py +++ b/openlp/plugins/images/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -26,4 +26,4 @@ """ The :mod:`images` module provides the Images plugin. The Images plugin provides the facility to display images from OpenLP. -""" \ No newline at end of file +""" diff --git a/openlp/plugins/images/imageplugin.py b/openlp/plugins/images/imageplugin.py index 2cc0f1d93..84d7a71cc 100644 --- a/openlp/plugins/images/imageplugin.py +++ b/openlp/plugins/images/imageplugin.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/images/lib/__init__.py b/openlp/plugins/images/lib/__init__.py index 6ff2a295b..34c9f1ca8 100644 --- a/openlp/plugins/images/lib/__init__.py +++ b/openlp/plugins/images/lib/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -24,4 +24,4 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### -from mediaitem import ImageMediaItem \ No newline at end of file +from mediaitem import ImageMediaItem diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index 5aa34cc24..e6fdfe7db 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/media/__init__.py b/openlp/plugins/media/__init__.py index 7be6e5ea9..c13c59ef6 100644 --- a/openlp/plugins/media/__init__.py +++ b/openlp/plugins/media/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -28,4 +28,4 @@ The :mod:`media` module provides the Media plugin which allows OpenLP to display videos. The media supported depends not only on the Python support but also extensively on the codecs installed on the underlying operating system being picked up and usable by Python. -""" \ No newline at end of file +""" diff --git a/openlp/plugins/media/lib/__init__.py b/openlp/plugins/media/lib/__init__.py index 59d7642df..cb4806631 100644 --- a/openlp/plugins/media/lib/__init__.py +++ b/openlp/plugins/media/lib/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -27,4 +27,4 @@ from mediaitem import MediaMediaItem from mediatab import MediaTab -__all__ = ['MediaMediaItem'] \ No newline at end of file +__all__ = ['MediaMediaItem'] diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index 8bf201180..40ea7abb1 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -61,7 +61,7 @@ class MediaMediaItem(MediaManagerItem): self.onNewPrompt = translate('MediaPlugin.MediaItem', 'Select Media') self.onNewFileMasks = unicode(translate('MediaPlugin.MediaItem', 'Videos (%s);;Audio (%s);;%s (*)')) % ( - u' '.join(self.parent.video_extensions_list), + u' '.join(self.parent.video_extensions_list), u' '.join(self.parent.audio_extensions_list), UiStrings.AllFiles) self.replaceAction.setText(UiStrings.ReplaceBG) self.replaceAction.setToolTip(UiStrings.ReplaceLiveBG) diff --git a/openlp/plugins/media/lib/mediatab.py b/openlp/plugins/media/lib/mediatab.py index c51b53a9a..995816860 100644 --- a/openlp/plugins/media/lib/mediatab.py +++ b/openlp/plugins/media/lib/mediatab.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index 74a8f3f2e..ac3a2636b 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/presentations/__init__.py b/openlp/plugins/presentations/__init__.py index 317281c23..628816bcf 100644 --- a/openlp/plugins/presentations/__init__.py +++ b/openlp/plugins/presentations/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -26,4 +26,4 @@ """ The :mod:`presentations` module provides the Presentations plugin which allows OpenLP to show presentations from most popular presentation packages. -""" \ No newline at end of file +""" diff --git a/openlp/plugins/presentations/lib/__init__.py b/openlp/plugins/presentations/lib/__init__.py index 2e46cf486..b5575268a 100644 --- a/openlp/plugins/presentations/lib/__init__.py +++ b/openlp/plugins/presentations/lib/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -27,4 +27,4 @@ from presentationcontroller import PresentationController from messagelistener import MessageListener from mediaitem import PresentationMediaItem -from presentationtab import PresentationTab \ No newline at end of file +from presentationtab import PresentationTab diff --git a/openlp/plugins/presentations/lib/impresscontroller.py b/openlp/plugins/presentations/lib/impresscontroller.py index ad5faa2dd..2880bd27a 100644 --- a/openlp/plugins/presentations/lib/impresscontroller.py +++ b/openlp/plugins/presentations/lib/impresscontroller.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index 35db047e2..2a552a480 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/presentations/lib/messagelistener.py b/openlp/plugins/presentations/lib/messagelistener.py index b7c64ccee..cf43566ae 100644 --- a/openlp/plugins/presentations/lib/messagelistener.py +++ b/openlp/plugins/presentations/lib/messagelistener.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/presentations/lib/powerpointcontroller.py b/openlp/plugins/presentations/lib/powerpointcontroller.py index eb00da255..4dc9e8f3a 100644 --- a/openlp/plugins/presentations/lib/powerpointcontroller.py +++ b/openlp/plugins/presentations/lib/powerpointcontroller.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/presentations/lib/pptviewcontroller.py b/openlp/plugins/presentations/lib/pptviewcontroller.py index fc839195c..0900d1d9d 100644 --- a/openlp/plugins/presentations/lib/pptviewcontroller.py +++ b/openlp/plugins/presentations/lib/pptviewcontroller.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/presentations/lib/pptviewlib/ppttest.py b/openlp/plugins/presentations/lib/pptviewlib/ppttest.py index de0be3e73..1e10def7d 100644 --- a/openlp/plugins/presentations/lib/pptviewlib/ppttest.py +++ b/openlp/plugins/presentations/lib/pptviewlib/ppttest.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -169,4 +169,4 @@ if __name__ == '__main__': app = QtGui.QApplication(sys.argv) qb = PPTViewer() qb.show() - sys.exit(app.exec_()) \ No newline at end of file + sys.exit(app.exec_()) diff --git a/openlp/plugins/presentations/lib/presentationcontroller.py b/openlp/plugins/presentations/lib/presentationcontroller.py index 8b282e0f4..d995baa8c 100644 --- a/openlp/plugins/presentations/lib/presentationcontroller.py +++ b/openlp/plugins/presentations/lib/presentationcontroller.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/presentations/lib/presentationtab.py b/openlp/plugins/presentations/lib/presentationtab.py index 8bcb7474a..7b85eebb4 100644 --- a/openlp/plugins/presentations/lib/presentationtab.py +++ b/openlp/plugins/presentations/lib/presentationtab.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index ece25e363..eb7e714f0 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/remotes/__init__.py b/openlp/plugins/remotes/__init__.py index 4e619fb67..b5077f435 100644 --- a/openlp/plugins/remotes/__init__.py +++ b/openlp/plugins/remotes/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -26,4 +26,4 @@ """ The :mod:`remotes` plugin allows OpenLP to be controlled from another machine over a network connection. -""" \ No newline at end of file +""" diff --git a/openlp/plugins/remotes/lib/__init__.py b/openlp/plugins/remotes/lib/__init__.py index b6f952242..8e4f1b210 100644 --- a/openlp/plugins/remotes/lib/__init__.py +++ b/openlp/plugins/remotes/lib/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -25,4 +25,4 @@ ############################################################################### from remotetab import RemoteTab -from httpserver import HttpServer \ No newline at end of file +from httpserver import HttpServer diff --git a/openlp/plugins/remotes/lib/httpserver.py b/openlp/plugins/remotes/lib/httpserver.py index 7ced66103..173c89e13 100644 --- a/openlp/plugins/remotes/lib/httpserver.py +++ b/openlp/plugins/remotes/lib/httpserver.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/remotes/lib/remotetab.py b/openlp/plugins/remotes/lib/remotetab.py index d06e69164..2dfee06ce 100644 --- a/openlp/plugins/remotes/lib/remotetab.py +++ b/openlp/plugins/remotes/lib/remotetab.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/remotes/remoteplugin.py b/openlp/plugins/remotes/remoteplugin.py index b513d4ff7..7236d7546 100644 --- a/openlp/plugins/remotes/remoteplugin.py +++ b/openlp/plugins/remotes/remoteplugin.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/__init__.py b/openlp/plugins/songs/__init__.py index c95d29c46..8332f7233 100644 --- a/openlp/plugins/songs/__init__.py +++ b/openlp/plugins/songs/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -26,4 +26,4 @@ """ The :mod:`songs` module provides the Songs plugin. The Songs plugin provides the main lyric projection function of OpenLP. -""" \ No newline at end of file +""" diff --git a/openlp/plugins/songs/forms/__init__.py b/openlp/plugins/songs/forms/__init__.py index e75f9fe04..356817ef9 100644 --- a/openlp/plugins/songs/forms/__init__.py +++ b/openlp/plugins/songs/forms/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/forms/authorsdialog.py b/openlp/plugins/songs/forms/authorsdialog.py index 09c723364..ed2f87e2e 100644 --- a/openlp/plugins/songs/forms/authorsdialog.py +++ b/openlp/plugins/songs/forms/authorsdialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/forms/authorsform.py b/openlp/plugins/songs/forms/authorsform.py index 3a37cf290..ad4cea3de 100644 --- a/openlp/plugins/songs/forms/authorsform.py +++ b/openlp/plugins/songs/forms/authorsform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/forms/editsongdialog.py b/openlp/plugins/songs/forms/editsongdialog.py index bcc075574..c9dfb1e13 100644 --- a/openlp/plugins/songs/forms/editsongdialog.py +++ b/openlp/plugins/songs/forms/editsongdialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 68147cf6c..ef47e5694 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/forms/editversedialog.py b/openlp/plugins/songs/forms/editversedialog.py index 64da3e89e..391d9be65 100644 --- a/openlp/plugins/songs/forms/editversedialog.py +++ b/openlp/plugins/songs/forms/editversedialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/forms/editverseform.py b/openlp/plugins/songs/forms/editverseform.py index 6156e6821..8a52c1859 100644 --- a/openlp/plugins/songs/forms/editverseform.py +++ b/openlp/plugins/songs/forms/editverseform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/forms/songbookdialog.py b/openlp/plugins/songs/forms/songbookdialog.py index f6dd3930c..337210b38 100644 --- a/openlp/plugins/songs/forms/songbookdialog.py +++ b/openlp/plugins/songs/forms/songbookdialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/forms/songbookform.py b/openlp/plugins/songs/forms/songbookform.py index 3f054fe8d..23886750b 100644 --- a/openlp/plugins/songs/forms/songbookform.py +++ b/openlp/plugins/songs/forms/songbookform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index bcf6a8873..231d8fd43 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index 16c0f9edb..10422aadd 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/forms/songmaintenancedialog.py b/openlp/plugins/songs/forms/songmaintenancedialog.py index 0316ab42b..42ec16352 100644 --- a/openlp/plugins/songs/forms/songmaintenancedialog.py +++ b/openlp/plugins/songs/forms/songmaintenancedialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/forms/songmaintenanceform.py b/openlp/plugins/songs/forms/songmaintenanceform.py index 7f9b8bec5..d5f432c2b 100644 --- a/openlp/plugins/songs/forms/songmaintenanceform.py +++ b/openlp/plugins/songs/forms/songmaintenanceform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/forms/topicsdialog.py b/openlp/plugins/songs/forms/topicsdialog.py index 1e7bdb6a0..ee6fc88e7 100644 --- a/openlp/plugins/songs/forms/topicsdialog.py +++ b/openlp/plugins/songs/forms/topicsdialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/forms/topicsform.py b/openlp/plugins/songs/forms/topicsform.py index 792570c93..a191d8156 100644 --- a/openlp/plugins/songs/forms/topicsform.py +++ b/openlp/plugins/songs/forms/topicsform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/__init__.py b/openlp/plugins/songs/lib/__init__.py index 70a47a239..507fd02d4 100644 --- a/openlp/plugins/songs/lib/__init__.py +++ b/openlp/plugins/songs/lib/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/cclifileimport.py b/openlp/plugins/songs/lib/cclifileimport.py index 3d08584d0..b9236919a 100644 --- a/openlp/plugins/songs/lib/cclifileimport.py +++ b/openlp/plugins/songs/lib/cclifileimport.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund, Derek Scotney # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/db.py b/openlp/plugins/songs/lib/db.py index d9a3202b5..a6255476a 100644 --- a/openlp/plugins/songs/lib/db.py +++ b/openlp/plugins/songs/lib/db.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/easislidesimport.py b/openlp/plugins/songs/lib/easislidesimport.py index bdf263a4b..67f889898 100644 --- a/openlp/plugins/songs/lib/easislidesimport.py +++ b/openlp/plugins/songs/lib/easislidesimport.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/ewimport.py b/openlp/plugins/songs/lib/ewimport.py index c88238610..2119cc245 100644 --- a/openlp/plugins/songs/lib/ewimport.py +++ b/openlp/plugins/songs/lib/ewimport.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund, Jeffrey Smith # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/foilpresenterimport.py b/openlp/plugins/songs/lib/foilpresenterimport.py index 2eded332f..e4101f42a 100644 --- a/openlp/plugins/songs/lib/foilpresenterimport.py +++ b/openlp/plugins/songs/lib/foilpresenterimport.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -139,48 +139,48 @@ class FoilPresenter(object): """ This class represents the converter for Foilpresenter XML from a song. - As Foilpresenter has a rich set of different features, we cannot support + As Foilpresenter has a rich set of different features, we cannot support them all. The following features are supported by the :class:`Foilpresenter` - OpenPL does not support styletype and font attributes like "align, font, - textsize, bold, italic, underline" - + OpenPL does not support styletype and font attributes like "align, font, + textsize, bold, italic, underline" + ** - This property is currently not supported. - - ** - As OpenLP does only support one title, the first titlestring becomes + This property is currently not supported. + + *<title>* + As OpenLP does only support one title, the first titlestring becomes title, all other titlestrings will be alternate titles *<sprache>* This property is not supported. - *<ccliid>* + *<ccliid>* The *<ccliid>* property is fully supported. - *<tonart>* + *<tonart>* This property is currently not supported. *<valign>* This property is not supported. - - *<notiz>* + + *<notiz>* The *<notiz>* property is fully supported. *<versionsinfo>* - This property is not supported. + This property is not supported. *<farben>* - This property is not supported. - + This property is not supported. + *<reihenfolge>* = verseOrder - OpenLP supports this property. + OpenLP supports this property. *<strophen>* Only the attributes *key* and *text* are supported. *<verkn>* - This property is not supported. + This property is not supported. *<verkn>* This property is not supported. @@ -195,8 +195,8 @@ class FoilPresenter(object): *<kategorien>* This property is not supported. - The tag *<author>* is not support by foilpresenter, mostly the author is - named in the <copyright> tag. We try to extract the authors from the + The tag *<author>* is not support by foilpresenter, mostly the author is + named in the <copyright> tag. We try to extract the authors from the <copyright> tag. """ @@ -205,7 +205,7 @@ class FoilPresenter(object): def xml_to_song(self, xml): """ - Create and save a song from Foilpresenter format xml to the database. + Create and save a song from Foilpresenter format xml to the database. ``xml`` The XML to parse (unicode). @@ -294,11 +294,11 @@ class FoilPresenter(object): if copyright.find(u'Rechte') != -1: temp = copyright.partition(u'Rechte') copyright = temp[0] - markers = [u'Text +u\.?n?d? +Melodie[a-zA-Z0-9\,\. ]*:', - u'Text +u\.?n?d? +Musik', u'T & M', u'Melodie und Satz', - u'Text[a-zA-Z0-9\,\. ]*:', u'Melodie', u'Musik', u'Satz', - u'Weise', u'[dD]eutsch', u'[dD]t[\.\:]', u'Englisch', - u'[oO]riginal', u'Bearbeitung', u'[R|r]efrain'] + markers = [u'Text +u\.?n?d? +Melodie[a-zA-Z0-9\,\. ]*:', + u'Text +u\.?n?d? +Musik', u'T & M', u'Melodie und Satz', + u'Text[a-zA-Z0-9\,\. ]*:', u'Melodie', u'Musik', u'Satz', + u'Weise', u'[dD]eutsch', u'[dD]t[\.\:]', u'Englisch', + u'[oO]riginal', u'Bearbeitung', u'[R|r]efrain'] for marker in markers: copyright = re.compile(marker).sub(u'<marker>', copyright) copyright = re.compile(u'(?<=<marker>) *:').sub(u'', copyright) @@ -314,11 +314,11 @@ class FoilPresenter(object): elif x > 0: strings.append(copyright) i = 1 - else: + else: i = 1 for author in strings: - temp = re.split(u',(?=\D{2})|(?<=\D),|\/(?=\D{3,})|(?<=\D);', - author) + temp = re.split(u',(?=\D{2})|(?<=\D),|\/(?=\D{3,})|(?<=\D);', + author) for tempx in temp: author_temp.append(tempx) for author in author_temp: @@ -326,12 +326,12 @@ class FoilPresenter(object): '\s*[0-9]{4}\s*[\-\/]?\s*([0-9]{4})?[\/,;\-\s]*$' author = re.compile(regex).sub(u'', author) author = re.compile( - u'[0-9]{1,2}\.\s?J(ahr)?h\.|um\s*$|vor\s*$').sub(u'', + u'[0-9]{1,2}\.\s?J(ahr)?h\.|um\s*$|vor\s*$').sub(u'', author) author = re.compile(u'[N|n]ach.*$').sub(u'', author) author = author.strip() if re.search( - u'\w+\.?\s+\w{3,}\s+[a|u]nd\s|\w+\.?\s+\w{3,}\s+&\s', + u'\w+\.?\s+\w{3,}\s+[a|u]nd\s|\w+\.?\s+\w{3,}\s+&\s', author, re.U) != None: temp = re.split(u'\s[a|u]nd\s|\s&\s', author) for tempx in temp: @@ -414,13 +414,13 @@ class FoilPresenter(object): temp_verse_sort = [] temp_sortnr_backup = 1 temp_sortnr_liste = [] - versenumber = {u'V': 1, u'C': 1, u'B': 1, u'E': 1, u'O': 1, u'I': 1, + versenumber = {u'V': 1, u'C': 1, u'B': 1, u'E': 1, u'O': 1, u'I': 1, u'P': 1} for strophe in foilpresenterfolie.strophen.strophe: text = self._child(strophe.text_) verse_name = self._child(strophe.key) children = strophe.getchildren() - sortnr = False + sortnr = False for child in children: if child.tag == u'sortnr': verse_sortnr = self._child(strophe.sortnr) @@ -467,9 +467,9 @@ class FoilPresenter(object): verse_number = unicode(int(verse_number) + 1) verse_type_index = VerseType.from_tag(verse_type[0]) verse_type = VerseType.Names[verse_type_index] - temp_verse_order[verse_sortnr] = (u''.join((verse_type[0], + temp_verse_order[verse_sortnr] = (u''.join((verse_type[0], verse_number))) - temp_verse_order_backup.append(u''.join((verse_type[0], + temp_verse_order_backup.append(u''.join((verse_type[0], verse_number))) sxml.add_verse_to_lyrics(verse_type, verse_number, text) search_text = search_text + text diff --git a/openlp/plugins/songs/lib/importer.py b/openlp/plugins/songs/lib/importer.py index f3a64a998..773be2fd7 100644 --- a/openlp/plugins/songs/lib/importer.py +++ b/openlp/plugins/songs/lib/importer.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 1df63d0b5..1bf00b403 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/olp1import.py b/openlp/plugins/songs/lib/olp1import.py index 5e18c7ffa..989b7df8a 100644 --- a/openlp/plugins/songs/lib/olp1import.py +++ b/openlp/plugins/songs/lib/olp1import.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/olpimport.py b/openlp/plugins/songs/lib/olpimport.py index fba518772..fe010b501 100644 --- a/openlp/plugins/songs/lib/olpimport.py +++ b/openlp/plugins/songs/lib/olpimport.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/oooimport.py b/openlp/plugins/songs/lib/oooimport.py index 863fec2b8..d2e5870a5 100644 --- a/openlp/plugins/songs/lib/oooimport.py +++ b/openlp/plugins/songs/lib/oooimport.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/openlyricsexport.py b/openlp/plugins/songs/lib/openlyricsexport.py index ffb1a2d6f..c2b58980b 100644 --- a/openlp/plugins/songs/lib/openlyricsexport.py +++ b/openlp/plugins/songs/lib/openlyricsexport.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/openlyricsimport.py b/openlp/plugins/songs/lib/openlyricsimport.py index 0396335b8..306e31619 100644 --- a/openlp/plugins/songs/lib/openlyricsimport.py +++ b/openlp/plugins/songs/lib/openlyricsimport.py @@ -5,10 +5,10 @@ # OpenLP - Open Source Lyrics Projection # # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # -# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/opensongimport.py b/openlp/plugins/songs/lib/opensongimport.py index 5214a0a24..8fddf5e4f 100644 --- a/openlp/plugins/songs/lib/opensongimport.py +++ b/openlp/plugins/songs/lib/opensongimport.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/sofimport.py b/openlp/plugins/songs/lib/sofimport.py index cfb80caa3..7fdf3c45b 100644 --- a/openlp/plugins/songs/lib/sofimport.py +++ b/openlp/plugins/songs/lib/sofimport.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/songbeamerimport.py b/openlp/plugins/songs/lib/songbeamerimport.py index afb9f5646..78a0a81c7 100644 --- a/openlp/plugins/songs/lib/songbeamerimport.py +++ b/openlp/plugins/songs/lib/songbeamerimport.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index 36f2e3504..0212184f8 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -299,7 +299,7 @@ class SongImport(QtCore.QObject): song.lyrics = unicode(sxml.extract_xml(), u'utf-8') if not len(self.verse_order_list) and \ self.verse_order_list_generated_useful: - self.verse_order_list = self.verse_order_list_generated + self.verse_order_list = self.verse_order_list_generated for i, current_verse_def in enumerate(self.verse_order_list): if verses_changed_to_other.has_key(current_verse_def): self.verse_order_list[i] = \ diff --git a/openlp/plugins/songs/lib/songshowplusimport.py b/openlp/plugins/songs/lib/songshowplusimport.py index 74040bcc0..230c5c73d 100644 --- a/openlp/plugins/songs/lib/songshowplusimport.py +++ b/openlp/plugins/songs/lib/songshowplusimport.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/songstab.py b/openlp/plugins/songs/lib/songstab.py index 9ed8ace94..2848208d2 100644 --- a/openlp/plugins/songs/lib/songstab.py +++ b/openlp/plugins/songs/lib/songstab.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/test/test_import_file.py b/openlp/plugins/songs/lib/test/test_import_file.py index 0a0228317..4c3460426 100644 --- a/openlp/plugins/songs/lib/test/test_import_file.py +++ b/openlp/plugins/songs/lib/test/test_import_file.py @@ -4,11 +4,11 @@ ############################################################################### # OpenLP - Open Source Lyrics Projection # # --------------------------------------------------------------------------- # -# Copyright (c) 2008-2010 Raoul Snyman # -# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Copyright (c) 2008-2011 Raoul Snyman # +# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/test/test_importing_lots.py b/openlp/plugins/songs/lib/test/test_importing_lots.py index 75982da92..4fa5dc7c1 100644 --- a/openlp/plugins/songs/lib/test/test_importing_lots.py +++ b/openlp/plugins/songs/lib/test/test_importing_lots.py @@ -1,3 +1,29 @@ +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 + +############################################################################### +# OpenLP - Open Source Lyrics Projection # +# --------------------------------------------------------------------------- # +# Copyright (c) 2008-2011 Raoul Snyman # +# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # +# --------------------------------------------------------------------------- # +# This program is free software; you can redistribute it and/or modify it # +# under the terms of the GNU General Public License as published by the Free # +# Software Foundation; version 2 of the License. # +# # +# This program is distributed in the hope that it will be useful, but WITHOUT # +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # +# more details. # +# # +# You should have received a copy of the GNU General Public License along # +# with this program; if not, write to the Free Software Foundation, Inc., 59 # +# Temple Place, Suite 330, Boston, MA 02111-1307 USA # +############################################################################### + from openlp.plugins.songs.lib.opensongimport import OpenSongImport from openlp.plugins.songs.lib.db import init_schema from openlp.core.lib.db import Manager diff --git a/openlp/plugins/songs/lib/test/test_opensongimport.py b/openlp/plugins/songs/lib/test/test_opensongimport.py index fd1d37e3e..cd85cad3b 100644 --- a/openlp/plugins/songs/lib/test/test_opensongimport.py +++ b/openlp/plugins/songs/lib/test/test_opensongimport.py @@ -4,11 +4,11 @@ ############################################################################### # OpenLP - Open Source Lyrics Projection # # --------------------------------------------------------------------------- # -# Copyright (c) 2008-2010 Raoul Snyman # -# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Copyright (c) 2008-2011 Raoul Snyman # +# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/ui.py b/openlp/plugins/songs/lib/ui.py index 6415c48c9..fe4aab988 100644 --- a/openlp/plugins/songs/lib/ui.py +++ b/openlp/plugins/songs/lib/ui.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/wowimport.py b/openlp/plugins/songs/lib/wowimport.py index 05c9704f6..67e1782eb 100644 --- a/openlp/plugins/songs/lib/wowimport.py +++ b/openlp/plugins/songs/lib/wowimport.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index 8f5c35c0a..16da0a444 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -409,7 +409,7 @@ class OpenLyrics(object): The song object. """ if hasattr(properties, u'comments'): - comments_list = [] + comments_list = [] for comment in properties.comments.comment: commenttext = self._text(comment) if commenttext: diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 609c1990d..0335b3a6e 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songusage/__init__.py b/openlp/plugins/songusage/__init__.py index 7f532aada..5a58a5a81 100644 --- a/openlp/plugins/songusage/__init__.py +++ b/openlp/plugins/songusage/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -27,4 +27,4 @@ The :mod:`songusage` module contains the Song Usage plugin. The Song Usage plugin provides auditing capabilities for reporting the songs you are using to copyright license organisations. -""" \ No newline at end of file +""" diff --git a/openlp/plugins/songusage/forms/__init__.py b/openlp/plugins/songusage/forms/__init__.py index ef99bce89..c95384e5e 100644 --- a/openlp/plugins/songusage/forms/__init__.py +++ b/openlp/plugins/songusage/forms/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -25,4 +25,4 @@ ############################################################################### from songusagedeleteform import SongUsageDeleteForm -from songusagedetailform import SongUsageDetailForm \ No newline at end of file +from songusagedetailform import SongUsageDetailForm diff --git a/openlp/plugins/songusage/forms/songusagedeletedialog.py b/openlp/plugins/songusage/forms/songusagedeletedialog.py index 9dc4219fc..879056e16 100644 --- a/openlp/plugins/songusage/forms/songusagedeletedialog.py +++ b/openlp/plugins/songusage/forms/songusagedeletedialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songusage/forms/songusagedeleteform.py b/openlp/plugins/songusage/forms/songusagedeleteform.py index c03fe15a3..a96aacccd 100644 --- a/openlp/plugins/songusage/forms/songusagedeleteform.py +++ b/openlp/plugins/songusage/forms/songusagedeleteform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songusage/forms/songusagedetaildialog.py b/openlp/plugins/songusage/forms/songusagedetaildialog.py index 322e3eb4b..7c812efeb 100644 --- a/openlp/plugins/songusage/forms/songusagedetaildialog.py +++ b/openlp/plugins/songusage/forms/songusagedetaildialog.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songusage/forms/songusagedetailform.py b/openlp/plugins/songusage/forms/songusagedetailform.py index ff8ec4858..ee37b2a9c 100644 --- a/openlp/plugins/songusage/forms/songusagedetailform.py +++ b/openlp/plugins/songusage/forms/songusagedetailform.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/openlp/plugins/songusage/lib/__init__.py b/openlp/plugins/songusage/lib/__init__.py index c981e023b..860b25463 100644 --- a/openlp/plugins/songusage/lib/__init__.py +++ b/openlp/plugins/songusage/lib/__init__.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -25,4 +25,4 @@ ############################################################################### """ The :mod:`lib` module contains the library functions for the songusage plugin. -""" \ No newline at end of file +""" diff --git a/openlp/plugins/songusage/lib/db.py b/openlp/plugins/songusage/lib/db.py index 80079bf85..2508ddc14 100644 --- a/openlp/plugins/songusage/lib/db.py +++ b/openlp/plugins/songusage/lib/db.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -61,4 +61,4 @@ def init_schema(url): mapper(SongUsageItem, songusage_table) metadata.create_all(checkfirst=True) - return session \ No newline at end of file + return session diff --git a/openlp/plugins/songusage/songusageplugin.py b/openlp/plugins/songusage/songusageplugin.py index ec37dc65e..e1dc0f1a8 100644 --- a/openlp/plugins/songusage/songusageplugin.py +++ b/openlp/plugins/songusage/songusageplugin.py @@ -6,9 +6,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/resources/pyinstaller/hook-openlp.plugins.presentations.presentationplugin.py b/resources/pyinstaller/hook-openlp.plugins.presentations.presentationplugin.py index f99d4feac..2f00db438 100644 --- a/resources/pyinstaller/hook-openlp.plugins.presentations.presentationplugin.py +++ b/resources/pyinstaller/hook-openlp.plugins.presentations.presentationplugin.py @@ -4,11 +4,11 @@ ############################################################################### # OpenLP - Open Source Lyrics Projection # # --------------------------------------------------------------------------- # -# Copyright (c) 2008-2010 Raoul Snyman # -# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Copyright (c) 2008-2011 Raoul Snyman # +# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/resources/pyinstaller/hook-openlp.py b/resources/pyinstaller/hook-openlp.py index 489c633f6..7e954551f 100644 --- a/resources/pyinstaller/hook-openlp.py +++ b/resources/pyinstaller/hook-openlp.py @@ -4,11 +4,11 @@ ############################################################################### # OpenLP - Open Source Lyrics Projection # # --------------------------------------------------------------------------- # -# Copyright (c) 2008-2010 Raoul Snyman # -# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Copyright (c) 2008-2011 Raoul Snyman # +# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/scripts/generate_resources.sh b/scripts/generate_resources.sh index c2039a5b6..b363e58b6 100755 --- a/scripts/generate_resources.sh +++ b/scripts/generate_resources.sh @@ -4,10 +4,11 @@ ############################################################################### # OpenLP - Open Source Lyrics Projection # # --------------------------------------------------------------------------- # -# Copyright (c) 2008-2010 Raoul Snyman # -# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Christian Richter, Maikel Stuivenberg, Martin # -# Thompson, Jon Tibble, Carsten Tinggaard # +# Copyright (c) 2008-2011 Raoul Snyman # +# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/scripts/openlp-remoteclient.py b/scripts/openlp-remoteclient.py index 34fef44a8..11868e292 100644 --- a/scripts/openlp-remoteclient.py +++ b/scripts/openlp-remoteclient.py @@ -5,11 +5,11 @@ ############################################################################### # OpenLP - Open Source Lyrics Projection # # --------------------------------------------------------------------------- # -# Copyright (c) 2008-2010 Raoul Snyman # -# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Copyright (c) 2008-2011 Raoul Snyman # +# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/scripts/resources.patch b/scripts/resources.patch index cfcf4e37e..f80d31d73 100644 --- a/scripts/resources.patch +++ b/scripts/resources.patch @@ -1,9 +1,9 @@ ---- openlp/core/resources.py.old Mon Jun 21 23:16:19 2010 -+++ openlp/core/resources.py Mon Jun 21 23:27:48 2010 +--- openlp/core/resources.py.old Mon Jun 21 23:16:19 2010 ++++ openlp/core/resources.py Mon Jun 21 23:27:48 2010 @@ -1,10 +1,32 @@ # -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 - + -# Resource object code -# -# @@ -12,11 +12,11 @@ +############################################################################### +# OpenLP - Open Source Lyrics Projection # +# --------------------------------------------------------------------------- # -+# Copyright (c) 2008-2010 Raoul Snyman # -+# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael # -+# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -+# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -+# Carsten Tinggaard, Frode Woldsund # ++# Copyright (c) 2008-2011 Raoul Snyman # ++# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # ++# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # ++# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # ++# Tibble, Carsten Tinggaard, Frode Woldsund # +# --------------------------------------------------------------------------- # +# This program is free software; you can redistribute it and/or modify it # +# under the terms of the GNU General Public License as published by the Free # @@ -36,11 +36,11 @@ +store for use by OpenLP. +""" from PyQt4 import QtCore - + qt_resource_data = "\ @@ -48643,9 +48664,16 @@ " - + def qInitResources(): - QtCore.qRegisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data) + """ @@ -48,7 +48,7 @@ + """ + QtCore.qRegisterResourceData(0x01, qt_resource_struct, qt_resource_name, + qt_resource_data) - + def qCleanupResources(): - QtCore.qUnregisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data) + """ @@ -56,5 +56,5 @@ + """ + QtCore.qUnregisterResourceData(0x01, qt_resource_struct, qt_resource_name, + qt_resource_data) - + -qInitResources() diff --git a/scripts/translation_utils.py b/scripts/translation_utils.py index 495732085..df8d5dc5e 100755 --- a/scripts/translation_utils.py +++ b/scripts/translation_utils.py @@ -5,11 +5,11 @@ ############################################################################### # OpenLP - Open Source Lyrics Projection # # --------------------------------------------------------------------------- # -# Copyright (c) 2008-2010 Raoul Snyman # -# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Copyright (c) 2008-2011 Raoul Snyman # +# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/scripts/windows-builder.py b/scripts/windows-builder.py index 1af85853d..b4085712f 100644 --- a/scripts/windows-builder.py +++ b/scripts/windows-builder.py @@ -4,11 +4,11 @@ ############################################################################### # OpenLP - Open Source Lyrics Projection # # --------------------------------------------------------------------------- # -# Copyright (c) 2008-2010 Raoul Snyman # -# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Copyright (c) 2008-2011 Raoul Snyman # +# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # diff --git a/setup.py b/setup.py index 205688f1e..98e9d40fd 100755 --- a/setup.py +++ b/setup.py @@ -7,9 +7,9 @@ # --------------------------------------------------------------------------- # # Copyright (c) 2008-2011 Raoul Snyman # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # -# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # -# Carsten Tinggaard, Frode Woldsund # +# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, # +# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Carsten Tinggaard, Frode Woldsund # # --------------------------------------------------------------------------- # # This program is free software; you can redistribute it and/or modify it # # under the terms of the GNU General Public License as published by the Free # @@ -78,4 +78,4 @@ OpenLP (previously openlp.org) is free church presentation software, or lyrics p entry_points=""" # -*- Entry points: -*- """ -) \ No newline at end of file +) From 2c9d52de8ccf2f9d49815b7577955f8a230b4548 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat <googol@lavabit.com> Date: Thu, 24 Feb 2011 15:20:35 +0100 Subject: [PATCH 229/243] --- openlp/plugins/bibles/lib/csvbible.py | 2 -- openlp/plugins/bibles/lib/db.py | 4 +++- openlp/plugins/bibles/lib/openlp1.py | 2 -- openlp/plugins/bibles/lib/opensong.py | 2 -- openlp/plugins/bibles/lib/osis.py | 9 ++++----- 5 files changed, 7 insertions(+), 12 deletions(-) diff --git a/openlp/plugins/bibles/lib/csvbible.py b/openlp/plugins/bibles/lib/csvbible.py index 82872e15b..0b7f69c8f 100644 --- a/openlp/plugins/bibles/lib/csvbible.py +++ b/openlp/plugins/bibles/lib/csvbible.py @@ -94,8 +94,6 @@ class CSVBible(BibleDB): self.testamentsfile = None self.booksfile = kwargs[u'booksfile'] self.versesfile = kwargs[u'versefile'] - QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'openlp_stop_wizard'), self.stop_import) def setup_testaments(self): """ diff --git a/openlp/plugins/bibles/lib/db.py b/openlp/plugins/bibles/lib/db.py index b986b0d66..11a5eafc3 100644 --- a/openlp/plugins/bibles/lib/db.py +++ b/openlp/plugins/bibles/lib/db.py @@ -33,7 +33,7 @@ from sqlalchemy import Column, ForeignKey, or_, Table, types from sqlalchemy.orm import class_mapper, mapper, relation from sqlalchemy.orm.exc import UnmappedClassError -from openlp.core.lib import translate +from openlp.core.lib import Receiver, translate from openlp.core.lib.db import BaseModel, init_db, Manager from openlp.core.lib.ui import critical_error_message_box @@ -162,6 +162,8 @@ class BibleDB(QtCore.QObject, Manager): if u'file' in kwargs: self.get_name() self.wizard = None + QtCore.QObject.connect(Receiver.get_receiver(), + QtCore.SIGNAL(u'openlp_stop_wizard'), self.stop_import) def stop_import(self): """ diff --git a/openlp/plugins/bibles/lib/openlp1.py b/openlp/plugins/bibles/lib/openlp1.py index 73b7eb91a..438a4eb67 100644 --- a/openlp/plugins/bibles/lib/openlp1.py +++ b/openlp/plugins/bibles/lib/openlp1.py @@ -46,8 +46,6 @@ class OpenLP1Bible(BibleDB): log.debug(self.__class__.__name__) BibleDB.__init__(self, parent, **kwargs) self.filename = kwargs[u'filename'] - QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'openlp_stop_wizard'), self.stop_import) def do_import(self): """ diff --git a/openlp/plugins/bibles/lib/opensong.py b/openlp/plugins/bibles/lib/opensong.py index 9a0fd110d..4924b1259 100644 --- a/openlp/plugins/bibles/lib/opensong.py +++ b/openlp/plugins/bibles/lib/opensong.py @@ -46,8 +46,6 @@ class OpenSongBible(BibleDB): log.debug(self.__class__.__name__) BibleDB.__init__(self, parent, **kwargs) self.filename = kwargs['filename'] - QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'openlp_stop_wizard'), self.stop_import) def do_import(self): """ diff --git a/openlp/plugins/bibles/lib/osis.py b/openlp/plugins/bibles/lib/osis.py index 347730bf4..2900e2c32 100644 --- a/openlp/plugins/bibles/lib/osis.py +++ b/openlp/plugins/bibles/lib/osis.py @@ -41,14 +41,15 @@ log = logging.getLogger(__name__) class OSISBible(BibleDB): """ - OSIS Bible format importer class. + Bible importer class for the `OSIS <http://www.bibletechnologies.net/>`_ + format. For the xml specifications see the `Zefania XML Bible Markup + <http://bgfdb.de/zefaniaxml/bml/>`_ documentation. """ log.info(u'BibleOSISImpl loaded') def __init__(self, parent, **kwargs): """ - Constructor to create and set up an instance of the OpenSongBible - class. This class is used to import Bibles from OpenSong's XML format. + This class is used to import Bibles from the OSIS XML format. """ log.debug(self.__class__.__name__) BibleDB.__init__(self, parent, **kwargs) @@ -86,8 +87,6 @@ class OSISBible(BibleDB): finally: if fbibles: fbibles.close() - QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'openlp_stop_wizard'), self.stop_import) def do_import(self): """ From 63099832ad80bf8d4ac2a4f8e904f8b2b7723f40 Mon Sep 17 00:00:00 2001 From: Tim Bentley <tim.bentley@gmail.com> Date: Thu, 24 Feb 2011 16:55:17 +0000 Subject: [PATCH 230/243] Fix order --- openlp/core/ui/mainwindow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 9071016e8..eb9ce530e 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -279,7 +279,7 @@ class Ui_MainWindow(object): add_actions(self.SettingsLanguageMenu, self.LanguageGroup.actions()) add_actions(self.SettingsMenu, (self.settingsPluginListItem, self.SettingsLanguageMenu.menuAction(), None, - self.SettingsShortcutsItem, self.DisplayTagItem, + self.DisplayTagItem, self.SettingsShortcutsItem, self.SettingsConfigureItem)) add_actions(self.ToolsMenu, (self.ToolsAddToolItem, None)) add_actions(self.ToolsMenu, (self.ToolsOpenDataFolder, None)) From a2e0ecf314bf03d1f162154e9d136ee108779128 Mon Sep 17 00:00:00 2001 From: Jon Tibble <meths@btinternet.com> Date: Thu, 24 Feb 2011 19:13:51 +0000 Subject: [PATCH 231/243] Fix acknowledged missing verses --- openlp/plugins/bibles/lib/http.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/bibles/lib/http.py b/openlp/plugins/bibles/lib/http.py index 064a6064d..60b515f88 100644 --- a/openlp/plugins/bibles/lib/http.py +++ b/openlp/plugins/bibles/lib/http.py @@ -236,8 +236,20 @@ class BGExtract(object): while found_count < verse_count: content = content.findNext(u'sup', u'versenum') raw_verse_num = content.next - raw_verse_text = raw_verse_num.next - verse_list[int(str(raw_verse_num))] = unicode(raw_verse_text) + clean_verse_num = 0 + # Not all verses exist in all translations and may or may not be + # represented by a verse number. If they are not fine, if they are + # it will probably be in a format that breaks int(). We will then + # have no idea what garbage may be sucked in to the verse text so + # if we do not get a clean int() then ignore the verse completely. + try: + clean_verse_num = int(str(raw_verse_num)) + except ValueError: + log.exception(u'Illegal verse number in %s %s %s:%s', + version, bookname, chapter, unicode(raw_verse_num)) + if clean_verse_num: + raw_verse_text = raw_verse_num.next + verse_list[clean_verse_num] = unicode(raw_verse_text) found_count += 1 return SearchResults(bookname, chapter, verse_list) From ff0e1266a7cc33056a207b2ff92608ebddf5962b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20K=C3=B6hler?= <orangeshirt@web.de> Date: Thu, 24 Feb 2011 21:56:31 +0100 Subject: [PATCH 232/243] changed the handling of author unknown --- openlp/plugins/songs/lib/foilpresenterimport.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/openlp/plugins/songs/lib/foilpresenterimport.py b/openlp/plugins/songs/lib/foilpresenterimport.py index 25d5ae69c..7b555ac23 100644 --- a/openlp/plugins/songs/lib/foilpresenterimport.py +++ b/openlp/plugins/songs/lib/foilpresenterimport.py @@ -94,11 +94,10 @@ import os from lxml import etree, objectify from openlp.core.ui.wizard import WizardStrings -from openlp.plugins.songs.lib import VerseType +from openlp.plugins.songs.lib import add_author_unknown, VerseType from openlp.plugins.songs.lib.songimport import SongImport from openlp.plugins.songs.lib.db import Author, Book, Song, Topic from openlp.plugins.songs.lib.xml import SongXML -from openlp.plugins.songs.lib.ui import SongStrings log = logging.getLogger(__name__) @@ -293,13 +292,13 @@ class FoilPresenter(object): if copyright.find(u'Rechte') != -1: temp = copyright.partition(u'Rechte') copyright = temp[0] - markers = [u'Text +u\.?n?d? +Melodie[a-zA-Z0-9\,\. ]*:', + markers = [u'Text +u\.?n?d? +Melodie[\w\,\. ]*:', u'Text +u\.?n?d? +Musik', u'T & M', u'Melodie und Satz', - u'Text[a-zA-Z0-9\,\. ]*:', u'Melodie', u'Musik', u'Satz', + u'Text[\w\,\. ]*:', u'Melodie', u'Musik', u'Satz', u'Weise', u'[dD]eutsch', u'[dD]t[\.\:]', u'Englisch', u'[oO]riginal', u'Bearbeitung', u'[R|r]efrain'] for marker in markers: - copyright = re.compile(marker).sub(u'<marker>', copyright) + copyright = re.compile(marker).sub(u'<marker>', copyright, re.U) copyright = re.compile(u'(?<=<marker>) *:').sub(u'', copyright) i = 0 x = 0 @@ -338,8 +337,6 @@ class FoilPresenter(object): authors.append(tempx) elif (len(author) > 2): authors.append(author) - if not authors: - authors.append(SongStrings.AuthorUnknown) for display_name in authors: author = self.manager.get_object_filtered(Author, Author.display_name == display_name) @@ -350,6 +347,8 @@ class FoilPresenter(object): first_name = u' '.join(display_name.split(u' ')[:-1])) self.manager.save_object(author) song.authors.append(author) + if not song.authors: + add_author_unknown(self.manager, song) def _process_cclinumber(self, foilpresenterfolie, song): """ From 4cac889279f3582d41345cf59326e57c6db5c752 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat <googol@lavabit.com> Date: Thu, 24 Feb 2011 22:07:12 +0100 Subject: [PATCH 233/243] fix bug, clean ups --- openlp/plugins/bibles/lib/manager.py | 10 ---------- openlp/plugins/bibles/lib/mediaitem.py | 8 ++------ 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/openlp/plugins/bibles/lib/manager.py b/openlp/plugins/bibles/lib/manager.py index 251ce350b..1f56ef932 100644 --- a/openlp/plugins/bibles/lib/manager.py +++ b/openlp/plugins/bibles/lib/manager.py @@ -46,16 +46,6 @@ except ImportError: log = logging.getLogger(__name__) -class BibleMode(object): - """ - This is basically an enumeration class which specifies the mode of a Bible. - Mode refers to whether or not a Bible in OpenLP is a full Bible or needs to - be downloaded from the Internet on an as-needed basis. - """ - Full = 1 - Partial = 2 - - class BibleFormat(object): """ This is a special enumeration class that holds the various types of Bibles, diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index e7cf273c1..ab7897828 100644 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -482,7 +482,7 @@ class BibleMediaItem(MediaManagerItem): self.listView.clear() if self.listView.count() != 0: self.__checkSecondBible(bible, second_bible) - else: + elif self.search_results: self.displayResults(bible, second_bible) Receiver.send_message(u'cursor_normal') self.advancedSearchButton.setEnabled(True) @@ -698,11 +698,7 @@ class BibleMediaItem(MediaManagerItem): service_item.add_capability(ItemCapabilities.AllowsPreview) service_item.add_capability(ItemCapabilities.AllowsLoop) # Service Item: Title - for title in raw_title: - if not service_item.title: - service_item.title = title - else: - service_item.title += u', ' + title + service_item.title = u', '.join(raw_title) # Service Item: Theme if len(self.settings.bible_theme) == 0: service_item.theme = None From f91713b2ef7dec0ace759802966f4617a1dcf8cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20K=C3=B6hler?= <orangeshirt@web.de> Date: Thu, 24 Feb 2011 22:27:14 +0100 Subject: [PATCH 234/243] removed double space and control line length --- openlp/plugins/songs/lib/foilpresenterimport.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/plugins/songs/lib/foilpresenterimport.py b/openlp/plugins/songs/lib/foilpresenterimport.py index 7b555ac23..1a2aaa18d 100644 --- a/openlp/plugins/songs/lib/foilpresenterimport.py +++ b/openlp/plugins/songs/lib/foilpresenterimport.py @@ -298,7 +298,7 @@ class FoilPresenter(object): u'Weise', u'[dD]eutsch', u'[dD]t[\.\:]', u'Englisch', u'[oO]riginal', u'Bearbeitung', u'[R|r]efrain'] for marker in markers: - copyright = re.compile(marker).sub(u'<marker>', copyright, re.U) + copyright = re.compile(marker).sub(u'<marker>', copyright, re.U) copyright = re.compile(u'(?<=<marker>) *:').sub(u'', copyright) i = 0 x = 0 From 83fba055d5e712b6c9ca3d3b0db9841e3d0685aa Mon Sep 17 00:00:00 2001 From: Jon Tibble <meths@btinternet.com> Date: Fri, 25 Feb 2011 01:03:25 +0000 Subject: [PATCH 235/243] Fix non-saving OpenLyrics authors --- openlp/plugins/songs/lib/xml.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index 91111e40a..a2a73ec97 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -381,6 +381,7 @@ class OpenLyrics(object): author = Author.populate(display_name=display_name, last_name=display_name.split(u' ')[-1], first_name=u' '.join(display_name.split(u' ')[:-1])) + song.authors.append(author) if not song.authors: add_author_unknown(self.manager, song) From 6bcbd3526e87a7926daca66923d72196dd9a8b4f Mon Sep 17 00:00:00 2001 From: Raoul Snyman <raoul.snyman@saturnlaboratories.co.za> Date: Fri, 25 Feb 2011 08:16:32 +0200 Subject: [PATCH 236/243] Fixed bug #700859: Bible importers do not clean up properly after a failed import. --- openlp/plugins/bibles/forms/bibleimportform.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index fc37fad58..aea7c62e0 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -739,6 +739,7 @@ class BibleImportForm(OpenLPWizard): name=license_version, filename=unicode(self.field(u'openlp1_location').toString()) ) + bible_name = importer.name if importer.do_import(): self.manager.save_meta_data(license_version, license_version, license_copyright, license_permissions) @@ -754,3 +755,4 @@ class BibleImportForm(OpenLPWizard): self.progressLabel.setText(translate( 'BiblesPlugin.ImportWizardForm', 'Your Bible import failed.')) delete_database(self.plugin.settingsSection, importer.file) + del self.manager.db_cache[bible_name] From 5f48a38769e7c44755478fee3868645954427846 Mon Sep 17 00:00:00 2001 From: Raoul Snyman <raoul.snyman@saturnlaboratories.co.za> Date: Fri, 25 Feb 2011 08:24:35 +0200 Subject: [PATCH 237/243] Removed the need for the extra variable. --- openlp/plugins/bibles/forms/bibleimportform.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index aea7c62e0..67996e158 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -739,7 +739,6 @@ class BibleImportForm(OpenLPWizard): name=license_version, filename=unicode(self.field(u'openlp1_location').toString()) ) - bible_name = importer.name if importer.do_import(): self.manager.save_meta_data(license_version, license_version, license_copyright, license_permissions) @@ -754,5 +753,5 @@ class BibleImportForm(OpenLPWizard): else: self.progressLabel.setText(translate( 'BiblesPlugin.ImportWizardForm', 'Your Bible import failed.')) + del self.manager.db_cache[importer.name] delete_database(self.plugin.settingsSection, importer.file) - del self.manager.db_cache[bible_name] From 0dbc1c6e1a06375b5968587995309907049ed7f4 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat <googol@lavabit.com> Date: Fri, 25 Feb 2011 17:29:03 +0100 Subject: [PATCH 238/243] different clean ups --- .../plugins/songs/lib/foilpresenterimport.py | 8 +++---- openlp/plugins/songs/lib/mediaitem.py | 23 +++++-------------- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/openlp/plugins/songs/lib/foilpresenterimport.py b/openlp/plugins/songs/lib/foilpresenterimport.py index 1a2aaa18d..e232d7d2f 100644 --- a/openlp/plugins/songs/lib/foilpresenterimport.py +++ b/openlp/plugins/songs/lib/foilpresenterimport.py @@ -133,6 +133,7 @@ class FoilPresenterImport(SongImport): log.exception(u'XML syntax error in file %s' % file_path) return True + class FoilPresenter(object): """ This class represents the converter for Foilpresenter XML from a song. @@ -259,7 +260,6 @@ class FoilPresenter(object): copyright = None if copyright: strings = [] - author_temp = [] if copyright.find(u'Copyright') != -1: temp = copyright.partition(u'Copyright') copyright = temp[0] @@ -305,7 +305,7 @@ class FoilPresenter(object): while i != 1: if copyright.find(u'<marker>') != -1: temp = copyright.partition(u'<marker>') - if (temp[0].strip() != u'') & (x > 0): + if temp[0].strip() and x > 0: strings.append(temp[0]) copyright = temp[2] x += 1 @@ -330,12 +330,12 @@ class FoilPresenter(object): author = author.strip() if re.search( u'\w+\.?\s+\w{3,}\s+[a|u]nd\s|\w+\.?\s+\w{3,}\s+&\s', - author, re.U) != None: + author, re.U): temp = re.split(u'\s[a|u]nd\s|\s&\s', author) for tempx in temp: tempx = tempx.strip() authors.append(tempx) - elif (len(author) > 2): + elif len(author) > 2: authors.append(author) for display_name in authors: author = self.manager.get_object_filtered(Author, diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 1bf00b403..37579ce1d 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -218,13 +218,9 @@ class SongMediaItem(MediaManagerItem): self.listView.clear() searchresults.sort(cmp=self.collateSongTitles) for song in searchresults: - author_list = u'' - for author in song.authors: - if author_list != u'': - author_list = author_list + u', ' - author_list = author_list + author.display_name + author_list = [author.display_name for author in song.authors] song_title = unicode(song.title) - song_detail = u'%s (%s)' % (song_title, author_list) + song_detail = u'%s (%s)' % (song_title, u', '.join(author_list)) song_name = QtGui.QListWidgetItem(song_detail) song_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(song.id)) self.listView.addItem(song_name) @@ -334,9 +330,6 @@ class SongMediaItem(MediaManagerItem): def generateSlideData(self, service_item, item=None, xmlVersion=False): log.debug(u'generateSlideData (%s:%s)' % (service_item, item)) raw_footer = [] - author_list = u'' - author_audit = [] - ccli = u'' item_id = self._getIdOfItemToGenerate(item, self.remoteSong) service_item.add_capability(ItemCapabilities.AllowsEdit) service_item.add_capability(ItemCapabilities.AllowsPreview) @@ -397,13 +390,9 @@ class SongMediaItem(MediaManagerItem): for slide in verses: service_item.add_from_text(slide[:30], unicode(slide)) service_item.title = song.title - for author in song.authors: - if len(author_list) > 1: - author_list = author_list + u', ' - author_list = author_list + unicode(author.display_name) - author_audit.append(unicode(author.display_name)) + author_list = [unicode(author.display_name) for author in song.authors] raw_footer.append(song.title) - raw_footer.append(author_list) + raw_footer.append(u', '.join(author_list)) raw_footer.append(song.copyright) if QtCore.QSettings().value(u'general/ccli number', QtCore.QVariant(u'')).toString(): @@ -413,10 +402,10 @@ class SongMediaItem(MediaManagerItem): QtCore.QVariant(u'')).toString())) service_item.raw_footer = raw_footer service_item.audit = [ - song.title, author_audit, song.copyright, unicode(song.ccli_number) + song.title, author_list, song.copyright, unicode(song.ccli_number) ] service_item.data_string = {u'title': song.search_title, - u'authors': author_list} + u'authors': u', '.join(author_list)} service_item.xml_version = self.openLyrics.song_to_xml(song) return True From 0ed7e259fc86585ed65fa24ff7ba050f2ec9fa2d Mon Sep 17 00:00:00 2001 From: Andreas Preikschat <googol@lavabit.com> Date: Fri, 25 Feb 2011 18:05:01 +0100 Subject: [PATCH 239/243] removed white spaces --- openlp/core/lib/__init__.py | 4 ++-- openlp/core/lib/db.py | 10 +++++----- openlp/core/lib/settingsmanager.py | 8 ++++---- openlp/core/lib/ui.py | 14 +++++++------- openlp/core/theme/theme.py | 8 ++++---- openlp/core/ui/displaytagform.py | 2 +- openlp/core/ui/generaltab.py | 2 +- openlp/core/ui/thememanager.py | 6 +++--- openlp/core/utils/__init__.py | 4 ++-- openlp/plugins/bibles/lib/db.py | 2 +- openlp/plugins/bibles/lib/http.py | 10 +++++----- openlp/plugins/bibles/lib/manager.py | 2 +- openlp/plugins/media/mediaplugin.py | 2 +- .../plugins/presentations/lib/impresscontroller.py | 4 ++-- .../presentations/lib/presentationcontroller.py | 2 +- openlp/plugins/remotes/lib/httpserver.py | 2 +- openlp/plugins/songs/forms/editsongform.py | 6 +++--- openlp/plugins/songs/lib/easislidesimport.py | 2 +- openlp/plugins/songs/lib/ewimport.py | 4 ++-- openlp/plugins/songs/lib/foilpresenterimport.py | 4 ++-- openlp/plugins/songs/lib/mediaitem.py | 2 +- openlp/plugins/songs/lib/songimport.py | 2 +- 22 files changed, 51 insertions(+), 51 deletions(-) diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index 89ecaf3be..dc60a5a65 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -106,8 +106,8 @@ def translate(context, text, comment=None, def get_text_file_string(text_file): """ - Open a file and return its content as unicode string. If the supplied file - name is not a file then the function returns False. If there is an error + Open a file and return its content as unicode string. If the supplied file + name is not a file then the function returns False. If there is an error loading the file or the content can't be decoded then the function will return None. diff --git a/openlp/core/lib/db.py b/openlp/core/lib/db.py index 62150cce3..f6a7fdaad 100644 --- a/openlp/core/lib/db.py +++ b/openlp/core/lib/db.py @@ -65,7 +65,7 @@ def delete_database(plugin_name, db_file_name=None): The name of the plugin to remove the database for ``db_file_name`` - The database file name. Defaults to None resulting in the + The database file name. Defaults to None resulting in the plugin_name being used. """ db_file_path = None @@ -107,7 +107,7 @@ class Manager(object): The init_schema function for this database ``db_file_name`` - The file name to use for this database. Defaults to None resulting + The file name to use for this database. Defaults to None resulting in the plugin_name being used. """ settings = QtCore.QSettings() @@ -211,11 +211,11 @@ class Manager(object): The type of objects to return ``filter_clause`` - The filter governing selection of objects to return. Defaults to + The filter governing selection of objects to return. Defaults to None. ``order_by_ref`` - Any parameters to order the returned objects by. Defaults to None. + Any parameters to order the returned objects by. Defaults to None. """ query = self.session.query(object_class) if filter_clause is not None: @@ -232,7 +232,7 @@ class Manager(object): The type of objects to return. ``filter_clause`` - The filter governing selection of objects to return. Defaults to + The filter governing selection of objects to return. Defaults to None. """ query = self.session.query(object_class) diff --git a/openlp/core/lib/settingsmanager.py b/openlp/core/lib/settingsmanager.py index 3d8d8059e..d09497540 100644 --- a/openlp/core/lib/settingsmanager.py +++ b/openlp/core/lib/settingsmanager.py @@ -64,7 +64,7 @@ class SettingsManager(object): Read the last directory used for plugin. ``section`` - The section of code calling the method. This is used in the + The section of code calling the method. This is used in the settings key. ``num`` @@ -84,7 +84,7 @@ class SettingsManager(object): Save the last directory used for plugin. ``section`` - The section of code calling the method. This is used in the + The section of code calling the method. This is used in the settings key. ``directory`` @@ -160,11 +160,11 @@ class SettingsManager(object): Get a list of files from the data files path. ``section`` - Defaults to *None*. The section of code getting the files - used + Defaults to *None*. The section of code getting the files - used to load from a section's data subdirectory. ``extension`` - Defaults to *None*. The extension to search for. + Defaults to *None*. The extension to search for. """ path = AppLocation.get_data_path() if section: diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index c127d810d..eae4f60ca 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -130,7 +130,7 @@ def create_accept_reject_button_box(parent, okay=False): methods to handle the default ``accepted()`` and ``rejected()`` signals. ``parent`` - The parent object. This should be a ``QWidget`` descendant. + The parent object. This should be a ``QWidget`` descendant. ``okay`` If true creates an okay/cancel combination instead of save/cancel. @@ -185,15 +185,15 @@ def media_item_combo_box(parent, name): def create_delete_push_button(parent, icon=None): """ - Creates a standard push button with a delete label and optional icon. The + Creates a standard push button with a delete label and optional icon. The button is connected to the parent's ``onDeleteButtonClicked()`` method to handle the ``clicked()`` signal. ``parent`` - The parent object. This should be a ``QWidget`` descendant. + The parent object. This should be a ``QWidget`` descendant. ``icon`` - An icon to display on the button. This can be either a ``QIcon``, a + An icon to display on the button. This can be either a ``QIcon``, a resource path or a file name. """ delete_button = QtGui.QPushButton(parent) @@ -210,12 +210,12 @@ def create_delete_push_button(parent, icon=None): def create_up_down_push_button_set(parent): """ Creates a standard set of two push buttons, one for up and the other for - down, for use with lists. The buttons use arrow icons and no text and are + down, for use with lists. The buttons use arrow icons and no text and are connected to the parent's ``onUpButtonClicked()`` and ``onDownButtonClicked()`` to handle their respective ``clicked()`` signals. ``parent`` - The parent object. This should be a ``QWidget`` descendant. + The parent object. This should be a ``QWidget`` descendant. """ up_button = QtGui.QPushButton(parent) up_button.setIcon(build_icon(u':/services/service_up.png')) @@ -295,7 +295,7 @@ def create_valign_combo(form, parent, layout): The UI screen that the label and combo will appear on. ``parent`` - The parent object. This should be a ``QWidget`` descendant. + The parent object. This should be a ``QWidget`` descendant. ``layout`` A layout object to add the label and combo widgets to. diff --git a/openlp/core/theme/theme.py b/openlp/core/theme/theme.py index 17217113a..bb6b25a9e 100644 --- a/openlp/core/theme/theme.py +++ b/openlp/core/theme/theme.py @@ -92,7 +92,7 @@ class Theme(object): * ``solid`` - color ``BackgroundParameter2`` - Extra information about the background. The contents of this attribute + Extra information about the background. The contents of this attribute depend on the BackgroundType: * ``image`` - border color @@ -100,7 +100,7 @@ class Theme(object): * ``solid`` - N/A ``BackgroundParameter3`` - Extra information about the background. The contents of this attribute + Extra information about the background. The contents of this attribute depend on the BackgroundType: * ``image`` - N/A @@ -142,7 +142,7 @@ class Theme(object): Color for the outline (or None if Outline is 0) ``HorizontalAlign`` - The horizontal alignment to apply to text. Valid alignments are: + The horizontal alignment to apply to text. Valid alignments are: * ``0`` - left align * ``1`` - right align @@ -156,7 +156,7 @@ class Theme(object): * ``2`` - centre align ``WrapStyle`` - The wrap style to apply to the text. Valid styles are: + The wrap style to apply to the text. Valid styles are: * ``0`` - normal * ``1`` - lyrics diff --git a/openlp/core/ui/displaytagform.py b/openlp/core/ui/displaytagform.py index 114a52bf6..e29fe3384 100644 --- a/openlp/core/ui/displaytagform.py +++ b/openlp/core/ui/displaytagform.py @@ -72,7 +72,7 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): def preLoad(self): """ Load the Tags from store so can be used in the system or used to - update the display. If Cancel was selected this is needed to reset the + update the display. If Cancel was selected this is needed to reset the dsiplay to the correct version. """ # Initial Load of the Tags diff --git a/openlp/core/ui/generaltab.py b/openlp/core/ui/generaltab.py index f2bcbbe7e..4eacc5959 100644 --- a/openlp/core/ui/generaltab.py +++ b/openlp/core/ui/generaltab.py @@ -45,7 +45,7 @@ class ValidEdit(QtGui.QLineEdit): def validText(self): """ - Only return Integers. Space is 0 + Only return Integers. Space is 0 """ if self.text().isEmpty(): return QtCore.QString(u'0') diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 974f98f61..0e04d7b46 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -266,7 +266,7 @@ class ThemeManager(QtGui.QWidget): oldThemeName = unicode(item.data(QtCore.Qt.UserRole).toString()) self.fileRenameForm.fileNameEdit.setText(oldThemeName) if self.fileRenameForm.exec_(): - newThemeName = unicode(self.fileRenameForm.fileNameEdit.text()) + newThemeName = unicode(self.fileRenameForm.fileNameEdit.text()) if self.checkIfThemeExists(newThemeName): oldThemeData = self.getThemeData(oldThemeName) self.cloneThemeData(oldThemeData, newThemeName) @@ -284,7 +284,7 @@ class ThemeManager(QtGui.QWidget): oldThemeName = unicode(item.data(QtCore.Qt.UserRole).toString()) self.fileRenameForm.fileNameEdit.setText(oldThemeName) if self.fileRenameForm.exec_(True): - newThemeName = unicode(self.fileRenameForm.fileNameEdit.text()) + newThemeName = unicode(self.fileRenameForm.fileNameEdit.text()) if self.checkIfThemeExists(newThemeName): themeData = self.getThemeData(oldThemeName) self.cloneThemeData(themeData, newThemeName) @@ -399,7 +399,7 @@ class ThemeManager(QtGui.QWidget): def onImportTheme(self): """ Opens a file dialog to select the theme file(s) to import before - attempting to extract OpenLP themes from those files. This process + attempting to extract OpenLP themes from those files. This process will load both OpenLP version 1 and version 2 themes. """ files = QtGui.QFileDialog.getOpenFileNames(self, diff --git a/openlp/core/utils/__init__.py b/openlp/core/utils/__init__.py index 86372e080..70b994653 100644 --- a/openlp/core/utils/__init__.py +++ b/openlp/core/utils/__init__.py @@ -242,7 +242,7 @@ def add_actions(target, actions): The menu or toolbar to add actions to. ``actions`` - The actions to be added. An action consisting of the keyword 'None' + The actions to be added. An action consisting of the keyword 'None' will result in a separator being inserted into the target. """ for action in actions: @@ -318,7 +318,7 @@ def get_web_page(url, header=None, update_openlp=False): Tells OpenLP to update itself if the page is successfully downloaded. Defaults to False. """ - # TODO: Add proxy usage. Get proxy info from OpenLP settings, add to a + # TODO: Add proxy usage. Get proxy info from OpenLP settings, add to a # proxy_handler, build into an opener and install the opener into urllib2. # http://docs.python.org/library/urllib2.html if not url: diff --git a/openlp/plugins/bibles/lib/db.py b/openlp/plugins/bibles/lib/db.py index 63dd15466..5cf000ee1 100644 --- a/openlp/plugins/bibles/lib/db.py +++ b/openlp/plugins/bibles/lib/db.py @@ -322,7 +322,7 @@ class BibleDB(QtCore.QObject, Manager): def get_books(self): """ A wrapper so both local and web bibles have a get_books() method that - manager can call. Used in the media manager advanced search tab. + manager can call. Used in the media manager advanced search tab. """ return self.get_all_objects(Book, order_by_ref=Book.id) diff --git a/openlp/plugins/bibles/lib/http.py b/openlp/plugins/bibles/lib/http.py index 60b515f88..e13985e4b 100644 --- a/openlp/plugins/bibles/lib/http.py +++ b/openlp/plugins/bibles/lib/http.py @@ -238,8 +238,8 @@ class BGExtract(object): raw_verse_num = content.next clean_verse_num = 0 # Not all verses exist in all translations and may or may not be - # represented by a verse number. If they are not fine, if they are - # it will probably be in a format that breaks int(). We will then + # represented by a verse number. If they are not fine, if they are + # it will probably be in a format that breaks int(). We will then # have no idea what garbage may be sucked in to the verse text so # if we do not get a clean int() then ignore the verse completely. try: @@ -384,7 +384,7 @@ class HTTPBible(BibleDB): BibleDB.__init__(self, parent, **kwargs) self.download_source = kwargs[u'download_source'] self.download_name = kwargs[u'download_name'] - # TODO: Clean up proxy stuff. We probably want one global proxy per + # TODO: Clean up proxy stuff. We probably want one global proxy per # connection type (HTTP and HTTPS) at most. self.proxy_server = None self.proxy_username = None @@ -458,8 +458,8 @@ class HTTPBible(BibleDB): search_results = self.get_chapter(book, reference[1]) if search_results and search_results.has_verselist(): ## We have found a book of the bible lets check to see - ## if it was there. By reusing the returned book name - ## we get a correct book. For example it is possible + ## if it was there. By reusing the returned book name + ## we get a correct book. For example it is possible ## to request ac and get Acts back. bookname = search_results.book Receiver.send_message(u'openlp_process_events') diff --git a/openlp/plugins/bibles/lib/manager.py b/openlp/plugins/bibles/lib/manager.py index 251ce350b..6794ec1ba 100644 --- a/openlp/plugins/bibles/lib/manager.py +++ b/openlp/plugins/bibles/lib/manager.py @@ -275,7 +275,7 @@ class BibleManager(object): 'Scripture Reference Error'), u'message': translate('BiblesPlugin.BibleManager', 'Your scripture reference is either not supported by OpenLP ' - 'or is invalid. Please make sure your reference conforms to ' + 'or is invalid. Please make sure your reference conforms to ' 'one of the following patterns:\n\n' 'Book Chapter\n' 'Book Chapter-Chapter\n' diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index ac3a2636b..3438f0279 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -63,7 +63,7 @@ class MediaPlugin(Plugin): if ext not in list: list.append(ext) self.serviceManager.supportedSuffixes(extension[1:]) - log.info(u'MediaPlugin: %s extensions: %s' % (mimetype, + log.info(u'MediaPlugin: %s extensions: %s' % (mimetype, u' '.join(extensions))) def about(self): diff --git a/openlp/plugins/presentations/lib/impresscontroller.py b/openlp/plugins/presentations/lib/impresscontroller.py index 2880bd27a..48fb85ed3 100644 --- a/openlp/plugins/presentations/lib/impresscontroller.py +++ b/openlp/plugins/presentations/lib/impresscontroller.py @@ -211,8 +211,8 @@ class ImpressDocument(PresentationDocument): """ Called when a presentation is added to the SlideController. It builds the environment, starts communcations with the background - OpenOffice task started earlier. If OpenOffice is not present is is - started. Once the environment is available the presentation is loaded + OpenOffice task started earlier. If OpenOffice is not present is is + started. Once the environment is available the presentation is loaded and started. ``presentation`` diff --git a/openlp/plugins/presentations/lib/presentationcontroller.py b/openlp/plugins/presentations/lib/presentationcontroller.py index d995baa8c..bd37746c1 100644 --- a/openlp/plugins/presentations/lib/presentationcontroller.py +++ b/openlp/plugins/presentations/lib/presentationcontroller.py @@ -357,7 +357,7 @@ class PresentationController(object): def __init__(self, plugin=None, name=u'PresentationController', document_class=PresentationDocument): """ - This is the constructor for the presentationcontroller object. This + This is the constructor for the presentationcontroller object. This provides an easy way for descendent plugins to populate common data. This method *must* be overridden, like so:: diff --git a/openlp/plugins/remotes/lib/httpserver.py b/openlp/plugins/remotes/lib/httpserver.py index 173c89e13..c92569a4a 100644 --- a/openlp/plugins/remotes/lib/httpserver.py +++ b/openlp/plugins/remotes/lib/httpserver.py @@ -43,7 +43,7 @@ log = logging.getLogger(__name__) class HttpServer(object): """ Ability to control OpenLP via a webbrowser - e.g. http://localhost:4316/send/slidecontroller_live_next + e.g. http://localhost:4316/send/slidecontroller_live_next http://localhost:4316/send/alerts_text?q=your%20alert%20text """ def __init__(self, parent): diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index ef47e5694..0e874c3d5 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -557,7 +557,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): """ Check the validity of the song. """ - # This checks data in the form *not* self.song. self.song is still + # This checks data in the form *not* self.song. self.song is still # None at this point. log.debug(u'Validate Song') # Lets be nice and assume the data is correct. @@ -714,14 +714,14 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): def saveSong(self, preview=False): """ Get all the data from the widgets on the form, and then save it to the - database. The form has been validated and all reference items + database. The form has been validated and all reference items (Authors, Books and Topics) have been saved before this function is called. ``preview`` Should be ``True`` if the song is also previewed (boolean). """ - # The Song() assignment. No database calls should be made while a + # The Song() assignment. No database calls should be made while a # Song() is in a partially complete state. if not self.song: self.song = Song() diff --git a/openlp/plugins/songs/lib/easislidesimport.py b/openlp/plugins/songs/lib/easislidesimport.py index 67f889898..c4683765b 100644 --- a/openlp/plugins/songs/lib/easislidesimport.py +++ b/openlp/plugins/songs/lib/easislidesimport.py @@ -96,7 +96,7 @@ class EasiSlidesImport(SongImport): mandatory=False): """ Add imported values to the song model converting them to unicode at the - same time. If the unicode decode fails or a mandatory attribute is not + same time. If the unicode decode fails or a mandatory attribute is not present _success is set to False so the importer can react appropriately. diff --git a/openlp/plugins/songs/lib/ewimport.py b/openlp/plugins/songs/lib/ewimport.py index 2119cc245..1f4ded5bd 100644 --- a/openlp/plugins/songs/lib/ewimport.py +++ b/openlp/plugins/songs/lib/ewimport.py @@ -72,7 +72,7 @@ def strip_rtf(blob, encoding): elif control_str == 'tab': clear_text.append(u'\t') # Prefer the encoding specified by the RTF data to that - # specified by the Paradox table header + # specified by the Paradox table header # West European encoding elif control_str == 'fcharset0': encoding = u'cp1252' @@ -163,7 +163,7 @@ class EasyWorshipSongImport(SongImport): if code_page == 852: self.encoding = u'cp1250' # The following codepage to actual encoding mappings have not been - # observed, but merely guessed. Actual example files are needed. + # observed, but merely guessed. Actual example files are needed. elif code_page == 737: self.encoding = u'cp1253' elif code_page == 775: diff --git a/openlp/plugins/songs/lib/foilpresenterimport.py b/openlp/plugins/songs/lib/foilpresenterimport.py index e232d7d2f..c0f9f093d 100644 --- a/openlp/plugins/songs/lib/foilpresenterimport.py +++ b/openlp/plugins/songs/lib/foilpresenterimport.py @@ -296,7 +296,7 @@ class FoilPresenter(object): u'Text +u\.?n?d? +Musik', u'T & M', u'Melodie und Satz', u'Text[\w\,\. ]*:', u'Melodie', u'Musik', u'Satz', u'Weise', u'[dD]eutsch', u'[dD]t[\.\:]', u'Englisch', - u'[oO]riginal', u'Bearbeitung', u'[R|r]efrain'] + u'[oO]riginal', u'Bearbeitung', u'[R|r]efrain'] for marker in markers: copyright = re.compile(marker).sub(u'<marker>', copyright, re.U) copyright = re.compile(u'(?<=<marker>) *:').sub(u'', copyright) @@ -411,7 +411,7 @@ class FoilPresenter(object): temp_verse_order_backup = [] temp_sortnr_backup = 1 temp_sortnr_liste = [] - versenumber = {u'V': 1, u'C': 1, u'B': 1, u'E': 1, u'O': 1, u'I': 1, + versenumber = {u'V': 1, u'C': 1, u'B': 1, u'E': 1, u'O': 1, u'I': 1, u'P': 1} for strophe in foilpresenterfolie.strophen.strophe: text = self._child(strophe.text_) diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 37579ce1d..d9e9b3063 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -199,7 +199,7 @@ class SongMediaItem(MediaManagerItem): """ log.debug(u'onSongListLoad') # Called to redisplay the song list screen edit from a search - # or from the exit of the Song edit dialog. If remote editing is active + # or from the exit of the Song edit dialog. If remote editing is active # Trigger it and clean up so it will not update again. if self.remoteTriggered == u'L': self.onAddClick() diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index 0212184f8..5bfba9b77 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -347,7 +347,7 @@ class SongImport(QtCore.QObject): """ For debugging """ - print u'========================================' \ + print u'========================================' \ + u'========================================' print u'TITLE: ' + self.title print u'ALT TITLE: ' + self.alternate_title From 123b1beded13310a55e8da0c370160742d1750f8 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat <googol@lavabit.com> Date: Fri, 25 Feb 2011 18:27:06 +0100 Subject: [PATCH 240/243] added missing lines --- openlp/core/lib/db.py | 1 + openlp/core/lib/theme.py | 3 +++ openlp/plugins/presentations/lib/messagelistener.py | 1 + openlp/plugins/songs/lib/ewimport.py | 1 + openlp/plugins/songs/lib/mediaitem.py | 1 + openlp/plugins/songs/lib/opensongimport.py | 1 - 6 files changed, 7 insertions(+), 1 deletion(-) diff --git a/openlp/core/lib/db.py b/openlp/core/lib/db.py index f6a7fdaad..c92f992c8 100644 --- a/openlp/core/lib/db.py +++ b/openlp/core/lib/db.py @@ -91,6 +91,7 @@ class BaseModel(object): instance.__setattr__(key, kwargs[key]) return instance + class Manager(object): """ Provide generic object persistence management diff --git a/openlp/core/lib/theme.py b/openlp/core/lib/theme.py index 6f97c0608..ef26ca842 100644 --- a/openlp/core/lib/theme.py +++ b/openlp/core/lib/theme.py @@ -91,6 +91,7 @@ class ThemeLevel(object): Service = 2 Song = 3 + class BackgroundType(object): """ Type enumeration for backgrounds. @@ -123,6 +124,7 @@ class BackgroundType(object): elif type_string == u'image': return BackgroundType.Image + class BackgroundGradientType(object): """ Type enumeration for background gradients. @@ -200,6 +202,7 @@ INTEGER_LIST = [u'size', u'line_adjustment', u'x', u'height', u'y', u'width', u'shadow_size', u'outline_size', u'horizontal_align', u'vertical_align', u'wrap_style'] + class ThemeXML(object): """ A class to encapsulate the Theme XML. diff --git a/openlp/plugins/presentations/lib/messagelistener.py b/openlp/plugins/presentations/lib/messagelistener.py index cf43566ae..4db78f7a5 100644 --- a/openlp/plugins/presentations/lib/messagelistener.py +++ b/openlp/plugins/presentations/lib/messagelistener.py @@ -213,6 +213,7 @@ class Controller(object): def poll(self): self.doc.poll_slidenumber(self.is_live) + class MessageListener(object): """ This is the Presentation listener who acts on events from the slide diff --git a/openlp/plugins/songs/lib/ewimport.py b/openlp/plugins/songs/lib/ewimport.py index 1f4ded5bd..880c7f547 100644 --- a/openlp/plugins/songs/lib/ewimport.py +++ b/openlp/plugins/songs/lib/ewimport.py @@ -129,6 +129,7 @@ class FieldDescEntry: self.type = type self.size = size + class EasyWorshipSongImport(SongImport): """ The :class:`EasyWorshipSongImport` class provides OpenLP with the diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index d9e9b3063..d29e18c1d 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -53,6 +53,7 @@ class SongSearch(object): Authors = 4 Themes = 5 + class SongMediaItem(MediaManagerItem): """ This is the custom media manager item for Songs. diff --git a/openlp/plugins/songs/lib/opensongimport.py b/openlp/plugins/songs/lib/opensongimport.py index 8fddf5e4f..4da1234a5 100644 --- a/openlp/plugins/songs/lib/opensongimport.py +++ b/openlp/plugins/songs/lib/opensongimport.py @@ -36,7 +36,6 @@ from openlp.plugins.songs.lib.songimport import SongImport log = logging.getLogger(__name__) -#TODO: Use lxml for parsing and make sure we use methods of "SongImport" . class OpenSongImport(SongImport): """ Import songs exported from OpenSong From c12b84fa38417f4b2a3b11196a5beef118768da3 Mon Sep 17 00:00:00 2001 From: Tim Bentley <tim.bentley@gmail.com> Date: Fri, 25 Feb 2011 18:05:02 +0000 Subject: [PATCH 241/243] Make static static --- openlp/core/lib/rendermanager.py | 34 +++++++++++++++----------------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/openlp/core/lib/rendermanager.py b/openlp/core/lib/rendermanager.py index b68237b4a..eaf628a34 100644 --- a/openlp/core/lib/rendermanager.py +++ b/openlp/core/lib/rendermanager.py @@ -34,6 +34,15 @@ from openlp.core.ui import MainDisplay log = logging.getLogger(__name__) +VERSE = u'The Lord said to {r}Noah{/r}: \n' \ + 'There\'s gonna be a {su}floody{/su}, {sb}floody{/sb}\n' \ + 'The Lord said to {g}Noah{/g}:\n' \ + 'There\'s gonna be a {st}floody{/st}, {it}floody{/it}\n' \ + 'Get those children out of the muddy, muddy \n' \ + '{r}C{/r}{b}h{/b}{bl}i{/bl}{y}l{/y}{g}d{/g}{pk}' \ + 'r{/pk}{o}e{/o}{pp}n{/pp} of the Lord\n' +FOOTER = [u'Arky Arky (Unknown)', u'Public Domain', u'CCLI 123456'] + class RenderManager(object): """ Class to pull all Renderer interactions into one place. The plugins will @@ -202,28 +211,17 @@ class RenderManager(object): self.force_page = force_page # set the default image size for previews self.calculate_default(self.screens.preview[u'size']) - verse = u'The Lord said to {r}Noah{/r}: \n' \ - 'There\'s gonna be a {su}floody{/su}, {sb}floody{/sb}\n' \ - 'The Lord said to {g}Noah{/g}:\n' \ - 'There\'s gonna be a {st}floody{/st}, {it}floody{/it}\n' \ - 'Get those children out of the muddy, muddy \n' \ - '{r}C{/r}{b}h{/b}{bl}i{/bl}{y}l{/y}{g}d{/g}{pk}' \ - 'r{/pk}{o}e{/o}{pp}n{/pp} of the Lord\n' - # make big page for theme edit dialog to get line count - if self.force_page: - verse = verse + verse + verse - else: - self.image_manager.del_image(theme_data.theme_name) - footer = [] - footer.append(u'Arky Arky (Unknown)') - footer.append(u'Public Domain') - footer.append(u'CCLI 123456') # build a service item to generate preview serviceItem = ServiceItem() serviceItem.theme = theme_data - serviceItem.add_from_text(u'', verse, footer) + if self.force_page: + # make big page for theme edit dialog to get line count + serviceItem.add_from_text(u'', VERSE + VERSE + VERSE, FOOTER) + else: + self.image_manager.del_image(theme_data.theme_name) + serviceItem.add_from_text(u'', VERSE, FOOTER) serviceItem.render_manager = self - serviceItem.raw_footer = footer + serviceItem.raw_footer = FOOTER serviceItem.render(True) if not self.force_page: self.display.buildHtml(serviceItem) From fe2f80d1478c63a910f08b67142132c84723fe49 Mon Sep 17 00:00:00 2001 From: Jon Tibble <meths@btinternet.com> Date: Sat, 26 Feb 2011 00:34:46 +0000 Subject: [PATCH 242/243] Fix BibleGateway Jesus' speech --- openlp/plugins/bibles/lib/http.py | 38 ++++++++++++++++++------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/openlp/plugins/bibles/lib/http.py b/openlp/plugins/bibles/lib/http.py index 60b515f88..fcb1467f2 100644 --- a/openlp/plugins/bibles/lib/http.py +++ b/openlp/plugins/bibles/lib/http.py @@ -35,7 +35,7 @@ import socket import urllib from HTMLParser import HTMLParseError -from BeautifulSoup import BeautifulSoup, NavigableString +from BeautifulSoup import BeautifulSoup, NavigableString, Tag from openlp.core.lib import Receiver, translate from openlp.core.lib.ui import critical_error_message_box @@ -221,21 +221,14 @@ class BGExtract(object): crossrefs = soup.findAll(u'sup', u'xref') if crossrefs: [crossref.extract() for crossref in crossrefs] + headings = soup.findAll(u'h5') + if headings: + [heading.extract() for heading in headings] cleanup = [(re.compile('\s+'), lambda match: ' ')] verses = BeautifulSoup(str(soup), markupMassage=cleanup) - content = verses.find(u'div', u'result-text-style-normal') - if not content: - content = verses.find(u'div', u'result-text-style-rtl-serif') - if not content: - log.debug(u'No content found in the BibleGateway response.') - send_error_message(u'parse') - return None - verse_count = len(verses.findAll(u'sup', u'versenum')) - found_count = 0 verse_list = {} - while found_count < verse_count: - content = content.findNext(u'sup', u'versenum') - raw_verse_num = content.next + for verse in verses(u'sup', u'versenum'): + raw_verse_num = verse.next clean_verse_num = 0 # Not all verses exist in all translations and may or may not be # represented by a verse number. If they are not fine, if they are @@ -248,9 +241,22 @@ class BGExtract(object): log.exception(u'Illegal verse number in %s %s %s:%s', version, bookname, chapter, unicode(raw_verse_num)) if clean_verse_num: - raw_verse_text = raw_verse_num.next - verse_list[clean_verse_num] = unicode(raw_verse_text) - found_count += 1 + verse_text = raw_verse_num.next + part = raw_verse_num.next.next + while not (isinstance(part, Tag) and part.attrMap and + part.attrMap[u'class'] == u'versenum'): + # While we are still in the same verse grab all the text. + if isinstance(part, NavigableString): + verse_text = verse_text + part + if isinstance(part.next, Tag) and part.next.name == u'div': + # Run out of verses so stop. + break + part = part.next + verse_list[clean_verse_num] = unicode(verse_text) + if not verse_list: + log.debug(u'No content found in the BibleGateway response.') + send_error_message(u'parse') + return None return SearchResults(bookname, chapter, verse_list) From 631d8e84ff8e068320821631195869e6eec6d558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20K=C3=B6hler?= <orangeshirt@web.de> Date: Sat, 26 Feb 2011 09:14:37 +0100 Subject: [PATCH 243/243] adapt regex define author_temp again --- openlp/plugins/songs/lib/foilpresenterimport.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/songs/lib/foilpresenterimport.py b/openlp/plugins/songs/lib/foilpresenterimport.py index c0f9f093d..0d81e6f41 100644 --- a/openlp/plugins/songs/lib/foilpresenterimport.py +++ b/openlp/plugins/songs/lib/foilpresenterimport.py @@ -314,14 +314,15 @@ class FoilPresenter(object): i = 1 else: i = 1 + author_temp = [] for author in strings: temp = re.split(u',(?=\D{2})|(?<=\D),|\/(?=\D{3,})|(?<=\D);', author) for tempx in temp: author_temp.append(tempx) for author in author_temp: - regex = u'^[\/,;\-\s]+|[\/,;\-\s]+$|'\ - '\s*[0-9]{4}\s*[\-\/]?\s*([0-9]{4})?[\/,;\-\s]*$' + regex = u'^[\/,;\-\s\.]+|[\/,;\-\s\.]+$|'\ + '\s*[0-9]{4}\s*[\-\/]?\s*([0-9]{4})?[\/,;\-\s\.]*$' author = re.compile(regex).sub(u'', author) author = re.compile( u'[0-9]{1,2}\.\s?J(ahr)?h\.|um\s*$|vor\s*$').sub(u'',