forked from openlp/openlp
r1341
This commit is contained in:
commit
81e44feb66
21
README.txt
Normal file
21
README.txt
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
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!
|
||||||
|
|
@ -4,11 +4,11 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
# OpenLP - Open Source Lyrics Projection #
|
# OpenLP - Open Source Lyrics Projection #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2010 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -6,18 +6,18 @@ Object Library
|
|||||||
.. automodule:: openlp.core.lib
|
.. automodule:: openlp.core.lib
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
:mod:`BaseListWithDnD`
|
|
||||||
----------------------
|
|
||||||
|
|
||||||
.. autoclass:: openlp.core.lib.baselistwithdnd.BaseListWithDnD
|
|
||||||
:members:
|
|
||||||
|
|
||||||
:mod:`EventReceiver`
|
:mod:`EventReceiver`
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
.. autoclass:: openlp.core.lib.eventreceiver.EventReceiver
|
.. autoclass:: openlp.core.lib.eventreceiver.EventReceiver
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
|
:mod:`ListWidgetWithDnD`
|
||||||
|
------------------------
|
||||||
|
|
||||||
|
.. autoclass:: openlp.core.lib.listwidgetwithdnd.ListWidgetWithDnD
|
||||||
|
:members:
|
||||||
|
|
||||||
:mod:`MediaManagerItem`
|
:mod:`MediaManagerItem`
|
||||||
-----------------------
|
-----------------------
|
||||||
|
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
.. _core-theme:
|
.. _core-theme:
|
||||||
|
|
||||||
:mod:`theme` Module
|
Theme Function Library
|
||||||
===================
|
======================
|
||||||
|
|
||||||
.. automodule:: openlp.core.theme
|
.. automodule:: openlp.core.theme
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
|
.. autoclass:: openlp.core.theme.theme.Theme
|
||||||
|
:members:
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
.. _openlp:
|
|
||||||
|
|
||||||
:mod:`openlp` Module
|
|
||||||
====================
|
|
||||||
|
|
||||||
.. automodule:: openlp
|
|
||||||
:members:
|
|
@ -18,7 +18,7 @@ Forms
|
|||||||
.. automodule:: openlp.plugins.bibles.forms
|
.. automodule:: openlp.plugins.bibles.forms
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
.. autoclass:: openlp.plugins.bibles.forms.importwizardform.ImportWizardForm
|
.. autoclass:: openlp.plugins.bibles.forms.bibleimportform.BibleImportForm
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
Helper Classes & Functions
|
Helper Classes & Functions
|
||||||
|
@ -54,9 +54,6 @@ Helper Classes & Functions
|
|||||||
.. automodule:: openlp.plugins.songs.lib.mediaitem
|
.. automodule:: openlp.plugins.songs.lib.mediaitem
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
.. autoclass:: openlp.plugins.songs.lib.mediaitem.SongListView
|
|
||||||
:members:
|
|
||||||
|
|
||||||
.. automodule:: openlp.plugins.songs.lib.songimport
|
.. automodule:: openlp.plugins.songs.lib.songimport
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ copyright = u'2004-2010 Raoul Snyman'
|
|||||||
# The short X.Y version.
|
# The short X.Y version.
|
||||||
version = '2.0'
|
version = '2.0'
|
||||||
# The full version, including alpha/beta/rc tags.
|
# 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
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||||
# for a list of supported languages.
|
# for a list of supported languages.
|
||||||
@ -92,11 +92,13 @@ pygments_style = 'sphinx'
|
|||||||
|
|
||||||
# The theme to use for HTML and HTML Help pages. Major themes that come with
|
# The theme to use for HTML and HTML Help pages. Major themes that come with
|
||||||
# Sphinx are currently 'default' and 'sphinxdoc'.
|
# Sphinx are currently 'default' and 'sphinxdoc'.
|
||||||
|
#html_theme = 'openlp_qthelp'
|
||||||
html_theme = 'default'
|
html_theme = 'default'
|
||||||
|
|
||||||
# Theme options are theme-specific and customize the look and feel of a theme
|
# 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
|
# further. For a list of options available for each theme, see the
|
||||||
# documentation.
|
# documentation.
|
||||||
|
if html_theme == 'default':
|
||||||
html_theme_options = {
|
html_theme_options = {
|
||||||
'sidebarbgcolor': '#3a60a9',
|
'sidebarbgcolor': '#3a60a9',
|
||||||
'relbarbgcolor': '#203b6f',
|
'relbarbgcolor': '#203b6f',
|
||||||
@ -107,7 +109,7 @@ html_theme_options = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Add any paths that contain custom themes here, relative to this directory.
|
# 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
|
# The name for this set of Sphinx documents. If None, it defaults to
|
||||||
# "<project> v<release> documentation".
|
# "<project> v<release> documentation".
|
||||||
|
@ -149,15 +149,15 @@ Or, as root::
|
|||||||
root@linux: # nividia-settings
|
root@linux: # nividia-settings
|
||||||
|
|
||||||
If you do not want to write the changes to your ``xorg.conf`` file simply run
|
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,
|
the nVidia Settings program (:command:`nvidia-settings`) from your desktop's
|
||||||
usually in an administration or system menu, or from the terminal as a normal
|
menu, usually in an administration or system menu, or from the terminal as a
|
||||||
user run::
|
normal user run::
|
||||||
|
|
||||||
user@linux:~ $ nvidia-settings
|
user@linux:~ $ nvidia-settings
|
||||||
|
|
||||||
Once you have opened nVidia Settings, click on
|
Once you have opened nVidia Settings, click on :guilabel:`X Server Display
|
||||||
:guilabel:`X Server Display Configuration`. Then select the monitor you are
|
Configuration`. Then select the monitor you are wanting to use as your second
|
||||||
wanting to use as your second monitor and click :guilabel:`Configure`.
|
monitor and click :guilabel:`Configure`.
|
||||||
|
|
||||||
.. image:: pics/nvlinux1.png
|
.. image:: pics/nvlinux1.png
|
||||||
|
|
||||||
|
@ -17,10 +17,3 @@ Contents:
|
|||||||
mediamanager
|
mediamanager
|
||||||
songs
|
songs
|
||||||
|
|
||||||
Indices and tables
|
|
||||||
==================
|
|
||||||
|
|
||||||
* :ref:`genindex`
|
|
||||||
* :ref:`modindex`
|
|
||||||
* :ref:`search`
|
|
||||||
|
|
||||||
|
68
documentation/manual/themes/openlp_qthelp/layout.html
Normal file
68
documentation/manual/themes/openlp_qthelp/layout.html
Normal file
@ -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() %}
|
||||||
|
<p>
|
||||||
|
{%- block openlp_qthelprel1 %}
|
||||||
|
{%- endblock %}
|
||||||
|
{%- if prev %}
|
||||||
|
«  <a href="{{ prev.link|e }}">{{ prev.title }}</a>
|
||||||
|
  ::  
|
||||||
|
{%- endif %}
|
||||||
|
<a class="uplink" href="{{ pathto(master_doc) }}">{{ _('Contents') }}</a>
|
||||||
|
{%- if next %}
|
||||||
|
  ::  
|
||||||
|
<a href="{{ next.link|e }}">{{ next.title }}</a>  »
|
||||||
|
{%- endif %}
|
||||||
|
{%- block openlp_qthelprel2 %}
|
||||||
|
{%- endblock %}
|
||||||
|
</p>
|
||||||
|
{% endmacro %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<!-- div class="header">
|
||||||
|
{%- block openlp_qthelpheader %}
|
||||||
|
{%- if theme_full_logo != "false" %}
|
||||||
|
<a href="{{ pathto('index') }}">
|
||||||
|
<img class="logo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/>
|
||||||
|
</a>
|
||||||
|
{%- else %}
|
||||||
|
{%- if logo -%}
|
||||||
|
<img class="rightlogo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/>
|
||||||
|
{%- endif -%}
|
||||||
|
<h1 class="heading"><a href="{{ pathto('index') }}">
|
||||||
|
<span>{{ shorttitle|e }}</span></a></h1>
|
||||||
|
<h2 class="heading"><span>{{ title|striptags|e }}</span></h2>
|
||||||
|
{%- endif %}
|
||||||
|
{%- endblock %}
|
||||||
|
</div -->
|
||||||
|
<div class="topnav">
|
||||||
|
{{ nav() }}
|
||||||
|
</div>
|
||||||
|
<div class="content">
|
||||||
|
{#{%- if display_toc %}
|
||||||
|
<div id="toc">
|
||||||
|
<h3>Table Of Contents</h3>
|
||||||
|
{{ toc }}
|
||||||
|
</div>
|
||||||
|
{%- endif %}#}
|
||||||
|
{% block body %}{% endblock %}
|
||||||
|
</div>
|
||||||
|
<div class="bottomnav">
|
||||||
|
{{ nav() }}
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.0 KiB |
BIN
documentation/manual/themes/openlp_qthelp/static/bg-page.png
Normal file
BIN
documentation/manual/themes/openlp_qthelp/static/bg-page.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 164 B |
Binary file not shown.
After Width: | Height: | Size: 365 B |
@ -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 <revol@free.fr>
|
||||||
|
* Stephan Assmus <superstippi@gmx.de>
|
||||||
|
* Braden Ewing <brewin@gmail.com>
|
||||||
|
* Humdinger <humdingerb@gmail.com>
|
||||||
|
*
|
||||||
|
* :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;
|
||||||
|
}
|
12
documentation/manual/themes/openlp_qthelp/theme.conf
Normal file
12
documentation/manual/themes/openlp_qthelp/theme.conf
Normal file
@ -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
|
@ -7,9 +7,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -188,7 +188,8 @@ class OpenLP(QtGui.QApplication):
|
|||||||
u'primary': (self.desktop().primaryScreen() == screen)})
|
u'primary': (self.desktop().primaryScreen() == screen)})
|
||||||
log.info(u'Screen %d found with resolution %s', screen, size)
|
log.info(u'Screen %d found with resolution %s', screen, size)
|
||||||
# start the main app window
|
# 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()
|
self.mainWindow.show()
|
||||||
if show_splash:
|
if show_splash:
|
||||||
# now kill the splashscreen
|
# now kill the splashscreen
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -239,7 +239,8 @@ def resize_image(image, width, height, background=QtCore.Qt.black):
|
|||||||
Resize an image to fit on the current screen.
|
Resize an image to fit on the current screen.
|
||||||
|
|
||||||
``image``
|
``image``
|
||||||
The image to resize.
|
The image to resize. It has to be either a ``QImage`` instance or the
|
||||||
|
path to the image.
|
||||||
|
|
||||||
``width``
|
``width``
|
||||||
The new image width.
|
The new image width.
|
||||||
@ -319,8 +320,7 @@ def check_directory_exists(dir):
|
|||||||
if not os.path.exists(dir):
|
if not os.path.exists(dir):
|
||||||
os.makedirs(dir)
|
os.makedirs(dir)
|
||||||
|
|
||||||
from theme import ThemeLevel, ThemeXML, BackgroundGradientType, \
|
from listwidgetwithdnd import ListWidgetWithDnD
|
||||||
BackgroundType, HorizontalType, VerticalType
|
|
||||||
from displaytags import DisplayTags
|
from displaytags import DisplayTags
|
||||||
from spelltextedit import SpellTextEdit
|
from spelltextedit import SpellTextEdit
|
||||||
from eventreceiver import Receiver
|
from eventreceiver import Receiver
|
||||||
@ -339,4 +339,3 @@ from dockwidget import OpenLPDockWidget
|
|||||||
from renderer import Renderer
|
from renderer import Renderer
|
||||||
from rendermanager import RenderManager
|
from rendermanager import RenderManager
|
||||||
from mediamanageritem import MediaManagerItem
|
from mediamanageritem import MediaManagerItem
|
||||||
from baselistwithdnd import BaseListWithDnD
|
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -86,10 +86,11 @@ class BaseModel(object):
|
|||||||
"""
|
"""
|
||||||
Creates an instance of a class and populates it, returning the instance
|
Creates an instance of a class and populates it, returning the instance
|
||||||
"""
|
"""
|
||||||
me = cls()
|
instance = cls()
|
||||||
for key in kwargs:
|
for key in kwargs:
|
||||||
me.__setattr__(key, kwargs[key])
|
instance.__setattr__(key, kwargs[key])
|
||||||
return me
|
return instance
|
||||||
|
|
||||||
|
|
||||||
class Manager(object):
|
class Manager(object):
|
||||||
"""
|
"""
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -60,8 +60,8 @@ class DisplayTags(object):
|
|||||||
DisplayTags.html_expands.append(tag)
|
DisplayTags.html_expands.append(tag)
|
||||||
|
|
||||||
@staticmethod
|
@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)
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -28,7 +28,8 @@ import logging
|
|||||||
|
|
||||||
from PyQt4 import QtWebKit
|
from PyQt4 import QtWebKit
|
||||||
|
|
||||||
from openlp.core.lib import BackgroundType, BackgroundGradientType
|
from openlp.core.lib.theme import BackgroundType, BackgroundGradientType, \
|
||||||
|
VerticalType, HorizontalType
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -530,18 +531,8 @@ def build_lyrics_format_css(theme, width, height):
|
|||||||
Height of the lyrics block
|
Height of the lyrics block
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if theme.display_horizontal_align == 2:
|
align = HorizontalType.Names[theme.display_horizontal_align]
|
||||||
align = u'center'
|
valign = VerticalType.Names[theme.display_vertical_align]
|
||||||
elif theme.display_horizontal_align == 1:
|
|
||||||
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'
|
|
||||||
if theme.font_main_outline:
|
if theme.font_main_outline:
|
||||||
left_margin = int(theme.font_main_outline_size) * 2
|
left_margin = int(theme.font_main_outline_size) * 2
|
||||||
else:
|
else:
|
||||||
@ -634,13 +625,7 @@ def build_alert_css(alertTab, width):
|
|||||||
"""
|
"""
|
||||||
if not alertTab:
|
if not alertTab:
|
||||||
return u''
|
return u''
|
||||||
align = u''
|
align = VerticalType.Names[alertTab.location]
|
||||||
if alertTab.location == 2:
|
|
||||||
align = u'bottom'
|
|
||||||
elif alertTab.location == 1:
|
|
||||||
align = u'middle'
|
|
||||||
else:
|
|
||||||
align = u'top'
|
|
||||||
alert = style % (width, align, alertTab.font_face, alertTab.font_size,
|
alert = style % (width, align, alertTab.font_face, alertTab.font_size,
|
||||||
alertTab.font_color, alertTab.bg_color)
|
alertTab.font_color, alertTab.bg_color)
|
||||||
return alert
|
return alert
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -61,14 +61,15 @@ class Image(object):
|
|||||||
image = None
|
image = None
|
||||||
image_bytes = None
|
image_bytes = None
|
||||||
|
|
||||||
|
|
||||||
class ImageManager(QtCore.QObject):
|
class ImageManager(QtCore.QObject):
|
||||||
"""
|
"""
|
||||||
Image Manager handles the conversion and sizing of images.
|
Image Manager handles the conversion and sizing of images.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
log.info(u'Image Manager loaded')
|
log.info(u'Image Manager loaded')
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
QtCore.QObject.__init__(self)
|
||||||
self._cache = {}
|
self._cache = {}
|
||||||
self._thread_running = False
|
self._thread_running = False
|
||||||
self._cache_dirty = False
|
self._cache_dirty = False
|
||||||
@ -85,8 +86,7 @@ class ImageManager(QtCore.QObject):
|
|||||||
for key in self._cache.keys():
|
for key in self._cache.keys():
|
||||||
image = self._cache[key]
|
image = self._cache[key]
|
||||||
image.dirty = True
|
image.dirty = True
|
||||||
image.image = resize_image(image.path,
|
image.image = resize_image(image.path, self.width, self.height)
|
||||||
self.width, self.height)
|
|
||||||
self._cache_dirty = True
|
self._cache_dirty = True
|
||||||
# only one thread please
|
# only one thread please
|
||||||
if not self._thread_running:
|
if not self._thread_running:
|
||||||
@ -128,8 +128,7 @@ class ImageManager(QtCore.QObject):
|
|||||||
image = Image()
|
image = Image()
|
||||||
image.name = name
|
image.name = name
|
||||||
image.path = path
|
image.path = path
|
||||||
image.image = resize_image(path,
|
image.image = resize_image(path, self.width, self.height)
|
||||||
self.width, self.height)
|
|
||||||
self._cache[name] = image
|
self._cache[name] = image
|
||||||
else:
|
else:
|
||||||
log.debug(u'Image in cache %s:%s' % (name, path))
|
log.debug(u'Image in cache %s:%s' % (name, path))
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -28,17 +28,17 @@ Extend QListWidget to handle drag and drop functionality
|
|||||||
"""
|
"""
|
||||||
from PyQt4 import QtCore, QtGui
|
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
|
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
|
Initialise the list widget
|
||||||
"""
|
"""
|
||||||
QtGui.QListWidget.__init__(self, parent)
|
QtGui.QListWidget.__init__(self, parent)
|
||||||
# this must be set by the class which is inheriting
|
self.mimeDataText = name
|
||||||
assert(self.PluginName)
|
assert(self.mimeDataText)
|
||||||
|
|
||||||
def mouseMoveEvent(self, event):
|
def mouseMoveEvent(self, event):
|
||||||
"""
|
"""
|
||||||
@ -47,9 +47,10 @@ class BaseListWithDnD(QtGui.QListWidget):
|
|||||||
just tell it what plugin to call
|
just tell it what plugin to call
|
||||||
"""
|
"""
|
||||||
if event.buttons() != QtCore.Qt.LeftButton:
|
if event.buttons() != QtCore.Qt.LeftButton:
|
||||||
|
event.ignore()
|
||||||
return
|
return
|
||||||
drag = QtGui.QDrag(self)
|
drag = QtGui.QDrag(self)
|
||||||
mimeData = QtCore.QMimeData()
|
mimeData = QtCore.QMimeData()
|
||||||
drag.setMimeData(mimeData)
|
drag.setMimeData(mimeData)
|
||||||
mimeData.setText(self.PluginName)
|
mimeData.setText(self.mimeDataText)
|
||||||
drag.start(QtCore.Qt.CopyAction)
|
drag.start(QtCore.Qt.CopyAction)
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -33,7 +33,8 @@ from PyQt4 import QtCore, QtGui
|
|||||||
|
|
||||||
from openlp.core.lib import context_menu_action, context_menu_separator, \
|
from openlp.core.lib import context_menu_action, context_menu_separator, \
|
||||||
SettingsManager, OpenLPToolbar, ServiceItem, StringContent, build_icon, \
|
SettingsManager, OpenLPToolbar, ServiceItem, StringContent, build_icon, \
|
||||||
translate, Receiver
|
translate, Receiver, ListWidgetWithDnD
|
||||||
|
from openlp.core.lib.ui import UiStrings
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -65,19 +66,15 @@ class MediaManagerItem(QtGui.QWidget):
|
|||||||
When creating a descendant class from this class for your plugin,
|
When creating a descendant class from this class for your plugin,
|
||||||
the following member variables should be set.
|
the following member variables should be set.
|
||||||
|
|
||||||
``self.OnNewPrompt``
|
``self.onNewPrompt``
|
||||||
|
|
||||||
Defaults to *'Select Image(s)'*.
|
Defaults to *'Select Image(s)'*.
|
||||||
|
|
||||||
``self.OnNewFileMasks``
|
``self.onNewFileMasks``
|
||||||
Defaults to *'Images (*.jpg *jpeg *.gif *.png *.bmp)'*. This
|
Defaults to *'Images (*.jpg *jpeg *.gif *.png *.bmp)'*. This
|
||||||
assumes that the new action is to load a file. If not, you
|
assumes that the new action is to load a file. If not, you
|
||||||
need to override the ``OnNew`` method.
|
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``
|
``self.PreviewFunction``
|
||||||
This must be a method which returns a QImage to represent the
|
This must be a method which returns a QImage to represent the
|
||||||
item (usually a preview). No scaling is required, that is
|
item (usually a preview). No scaling is required, that is
|
||||||
@ -158,7 +155,7 @@ class MediaManagerItem(QtGui.QWidget):
|
|||||||
|
|
||||||
``icon``
|
``icon``
|
||||||
The icon of the button. This can be an instance of QIcon, or a
|
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 ':/'.
|
internal resource path starting with ':/'.
|
||||||
|
|
||||||
``slot``
|
``slot``
|
||||||
@ -202,68 +199,50 @@ class MediaManagerItem(QtGui.QWidget):
|
|||||||
"""
|
"""
|
||||||
Create buttons for the media item toolbar
|
Create buttons for the media item toolbar
|
||||||
"""
|
"""
|
||||||
|
toolbar_actions = []
|
||||||
## Import Button ##
|
## Import Button ##
|
||||||
if self.hasImportIcon:
|
if self.hasImportIcon:
|
||||||
import_string = self.plugin.getString(StringContent.Import)
|
toolbar_actions.append([StringContent.Import,
|
||||||
self.addToolbarButton(
|
u':/general/general_import.png', self.onImportClick])
|
||||||
import_string[u'title'],
|
|
||||||
import_string[u'tooltip'],
|
|
||||||
u':/general/general_import.png', self.onImportClick)
|
|
||||||
## Load Button ##
|
## Load Button ##
|
||||||
if self.hasFileIcon:
|
if self.hasFileIcon:
|
||||||
load_string = self.plugin.getString(StringContent.Load)
|
toolbar_actions.append([StringContent.Load,
|
||||||
self.addToolbarButton(
|
u':/general/general_open.png', self.onFileClick])
|
||||||
load_string[u'title'],
|
|
||||||
load_string[u'tooltip'],
|
|
||||||
u':/general/general_open.png', self.onFileClick)
|
|
||||||
## New Button ##
|
## New Button ##
|
||||||
if self.hasNewIcon:
|
if self.hasNewIcon:
|
||||||
new_string = self.plugin.getString(StringContent.New)
|
toolbar_actions.append([StringContent.New,
|
||||||
self.addToolbarButton(
|
u':/general/general_new.png', self.onNewClick])
|
||||||
new_string[u'title'],
|
|
||||||
new_string[u'tooltip'],
|
|
||||||
u':/general/general_new.png', self.onNewClick)
|
|
||||||
## Edit Button ##
|
## Edit Button ##
|
||||||
if self.hasEditIcon:
|
if self.hasEditIcon:
|
||||||
edit_string = self.plugin.getString(StringContent.Edit)
|
toolbar_actions.append([StringContent.Edit,
|
||||||
self.addToolbarButton(
|
u':/general/general_edit.png', self.onEditClick])
|
||||||
edit_string[u'title'],
|
|
||||||
edit_string[u'tooltip'],
|
|
||||||
u':/general/general_edit.png', self.onEditClick)
|
|
||||||
## Delete Button ##
|
## Delete Button ##
|
||||||
if self.hasDeleteIcon:
|
if self.hasDeleteIcon:
|
||||||
delete_string = self.plugin.getString(StringContent.Delete)
|
toolbar_actions.append([StringContent.Delete,
|
||||||
self.addToolbarButton(
|
u':/general/general_delete.png', self.onDeleteClick])
|
||||||
delete_string[u'title'],
|
|
||||||
delete_string[u'tooltip'],
|
|
||||||
u':/general/general_delete.png', self.onDeleteClick)
|
|
||||||
## Separator Line ##
|
## Separator Line ##
|
||||||
self.addToolbarSeparator()
|
self.addToolbarSeparator()
|
||||||
## Preview ##
|
## Preview ##
|
||||||
preview_string = self.plugin.getString(StringContent.Preview)
|
toolbar_actions.append([StringContent.Preview,
|
||||||
self.addToolbarButton(
|
u':/general/general_preview.png', self.onPreviewClick])
|
||||||
preview_string[u'title'],
|
|
||||||
preview_string[u'tooltip'],
|
|
||||||
u':/general/general_preview.png', self.onPreviewClick)
|
|
||||||
## Live Button ##
|
## Live Button ##
|
||||||
live_string = self.plugin.getString(StringContent.Live)
|
toolbar_actions.append([StringContent.Live,
|
||||||
self.addToolbarButton(
|
u':/general/general_live.png', self.onLiveClick])
|
||||||
live_string[u'title'],
|
|
||||||
live_string[u'tooltip'],
|
|
||||||
u':/general/general_live.png', self.onLiveClick)
|
|
||||||
## Add to service Button ##
|
## Add to service Button ##
|
||||||
service_string = self.plugin.getString(StringContent.Service)
|
toolbar_actions.append([StringContent.Service,
|
||||||
|
u':/general/general_add.png', self.onAddClick])
|
||||||
|
for action in toolbar_actions:
|
||||||
self.addToolbarButton(
|
self.addToolbarButton(
|
||||||
service_string[u'title'],
|
self.plugin.getString(action[0])[u'title'],
|
||||||
service_string[u'tooltip'],
|
self.plugin.getString(action[0])[u'tooltip'],
|
||||||
u':/general/general_add.png', self.onAddClick)
|
action[1], action[2])
|
||||||
|
|
||||||
def addListViewToToolBar(self):
|
def addListViewToToolBar(self):
|
||||||
"""
|
"""
|
||||||
Creates the main widget for listing items the media item is tracking
|
Creates the main widget for listing items the media item is tracking
|
||||||
"""
|
"""
|
||||||
# Add the List widget
|
# Add the List widget
|
||||||
self.listView = self.ListViewWithDnD_class(self)
|
self.listView = ListWidgetWithDnD(self, self.plugin.name)
|
||||||
self.listView.uniformItemSizes = True
|
self.listView.uniformItemSizes = True
|
||||||
self.listView.setSpacing(1)
|
self.listView.setSpacing(1)
|
||||||
self.listView.setSelectionMode(
|
self.listView.setSelectionMode(
|
||||||
@ -275,7 +254,6 @@ class MediaManagerItem(QtGui.QWidget):
|
|||||||
self.pageLayout.addWidget(self.listView)
|
self.pageLayout.addWidget(self.listView)
|
||||||
# define and add the context menu
|
# define and add the context menu
|
||||||
self.listView.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
|
self.listView.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
|
||||||
name_string = self.plugin.getString(StringContent.Name)
|
|
||||||
if self.hasEditIcon:
|
if self.hasEditIcon:
|
||||||
self.listView.addAction(
|
self.listView.addAction(
|
||||||
context_menu_action(
|
context_menu_action(
|
||||||
@ -340,9 +318,9 @@ class MediaManagerItem(QtGui.QWidget):
|
|||||||
Add a file to the list widget to make it available for showing
|
Add a file to the list widget to make it available for showing
|
||||||
"""
|
"""
|
||||||
files = QtGui.QFileDialog.getOpenFileNames(
|
files = QtGui.QFileDialog.getOpenFileNames(
|
||||||
self, self.OnNewPrompt,
|
self, self.onNewPrompt,
|
||||||
SettingsManager.get_last_dir(self.settingsSection),
|
SettingsManager.get_last_dir(self.settingsSection),
|
||||||
self.OnNewFileMasks)
|
self.onNewFileMasks)
|
||||||
log.info(u'New files(s) %s', unicode(files))
|
log.info(u'New files(s) %s', unicode(files))
|
||||||
if files:
|
if files:
|
||||||
Receiver.send_message(u'cursor_busy')
|
Receiver.send_message(u'cursor_busy')
|
||||||
@ -439,8 +417,7 @@ class MediaManagerItem(QtGui.QWidget):
|
|||||||
item to the preview slide controller.
|
item to the preview slide controller.
|
||||||
"""
|
"""
|
||||||
if not self.listView.selectedIndexes() and not self.remoteTriggered:
|
if not self.listView.selectedIndexes() and not self.remoteTriggered:
|
||||||
QtGui.QMessageBox.information(self,
|
QtGui.QMessageBox.information(self, UiStrings.NISp,
|
||||||
translate('OpenLP.MediaManagerItem', 'No Items Selected'),
|
|
||||||
translate('OpenLP.MediaManagerItem',
|
translate('OpenLP.MediaManagerItem',
|
||||||
'You must select one or more items to preview.'))
|
'You must select one or more items to preview.'))
|
||||||
else:
|
else:
|
||||||
@ -456,8 +433,7 @@ class MediaManagerItem(QtGui.QWidget):
|
|||||||
item to the live slide controller.
|
item to the live slide controller.
|
||||||
"""
|
"""
|
||||||
if not self.listView.selectedIndexes():
|
if not self.listView.selectedIndexes():
|
||||||
QtGui.QMessageBox.information(self,
|
QtGui.QMessageBox.information(self, UiStrings.NISp,
|
||||||
translate('OpenLP.MediaManagerItem', 'No Items Selected'),
|
|
||||||
translate('OpenLP.MediaManagerItem',
|
translate('OpenLP.MediaManagerItem',
|
||||||
'You must select one or more items to send live.'))
|
'You must select one or more items to send live.'))
|
||||||
else:
|
else:
|
||||||
@ -472,8 +448,7 @@ class MediaManagerItem(QtGui.QWidget):
|
|||||||
Add a selected item to the current service
|
Add a selected item to the current service
|
||||||
"""
|
"""
|
||||||
if not self.listView.selectedIndexes() and not self.remoteTriggered:
|
if not self.listView.selectedIndexes() and not self.remoteTriggered:
|
||||||
QtGui.QMessageBox.information(self,
|
QtGui.QMessageBox.information(self, UiStrings.NISp,
|
||||||
translate('OpenLP.MediaManagerItem', 'No Items Selected'),
|
|
||||||
translate('OpenLP.MediaManagerItem',
|
translate('OpenLP.MediaManagerItem',
|
||||||
'You must select one or more items.'))
|
'You must select one or more items.'))
|
||||||
else:
|
else:
|
||||||
@ -499,17 +474,14 @@ class MediaManagerItem(QtGui.QWidget):
|
|||||||
Add a selected item to an existing item in the current service.
|
Add a selected item to an existing item in the current service.
|
||||||
"""
|
"""
|
||||||
if not self.listView.selectedIndexes() and not self.remoteTriggered:
|
if not self.listView.selectedIndexes() and not self.remoteTriggered:
|
||||||
QtGui.QMessageBox.information(self,
|
QtGui.QMessageBox.information(self, UiStrings.NISp,
|
||||||
translate('OpenLP.MediaManagerItem', 'No items selected'),
|
|
||||||
translate('OpenLP.MediaManagerItem',
|
translate('OpenLP.MediaManagerItem',
|
||||||
'You must select one or more items'))
|
'You must select one or more items.'))
|
||||||
else:
|
else:
|
||||||
log.debug(u'%s Add requested', self.plugin.name)
|
log.debug(u'%s Add requested', self.plugin.name)
|
||||||
serviceItem = self.parent.serviceManager.getServiceItem()
|
serviceItem = self.parent.serviceManager.getServiceItem()
|
||||||
if not serviceItem:
|
if not serviceItem:
|
||||||
QtGui.QMessageBox.information(self,
|
QtGui.QMessageBox.information(self, UiStrings.NISs,
|
||||||
translate('OpenLP.MediaManagerItem',
|
|
||||||
'No Service Item Selected'),
|
|
||||||
translate('OpenLP.MediaManagerItem',
|
translate('OpenLP.MediaManagerItem',
|
||||||
'You must select an existing service item to add to.'))
|
'You must select an existing service item to add to.'))
|
||||||
elif self.plugin.name.lower() == serviceItem.name.lower():
|
elif self.plugin.name.lower() == serviceItem.name.lower():
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -31,6 +31,7 @@ import logging
|
|||||||
from PyQt4 import QtCore
|
from PyQt4 import QtCore
|
||||||
|
|
||||||
from openlp.core.lib import Receiver
|
from openlp.core.lib import Receiver
|
||||||
|
from openlp.core.lib.ui import UiStrings
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -44,6 +45,9 @@ class PluginStatus(object):
|
|||||||
|
|
||||||
|
|
||||||
class StringContent(object):
|
class StringContent(object):
|
||||||
|
"""
|
||||||
|
Provide standard strings for objects to use.
|
||||||
|
"""
|
||||||
Name = u'name'
|
Name = u'name'
|
||||||
Import = u'import'
|
Import = u'import'
|
||||||
Load = u'load'
|
Load = u'load'
|
||||||
@ -110,7 +114,8 @@ class Plugin(QtCore.QObject):
|
|||||||
"""
|
"""
|
||||||
log.info(u'loaded')
|
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
|
This is the constructor for the plugin object. This provides an easy
|
||||||
way for descendent plugins to populate common data. This method *must*
|
way for descendent plugins to populate common data. This method *must*
|
||||||
@ -128,15 +133,24 @@ class Plugin(QtCore.QObject):
|
|||||||
|
|
||||||
``pluginHelpers``
|
``pluginHelpers``
|
||||||
Defaults to *None*. A list of helper objects.
|
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)
|
QtCore.QObject.__init__(self)
|
||||||
self.name = name
|
self.name = name
|
||||||
self.textStrings = {}
|
self.textStrings = {}
|
||||||
self.setPluginTextStrings()
|
self.setPluginTextStrings()
|
||||||
|
self.nameStrings = self.textStrings[StringContent.Name]
|
||||||
if version:
|
if version:
|
||||||
self.version = version
|
self.version = version
|
||||||
self.settingsSection = self.name.lower()
|
self.settingsSection = self.name.lower()
|
||||||
self.icon = None
|
self.icon = None
|
||||||
|
self.mediaItemClass = mediaItemClass
|
||||||
|
self.settingsTabClass = settingsTabClass
|
||||||
self.weight = 0
|
self.weight = 0
|
||||||
self.status = PluginStatus.Inactive
|
self.status = PluginStatus.Inactive
|
||||||
# Set up logging
|
# Set up logging
|
||||||
@ -195,7 +209,9 @@ class Plugin(QtCore.QObject):
|
|||||||
Construct a MediaManagerItem object with all the buttons and things
|
Construct a MediaManagerItem object with all the buttons and things
|
||||||
you need, and return it for integration into openlp.org.
|
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):
|
def addImportMenuItem(self, importMenu):
|
||||||
"""
|
"""
|
||||||
@ -226,9 +242,13 @@ class Plugin(QtCore.QObject):
|
|||||||
|
|
||||||
def getSettingsTab(self):
|
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):
|
def addToMenu(self, menubar):
|
||||||
"""
|
"""
|
||||||
@ -316,8 +336,39 @@ class Plugin(QtCore.QObject):
|
|||||||
"""
|
"""
|
||||||
return self.textStrings[name]
|
return self.textStrings[name]
|
||||||
|
|
||||||
def setPluginTextStrings(self):
|
def setPluginUiTextStrings(self, tooltips):
|
||||||
"""
|
"""
|
||||||
Called to define all translatable texts of the plugin
|
Called to define all translatable texts of the plugin
|
||||||
"""
|
"""
|
||||||
pass
|
## Load Action ##
|
||||||
|
self.__setNameTextString(StringContent.Load,
|
||||||
|
UiStrings.Load, tooltips[u'load'])
|
||||||
|
## Import Action ##
|
||||||
|
self.__setNameTextString(StringContent.Import,
|
||||||
|
UiStrings.Import, tooltips[u'import'])
|
||||||
|
## New Action ##
|
||||||
|
self.__setNameTextString(StringContent.New,
|
||||||
|
UiStrings.Add, tooltips[u'new'])
|
||||||
|
## Edit Action ##
|
||||||
|
self.__setNameTextString(StringContent.Edit,
|
||||||
|
UiStrings.Edit, tooltips[u'edit'])
|
||||||
|
## Delete Action ##
|
||||||
|
self.__setNameTextString(StringContent.Delete,
|
||||||
|
UiStrings.Delete, tooltips[u'delete'])
|
||||||
|
## Preview Action ##
|
||||||
|
self.__setNameTextString(StringContent.Preview,
|
||||||
|
UiStrings.Preview, tooltips[u'preview'])
|
||||||
|
## Send Live Action ##
|
||||||
|
self.__setNameTextString(StringContent.Live,
|
||||||
|
UiStrings.Live, tooltips[u'live'])
|
||||||
|
## Add to Service Action ##
|
||||||
|
self.__setNameTextString(StringContent.Service,
|
||||||
|
UiStrings.Service, tooltips[u'service'])
|
||||||
|
|
||||||
|
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}
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -28,11 +28,21 @@ import logging
|
|||||||
|
|
||||||
from PyQt4 import QtCore
|
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
|
from openlp.core.ui import MainDisplay
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
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 RenderManager(object):
|
||||||
"""
|
"""
|
||||||
Class to pull all Renderer interactions into one place. The plugins will
|
Class to pull all Renderer interactions into one place. The plugins will
|
||||||
@ -68,7 +78,6 @@ class RenderManager(object):
|
|||||||
self.theme_level = u''
|
self.theme_level = u''
|
||||||
self.override_background = None
|
self.override_background = None
|
||||||
self.theme_data = None
|
self.theme_data = None
|
||||||
self.alertTab = None
|
|
||||||
self.force_page = False
|
self.force_page = False
|
||||||
|
|
||||||
def update_display(self):
|
def update_display(self):
|
||||||
@ -174,14 +183,13 @@ class RenderManager(object):
|
|||||||
main_rect = None
|
main_rect = None
|
||||||
footer_rect = None
|
footer_rect = None
|
||||||
if not theme.font_main_override:
|
if not theme.font_main_override:
|
||||||
main_rect = QtCore.QRect(10, 0,
|
main_rect = QtCore.QRect(10, 0, self.width - 20, self.footer_start)
|
||||||
self.width - 20, self.footer_start)
|
|
||||||
else:
|
else:
|
||||||
main_rect = QtCore.QRect(theme.font_main_x, theme.font_main_y,
|
main_rect = QtCore.QRect(theme.font_main_x, theme.font_main_y,
|
||||||
theme.font_main_width - 1, theme.font_main_height - 1)
|
theme.font_main_width - 1, theme.font_main_height - 1)
|
||||||
if not theme.font_footer_override:
|
if not theme.font_footer_override:
|
||||||
footer_rect = QtCore.QRect(10, self.footer_start,
|
footer_rect = QtCore.QRect(10, self.footer_start, self.width - 20,
|
||||||
self.width - 20, self.height - self.footer_start)
|
self.height - self.footer_start)
|
||||||
else:
|
else:
|
||||||
footer_rect = QtCore.QRect(theme.font_footer_x,
|
footer_rect = QtCore.QRect(theme.font_footer_x,
|
||||||
theme.font_footer_y, theme.font_footer_width - 1,
|
theme.font_footer_y, theme.font_footer_width - 1,
|
||||||
@ -203,28 +211,17 @@ class RenderManager(object):
|
|||||||
self.force_page = force_page
|
self.force_page = force_page
|
||||||
# set the default image size for previews
|
# set the default image size for previews
|
||||||
self.calculate_default(self.screens.preview[u'size'])
|
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
|
# build a service item to generate preview
|
||||||
serviceItem = ServiceItem()
|
serviceItem = ServiceItem()
|
||||||
serviceItem.theme = theme_data
|
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.render_manager = self
|
||||||
serviceItem.raw_footer = footer
|
serviceItem.raw_footer = FOOTER
|
||||||
serviceItem.render(True)
|
serviceItem.render(True)
|
||||||
if not self.force_page:
|
if not self.force_page:
|
||||||
self.display.buildHtml(serviceItem)
|
self.display.buildHtml(serviceItem)
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -28,11 +28,13 @@ The :mod:`serviceitem` provides the service item functionality including the
|
|||||||
type and capability of an item.
|
type and capability of an item.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import datetime
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from openlp.core.lib import build_icon, clean_tags, expand_tags
|
from openlp.core.lib import build_icon, clean_tags, expand_tags
|
||||||
|
from openlp.core.lib.ui import UiStrings
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -60,6 +62,7 @@ class ItemCapabilities(object):
|
|||||||
AddIfNewItem = 9
|
AddIfNewItem = 9
|
||||||
ProvidesOwnDisplay = 10
|
ProvidesOwnDisplay = 10
|
||||||
AllowsDetailedTitleDisplay = 11
|
AllowsDetailedTitleDisplay = 11
|
||||||
|
AllowsVarableStartTime = 12
|
||||||
|
|
||||||
|
|
||||||
class ServiceItem(object):
|
class ServiceItem(object):
|
||||||
@ -105,6 +108,8 @@ class ServiceItem(object):
|
|||||||
self.data_string = u''
|
self.data_string = u''
|
||||||
self.edit_id = None
|
self.edit_id = None
|
||||||
self.xml_version = None
|
self.xml_version = None
|
||||||
|
self.start_time = 0
|
||||||
|
self.media_length = 0
|
||||||
self._new_item()
|
self._new_item()
|
||||||
|
|
||||||
def _new_item(self):
|
def _new_item(self):
|
||||||
@ -257,7 +262,9 @@ class ServiceItem(object):
|
|||||||
u'capabilities': self.capabilities,
|
u'capabilities': self.capabilities,
|
||||||
u'search': self.search_string,
|
u'search': self.search_string,
|
||||||
u'data': self.data_string,
|
u'data': self.data_string,
|
||||||
u'xml_version': self.xml_version
|
u'xml_version': self.xml_version,
|
||||||
|
u'start_time': self.start_time,
|
||||||
|
u'media_length': self.media_length
|
||||||
}
|
}
|
||||||
service_data = []
|
service_data = []
|
||||||
if self.service_item_type == ServiceItemType.Text:
|
if self.service_item_type == ServiceItemType.Text:
|
||||||
@ -301,6 +308,10 @@ class ServiceItem(object):
|
|||||||
self.data_string = header[u'data']
|
self.data_string = header[u'data']
|
||||||
if u'xml_version' in header:
|
if u'xml_version' in header:
|
||||||
self.xml_version = header[u'xml_version']
|
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:
|
if self.service_item_type == ServiceItemType.Text:
|
||||||
for slide in serviceitem[u'serviceitem'][u'data']:
|
for slide in serviceitem[u'serviceitem'][u'data']:
|
||||||
self._raw_frames.append(slide)
|
self._raw_frames.append(slide)
|
||||||
@ -420,3 +431,24 @@ class ServiceItem(object):
|
|||||||
return self._raw_frames[row][u'path']
|
return self._raw_frames[row][u'path']
|
||||||
except IndexError:
|
except IndexError:
|
||||||
return u''
|
return u''
|
||||||
|
|
||||||
|
def get_media_time(self):
|
||||||
|
"""
|
||||||
|
Returns the start and finish time for a media item
|
||||||
|
"""
|
||||||
|
start = None
|
||||||
|
end = None
|
||||||
|
if self.start_time != 0:
|
||||||
|
start = UiStrings.StartTimeCode % \
|
||||||
|
unicode(datetime.timedelta(seconds=self.start_time))
|
||||||
|
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:
|
||||||
|
return start
|
||||||
|
elif not start and end:
|
||||||
|
return end
|
||||||
|
else:
|
||||||
|
return u'%s : %s' % (start, end)
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -33,7 +33,8 @@ import logging
|
|||||||
from xml.dom.minidom import Document
|
from xml.dom.minidom import Document
|
||||||
from lxml import etree, objectify
|
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__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -90,6 +91,7 @@ class ThemeLevel(object):
|
|||||||
Service = 2
|
Service = 2
|
||||||
Song = 3
|
Song = 3
|
||||||
|
|
||||||
|
|
||||||
class BackgroundType(object):
|
class BackgroundType(object):
|
||||||
"""
|
"""
|
||||||
Type enumeration for backgrounds.
|
Type enumeration for backgrounds.
|
||||||
@ -122,6 +124,7 @@ class BackgroundType(object):
|
|||||||
elif type_string == u'image':
|
elif type_string == u'image':
|
||||||
return BackgroundType.Image
|
return BackgroundType.Image
|
||||||
|
|
||||||
|
|
||||||
class BackgroundGradientType(object):
|
class BackgroundGradientType(object):
|
||||||
"""
|
"""
|
||||||
Type enumeration for background gradients.
|
Type enumeration for background gradients.
|
||||||
@ -164,13 +167,21 @@ class BackgroundGradientType(object):
|
|||||||
elif type_string == u'leftBottom':
|
elif type_string == u'leftBottom':
|
||||||
return BackgroundGradientType.LeftBottom
|
return BackgroundGradientType.LeftBottom
|
||||||
|
|
||||||
|
|
||||||
class HorizontalType(object):
|
class HorizontalType(object):
|
||||||
"""
|
"""
|
||||||
Type enumeration for horizontal alignment.
|
Type enumeration for horizontal alignment.
|
||||||
"""
|
"""
|
||||||
Left = 0
|
Left = 0
|
||||||
Center = 1
|
Right = 1
|
||||||
Right = 2
|
Center = 2
|
||||||
|
|
||||||
|
Names = [u'left', u'right', u'center']
|
||||||
|
TranslatedNames = [
|
||||||
|
translate('OpenLP.ThemeWizard', 'Left'),
|
||||||
|
translate('OpenLP.ThemeWizard', 'Right'),
|
||||||
|
translate('OpenLP.ThemeWizard', 'Center')]
|
||||||
|
|
||||||
|
|
||||||
class VerticalType(object):
|
class VerticalType(object):
|
||||||
"""
|
"""
|
||||||
@ -180,6 +191,10 @@ class VerticalType(object):
|
|||||||
Middle = 1
|
Middle = 1
|
||||||
Bottom = 2
|
Bottom = 2
|
||||||
|
|
||||||
|
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',
|
BOOLEAN_LIST = [u'bold', u'italics', u'override', u'outline', u'shadow',
|
||||||
u'slide_transition']
|
u'slide_transition']
|
||||||
|
|
||||||
@ -187,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'width', u'shadow_size', u'outline_size', u'horizontal_align',
|
||||||
u'vertical_align', u'wrap_style']
|
u'vertical_align', u'wrap_style']
|
||||||
|
|
||||||
|
|
||||||
class ThemeXML(object):
|
class ThemeXML(object):
|
||||||
"""
|
"""
|
||||||
A class to encapsulate the Theme XML.
|
A class to encapsulate the Theme XML.
|
||||||
@ -583,8 +599,7 @@ class ThemeXML(object):
|
|||||||
self.background_end_color,
|
self.background_end_color,
|
||||||
self.background_direction)
|
self.background_direction)
|
||||||
else:
|
else:
|
||||||
filename = \
|
filename = os.path.split(self.background_filename)[1]
|
||||||
os.path.split(self.background_filename)[1]
|
|
||||||
self.add_background_image(filename)
|
self.add_background_image(filename)
|
||||||
self.add_font(self.font_main_name,
|
self.add_font(self.font_main_name,
|
||||||
self.font_main_color,
|
self.font_main_color,
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -61,7 +61,7 @@ class OpenLPToolbar(QtGui.QToolBar):
|
|||||||
|
|
||||||
``icon``
|
``icon``
|
||||||
The icon of the button. This can be an instance of QIcon, or a
|
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 ':/'.
|
internal resource path starting with ':/'.
|
||||||
|
|
||||||
``tooltip``
|
``tooltip``
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -34,6 +34,66 @@ from openlp.core.lib import build_icon, Receiver, translate
|
|||||||
|
|
||||||
log = logging.getLogger(__name__)
|
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?
|
||||||
|
About = translate('OpenLP.Ui', 'About')
|
||||||
|
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:')
|
||||||
|
CreateService = translate('OpenLP.Ui', 'Create a new service.')
|
||||||
|
Delete = translate('OpenLP.Ui', '&Delete')
|
||||||
|
Edit = translate('OpenLP.Ui', '&Edit')
|
||||||
|
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'))
|
||||||
|
Live = translate('OpenLP.Ui', 'Live')
|
||||||
|
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')
|
||||||
|
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')
|
||||||
|
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')
|
||||||
|
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):
|
def add_welcome_page(parent, image):
|
||||||
"""
|
"""
|
||||||
Generate an opening welcome page for a wizard using a provided image.
|
Generate an opening welcome page for a wizard using a provided image.
|
||||||
@ -61,18 +121,25 @@ def add_welcome_page(parent, image):
|
|||||||
parent.welcomeLayout.addStretch()
|
parent.welcomeLayout.addStretch()
|
||||||
parent.addPage(parent.welcomePage)
|
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
|
Creates a standard dialog button box with two buttons. The buttons default
|
||||||
button box is connected to the parent's ``accept()`` and ``reject()``
|
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.
|
methods to handle the default ``accepted()`` and ``rejected()`` signals.
|
||||||
|
|
||||||
``parent``
|
``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.
|
||||||
"""
|
"""
|
||||||
button_box = QtGui.QDialogButtonBox(parent)
|
button_box = QtGui.QDialogButtonBox(parent)
|
||||||
button_box.setStandardButtons(
|
accept_button = QtGui.QDialogButtonBox.Save
|
||||||
QtGui.QDialogButtonBox.Save | QtGui.QDialogButtonBox.Cancel)
|
if okay:
|
||||||
|
accept_button = QtGui.QDialogButtonBox.Ok
|
||||||
|
button_box.setStandardButtons(accept_button | QtGui.QDialogButtonBox.Cancel)
|
||||||
button_box.setObjectName(u'%sButtonBox' % parent)
|
button_box.setObjectName(u'%sButtonBox' % parent)
|
||||||
QtCore.QObject.connect(button_box, QtCore.SIGNAL(u'accepted()'),
|
QtCore.QObject.connect(button_box, QtCore.SIGNAL(u'accepted()'),
|
||||||
parent.accept)
|
parent.accept)
|
||||||
@ -98,13 +165,12 @@ def critical_error_message_box(title=None, message=None, parent=None,
|
|||||||
``question``
|
``question``
|
||||||
Should this message box question the user.
|
Should this message box question the user.
|
||||||
"""
|
"""
|
||||||
error = translate('OpenLP.Ui', 'Error')
|
|
||||||
if question:
|
if question:
|
||||||
return QtGui.QMessageBox.critical(parent, error, message,
|
return QtGui.QMessageBox.critical(parent, UiStrings.Error, message,
|
||||||
QtGui.QMessageBox.StandardButtons(
|
QtGui.QMessageBox.StandardButtons(
|
||||||
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No))
|
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No))
|
||||||
data = {u'message': message}
|
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)
|
return Receiver.send_message(u'openlp_error_message', data)
|
||||||
|
|
||||||
def media_item_combo_box(parent, name):
|
def media_item_combo_box(parent, name):
|
||||||
@ -134,7 +200,7 @@ def create_delete_push_button(parent, icon=None):
|
|||||||
delete_button.setObjectName(u'deleteButton')
|
delete_button.setObjectName(u'deleteButton')
|
||||||
delete_icon = icon if icon else u':/general/general_delete.png'
|
delete_icon = icon if icon else u':/general/general_delete.png'
|
||||||
delete_button.setIcon(build_icon(delete_icon))
|
delete_button.setIcon(build_icon(delete_icon))
|
||||||
delete_button.setText(translate('OpenLP.Ui', '&Delete'))
|
delete_button.setText(UiStrings.Delete)
|
||||||
delete_button.setToolTip(
|
delete_button.setToolTip(
|
||||||
translate('OpenLP.Ui', 'Delete the selected item.'))
|
translate('OpenLP.Ui', 'Delete the selected item.'))
|
||||||
QtCore.QObject.connect(delete_button,
|
QtCore.QObject.connect(delete_button,
|
||||||
@ -219,3 +285,28 @@ def add_widget_completer(cache, widget):
|
|||||||
completer = QtGui.QCompleter(cache)
|
completer = QtGui.QCompleter(cache)
|
||||||
completer.setCaseSensitivity(QtCore.Qt.CaseInsensitive)
|
completer.setCaseSensitivity(QtCore.Qt.CaseInsensitive)
|
||||||
widget.setCompleter(completer)
|
widget.setCompleter(completer)
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
``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:'))
|
||||||
|
form.verticalComboBox = QtGui.QComboBox(parent)
|
||||||
|
form.verticalComboBox.setObjectName(u'VerticalComboBox')
|
||||||
|
form.verticalComboBox.addItem(UiStrings.Top)
|
||||||
|
form.verticalComboBox.addItem(UiStrings.Middle)
|
||||||
|
form.verticalComboBox.addItem(UiStrings.Bottom)
|
||||||
|
verticalLabel.setBuddy(form.verticalComboBox)
|
||||||
|
layout.addRow(verticalLabel, form.verticalComboBox)
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -33,11 +33,14 @@ processing version 1 themes in OpenLP version 2.
|
|||||||
from xml.etree.ElementTree import ElementTree, XML
|
from xml.etree.ElementTree import ElementTree, XML
|
||||||
from PyQt4 import QtGui
|
from PyQt4 import QtGui
|
||||||
|
|
||||||
DELPHI_COLORS = {u'clRed': 0xFF0000,
|
DELPHI_COLORS = {
|
||||||
u'clBlue': 0x0000FF,
|
u'clAqua': 0x00FFFF, u'clBlack': 0x000000, u'clBlue': 0x0000FF,
|
||||||
u'clYellow': 0xFFFF00,
|
u'clFuchsia': 0xFF00FF, u'clGray': 0x808080, u'clGreen': 0x008000,
|
||||||
u'clBlack': 0x000000,
|
u'clLime': 0x00FF00, u'clMaroon': 0x800000, u'clNavy': 0x000080,
|
||||||
u'clWhite': 0xFFFFFF}
|
u'clOlive': 0x808000, u'clPurple': 0x800080, u'clRed': 0xFF0000,
|
||||||
|
u'clSilver': 0xC0C0C0, u'clTeal': 0x008080, u'clWhite': 0xFFFFFF,
|
||||||
|
u'clYellow': 0xFFFF00
|
||||||
|
}
|
||||||
|
|
||||||
BLANK_STYLE_XML = \
|
BLANK_STYLE_XML = \
|
||||||
'''<?xml version="1.0" encoding="iso-8859-1"?>
|
'''<?xml version="1.0" encoding="iso-8859-1"?>
|
||||||
@ -69,37 +72,44 @@ class Theme(object):
|
|||||||
|
|
||||||
``BackgroundMode``
|
``BackgroundMode``
|
||||||
The behaviour of the background. Valid modes are:
|
The behaviour of the background. Valid modes are:
|
||||||
- 0 - Transparent
|
|
||||||
- 1 - Opaque
|
* ``0`` - Transparent
|
||||||
|
* ``1`` - Opaque
|
||||||
|
|
||||||
``BackgroundType``
|
``BackgroundType``
|
||||||
The content of the background. Valid types are:
|
The content of the background. Valid types are:
|
||||||
- 0 - solid color
|
|
||||||
- 1 - gradient color
|
* ``0`` - solid color
|
||||||
- 2 - image
|
* ``1`` - gradient color
|
||||||
|
* ``2`` - image
|
||||||
|
|
||||||
``BackgroundParameter1``
|
``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:
|
depend on the BackgroundType:
|
||||||
- image: image filename
|
|
||||||
- gradient: start color
|
* ``image`` - image filename
|
||||||
- solid: color
|
* ``gradient`` - start color
|
||||||
|
* ``solid`` - color
|
||||||
|
|
||||||
``BackgroundParameter2``
|
``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:
|
depend on the BackgroundType:
|
||||||
- image: border color
|
|
||||||
- gradient: end color
|
* ``image`` - border color
|
||||||
- solid: N/A
|
* ``gradient`` - end color
|
||||||
|
* ``solid`` - N/A
|
||||||
|
|
||||||
``BackgroundParameter3``
|
``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:
|
depend on the BackgroundType:
|
||||||
- image: N/A
|
|
||||||
- gradient: The direction of the gradient. Valid entries are:
|
* ``image`` - N/A
|
||||||
- 0 -> vertical
|
* ``gradient`` - The direction of the gradient. Valid entries are:
|
||||||
- 1 -> horizontal
|
|
||||||
- solid: N/A
|
* ``0`` - vertical
|
||||||
|
* ``1`` - horizontal
|
||||||
|
|
||||||
|
* ``solid`` - N/A
|
||||||
|
|
||||||
``FontName``
|
``FontName``
|
||||||
Name of the font to use for the main font.
|
Name of the font to use for the main font.
|
||||||
@ -115,36 +125,41 @@ class Theme(object):
|
|||||||
|
|
||||||
``Shadow``
|
``Shadow``
|
||||||
The shadow type to apply to the main font.
|
The shadow type to apply to the main font.
|
||||||
- 0 - no shadow
|
|
||||||
- non-zero - use shadow
|
* ``0`` - no shadow
|
||||||
|
* non-zero - use shadow
|
||||||
|
|
||||||
``ShadowColor``
|
``ShadowColor``
|
||||||
Color for the shadow
|
Color for the shadow
|
||||||
|
|
||||||
``Outline``
|
``Outline``
|
||||||
The outline to apply to the main font
|
The outline to apply to the main font
|
||||||
- 0 - no outline
|
|
||||||
- non-zero - use outline
|
* ``0`` - no outline
|
||||||
|
* non-zero - use outline
|
||||||
|
|
||||||
``OutlineColor``
|
``OutlineColor``
|
||||||
Color for the outline (or None if Outline is 0)
|
Color for the outline (or None if Outline is 0)
|
||||||
|
|
||||||
``HorizontalAlign``
|
``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
|
* ``0`` - left align
|
||||||
- 2 - centre align
|
* ``1`` - right align
|
||||||
|
* ``2`` - centre align
|
||||||
|
|
||||||
``VerticalAlign``
|
``VerticalAlign``
|
||||||
The vertical alignment to apply to the text. Valid alignments are:
|
The vertical alignment to apply to the text. Valid alignments are:
|
||||||
- 0 - top align
|
|
||||||
- 1 - bottom align
|
* ``0`` - top align
|
||||||
- 2 - centre align
|
* ``1`` - bottom align
|
||||||
|
* ``2`` - centre align
|
||||||
|
|
||||||
``WrapStyle``
|
``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
|
* ``0`` - normal
|
||||||
|
* ``1`` - lyrics
|
||||||
"""
|
"""
|
||||||
def __init__(self, xml):
|
def __init__(self, xml):
|
||||||
"""
|
"""
|
||||||
@ -184,7 +199,6 @@ class Theme(object):
|
|||||||
if element.tag != u'Theme':
|
if element.tag != u'Theme':
|
||||||
element_text = element.text
|
element_text = element.text
|
||||||
val = 0
|
val = 0
|
||||||
# easy!
|
|
||||||
if element_text is None:
|
if element_text is None:
|
||||||
val = element_text
|
val = element_text
|
||||||
# strings need special handling to sort the colours out
|
# strings need special handling to sort the colours out
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -28,7 +28,7 @@ The :mod:`ui` module provides the core user interface for OpenLP
|
|||||||
"""
|
"""
|
||||||
from PyQt4 import QtGui
|
from PyQt4 import QtGui
|
||||||
|
|
||||||
from openlp.core.lib import translate, Receiver
|
from openlp.core.lib import translate
|
||||||
|
|
||||||
class HideMode(object):
|
class HideMode(object):
|
||||||
"""
|
"""
|
||||||
@ -53,6 +53,7 @@ class HideMode(object):
|
|||||||
|
|
||||||
from themeform import ThemeForm
|
from themeform import ThemeForm
|
||||||
from filerenameform import FileRenameForm
|
from filerenameform import FileRenameForm
|
||||||
|
from starttimeform import StartTimeForm
|
||||||
from maindisplay import MainDisplay
|
from maindisplay import MainDisplay
|
||||||
from servicenoteform import ServiceNoteForm
|
from servicenoteform import ServiceNoteForm
|
||||||
from serviceitemeditform import ServiceItemEditForm
|
from serviceitemeditform import ServiceItemEditForm
|
||||||
@ -62,10 +63,10 @@ from splashscreen import SplashScreen
|
|||||||
from generaltab import GeneralTab
|
from generaltab import GeneralTab
|
||||||
from themestab import ThemesTab
|
from themestab import ThemesTab
|
||||||
from advancedtab import AdvancedTab
|
from advancedtab import AdvancedTab
|
||||||
from displaytagtab import DisplayTagTab
|
|
||||||
from aboutform import AboutForm
|
from aboutform import AboutForm
|
||||||
from pluginform import PluginForm
|
from pluginform import PluginForm
|
||||||
from settingsform import SettingsForm
|
from settingsform import SettingsForm
|
||||||
|
from displaytagform import DisplayTagForm
|
||||||
from shortcutlistform import ShortcutListForm
|
from shortcutlistform import ShortcutListForm
|
||||||
from mediadockmanager import MediaDockManager
|
from mediadockmanager import MediaDockManager
|
||||||
from servicemanager import ServiceManager
|
from servicemanager import ServiceManager
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -27,6 +27,7 @@
|
|||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import build_icon, translate
|
from openlp.core.lib import build_icon, translate
|
||||||
|
from openlp.core.lib.ui import UiStrings
|
||||||
|
|
||||||
class Ui_AboutDialog(object):
|
class Ui_AboutDialog(object):
|
||||||
def setupUi(self, aboutDialog):
|
def setupUi(self, aboutDialog):
|
||||||
@ -86,8 +87,7 @@ class Ui_AboutDialog(object):
|
|||||||
QtCore.QMetaObject.connectSlotsByName(aboutDialog)
|
QtCore.QMetaObject.connectSlotsByName(aboutDialog)
|
||||||
|
|
||||||
def retranslateUi(self, aboutDialog):
|
def retranslateUi(self, aboutDialog):
|
||||||
aboutDialog.setWindowTitle(translate('OpenLP.AboutForm',
|
aboutDialog.setWindowTitle(u'%s OpenLP' % UiStrings.About)
|
||||||
'About OpenLP'))
|
|
||||||
self.aboutTextEdit.setPlainText(translate('OpenLP.AboutForm',
|
self.aboutTextEdit.setPlainText(translate('OpenLP.AboutForm',
|
||||||
'OpenLP <version><revision> - Open Source Lyrics '
|
'OpenLP <version><revision> - Open Source Lyrics '
|
||||||
'Projection\n'
|
'Projection\n'
|
||||||
@ -105,8 +105,7 @@ class Ui_AboutDialog(object):
|
|||||||
'consider contributing by using the button below.'
|
'consider contributing by using the button below.'
|
||||||
))
|
))
|
||||||
self.aboutNotebook.setTabText(
|
self.aboutNotebook.setTabText(
|
||||||
self.aboutNotebook.indexOf(self.aboutTab),
|
self.aboutNotebook.indexOf(self.aboutTab), UiStrings.About)
|
||||||
translate('OpenLP.AboutForm', 'About'))
|
|
||||||
self.creditsTextEdit.setPlainText(translate('OpenLP.AboutForm',
|
self.creditsTextEdit.setPlainText(translate('OpenLP.AboutForm',
|
||||||
'Project Lead\n'
|
'Project Lead\n'
|
||||||
' Raoul "superfly" Snyman\n'
|
' Raoul "superfly" Snyman\n'
|
||||||
@ -164,9 +163,10 @@ class Ui_AboutDialog(object):
|
|||||||
self.licenseTextEdit.setPlainText(translate('OpenLP.AboutForm',
|
self.licenseTextEdit.setPlainText(translate('OpenLP.AboutForm',
|
||||||
'Copyright \xa9 2004-2011 Raoul Snyman\n'
|
'Copyright \xa9 2004-2011 Raoul Snyman\n'
|
||||||
'Portions copyright \xa9 2004-2011 '
|
'Portions copyright \xa9 2004-2011 '
|
||||||
'Tim Bentley, Jonathan Corwin, Michael Gorven, Scott Guerrieri, '
|
'Tim Bentley, Jonathan Corwin, Michael Gorven, Scott Guerrieri,\n'
|
||||||
'Christian Richter, Maikel Stuivenberg, Martin Thompson, Jon '
|
'Meinert Jordan, Andreas Preikschat, Christian Richter, Philip\n'
|
||||||
'Tibble, Carsten Tinggaard\n'
|
'Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, Carstenn'
|
||||||
|
'Tinggaard, Frode Woldsund\n'
|
||||||
'\n'
|
'\n'
|
||||||
'This program is free software; you can redistribute it and/or '
|
'This program is free software; you can redistribute it and/or '
|
||||||
'modify it under the terms of the GNU General Public License as '
|
'modify it under the terms of the GNU General Public License as '
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -28,7 +28,9 @@ The :mod:`advancedtab` provides an advanced settings facility.
|
|||||||
"""
|
"""
|
||||||
from PyQt4 import QtCore, QtGui
|
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):
|
class AdvancedTab(SettingsTab):
|
||||||
"""
|
"""
|
||||||
@ -40,6 +42,8 @@ class AdvancedTab(SettingsTab):
|
|||||||
Initialise the settings tab
|
Initialise the settings tab
|
||||||
"""
|
"""
|
||||||
SettingsTab.__init__(self, u'Advanced')
|
SettingsTab.__init__(self, u'Advanced')
|
||||||
|
self.default_image = u':/graphics/openlp-splash-screen.png'
|
||||||
|
self.default_color = u'#ffffff'
|
||||||
|
|
||||||
def setupUi(self):
|
def setupUi(self):
|
||||||
"""
|
"""
|
||||||
@ -80,49 +84,44 @@ class AdvancedTab(SettingsTab):
|
|||||||
self.hideMouseCheckBox.setObjectName(u'hideMouseCheckBox')
|
self.hideMouseCheckBox.setObjectName(u'hideMouseCheckBox')
|
||||||
self.hideMouseLayout.addWidget(self.hideMouseCheckBox)
|
self.hideMouseLayout.addWidget(self.hideMouseCheckBox)
|
||||||
self.leftLayout.addWidget(self.hideMouseGroupBox)
|
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.detailedServicePrintCheckBox = QtGui.QCheckBox(
|
|
||||||
self.serviceOrderGroupBox)
|
|
||||||
self.detailedServicePrintCheckBox.setObjectName(
|
|
||||||
u'detailedServicePrintCheckBox')
|
|
||||||
self.serviceOrderLayout.addWidget(self.detailedServicePrintCheckBox)
|
|
||||||
self.leftLayout.addWidget(self.serviceOrderGroupBox)
|
|
||||||
# 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.leftLayout.addStretch()
|
||||||
# self.databaseGroupBox = QtGui.QGroupBox(self.rightColumn)
|
self.defaultImageGroupBox = QtGui.QGroupBox(self.rightColumn)
|
||||||
# self.databaseGroupBox.setObjectName(u'databaseGroupBox')
|
self.defaultImageGroupBox.setObjectName(u'defaultImageGroupBox')
|
||||||
# self.databaseGroupBox.setEnabled(False)
|
self.defaultImageLayout = QtGui.QFormLayout(self.defaultImageGroupBox)
|
||||||
# self.databaseLayout = QtGui.QVBoxLayout(self.databaseGroupBox)
|
self.defaultImageLayout.setObjectName(u'defaultImageLayout')
|
||||||
# self.rightLayout.addWidget(self.databaseGroupBox)
|
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.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)
|
||||||
|
self.defaultFileLayout.addWidget(self.defaultBrowseButton)
|
||||||
|
self.defaultImageLayout.addRow(self.defaultFileLabel,
|
||||||
|
self.defaultFileLayout)
|
||||||
|
self.rightLayout.addWidget(self.defaultImageGroupBox)
|
||||||
self.rightLayout.addStretch()
|
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)
|
||||||
|
QtCore.QObject.connect(self.defaultBrowseButton,
|
||||||
|
QtCore.SIGNAL(u'pressed()'), self.onDefaultBrowseButtonPressed)
|
||||||
|
|
||||||
def retranslateUi(self):
|
def retranslateUi(self):
|
||||||
"""
|
"""
|
||||||
Setup the interface translation strings.
|
Setup the interface translation strings.
|
||||||
"""
|
"""
|
||||||
self.tabTitleVisible = translate('OpenLP.AdvancedTab', 'Advanced')
|
self.tabTitleVisible = UiStrings.Advanced
|
||||||
self.uiGroupBox.setTitle(translate('OpenLP.AdvancedTab', 'UI Settings'))
|
self.uiGroupBox.setTitle(translate('OpenLP.AdvancedTab', 'UI Settings'))
|
||||||
self.recentLabel.setText(
|
self.recentLabel.setText(
|
||||||
translate('OpenLP.AdvancedTab',
|
translate('OpenLP.AdvancedTab',
|
||||||
@ -138,19 +137,13 @@ class AdvancedTab(SettingsTab):
|
|||||||
self.hideMouseGroupBox.setTitle(translate('OpenLP.AdvancedTab',
|
self.hideMouseGroupBox.setTitle(translate('OpenLP.AdvancedTab',
|
||||||
'Mouse Cursor'))
|
'Mouse Cursor'))
|
||||||
self.hideMouseCheckBox.setText(translate('OpenLP.AdvancedTab',
|
self.hideMouseCheckBox.setText(translate('OpenLP.AdvancedTab',
|
||||||
'Hide the mouse cursor when moved over the display window'))
|
'Hide mouse cursor when over display window'))
|
||||||
self.serviceOrderGroupBox.setTitle(translate('OpenLP.AdvancedTab',
|
self.defaultImageGroupBox.setTitle(translate('OpenLP.AdvancedTab',
|
||||||
'Service Order Print'))
|
'Default Image'))
|
||||||
self.detailedServicePrintCheckBox.setText(
|
self.defaultColorLabel.setText(translate('OpenLP.AdvancedTab',
|
||||||
translate('OpenLP.AdvancedTab',
|
'Background color:'))
|
||||||
'Print slide texts and service item notes as well'))
|
self.defaultFileLabel.setText(translate('OpenLP.AdvancedTab',
|
||||||
# self.sharedDirGroupBox.setTitle(
|
'Image file:'))
|
||||||
# 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(translate('AdvancedTab', 'Browse...'))
|
|
||||||
# self.databaseGroupBox.setTitle(translate('AdvancedTab', 'Databases'))
|
|
||||||
|
|
||||||
def load(self):
|
def load(self):
|
||||||
"""
|
"""
|
||||||
@ -179,9 +172,14 @@ class AdvancedTab(SettingsTab):
|
|||||||
QtCore.QVariant(True)).toBool())
|
QtCore.QVariant(True)).toBool())
|
||||||
self.hideMouseCheckBox.setChecked(
|
self.hideMouseCheckBox.setChecked(
|
||||||
settings.value(u'hide mouse', QtCore.QVariant(False)).toBool())
|
settings.value(u'hide mouse', QtCore.QVariant(False)).toBool())
|
||||||
self.detailedServicePrintCheckBox.setChecked(settings.value(
|
self.default_color = settings.value(u'default color',
|
||||||
u'detailed service print', QtCore.QVariant(False)).toBool())
|
QtCore.QVariant(u'#ffffff')).toString()
|
||||||
|
self.defaultFileEdit.setText(settings.value(u'default image',
|
||||||
|
QtCore.QVariant(u':/graphics/openlp-splash-screen.png'))\
|
||||||
|
.toString())
|
||||||
settings.endGroup()
|
settings.endGroup()
|
||||||
|
self.defaultColorButton.setStyleSheet(
|
||||||
|
u'background-color: %s' % self.default_color)
|
||||||
|
|
||||||
def save(self):
|
def save(self):
|
||||||
"""
|
"""
|
||||||
@ -201,14 +199,24 @@ class AdvancedTab(SettingsTab):
|
|||||||
QtCore.QVariant(self.enableAutoCloseCheckBox.isChecked()))
|
QtCore.QVariant(self.enableAutoCloseCheckBox.isChecked()))
|
||||||
settings.setValue(u'hide mouse',
|
settings.setValue(u'hide mouse',
|
||||||
QtCore.QVariant(self.hideMouseCheckBox.isChecked()))
|
QtCore.QVariant(self.hideMouseCheckBox.isChecked()))
|
||||||
settings.setValue(u'detailed service print',
|
settings.setValue(u'default color', self.default_color)
|
||||||
QtCore.QVariant(self.detailedServicePrintCheckBox.isChecked()))
|
settings.setValue(u'default image', self.defaultFileEdit.text())
|
||||||
settings.endGroup()
|
settings.endGroup()
|
||||||
|
|
||||||
# def onSharedCheckBoxChanged(self, checked):
|
def onDefaultColorButtonPressed(self):
|
||||||
# """
|
new_color = QtGui.QColorDialog.getColor(
|
||||||
# Enables the widgets to allow a shared data location
|
QtGui.QColor(self.default_color), self)
|
||||||
# """
|
if new_color.isValid():
|
||||||
# self.sharedLabel.setEnabled(checked)
|
self.default_color = new_color.name()
|
||||||
# self.sharedTextEdit.setEnabled(checked)
|
self.defaultColorButton.setStyleSheet(
|
||||||
# self.sharedPushButton.setEnabled(checked)
|
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()
|
||||||
|
154
openlp/core/ui/displaytagdialog.py
Normal file
154
openlp/core/ui/displaytagdialog.py
Normal file
@ -0,0 +1,154 @@
|
|||||||
|
# -*- 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 PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
|
from openlp.core.lib import translate
|
||||||
|
from openlp.core.lib.ui import UiStrings, create_accept_reject_button_box
|
||||||
|
|
||||||
|
class Ui_DisplayTagDialog(object):
|
||||||
|
|
||||||
|
def setupUi(self, displayTagDialog):
|
||||||
|
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.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.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)
|
||||||
|
|
||||||
|
def retranslateUi(self, displayTagDialog):
|
||||||
|
displayTagDialog.setWindowTitle(translate('OpenLP.displayTagDialog',
|
||||||
|
'Configure Display Tags'))
|
||||||
|
self.editGroupBox.setTitle(
|
||||||
|
translate('OpenLP.DisplayTagDialog', 'Edit Selection'))
|
||||||
|
self.updatePushButton.setText(
|
||||||
|
translate('OpenLP.DisplayTagDialog', 'Update'))
|
||||||
|
self.descriptionLabel.setText(
|
||||||
|
translate('OpenLP.DisplayTagDialog', 'Description'))
|
||||||
|
self.tagLabel.setText(translate('OpenLP.DisplayTagDialog', 'Tag'))
|
||||||
|
self.startTagLabel.setText(
|
||||||
|
translate('OpenLP.DisplayTagDialog', 'Start tag'))
|
||||||
|
self.endTagLabel.setText(
|
||||||
|
translate('OpenLP.DisplayTagDialog', 'End tag'))
|
||||||
|
self.deletePushButton.setText(UiStrings.Delete)
|
||||||
|
self.defaultPushButton.setText(
|
||||||
|
translate('OpenLP.DisplayTagDialog', 'Default'))
|
||||||
|
self.newPushButton.setText(UiStrings.New)
|
||||||
|
self.tagTableWidget.horizontalHeaderItem(0).setText(
|
||||||
|
translate('OpenLP.DisplayTagDialog', 'Description'))
|
||||||
|
self.tagTableWidget.horizontalHeaderItem(1).setText(
|
||||||
|
translate('OpenLP.DisplayTagDialog', 'Tag id'))
|
||||||
|
self.tagTableWidget.horizontalHeaderItem(2).setText(
|
||||||
|
translate('OpenLP.DisplayTagDialog', 'Start Html'))
|
||||||
|
self.tagTableWidget.horizontalHeaderItem(3).setText(
|
||||||
|
translate('OpenLP.DisplayTagDialog', 'End Html'))
|
||||||
|
self.tagTableWidget.setColumnWidth(0, 120)
|
||||||
|
self.tagTableWidget.setColumnWidth(1, 40)
|
||||||
|
self.tagTableWidget.setColumnWidth(2, 240)
|
||||||
|
self.tagTableWidget.setColumnWidth(3, 240)
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -23,165 +23,31 @@
|
|||||||
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
|
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
|
||||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
'''
|
"""
|
||||||
The :mod:`DisplayTagTab` provides an Tag Edit facility. The Base set are
|
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.
|
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
|
The Custom Tag arrays are saved in a pickle so QSettings works on them. Base
|
||||||
Tags cannot be changed.
|
Tags cannot be changed.
|
||||||
|
"""
|
||||||
'''
|
|
||||||
import cPickle
|
import cPickle
|
||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
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 critical_error_message_box
|
from openlp.core.lib.ui import 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 .
|
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):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def preLoad(self):
|
|
||||||
"""
|
"""
|
||||||
Initialise values before the Load takes place
|
def __init__(self, parent):
|
||||||
"""
|
"""
|
||||||
# Create initial copy from master
|
Constructor
|
||||||
DisplayTags.reset_html_tags()
|
"""
|
||||||
user_expands = QtCore.QSettings().value(u'displayTags/html_tags',
|
QtGui.QDialog.__init__(self, parent)
|
||||||
QtCore.QVariant(u'')).toString()
|
self.setupUi(self)
|
||||||
# cPickle only accepts str not unicode strings
|
self.preLoad()
|
||||||
user_expands_string = str(unicode(user_expands).encode(u'utf8'))
|
|
||||||
if user_expands_string:
|
|
||||||
user_tags = cPickle.loads(user_expands_string)
|
|
||||||
# If we have some user ones added them as well
|
|
||||||
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(
|
|
||||||
translate('OpenLP.DisplayTagTab', 'Delete'))
|
|
||||||
self.defaultPushButton.setText(
|
|
||||||
translate('OpenLP.DisplayTagTab', 'Default'))
|
|
||||||
self.newPushButton.setText(translate('OpenLP.DisplayTagTab', '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.QObject.connect(self.tagTableWidget,
|
||||||
QtCore.SIGNAL(u'clicked(QModelIndex)'), self.onRowSelected)
|
QtCore.SIGNAL(u'clicked(QModelIndex)'), self.onRowSelected)
|
||||||
QtCore.QObject.connect(self.defaultPushButton,
|
QtCore.QObject.connect(self.defaultPushButton,
|
||||||
@ -193,35 +59,35 @@ class DisplayTagTab(SettingsTab):
|
|||||||
QtCore.QObject.connect(self.deletePushButton,
|
QtCore.QObject.connect(self.deletePushButton,
|
||||||
QtCore.SIGNAL(u'pressed()'), self.onDeletePushed)
|
QtCore.SIGNAL(u'pressed()'), self.onDeletePushed)
|
||||||
|
|
||||||
def load(self):
|
def exec_(self):
|
||||||
"""
|
"""
|
||||||
Load Display and set field state.
|
Load Display and set field state.
|
||||||
"""
|
"""
|
||||||
self.newPushButton.setEnabled(True)
|
# Create initial copy from master
|
||||||
self.updatePushButton.setEnabled(False)
|
self.preLoad()
|
||||||
self.deletePushButton.setEnabled(False)
|
self._resetTable()
|
||||||
for linenumber, html in enumerate(DisplayTags.get_html_tags()):
|
self.selected = -1
|
||||||
self.tagTableWidget.setRowCount(
|
return QtGui.QDialog.exec_(self)
|
||||||
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 save(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()
|
||||||
|
# cPickle only accepts str not unicode strings
|
||||||
|
user_expands_string = str(unicode(user_expands).encode(u'utf8'))
|
||||||
|
if user_expands_string:
|
||||||
|
user_tags = cPickle.loads(user_expands_string)
|
||||||
|
# If we have some user ones added them as well
|
||||||
|
for t in user_tags:
|
||||||
|
DisplayTags.add_html_tag(t)
|
||||||
|
|
||||||
|
def accept(self):
|
||||||
"""
|
"""
|
||||||
Save Custom tags in a pickle .
|
Save Custom tags in a pickle .
|
||||||
"""
|
"""
|
||||||
@ -236,13 +102,14 @@ class DisplayTagTab(SettingsTab):
|
|||||||
else:
|
else:
|
||||||
QtCore.QSettings().setValue(u'displayTags/html_tags',
|
QtCore.QSettings().setValue(u'displayTags/html_tags',
|
||||||
QtCore.QVariant(u''))
|
QtCore.QVariant(u''))
|
||||||
|
return QtGui.QDialog.accept(self)
|
||||||
|
|
||||||
def cancel(self):
|
def reject(self):
|
||||||
"""
|
"""
|
||||||
Reset Custom tags from Settings.
|
Reset Custom tags from Settings.
|
||||||
"""
|
"""
|
||||||
self.preLoad()
|
|
||||||
self._resetTable()
|
self._resetTable()
|
||||||
|
return QtGui.QDialog.reject(self)
|
||||||
|
|
||||||
def onRowSelected(self):
|
def onRowSelected(self):
|
||||||
"""
|
"""
|
||||||
@ -289,6 +156,7 @@ class DisplayTagTab(SettingsTab):
|
|||||||
self._resetTable()
|
self._resetTable()
|
||||||
# Highlight new row
|
# Highlight new row
|
||||||
self.tagTableWidget.selectRow(self.tagTableWidget.rowCount() - 1)
|
self.tagTableWidget.selectRow(self.tagTableWidget.rowCount() - 1)
|
||||||
|
self.onRowSelected()
|
||||||
|
|
||||||
def onDefaultPushed(self):
|
def onDefaultPushed(self):
|
||||||
"""
|
"""
|
||||||
@ -336,7 +204,29 @@ class DisplayTagTab(SettingsTab):
|
|||||||
"""
|
"""
|
||||||
self.tagTableWidget.clearContents()
|
self.tagTableWidget.clearContents()
|
||||||
self.tagTableWidget.setRowCount(0)
|
self.tagTableWidget.setRowCount(0)
|
||||||
self.load()
|
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):
|
def _strip(self, tag):
|
||||||
"""
|
"""
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -35,27 +35,28 @@ from PyQt4 import Qt, QtCore, QtGui
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
from PyQt4.phonon import Phonon
|
from PyQt4.phonon import Phonon
|
||||||
phonon_version = Phonon.phononVersion()
|
PHONON_VERSION = Phonon.phononVersion()
|
||||||
except ImportError:
|
except ImportError:
|
||||||
phonon_version = u'-'
|
PHONON_VERSION = u'-'
|
||||||
try:
|
try:
|
||||||
import chardet
|
import chardet
|
||||||
chardet_version = chardet.__version__
|
CHARDET_VERSION = chardet.__version__
|
||||||
except ImportError:
|
except ImportError:
|
||||||
chardet_version = u'-'
|
CHARDET_VERSION = u'-'
|
||||||
try:
|
try:
|
||||||
import enchant
|
import enchant
|
||||||
enchant_version = enchant.__version__
|
ENCHANT_VERSION = enchant.__version__
|
||||||
except ImportError:
|
except ImportError:
|
||||||
enchant_version = u'-'
|
ENCHANT_VERSION = u'-'
|
||||||
try:
|
try:
|
||||||
import sqlite
|
import sqlite
|
||||||
sqlite_version = sqlite.version
|
SQLITE_VERSION = sqlite.version
|
||||||
except ImportError:
|
except ImportError:
|
||||||
sqlite_version = u'-'
|
SQLITE_VERSION = u'-'
|
||||||
|
|
||||||
from openlp.core.lib import translate, SettingsManager
|
from openlp.core.lib import translate, SettingsManager
|
||||||
from openlp.core.lib.mailto import mailto
|
from openlp.core.lib.mailto import mailto
|
||||||
|
from openlp.core.lib.ui import UiStrings
|
||||||
|
|
||||||
from exceptiondialog import Ui_ExceptionDialog
|
from exceptiondialog import Ui_ExceptionDialog
|
||||||
|
|
||||||
@ -84,14 +85,14 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog):
|
|||||||
'Platform: %s\n')) % platform.platform()
|
'Platform: %s\n')) % platform.platform()
|
||||||
libraries = u'Python: %s\n' % platform.python_version() + \
|
libraries = u'Python: %s\n' % platform.python_version() + \
|
||||||
u'Qt4: %s\n' % Qt.qVersion() + \
|
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'PyQt4: %s\n' % Qt.PYQT_VERSION_STR + \
|
||||||
u'SQLAlchemy: %s\n' % sqlalchemy.__version__ + \
|
u'SQLAlchemy: %s\n' % sqlalchemy.__version__ + \
|
||||||
u'BeautifulSoup: %s\n' % BeautifulSoup.__version__ + \
|
u'BeautifulSoup: %s\n' % BeautifulSoup.__version__ + \
|
||||||
u'lxml: %s\n' % etree.__version__ + \
|
u'lxml: %s\n' % etree.__version__ + \
|
||||||
u'Chardet: %s\n' % chardet_version + \
|
u'Chardet: %s\n' % CHARDET_VERSION + \
|
||||||
u'PyEnchant: %s\n' % enchant_version + \
|
u'PyEnchant: %s\n' % ENCHANT_VERSION + \
|
||||||
u'PySQLite: %s\n' % sqlite_version
|
u'PySQLite: %s\n' % SQLITE_VERSION
|
||||||
if platform.system() == u'Linux':
|
if platform.system() == u'Linux':
|
||||||
if os.environ.get(u'KDE_FULL_SESSION') == u'true':
|
if os.environ.get(u'KDE_FULL_SESSION') == u'true':
|
||||||
system = system + u'Desktop: KDE SC\n'
|
system = system + u'Desktop: KDE SC\n'
|
||||||
@ -176,8 +177,7 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog):
|
|||||||
self,translate('ImagePlugin.ExceptionDialog',
|
self,translate('ImagePlugin.ExceptionDialog',
|
||||||
'Select Attachment'),
|
'Select Attachment'),
|
||||||
SettingsManager.get_last_dir(u'exceptions'),
|
SettingsManager.get_last_dir(u'exceptions'),
|
||||||
u'%s (*.*) (*)' %
|
u'%s (*.*) (*)' % UiStrings.AllFiles)
|
||||||
unicode(translate('ImagePlugin.MediaItem', 'All Files')))
|
|
||||||
log.info(u'New files(s) %s', unicode(files))
|
log.info(u'New files(s) %s', unicode(files))
|
||||||
if files:
|
if files:
|
||||||
self.fileAttachment = unicode(files)
|
self.fileAttachment = unicode(files)
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -27,30 +27,28 @@
|
|||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import translate
|
from openlp.core.lib import translate
|
||||||
|
from openlp.core.lib.ui import create_accept_reject_button_box
|
||||||
|
|
||||||
class Ui_FileRenameDialog(object):
|
class Ui_FileRenameDialog(object):
|
||||||
def setupUi(self, FileRenameDialog):
|
def setupUi(self, fileRenameDialog):
|
||||||
FileRenameDialog.setObjectName(u'FileRenameDialog')
|
fileRenameDialog.setObjectName(u'fileRenameDialog')
|
||||||
FileRenameDialog.resize(300, 10)
|
fileRenameDialog.resize(300, 10)
|
||||||
self.dialogLayout = QtGui.QGridLayout(FileRenameDialog)
|
self.dialogLayout = QtGui.QGridLayout(fileRenameDialog)
|
||||||
self.dialogLayout.setObjectName(u'dialogLayout')
|
self.dialogLayout.setObjectName(u'dialogLayout')
|
||||||
self.fileNameLabel = QtGui.QLabel(FileRenameDialog)
|
self.fileNameLabel = QtGui.QLabel(fileRenameDialog)
|
||||||
self.fileNameLabel.setObjectName(u'fileNameLabel')
|
self.fileNameLabel.setObjectName(u'fileNameLabel')
|
||||||
self.dialogLayout.addWidget(self.fileNameLabel, 0, 0)
|
self.dialogLayout.addWidget(self.fileNameLabel, 0, 0)
|
||||||
self.fileNameEdit = QtGui.QLineEdit(FileRenameDialog)
|
self.fileNameEdit = QtGui.QLineEdit(fileRenameDialog)
|
||||||
self.fileNameEdit.setValidator(QtGui.QRegExpValidator(
|
self.fileNameEdit.setValidator(QtGui.QRegExpValidator(
|
||||||
QtCore.QRegExp(r'[^/\\?*|<>\[\]":<>+%]+'), self))
|
QtCore.QRegExp(r'[^/\\?*|<>\[\]":<>+%]+'), self))
|
||||||
self.fileNameEdit.setObjectName(u'fileNameEdit')
|
self.fileNameEdit.setObjectName(u'fileNameEdit')
|
||||||
self.dialogLayout.addWidget(self.fileNameEdit, 0, 1)
|
self.dialogLayout.addWidget(self.fileNameEdit, 0, 1)
|
||||||
self.buttonBox = QtGui.QDialogButtonBox(FileRenameDialog)
|
self.buttonBox = create_accept_reject_button_box(fileRenameDialog, True)
|
||||||
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel |
|
|
||||||
QtGui.QDialogButtonBox.Ok)
|
|
||||||
self.buttonBox.setObjectName(u'buttonBox')
|
|
||||||
self.dialogLayout.addWidget(self.buttonBox, 1, 0, 1, 2)
|
self.dialogLayout.addWidget(self.buttonBox, 1, 0, 1, 2)
|
||||||
self.retranslateUi(FileRenameDialog)
|
self.retranslateUi(fileRenameDialog)
|
||||||
self.setMaximumHeight(self.sizeHint().height())
|
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',
|
self.fileNameLabel.setText(translate('OpenLP.FileRenameForm',
|
||||||
'New File Name:'))
|
'New File Name:'))
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -24,7 +24,7 @@
|
|||||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtGui
|
||||||
|
|
||||||
from filerenamedialog import Ui_FileRenameDialog
|
from filerenamedialog import Ui_FileRenameDialog
|
||||||
|
|
||||||
@ -37,10 +37,6 @@ class FileRenameForm(QtGui.QDialog, Ui_FileRenameDialog):
|
|||||||
def __init__(self, parent):
|
def __init__(self, parent):
|
||||||
QtGui.QDialog.__init__(self, parent)
|
QtGui.QDialog.__init__(self, parent)
|
||||||
self.setupUi(self)
|
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):
|
def exec_(self, copy=False):
|
||||||
"""
|
"""
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -28,6 +28,7 @@ import logging
|
|||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import SettingsTab, Receiver, translate
|
from openlp.core.lib import SettingsTab, Receiver, translate
|
||||||
|
from openlp.core.lib.ui import UiStrings
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -267,8 +268,7 @@ class GeneralTab(SettingsTab):
|
|||||||
translate('OpenLP.GeneralTab', ' sec'))
|
translate('OpenLP.GeneralTab', ' sec'))
|
||||||
self.ccliGroupBox.setTitle(
|
self.ccliGroupBox.setTitle(
|
||||||
translate('OpenLP.GeneralTab', 'CCLI Details'))
|
translate('OpenLP.GeneralTab', 'CCLI Details'))
|
||||||
self.numberLabel.setText(
|
self.numberLabel.setText(UiStrings.CCLINumberLabel)
|
||||||
translate('OpenLP.GeneralTab', 'CCLI number:'))
|
|
||||||
self.usernameLabel.setText(
|
self.usernameLabel.setText(
|
||||||
translate('OpenLP.GeneralTab', 'SongSelect username:'))
|
translate('OpenLP.GeneralTab', 'SongSelect username:'))
|
||||||
self.passwordLabel.setText(
|
self.passwordLabel.setText(
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -72,7 +72,7 @@ class MainDisplay(DisplayWidget):
|
|||||||
self.setWindowIcon(mainIcon)
|
self.setWindowIcon(mainIcon)
|
||||||
self.retranslateUi()
|
self.retranslateUi()
|
||||||
self.setStyleSheet(u'border: 0px; margin: 0px; padding: 0px;')
|
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)
|
QtCore.Qt.WindowStaysOnTopHint)
|
||||||
if self.isLive:
|
if self.isLive:
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
@ -106,6 +106,9 @@ class MainDisplay(DisplayWidget):
|
|||||||
self.audio = Phonon.AudioOutput(Phonon.VideoCategory, self.mediaObject)
|
self.audio = Phonon.AudioOutput(Phonon.VideoCategory, self.mediaObject)
|
||||||
Phonon.createPath(self.mediaObject, self.videoWidget)
|
Phonon.createPath(self.mediaObject, self.videoWidget)
|
||||||
Phonon.createPath(self.mediaObject, self.audio)
|
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 = QtWebKit.QWebView(self)
|
||||||
self.webView.setGeometry(0, 0,
|
self.webView.setGeometry(0, 0,
|
||||||
self.screen[u'size'].width(), self.screen[u'size'].height())
|
self.screen[u'size'].width(), self.screen[u'size'].height())
|
||||||
@ -129,14 +132,22 @@ class MainDisplay(DisplayWidget):
|
|||||||
painter_image.begin(self.black)
|
painter_image.begin(self.black)
|
||||||
painter_image.fillRect(self.black.rect(), QtCore.Qt.black)
|
painter_image.fillRect(self.black.rect(), QtCore.Qt.black)
|
||||||
# Build the initial frame.
|
# 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(
|
initialFrame = QtGui.QImage(
|
||||||
self.screens.current[u'size'].width(),
|
self.screens.current[u'size'].width(),
|
||||||
self.screens.current[u'size'].height(),
|
self.screens.current[u'size'].height(),
|
||||||
QtGui.QImage.Format_ARGB32_Premultiplied)
|
QtGui.QImage.Format_ARGB32_Premultiplied)
|
||||||
splash_image = QtGui.QImage(u':/graphics/openlp-splash-screen.png')
|
|
||||||
painter_image = QtGui.QPainter()
|
painter_image = QtGui.QPainter()
|
||||||
painter_image.begin(initialFrame)
|
painter_image.begin(initialFrame)
|
||||||
painter_image.fillRect(initialFrame.rect(), QtCore.Qt.white)
|
painter_image.fillRect(initialFrame.rect(), background_color)
|
||||||
painter_image.drawImage(
|
painter_image.drawImage(
|
||||||
(self.screens.current[u'size'].width() -
|
(self.screens.current[u'size'].width() -
|
||||||
splash_image.width()) / 2,
|
splash_image.width()) / 2,
|
||||||
@ -145,7 +156,7 @@ class MainDisplay(DisplayWidget):
|
|||||||
serviceItem = ServiceItem()
|
serviceItem = ServiceItem()
|
||||||
serviceItem.bg_image_bytes = image_to_byte(initialFrame)
|
serviceItem.bg_image_bytes = image_to_byte(initialFrame)
|
||||||
self.webView.setHtml(build_html(serviceItem, self.screen,
|
self.webView.setHtml(build_html(serviceItem, self.screen,
|
||||||
self.parent.alertTab, self.isLive, None))
|
self.alertTab, self.isLive, None))
|
||||||
self.initialFrame = True
|
self.initialFrame = True
|
||||||
# To display or not to display?
|
# To display or not to display?
|
||||||
if not self.screen[u'primary']:
|
if not self.screen[u'primary']:
|
||||||
@ -326,8 +337,7 @@ class MainDisplay(DisplayWidget):
|
|||||||
vol = float(volume)/float(10)
|
vol = float(volume)/float(10)
|
||||||
if isBackground or not self.usePhonon:
|
if isBackground or not self.usePhonon:
|
||||||
js = u'show_video("init", "%s", %s, true); show_video("play");' % \
|
js = u'show_video("init", "%s", %s, true); show_video("play");' % \
|
||||||
(videoPath.replace(u'\\', u'\\\\'), \
|
(videoPath.replace(u'\\', u'\\\\'), str(vol))
|
||||||
str(vol))
|
|
||||||
self.frame.evaluateJavaScript(js)
|
self.frame.evaluateJavaScript(js)
|
||||||
else:
|
else:
|
||||||
self.phononActive = True
|
self.phononActive = True
|
||||||
@ -342,6 +352,13 @@ class MainDisplay(DisplayWidget):
|
|||||||
Receiver.send_message(u'maindisplay_active')
|
Receiver.send_message(u'maindisplay_active')
|
||||||
return self.preview()
|
return self.preview()
|
||||||
|
|
||||||
|
def videoStart(self, newState, oldState):
|
||||||
|
"""
|
||||||
|
Start the video at a predetermined point.
|
||||||
|
"""
|
||||||
|
if newState == Phonon.PlayingState:
|
||||||
|
self.mediaObject.seek(self.serviceItem.start_time * 1000)
|
||||||
|
|
||||||
def isWebLoaded(self):
|
def isWebLoaded(self):
|
||||||
"""
|
"""
|
||||||
Called by webView event to show display is fully loaded
|
Called by webView event to show display is fully loaded
|
||||||
@ -398,8 +415,7 @@ class MainDisplay(DisplayWidget):
|
|||||||
if u'video' in self.override:
|
if u'video' in self.override:
|
||||||
Receiver.send_message(u'video_background_replaced')
|
Receiver.send_message(u'video_background_replaced')
|
||||||
self.override = {}
|
self.override = {}
|
||||||
elif self.override[u'theme'] != \
|
elif self.override[u'theme'] != serviceItem.themedata.theme_name:
|
||||||
serviceItem.themedata.theme_name:
|
|
||||||
Receiver.send_message(u'live_theme_changed')
|
Receiver.send_message(u'live_theme_changed')
|
||||||
self.override = {}
|
self.override = {}
|
||||||
else:
|
else:
|
||||||
@ -408,7 +424,7 @@ class MainDisplay(DisplayWidget):
|
|||||||
if self.serviceItem.themedata.background_filename:
|
if self.serviceItem.themedata.background_filename:
|
||||||
self.serviceItem.bg_image_bytes = self.imageManager. \
|
self.serviceItem.bg_image_bytes = self.imageManager. \
|
||||||
get_image_bytes(self.serviceItem.themedata.theme_name)
|
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)
|
self.isLive, background)
|
||||||
log.debug(u'buildHtml - pre setHtml')
|
log.debug(u'buildHtml - pre setHtml')
|
||||||
self.webView.setHtml(html)
|
self.webView.setHtml(html)
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -30,10 +30,11 @@ from PyQt4 import QtCore, QtGui
|
|||||||
|
|
||||||
from openlp.core.lib import RenderManager, build_icon, OpenLPDockWidget, \
|
from openlp.core.lib import RenderManager, build_icon, OpenLPDockWidget, \
|
||||||
SettingsManager, PluginManager, Receiver, translate
|
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, \
|
from openlp.core.ui import AboutForm, SettingsForm, ServiceManager, \
|
||||||
ThemeManager, SlideController, PluginForm, MediaDockManager, \
|
ThemeManager, SlideController, PluginForm, MediaDockManager, \
|
||||||
ShortcutListForm
|
ShortcutListForm, DisplayTagForm
|
||||||
from openlp.core.utils import AppLocation, add_actions, LanguageManager, \
|
from openlp.core.utils import AppLocation, add_actions, LanguageManager, \
|
||||||
ActionList
|
ActionList
|
||||||
|
|
||||||
@ -72,15 +73,15 @@ class Ui_MainWindow(object):
|
|||||||
# Set up the main container, which contains all the other form widgets.
|
# Set up the main container, which contains all the other form widgets.
|
||||||
self.MainContent = QtGui.QWidget(mainWindow)
|
self.MainContent = QtGui.QWidget(mainWindow)
|
||||||
self.MainContent.setObjectName(u'MainContent')
|
self.MainContent.setObjectName(u'MainContent')
|
||||||
self.MainContentLayout = QtGui.QHBoxLayout(self.MainContent)
|
self.mainContentLayout = QtGui.QHBoxLayout(self.MainContent)
|
||||||
self.MainContentLayout.setSpacing(0)
|
self.mainContentLayout.setSpacing(0)
|
||||||
self.MainContentLayout.setMargin(0)
|
self.mainContentLayout.setMargin(0)
|
||||||
self.MainContentLayout.setObjectName(u'MainContentLayout')
|
self.mainContentLayout.setObjectName(u'mainContentLayout')
|
||||||
mainWindow.setCentralWidget(self.MainContent)
|
mainWindow.setCentralWidget(self.MainContent)
|
||||||
self.ControlSplitter = QtGui.QSplitter(self.MainContent)
|
self.controlSplitter = QtGui.QSplitter(self.MainContent)
|
||||||
self.ControlSplitter.setOrientation(QtCore.Qt.Horizontal)
|
self.controlSplitter.setOrientation(QtCore.Qt.Horizontal)
|
||||||
self.ControlSplitter.setObjectName(u'ControlSplitter')
|
self.controlSplitter.setObjectName(u'controlSplitter')
|
||||||
self.MainContentLayout.addWidget(self.ControlSplitter)
|
self.mainContentLayout.addWidget(self.controlSplitter)
|
||||||
# Create slide controllers
|
# Create slide controllers
|
||||||
self.previewController = SlideController(self, self.settingsmanager,
|
self.previewController = SlideController(self, self.settingsmanager,
|
||||||
self.screens)
|
self.screens)
|
||||||
@ -102,9 +103,9 @@ class Ui_MainWindow(object):
|
|||||||
self.FileExportMenu = QtGui.QMenu(self.FileMenu)
|
self.FileExportMenu = QtGui.QMenu(self.FileMenu)
|
||||||
self.FileExportMenu.setObjectName(u'FileExportMenu')
|
self.FileExportMenu.setObjectName(u'FileExportMenu')
|
||||||
# View Menu
|
# View Menu
|
||||||
self.ViewMenu = QtGui.QMenu(self.MenuBar)
|
self.viewMenu = QtGui.QMenu(self.MenuBar)
|
||||||
self.ViewMenu.setObjectName(u'ViewMenu')
|
self.viewMenu.setObjectName(u'viewMenu')
|
||||||
self.ViewModeMenu = QtGui.QMenu(self.ViewMenu)
|
self.ViewModeMenu = QtGui.QMenu(self.viewMenu)
|
||||||
self.ViewModeMenu.setObjectName(u'ViewModeMenu')
|
self.ViewModeMenu.setObjectName(u'ViewModeMenu')
|
||||||
# Tools Menu
|
# Tools Menu
|
||||||
self.ToolsMenu = QtGui.QMenu(self.MenuBar)
|
self.ToolsMenu = QtGui.QMenu(self.MenuBar)
|
||||||
@ -125,38 +126,38 @@ class Ui_MainWindow(object):
|
|||||||
self.DefaultThemeLabel.setObjectName(u'DefaultThemeLabel')
|
self.DefaultThemeLabel.setObjectName(u'DefaultThemeLabel')
|
||||||
self.StatusBar.addPermanentWidget(self.DefaultThemeLabel)
|
self.StatusBar.addPermanentWidget(self.DefaultThemeLabel)
|
||||||
# Create the MediaManager
|
# Create the MediaManager
|
||||||
self.MediaManagerDock = OpenLPDockWidget(mainWindow,
|
self.mediaManagerDock = OpenLPDockWidget(mainWindow,
|
||||||
u'MediaManagerDock', u':/system/system_mediamanager.png')
|
u'mediaManagerDock', u':/system/system_mediamanager.png')
|
||||||
self.MediaManagerDock.setStyleSheet(MEDIA_MANAGER_STYLE)
|
self.mediaManagerDock.setStyleSheet(MEDIA_MANAGER_STYLE)
|
||||||
self.MediaManagerDock.setMinimumWidth(
|
self.mediaManagerDock.setMinimumWidth(
|
||||||
self.settingsmanager.mainwindow_left)
|
self.settingsmanager.mainwindow_left)
|
||||||
# Create the media toolbox
|
# Create the media toolbox
|
||||||
self.MediaToolBox = QtGui.QToolBox(self.MediaManagerDock)
|
self.MediaToolBox = QtGui.QToolBox(self.mediaManagerDock)
|
||||||
self.MediaToolBox.setObjectName(u'MediaToolBox')
|
self.MediaToolBox.setObjectName(u'MediaToolBox')
|
||||||
self.MediaManagerDock.setWidget(self.MediaToolBox)
|
self.mediaManagerDock.setWidget(self.MediaToolBox)
|
||||||
mainWindow.addDockWidget(QtCore.Qt.LeftDockWidgetArea,
|
mainWindow.addDockWidget(QtCore.Qt.LeftDockWidgetArea,
|
||||||
self.MediaManagerDock)
|
self.mediaManagerDock)
|
||||||
# Create the service manager
|
# Create the service manager
|
||||||
self.ServiceManagerDock = OpenLPDockWidget(mainWindow,
|
self.serviceManagerDock = OpenLPDockWidget(mainWindow,
|
||||||
u'ServiceManagerDock', u':/system/system_servicemanager.png')
|
u'serviceManagerDock', u':/system/system_servicemanager.png')
|
||||||
self.ServiceManagerDock.setMinimumWidth(
|
self.serviceManagerDock.setMinimumWidth(
|
||||||
self.settingsmanager.mainwindow_right)
|
self.settingsmanager.mainwindow_right)
|
||||||
self.ServiceManagerContents = ServiceManager(mainWindow,
|
self.ServiceManagerContents = ServiceManager(mainWindow,
|
||||||
self.ServiceManagerDock)
|
self.serviceManagerDock)
|
||||||
self.ServiceManagerDock.setWidget(self.ServiceManagerContents)
|
self.serviceManagerDock.setWidget(self.ServiceManagerContents)
|
||||||
mainWindow.addDockWidget(QtCore.Qt.RightDockWidgetArea,
|
mainWindow.addDockWidget(QtCore.Qt.RightDockWidgetArea,
|
||||||
self.ServiceManagerDock)
|
self.serviceManagerDock)
|
||||||
# Create the theme manager
|
# Create the theme manager
|
||||||
self.ThemeManagerDock = OpenLPDockWidget(mainWindow,
|
self.themeManagerDock = OpenLPDockWidget(mainWindow,
|
||||||
u'ThemeManagerDock', u':/system/system_thememanager.png')
|
u'themeManagerDock', u':/system/system_thememanager.png')
|
||||||
self.ThemeManagerDock.setMinimumWidth(
|
self.themeManagerDock.setMinimumWidth(
|
||||||
self.settingsmanager.mainwindow_right)
|
self.settingsmanager.mainwindow_right)
|
||||||
self.ThemeManagerContents = ThemeManager(mainWindow,
|
self.themeManagerContents = ThemeManager(mainWindow,
|
||||||
self.ThemeManagerDock)
|
self.themeManagerDock)
|
||||||
self.ThemeManagerContents.setObjectName(u'ThemeManagerContents')
|
self.themeManagerContents.setObjectName(u'themeManagerContents')
|
||||||
self.ThemeManagerDock.setWidget(self.ThemeManagerContents)
|
self.themeManagerDock.setWidget(self.themeManagerContents)
|
||||||
mainWindow.addDockWidget(QtCore.Qt.RightDockWidgetArea,
|
mainWindow.addDockWidget(QtCore.Qt.RightDockWidgetArea,
|
||||||
self.ThemeManagerDock)
|
self.themeManagerDock)
|
||||||
# Create the menu items
|
# Create the menu items
|
||||||
self.FileNewItem = icon_action(mainWindow, u'FileNewItem',
|
self.FileNewItem = icon_action(mainWindow, u'FileNewItem',
|
||||||
u':/general/general_new.png')
|
u':/general/general_new.png')
|
||||||
@ -186,14 +187,14 @@ class Ui_MainWindow(object):
|
|||||||
mainWindow.actionList.add_action(self.ExportLanguageItem, u'Export')
|
mainWindow.actionList.add_action(self.ExportLanguageItem, u'Export')
|
||||||
self.ViewMediaManagerItem = icon_action(mainWindow,
|
self.ViewMediaManagerItem = icon_action(mainWindow,
|
||||||
u'ViewMediaManagerItem', u':/system/system_mediamanager.png',
|
u'ViewMediaManagerItem', u':/system/system_mediamanager.png',
|
||||||
self.MediaManagerDock.isVisible())
|
self.mediaManagerDock.isVisible())
|
||||||
self.ViewThemeManagerItem = icon_action(mainWindow,
|
self.ViewThemeManagerItem = icon_action(mainWindow,
|
||||||
u'ViewThemeManagerItem', u':/system/system_thememanager.png',
|
u'ViewThemeManagerItem', u':/system/system_thememanager.png',
|
||||||
self.ThemeManagerDock.isVisible())
|
self.themeManagerDock.isVisible())
|
||||||
mainWindow.actionList.add_action(self.ViewMediaManagerItem, u'View')
|
mainWindow.actionList.add_action(self.ViewMediaManagerItem, u'View')
|
||||||
self.ViewServiceManagerItem = icon_action(mainWindow,
|
self.ViewServiceManagerItem = icon_action(mainWindow,
|
||||||
u'ViewServiceManagerItem', u':/system/system_servicemanager.png',
|
u'ViewServiceManagerItem', u':/system/system_servicemanager.png',
|
||||||
self.ServiceManagerDock.isVisible())
|
self.serviceManagerDock.isVisible())
|
||||||
mainWindow.actionList.add_action(self.ViewServiceManagerItem, u'View')
|
mainWindow.actionList.add_action(self.ViewServiceManagerItem, u'View')
|
||||||
self.ViewPreviewPanel = checkable_action(mainWindow,
|
self.ViewPreviewPanel = checkable_action(mainWindow,
|
||||||
u'ViewPreviewPanel', previewVisible)
|
u'ViewPreviewPanel', previewVisible)
|
||||||
@ -215,9 +216,12 @@ class Ui_MainWindow(object):
|
|||||||
self.ToolsAddToolItem = icon_action(mainWindow, u'ToolsAddToolItem',
|
self.ToolsAddToolItem = icon_action(mainWindow, u'ToolsAddToolItem',
|
||||||
u':/tools/tools_add.png')
|
u':/tools/tools_add.png')
|
||||||
mainWindow.actionList.add_action(self.ToolsAddToolItem, u'Tools')
|
mainWindow.actionList.add_action(self.ToolsAddToolItem, u'Tools')
|
||||||
self.SettingsPluginListItem = icon_action(mainWindow,
|
self.ToolsOpenDataFolder = icon_action(mainWindow,
|
||||||
u'SettingsPluginListItem', u':/system/settings_plugin_list.png')
|
u'ToolsOpenDataFolder', u':/general/general_open.png')
|
||||||
mainWindow.actionList.add_action(self.SettingsPluginListItem,
|
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,
|
||||||
u'Settings')
|
u'Settings')
|
||||||
# i18n Language Items
|
# i18n Language Items
|
||||||
self.AutoLanguageItem = checkable_action(mainWindow,
|
self.AutoLanguageItem = checkable_action(mainWindow,
|
||||||
@ -238,6 +242,8 @@ class Ui_MainWindow(object):
|
|||||||
self.SettingsShortcutsItem = icon_action(mainWindow,
|
self.SettingsShortcutsItem = icon_action(mainWindow,
|
||||||
u'SettingsShortcutsItem',
|
u'SettingsShortcutsItem',
|
||||||
u':/system/system_configure_shortcuts.png')
|
u':/system/system_configure_shortcuts.png')
|
||||||
|
self.DisplayTagItem = icon_action(mainWindow,
|
||||||
|
u'DisplayTagItem', u':/system/tag_editor.png')
|
||||||
self.SettingsConfigureItem = icon_action(mainWindow,
|
self.SettingsConfigureItem = icon_action(mainWindow,
|
||||||
u'SettingsConfigureItem', u':/system/system_settings.png')
|
u'SettingsConfigureItem', u':/system/system_settings.png')
|
||||||
mainWindow.actionList.add_action(self.SettingsShortcutsItem,
|
mainWindow.actionList.add_action(self.SettingsShortcutsItem,
|
||||||
@ -252,8 +258,8 @@ class Ui_MainWindow(object):
|
|||||||
self.HelpOnlineHelpItem = base_action(mainWindow, u'HelpOnlineHelpItem')
|
self.HelpOnlineHelpItem = base_action(mainWindow, u'HelpOnlineHelpItem')
|
||||||
self.HelpOnlineHelpItem.setEnabled(False)
|
self.HelpOnlineHelpItem.setEnabled(False)
|
||||||
mainWindow.actionList.add_action(self.HelpOnlineHelpItem, u'Help')
|
mainWindow.actionList.add_action(self.HelpOnlineHelpItem, u'Help')
|
||||||
self.HelpWebSiteItem = base_action(mainWindow, u'HelpWebSiteItem')
|
self.helpWebSiteItem = base_action(mainWindow, u'helpWebSiteItem')
|
||||||
mainWindow.actionList.add_action(self.HelpWebSiteItem, u'Help')
|
mainWindow.actionList.add_action(self.helpWebSiteItem, u'Help')
|
||||||
add_actions(self.FileImportMenu,
|
add_actions(self.FileImportMenu,
|
||||||
(self.ImportThemeItem, self.ImportLanguageItem))
|
(self.ImportThemeItem, self.ImportLanguageItem))
|
||||||
add_actions(self.FileExportMenu,
|
add_actions(self.FileExportMenu,
|
||||||
@ -264,22 +270,24 @@ class Ui_MainWindow(object):
|
|||||||
self.FileExportMenu.menuAction(), self.FileExitItem)
|
self.FileExportMenu.menuAction(), self.FileExitItem)
|
||||||
add_actions(self.ViewModeMenu, (self.ModeDefaultItem,
|
add_actions(self.ViewModeMenu, (self.ModeDefaultItem,
|
||||||
self.ModeSetupItem, self.ModeLiveItem))
|
self.ModeSetupItem, self.ModeLiveItem))
|
||||||
add_actions(self.ViewMenu, (self.ViewModeMenu.menuAction(),
|
add_actions(self.viewMenu, (self.ViewModeMenu.menuAction(),
|
||||||
None, self.ViewMediaManagerItem, self.ViewServiceManagerItem,
|
None, self.ViewMediaManagerItem, self.ViewServiceManagerItem,
|
||||||
self.ViewThemeManagerItem, None, self.ViewPreviewPanel,
|
self.ViewThemeManagerItem, None, self.ViewPreviewPanel,
|
||||||
self.ViewLivePanel))
|
self.ViewLivePanel))
|
||||||
# i18n add Language Actions
|
# i18n add Language Actions
|
||||||
add_actions(self.SettingsLanguageMenu, (self.AutoLanguageItem, None))
|
add_actions(self.SettingsLanguageMenu, (self.AutoLanguageItem, None))
|
||||||
add_actions(self.SettingsLanguageMenu, self.LanguageGroup.actions())
|
add_actions(self.SettingsLanguageMenu, self.LanguageGroup.actions())
|
||||||
add_actions(self.SettingsMenu, (self.SettingsPluginListItem,
|
add_actions(self.SettingsMenu, (self.settingsPluginListItem,
|
||||||
self.SettingsLanguageMenu.menuAction(), None,
|
self.SettingsLanguageMenu.menuAction(), None,
|
||||||
self.SettingsShortcutsItem, self.SettingsConfigureItem))
|
self.DisplayTagItem, self.SettingsShortcutsItem,
|
||||||
|
self.SettingsConfigureItem))
|
||||||
add_actions(self.ToolsMenu, (self.ToolsAddToolItem, None))
|
add_actions(self.ToolsMenu, (self.ToolsAddToolItem, None))
|
||||||
|
add_actions(self.ToolsMenu, (self.ToolsOpenDataFolder, None))
|
||||||
add_actions(self.HelpMenu, (self.HelpDocumentationItem,
|
add_actions(self.HelpMenu, (self.HelpDocumentationItem,
|
||||||
self.HelpOnlineHelpItem, None, self.HelpWebSiteItem,
|
self.HelpOnlineHelpItem, None, self.helpWebSiteItem,
|
||||||
self.HelpAboutItem))
|
self.HelpAboutItem))
|
||||||
add_actions(self.MenuBar, (self.FileMenu.menuAction(),
|
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()))
|
self.SettingsMenu.menuAction(), self.HelpMenu.menuAction()))
|
||||||
# Initialise the translation
|
# Initialise the translation
|
||||||
self.retranslateUi(mainWindow)
|
self.retranslateUi(mainWindow)
|
||||||
@ -295,39 +303,35 @@ class Ui_MainWindow(object):
|
|||||||
"""
|
"""
|
||||||
Set up the translation system
|
Set up the translation system
|
||||||
"""
|
"""
|
||||||
mainWindow.mainTitle = translate('OpenLP.MainWindow', 'OpenLP 2.0')
|
mainWindow.mainTitle = UiStrings.OLPV2
|
||||||
mainWindow.setWindowTitle(mainWindow.mainTitle)
|
mainWindow.setWindowTitle(mainWindow.mainTitle)
|
||||||
self.FileMenu.setTitle(translate('OpenLP.MainWindow', '&File'))
|
self.FileMenu.setTitle(translate('OpenLP.MainWindow', '&File'))
|
||||||
self.FileImportMenu.setTitle(translate('OpenLP.MainWindow', '&Import'))
|
self.FileImportMenu.setTitle(translate('OpenLP.MainWindow', '&Import'))
|
||||||
self.FileExportMenu.setTitle(translate('OpenLP.MainWindow', '&Export'))
|
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.ViewModeMenu.setTitle(translate('OpenLP.MainWindow', 'M&ode'))
|
||||||
self.ToolsMenu.setTitle(translate('OpenLP.MainWindow', '&Tools'))
|
self.ToolsMenu.setTitle(translate('OpenLP.MainWindow', '&Tools'))
|
||||||
self.SettingsMenu.setTitle(translate('OpenLP.MainWindow', '&Settings'))
|
self.SettingsMenu.setTitle(translate('OpenLP.MainWindow', '&Settings'))
|
||||||
self.SettingsLanguageMenu.setTitle(translate('OpenLP.MainWindow',
|
self.SettingsLanguageMenu.setTitle(translate('OpenLP.MainWindow',
|
||||||
'&Language'))
|
'&Language'))
|
||||||
self.HelpMenu.setTitle(translate('OpenLP.MainWindow', '&Help'))
|
self.HelpMenu.setTitle(translate('OpenLP.MainWindow', '&Help'))
|
||||||
self.MediaManagerDock.setWindowTitle(
|
self.mediaManagerDock.setWindowTitle(
|
||||||
translate('OpenLP.MainWindow', 'Media Manager'))
|
translate('OpenLP.MainWindow', 'Media Manager'))
|
||||||
self.ServiceManagerDock.setWindowTitle(
|
self.serviceManagerDock.setWindowTitle(
|
||||||
translate('OpenLP.MainWindow', 'Service Manager'))
|
translate('OpenLP.MainWindow', 'Service Manager'))
|
||||||
self.ThemeManagerDock.setWindowTitle(
|
self.themeManagerDock.setWindowTitle(
|
||||||
translate('OpenLP.MainWindow', 'Theme Manager'))
|
translate('OpenLP.MainWindow', 'Theme Manager'))
|
||||||
self.FileNewItem.setText(translate('OpenLP.MainWindow', '&New'))
|
self.FileNewItem.setText(translate('OpenLP.MainWindow', '&New'))
|
||||||
self.FileNewItem.setToolTip(
|
self.FileNewItem.setToolTip(UiStrings.NewService)
|
||||||
translate('OpenLP.MainWindow', 'New Service'))
|
self.FileNewItem.setStatusTip(UiStrings.CreateService)
|
||||||
self.FileNewItem.setStatusTip(
|
|
||||||
translate('OpenLP.MainWindow', 'Create a new service.'))
|
|
||||||
self.FileNewItem.setShortcut(translate('OpenLP.MainWindow', 'Ctrl+N'))
|
self.FileNewItem.setShortcut(translate('OpenLP.MainWindow', 'Ctrl+N'))
|
||||||
self.FileOpenItem.setText(translate('OpenLP.MainWindow', '&Open'))
|
self.FileOpenItem.setText(translate('OpenLP.MainWindow', '&Open'))
|
||||||
self.FileOpenItem.setToolTip(
|
self.FileOpenItem.setToolTip(UiStrings.OpenService)
|
||||||
translate('OpenLP.MainWindow', 'Open Service'))
|
|
||||||
self.FileOpenItem.setStatusTip(
|
self.FileOpenItem.setStatusTip(
|
||||||
translate('OpenLP.MainWindow', 'Open an existing service.'))
|
translate('OpenLP.MainWindow', 'Open an existing service.'))
|
||||||
self.FileOpenItem.setShortcut(translate('OpenLP.MainWindow', 'Ctrl+O'))
|
self.FileOpenItem.setShortcut(translate('OpenLP.MainWindow', 'Ctrl+O'))
|
||||||
self.FileSaveItem.setText(translate('OpenLP.MainWindow', '&Save'))
|
self.FileSaveItem.setText(translate('OpenLP.MainWindow', '&Save'))
|
||||||
self.FileSaveItem.setToolTip(
|
self.FileSaveItem.setToolTip(UiStrings.SaveService)
|
||||||
translate('OpenLP.MainWindow', 'Save Service'))
|
|
||||||
self.FileSaveItem.setStatusTip(
|
self.FileSaveItem.setStatusTip(
|
||||||
translate('OpenLP.MainWindow', 'Save the current service to disk.'))
|
translate('OpenLP.MainWindow', 'Save the current service to disk.'))
|
||||||
self.FileSaveItem.setShortcut(translate('OpenLP.MainWindow', 'Ctrl+S'))
|
self.FileSaveItem.setShortcut(translate('OpenLP.MainWindow', 'Ctrl+S'))
|
||||||
@ -339,8 +343,7 @@ class Ui_MainWindow(object):
|
|||||||
'Save the current service under a new name.'))
|
'Save the current service under a new name.'))
|
||||||
self.FileSaveAsItem.setShortcut(
|
self.FileSaveAsItem.setShortcut(
|
||||||
translate('OpenLP.MainWindow', 'Ctrl+Shift+S'))
|
translate('OpenLP.MainWindow', 'Ctrl+Shift+S'))
|
||||||
self.printServiceOrderItem.setText(
|
self.printServiceOrderItem.setText(UiStrings.PrintServiceOrder)
|
||||||
translate('OpenLP.MainWindow', 'Print Service Order'))
|
|
||||||
self.printServiceOrderItem.setStatusTip(translate('OpenLP.MainWindow',
|
self.printServiceOrderItem.setStatusTip(translate('OpenLP.MainWindow',
|
||||||
'Print the current Service Order.'))
|
'Print the current Service Order.'))
|
||||||
self.printServiceOrderItem.setShortcut(
|
self.printServiceOrderItem.setShortcut(
|
||||||
@ -361,6 +364,8 @@ class Ui_MainWindow(object):
|
|||||||
translate('OpenLP.MainWindow', '&Language'))
|
translate('OpenLP.MainWindow', '&Language'))
|
||||||
self.SettingsShortcutsItem.setText(
|
self.SettingsShortcutsItem.setText(
|
||||||
translate('OpenLP.MainWindow', 'Configure &Shortcuts...'))
|
translate('OpenLP.MainWindow', 'Configure &Shortcuts...'))
|
||||||
|
self.DisplayTagItem.setText(
|
||||||
|
translate('OpenLP.MainWindow', '&Configure Display Tags'))
|
||||||
self.SettingsConfigureItem.setText(
|
self.SettingsConfigureItem.setText(
|
||||||
translate('OpenLP.MainWindow', '&Configure OpenLP...'))
|
translate('OpenLP.MainWindow', '&Configure OpenLP...'))
|
||||||
self.ViewMediaManagerItem.setText(
|
self.ViewMediaManagerItem.setText(
|
||||||
@ -403,11 +408,11 @@ class Ui_MainWindow(object):
|
|||||||
'Toggle the visibility of the live panel.'))
|
'Toggle the visibility of the live panel.'))
|
||||||
self.ViewLivePanel.setShortcut(
|
self.ViewLivePanel.setShortcut(
|
||||||
translate('OpenLP.MainWindow', 'F12'))
|
translate('OpenLP.MainWindow', 'F12'))
|
||||||
self.SettingsPluginListItem.setText(translate('OpenLP.MainWindow',
|
self.settingsPluginListItem.setText(translate('OpenLP.MainWindow',
|
||||||
'&Plugin List'))
|
'&Plugin List'))
|
||||||
self.SettingsPluginListItem.setStatusTip(
|
self.settingsPluginListItem.setStatusTip(
|
||||||
translate('OpenLP.MainWindow', 'List the Plugins'))
|
translate('OpenLP.MainWindow', 'List the Plugins'))
|
||||||
self.SettingsPluginListItem.setShortcut(
|
self.settingsPluginListItem.setShortcut(
|
||||||
translate('OpenLP.MainWindow', 'Alt+F7'))
|
translate('OpenLP.MainWindow', 'Alt+F7'))
|
||||||
self.HelpDocumentationItem.setText(
|
self.HelpDocumentationItem.setText(
|
||||||
translate('OpenLP.MainWindow', '&User Guide'))
|
translate('OpenLP.MainWindow', '&User Guide'))
|
||||||
@ -418,7 +423,7 @@ class Ui_MainWindow(object):
|
|||||||
translate('OpenLP.MainWindow', 'Ctrl+F1'))
|
translate('OpenLP.MainWindow', 'Ctrl+F1'))
|
||||||
self.HelpOnlineHelpItem.setText(
|
self.HelpOnlineHelpItem.setText(
|
||||||
translate('OpenLP.MainWindow', '&Online Help'))
|
translate('OpenLP.MainWindow', '&Online Help'))
|
||||||
self.HelpWebSiteItem.setText(
|
self.helpWebSiteItem.setText(
|
||||||
translate('OpenLP.MainWindow', '&Web Site'))
|
translate('OpenLP.MainWindow', '&Web Site'))
|
||||||
self.AutoLanguageItem.setText(
|
self.AutoLanguageItem.setText(
|
||||||
translate('OpenLP.MainWindow', '&Auto Detect'))
|
translate('OpenLP.MainWindow', '&Auto Detect'))
|
||||||
@ -432,6 +437,10 @@ class Ui_MainWindow(object):
|
|||||||
translate('OpenLP.MainWindow', 'Add &Tool...'))
|
translate('OpenLP.MainWindow', 'Add &Tool...'))
|
||||||
self.ToolsAddToolItem.setStatusTip(translate('OpenLP.MainWindow',
|
self.ToolsAddToolItem.setStatusTip(translate('OpenLP.MainWindow',
|
||||||
'Add an application to the list of tools.'))
|
'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(
|
self.ModeDefaultItem.setText(
|
||||||
translate('OpenLP.MainWindow', '&Default'))
|
translate('OpenLP.MainWindow', '&Default'))
|
||||||
self.ModeDefaultItem.setStatusTip(translate('OpenLP.MainWindow',
|
self.ModeDefaultItem.setStatusTip(translate('OpenLP.MainWindow',
|
||||||
@ -452,7 +461,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
|
|
||||||
actionList = ActionList()
|
actionList = ActionList()
|
||||||
|
|
||||||
def __init__(self, screens, applicationVersion):
|
def __init__(self, screens, applicationVersion, clipboard):
|
||||||
"""
|
"""
|
||||||
This constructor sets up the interface, the various managers, and the
|
This constructor sets up the interface, the various managers, and the
|
||||||
plugins.
|
plugins.
|
||||||
@ -461,6 +470,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
self.screens = screens
|
self.screens = screens
|
||||||
self.actionList = ActionList()
|
self.actionList = ActionList()
|
||||||
self.applicationVersion = applicationVersion
|
self.applicationVersion = applicationVersion
|
||||||
|
self.clipboard = clipboard
|
||||||
# Set up settings sections for the main application
|
# Set up settings sections for the main application
|
||||||
# (not for use by plugins)
|
# (not for use by plugins)
|
||||||
self.uiSettingsSection = u'user interface'
|
self.uiSettingsSection = u'user interface'
|
||||||
@ -471,6 +481,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
self.settingsmanager = SettingsManager(screens)
|
self.settingsmanager = SettingsManager(screens)
|
||||||
self.aboutForm = AboutForm(self, applicationVersion)
|
self.aboutForm = AboutForm(self, applicationVersion)
|
||||||
self.settingsForm = SettingsForm(self.screens, self, self)
|
self.settingsForm = SettingsForm(self.screens, self, self)
|
||||||
|
self.displayTagForm = DisplayTagForm(self)
|
||||||
self.shortcutForm = ShortcutListForm(self)
|
self.shortcutForm = ShortcutListForm(self)
|
||||||
self.recentFiles = QtCore.QStringList()
|
self.recentFiles = QtCore.QStringList()
|
||||||
# Set up the path with plugins
|
# Set up the path with plugins
|
||||||
@ -487,10 +498,10 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
# Set up signals and slots
|
# Set up signals and slots
|
||||||
QtCore.QObject.connect(self.ImportThemeItem,
|
QtCore.QObject.connect(self.ImportThemeItem,
|
||||||
QtCore.SIGNAL(u'triggered()'),
|
QtCore.SIGNAL(u'triggered()'),
|
||||||
self.ThemeManagerContents.onImportTheme)
|
self.themeManagerContents.onImportTheme)
|
||||||
QtCore.QObject.connect(self.ExportThemeItem,
|
QtCore.QObject.connect(self.ExportThemeItem,
|
||||||
QtCore.SIGNAL(u'triggered()'),
|
QtCore.SIGNAL(u'triggered()'),
|
||||||
self.ThemeManagerContents.onExportTheme)
|
self.themeManagerContents.onExportTheme)
|
||||||
QtCore.QObject.connect(self.ViewMediaManagerItem,
|
QtCore.QObject.connect(self.ViewMediaManagerItem,
|
||||||
QtCore.SIGNAL(u'triggered(bool)'), self.toggleMediaManager)
|
QtCore.SIGNAL(u'triggered(bool)'), self.toggleMediaManager)
|
||||||
QtCore.QObject.connect(self.ViewServiceManagerItem,
|
QtCore.QObject.connect(self.ViewServiceManagerItem,
|
||||||
@ -501,21 +512,25 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
QtCore.SIGNAL(u'toggled(bool)'), self.setPreviewPanelVisibility)
|
QtCore.SIGNAL(u'toggled(bool)'), self.setPreviewPanelVisibility)
|
||||||
QtCore.QObject.connect(self.ViewLivePanel,
|
QtCore.QObject.connect(self.ViewLivePanel,
|
||||||
QtCore.SIGNAL(u'toggled(bool)'), self.setLivePanelVisibility)
|
QtCore.SIGNAL(u'toggled(bool)'), self.setLivePanelVisibility)
|
||||||
QtCore.QObject.connect(self.MediaManagerDock,
|
QtCore.QObject.connect(self.mediaManagerDock,
|
||||||
QtCore.SIGNAL(u'visibilityChanged(bool)'),
|
QtCore.SIGNAL(u'visibilityChanged(bool)'),
|
||||||
self.ViewMediaManagerItem.setChecked)
|
self.ViewMediaManagerItem.setChecked)
|
||||||
QtCore.QObject.connect(self.ServiceManagerDock,
|
QtCore.QObject.connect(self.serviceManagerDock,
|
||||||
QtCore.SIGNAL(u'visibilityChanged(bool)'),
|
QtCore.SIGNAL(u'visibilityChanged(bool)'),
|
||||||
self.ViewServiceManagerItem.setChecked)
|
self.ViewServiceManagerItem.setChecked)
|
||||||
QtCore.QObject.connect(self.ThemeManagerDock,
|
QtCore.QObject.connect(self.themeManagerDock,
|
||||||
QtCore.SIGNAL(u'visibilityChanged(bool)'),
|
QtCore.SIGNAL(u'visibilityChanged(bool)'),
|
||||||
self.ViewThemeManagerItem.setChecked)
|
self.ViewThemeManagerItem.setChecked)
|
||||||
QtCore.QObject.connect(self.HelpWebSiteItem,
|
QtCore.QObject.connect(self.helpWebSiteItem,
|
||||||
QtCore.SIGNAL(u'triggered()'), self.onHelpWebSiteClicked)
|
QtCore.SIGNAL(u'triggered()'), self.onHelpWebSiteClicked)
|
||||||
QtCore.QObject.connect(self.HelpAboutItem,
|
QtCore.QObject.connect(self.HelpAboutItem,
|
||||||
QtCore.SIGNAL(u'triggered()'), self.onHelpAboutItemClicked)
|
QtCore.SIGNAL(u'triggered()'), self.onHelpAboutItemClicked)
|
||||||
QtCore.QObject.connect(self.SettingsPluginListItem,
|
QtCore.QObject.connect(self.ToolsOpenDataFolder,
|
||||||
|
QtCore.SIGNAL(u'triggered()'), self.onToolsOpenDataFolderClicked)
|
||||||
|
QtCore.QObject.connect(self.settingsPluginListItem,
|
||||||
QtCore.SIGNAL(u'triggered()'), self.onPluginItemClicked)
|
QtCore.SIGNAL(u'triggered()'), self.onPluginItemClicked)
|
||||||
|
QtCore.QObject.connect(self.DisplayTagItem,
|
||||||
|
QtCore.SIGNAL(u'triggered()'), self.onDisplayTagItemClicked)
|
||||||
QtCore.QObject.connect(self.SettingsConfigureItem,
|
QtCore.QObject.connect(self.SettingsConfigureItem,
|
||||||
QtCore.SIGNAL(u'triggered()'), self.onSettingsConfigureItemClicked)
|
QtCore.SIGNAL(u'triggered()'), self.onSettingsConfigureItemClicked)
|
||||||
QtCore.QObject.connect(self.SettingsShortcutsItem,
|
QtCore.QObject.connect(self.SettingsShortcutsItem,
|
||||||
@ -567,7 +582,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
# RenderManager needs to call ThemeManager and
|
# RenderManager needs to call ThemeManager and
|
||||||
# ThemeManager needs to call RenderManager
|
# ThemeManager needs to call RenderManager
|
||||||
self.renderManager = RenderManager(
|
self.renderManager = RenderManager(
|
||||||
self.ThemeManagerContents, self.screens)
|
self.themeManagerContents, self.screens)
|
||||||
# Define the media Dock Manager
|
# Define the media Dock Manager
|
||||||
self.mediaDockManager = MediaDockManager(self.MediaToolBox)
|
self.mediaDockManager = MediaDockManager(self.MediaToolBox)
|
||||||
log.info(u'Load Plugins')
|
log.info(u'Load Plugins')
|
||||||
@ -601,7 +616,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
self.pluginManager.initialise_plugins()
|
self.pluginManager.initialise_plugins()
|
||||||
# Once all components are initialised load the Themes
|
# Once all components are initialised load the Themes
|
||||||
log.info(u'Load Themes')
|
log.info(u'Load Themes')
|
||||||
self.ThemeManagerContents.loadThemes()
|
self.themeManagerContents.loadThemes()
|
||||||
log.info(u'Load data from Settings')
|
log.info(u'Load data from Settings')
|
||||||
if QtCore.QSettings().value(u'advanced/save current plugin',
|
if QtCore.QSettings().value(u'advanced/save current plugin',
|
||||||
QtCore.QVariant(False)).toBool():
|
QtCore.QVariant(False)).toBool():
|
||||||
@ -702,6 +717,19 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
self.pluginForm.load()
|
self.pluginForm.load()
|
||||||
self.pluginForm.exec_()
|
self.pluginForm.exec_()
|
||||||
|
|
||||||
|
def onToolsOpenDataFolderClicked(self):
|
||||||
|
"""
|
||||||
|
Open data folder
|
||||||
|
"""
|
||||||
|
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):
|
def onSettingsConfigureItemClicked(self):
|
||||||
"""
|
"""
|
||||||
Show the Settings dialog
|
Show the Settings dialog
|
||||||
@ -748,9 +776,9 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
settings = QtCore.QSettings()
|
settings = QtCore.QSettings()
|
||||||
settings.setValue(u'%s/view mode' % self.generalSettingsSection,
|
settings.setValue(u'%s/view mode' % self.generalSettingsSection,
|
||||||
mode)
|
mode)
|
||||||
self.MediaManagerDock.setVisible(media)
|
self.mediaManagerDock.setVisible(media)
|
||||||
self.ServiceManagerDock.setVisible(service)
|
self.serviceManagerDock.setVisible(service)
|
||||||
self.ThemeManagerDock.setVisible(theme)
|
self.themeManagerDock.setVisible(theme)
|
||||||
self.setPreviewPanelVisibility(preview)
|
self.setPreviewPanelVisibility(preview)
|
||||||
self.setLivePanelVisibility(live)
|
self.setLivePanelVisibility(live)
|
||||||
|
|
||||||
@ -867,16 +895,16 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
theme)
|
theme)
|
||||||
|
|
||||||
def toggleMediaManager(self, visible):
|
def toggleMediaManager(self, visible):
|
||||||
if self.MediaManagerDock.isVisible() != visible:
|
if self.mediaManagerDock.isVisible() != visible:
|
||||||
self.MediaManagerDock.setVisible(visible)
|
self.mediaManagerDock.setVisible(visible)
|
||||||
|
|
||||||
def toggleServiceManager(self, visible):
|
def toggleServiceManager(self, visible):
|
||||||
if self.ServiceManagerDock.isVisible() != visible:
|
if self.serviceManagerDock.isVisible() != visible:
|
||||||
self.ServiceManagerDock.setVisible(visible)
|
self.serviceManagerDock.setVisible(visible)
|
||||||
|
|
||||||
def toggleThemeManager(self, visible):
|
def toggleThemeManager(self, visible):
|
||||||
if self.ThemeManagerDock.isVisible() != visible:
|
if self.themeManagerDock.isVisible() != visible:
|
||||||
self.ThemeManagerDock.setVisible(visible)
|
self.themeManagerDock.setVisible(visible)
|
||||||
|
|
||||||
def setPreviewPanelVisibility(self, visible):
|
def setPreviewPanelVisibility(self, visible):
|
||||||
"""
|
"""
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -25,7 +25,9 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import translate
|
from openlp.core.lib import translate
|
||||||
|
from openlp.core.lib.ui import UiStrings
|
||||||
|
|
||||||
class Ui_PluginViewDialog(object):
|
class Ui_PluginViewDialog(object):
|
||||||
def setupUi(self, pluginViewDialog):
|
def setupUi(self, pluginViewDialog):
|
||||||
@ -76,10 +78,8 @@ class Ui_PluginViewDialog(object):
|
|||||||
translate('OpenLP.PluginForm', 'Plugin List'))
|
translate('OpenLP.PluginForm', 'Plugin List'))
|
||||||
self.pluginInfoGroupBox.setTitle(
|
self.pluginInfoGroupBox.setTitle(
|
||||||
translate('OpenLP.PluginForm', 'Plugin Details'))
|
translate('OpenLP.PluginForm', 'Plugin Details'))
|
||||||
self.versionLabel.setText(
|
self.versionLabel.setText(u'%s:' % UiStrings.Version)
|
||||||
translate('OpenLP.PluginForm', 'Version:'))
|
self.aboutLabel.setText(u'%s:' % UiStrings.About)
|
||||||
self.aboutLabel.setText(
|
|
||||||
translate('OpenLP.PluginForm', 'About:'))
|
|
||||||
self.statusLabel.setText(
|
self.statusLabel.setText(
|
||||||
translate('OpenLP.PluginForm', 'Status:'))
|
translate('OpenLP.PluginForm', 'Status:'))
|
||||||
self.statusComboBox.setItemText(0,
|
self.statusComboBox.setItemText(0,
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -28,13 +28,15 @@ import logging
|
|||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import PluginStatus, StringContent, translate
|
from openlp.core.lib import PluginStatus, Receiver, translate
|
||||||
from plugindialog import Ui_PluginViewDialog
|
from plugindialog import Ui_PluginViewDialog
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
|
class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
|
||||||
|
"""
|
||||||
|
The plugin form provides user control over the plugins OpenLP uses.
|
||||||
|
"""
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
QtGui.QDialog.__init__(self, parent)
|
QtGui.QDialog.__init__(self, parent)
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
@ -78,15 +80,14 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
|
|||||||
# PluginStatus.Inactive
|
# PluginStatus.Inactive
|
||||||
status_text = unicode(
|
status_text = unicode(
|
||||||
translate('OpenLP.PluginForm', '%s (Inactive)'))
|
translate('OpenLP.PluginForm', '%s (Inactive)'))
|
||||||
name_string = plugin.getString(StringContent.Name)
|
item.setText(status_text % plugin.nameStrings[u'singular'])
|
||||||
item.setText(status_text % name_string[u'singular'])
|
|
||||||
# If the plugin has an icon, set it!
|
# If the plugin has an icon, set it!
|
||||||
if plugin.icon:
|
if plugin.icon:
|
||||||
item.setIcon(plugin.icon)
|
item.setIcon(plugin.icon)
|
||||||
self.pluginListWidget.addItem(item)
|
self.pluginListWidget.addItem(item)
|
||||||
pluginListWidth = max(pluginListWidth, self.fontMetrics().width(
|
pluginListWidth = max(pluginListWidth, self.fontMetrics().width(
|
||||||
unicode(translate('OpenLP.PluginForm', '%s (Inactive)')) %
|
unicode(translate('OpenLP.PluginForm', '%s (Inactive)')) %
|
||||||
name_string[u'singular']))
|
plugin.nameStrings[u'singular']))
|
||||||
self.pluginListWidget.setFixedWidth(pluginListWidth +
|
self.pluginListWidget.setFixedWidth(pluginListWidth +
|
||||||
self.pluginListWidget.iconSize().width() + 48)
|
self.pluginListWidget.iconSize().width() + 48)
|
||||||
|
|
||||||
@ -116,8 +117,7 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
|
|||||||
self.pluginListWidget.currentItem().text().split(u' ')[0]
|
self.pluginListWidget.currentItem().text().split(u' ')[0]
|
||||||
self.activePlugin = None
|
self.activePlugin = None
|
||||||
for plugin in self.parent.pluginManager.plugins:
|
for plugin in self.parent.pluginManager.plugins:
|
||||||
name_string = plugin.getString(StringContent.Name)
|
if plugin.nameStrings[u'singular'] == plugin_name_singular:
|
||||||
if name_string[u'singular'] == plugin_name_singular:
|
|
||||||
self.activePlugin = plugin
|
self.activePlugin = plugin
|
||||||
break
|
break
|
||||||
if self.activePlugin:
|
if self.activePlugin:
|
||||||
@ -129,7 +129,9 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
|
|||||||
if self.programaticChange:
|
if self.programaticChange:
|
||||||
return
|
return
|
||||||
if status == 0:
|
if status == 0:
|
||||||
|
Receiver.send_message(u'cursor_busy')
|
||||||
self.activePlugin.toggleStatus(PluginStatus.Active)
|
self.activePlugin.toggleStatus(PluginStatus.Active)
|
||||||
|
Receiver.send_message(u'cursor_normal')
|
||||||
else:
|
else:
|
||||||
self.activePlugin.toggleStatus(PluginStatus.Inactive)
|
self.activePlugin.toggleStatus(PluginStatus.Inactive)
|
||||||
status_text = unicode(
|
status_text = unicode(
|
||||||
@ -143,6 +145,5 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
|
|||||||
elif self.activePlugin.status == PluginStatus.Disabled:
|
elif self.activePlugin.status == PluginStatus.Disabled:
|
||||||
status_text = unicode(
|
status_text = unicode(
|
||||||
translate('OpenLP.PluginForm', '%s (Disabled)'))
|
translate('OpenLP.PluginForm', '%s (Disabled)'))
|
||||||
name_string = self.activePlugin.getString(StringContent.Name)
|
|
||||||
self.pluginListWidget.currentItem().setText(
|
self.pluginListWidget.currentItem().setText(
|
||||||
status_text % name_string[u'singular'])
|
status_text % self.activePlugin.nameStrings[u'singular'])
|
||||||
|
165
openlp/core/ui/printservicedialog.py
Normal file
165
openlp/core/ui/printservicedialog.py
Normal file
@ -0,0 +1,165 @@
|
|||||||
|
# -*- 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 PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
|
from openlp.core.lib import build_icon, translate, SpellTextEdit
|
||||||
|
from openlp.core.lib.ui import UiStrings
|
||||||
|
|
||||||
|
class ZoomSize(object):
|
||||||
|
"""
|
||||||
|
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)
|
||||||
|
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.printButton = self.toolbar.addAction(
|
||||||
|
build_icon(u':/general/general_print.png'), 'Print')
|
||||||
|
self.optionsButton = QtGui.QToolButton(self.toolbar)
|
||||||
|
self.optionsButton.setText(translate('OpenLP.PrintServiceForm',
|
||||||
|
'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.closeButton = self.toolbar.addAction(
|
||||||
|
build_icon(u':/system/system_close.png'),
|
||||||
|
translate('OpenLP.PrintServiceForm', 'Close'))
|
||||||
|
self.toolbar.addSeparator()
|
||||||
|
self.plainCopy = self.toolbar.addAction(
|
||||||
|
build_icon(u':/system/system_edit_copy.png'),
|
||||||
|
translate('OpenLP.PrintServiceForm', 'Copy'))
|
||||||
|
self.htmlCopy = self.toolbar.addAction(
|
||||||
|
build_icon(u':/system/system_edit_copy.png'),
|
||||||
|
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(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(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(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.toolbar.addWidget(self.zoomComboBox)
|
||||||
|
self.mainLayout.addWidget(self.toolbar)
|
||||||
|
self.previewWidget = QtGui.QPrintPreviewWidget(printServiceDialog)
|
||||||
|
self.mainLayout.addWidget(self.previewWidget)
|
||||||
|
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 = SpellTextEdit(self.optionsWidget)
|
||||||
|
self.footerTextEdit.setObjectName(u'footerTextEdit')
|
||||||
|
self.optionsLayout.addWidget(self.footerTextEdit)
|
||||||
|
self.optionsGroupBox = QtGui.QGroupBox(
|
||||||
|
translate('OpenLP.PrintServiceForm','Other Options'))
|
||||||
|
self.groupLayout = QtGui.QVBoxLayout()
|
||||||
|
self.slideTextCheckBox = QtGui.QCheckBox()
|
||||||
|
self.groupLayout.addWidget(self.slideTextCheckBox)
|
||||||
|
self.notesCheckBox = QtGui.QCheckBox()
|
||||||
|
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)
|
||||||
|
|
||||||
|
self.retranslateUi(printServiceDialog)
|
||||||
|
QtCore.QMetaObject.connectSlotsByName(printServiceDialog)
|
||||||
|
QtCore.QObject.connect(self.optionsButton,
|
||||||
|
QtCore.SIGNAL(u'toggled(bool)'), self.toggleOptions)
|
||||||
|
|
||||||
|
def retranslateUi(self, printServiceDialog):
|
||||||
|
printServiceDialog.setWindowTitle(UiStrings.PrintServiceOrder)
|
||||||
|
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.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])
|
244
openlp/core/ui/printserviceform.py
Normal file
244
openlp/core/ui/printserviceform.py
Normal file
@ -0,0 +1,244 @@
|
|||||||
|
# -*- 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 #
|
||||||
|
###############################################################################
|
||||||
|
import datetime
|
||||||
|
|
||||||
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
|
from openlp.core.lib import translate
|
||||||
|
from openlp.core.lib.ui import UiStrings
|
||||||
|
from openlp.core.ui.printservicedialog import Ui_PrintServiceDialog, ZoomSize
|
||||||
|
|
||||||
|
class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog):
|
||||||
|
|
||||||
|
def __init__(self, parent, serviceManager):
|
||||||
|
"""
|
||||||
|
Constructor
|
||||||
|
"""
|
||||||
|
QtGui.QDialog.__init__(self, parent)
|
||||||
|
self.parent = parent
|
||||||
|
self.serviceManager = serviceManager
|
||||||
|
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()
|
||||||
|
settings.beginGroup(u'advanced')
|
||||||
|
self.slideTextCheckBox.setChecked(settings.value(
|
||||||
|
u'print slide text', QtCore.QVariant(False)).toBool())
|
||||||
|
self.metaDataCheckBox.setChecked(settings.value(
|
||||||
|
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,
|
||||||
|
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.plainCopy,
|
||||||
|
QtCore.SIGNAL(u'triggered()'), self.copyText)
|
||||||
|
QtCore.QObject.connect(self.htmlCopy,
|
||||||
|
QtCore.SIGNAL(u'triggered()'), 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()
|
||||||
|
self.updatePreviewText()
|
||||||
|
|
||||||
|
def updatePreviewText(self):
|
||||||
|
"""
|
||||||
|
Creates the html text and updates the html of *self.document*.
|
||||||
|
"""
|
||||||
|
text = u''
|
||||||
|
if self.titleLineEdit.text():
|
||||||
|
text += u'<h2>%s</h2>' % unicode(self.titleLineEdit.text())
|
||||||
|
for item in self.serviceManager.serviceItems:
|
||||||
|
item = item[u'service_item']
|
||||||
|
# Add the title of the service item.
|
||||||
|
text += u'<h3><img src="%s" /> %s</h3>' % (item.icon,
|
||||||
|
item.get_display_title())
|
||||||
|
# Add slide text of the service item.
|
||||||
|
if self.slideTextCheckBox.isChecked():
|
||||||
|
if item.is_text():
|
||||||
|
# Add the text of the service item.
|
||||||
|
verse = None
|
||||||
|
for slide in item.get_frames():
|
||||||
|
if not verse:
|
||||||
|
text += u'<p>' + slide[u'html']
|
||||||
|
verse = slide[u'verseTag']
|
||||||
|
elif verse != slide[u'verseTag']:
|
||||||
|
text += u'<\p><p>' + slide[u'html']
|
||||||
|
verse = slide[u'verseTag']
|
||||||
|
else:
|
||||||
|
text += u'<br/>' + slide[u'html']
|
||||||
|
text += u'</p>'
|
||||||
|
elif item.is_image():
|
||||||
|
# Add the image names of the service item.
|
||||||
|
text += u'<ol>'
|
||||||
|
for slide in range(len(item.get_frames())):
|
||||||
|
text += u'<li><p>%s</p></li>' % \
|
||||||
|
item.get_frame_title(slide)
|
||||||
|
text += u'</ol>'
|
||||||
|
if item.foot_text:
|
||||||
|
# add footer
|
||||||
|
text += u'<p>%s</p>' % item.foot_text
|
||||||
|
# Add service items' notes.
|
||||||
|
if self.notesCheckBox.isChecked():
|
||||||
|
if item.notes:
|
||||||
|
text += u'<p><strong>%s</strong></p>%s' % (translate(
|
||||||
|
'OpenLP.ServiceManager', 'Notes:'),
|
||||||
|
item.notes.replace(u'\n', u'<br />'))
|
||||||
|
# Add play length of media files.
|
||||||
|
if item.is_media() and self.metaDataCheckBox.isChecked():
|
||||||
|
text += u'<p><strong>%s</strong> %s</p>' % (translate(
|
||||||
|
'OpenLP.ServiceManager', u'Playing time:'),
|
||||||
|
unicode(datetime.timedelta(seconds=item.media_length)))
|
||||||
|
if self.footerTextEdit.toPlainText():
|
||||||
|
text += u'<h4>%s</h4>%s' % (translate('OpenLP.ServiceManager',
|
||||||
|
u'Custom Service Notes:'), self.footerTextEdit.toPlainText())
|
||||||
|
self.document.setHtml(text)
|
||||||
|
self.previewWidget.updatePreview()
|
||||||
|
|
||||||
|
def paintRequested(self, printer):
|
||||||
|
"""
|
||||||
|
Paint the preview of the *self.document*.
|
||||||
|
|
||||||
|
``printer``
|
||||||
|
A *QPrinter* object.
|
||||||
|
"""
|
||||||
|
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()
|
||||||
|
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))
|
||||||
|
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*.
|
||||||
|
"""
|
||||||
|
if not self.printDialog.exec_():
|
||||||
|
return
|
||||||
|
# Print the document.
|
||||||
|
self.document.print_(self.printer)
|
||||||
|
|
||||||
|
def zoomIn(self):
|
||||||
|
"""
|
||||||
|
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.zoomIn(1 + self.zoom)
|
||||||
|
self.zoom = 0
|
||||||
|
|
||||||
|
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 saveOptions(self):
|
||||||
|
"""
|
||||||
|
Save the settings and close the dialog.
|
||||||
|
"""
|
||||||
|
# Save the settings for this dialog.
|
||||||
|
settings = QtCore.QSettings()
|
||||||
|
settings.beginGroup(u'advanced')
|
||||||
|
settings.setValue(u'print slide text',
|
||||||
|
QtCore.QVariant(self.slideTextCheckBox.isChecked()))
|
||||||
|
settings.setValue(u'print file meta data',
|
||||||
|
QtCore.QVariant(self.metaDataCheckBox.isChecked()))
|
||||||
|
settings.setValue(u'print notes',
|
||||||
|
QtCore.QVariant(self.notesCheckBox.isChecked()))
|
||||||
|
settings.endGroup()
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -71,7 +71,7 @@ class ScreenList(object):
|
|||||||
"""
|
"""
|
||||||
Set up the current screen dimensions
|
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:
|
if number + 1 > self.display_count:
|
||||||
self.current = self.screen_list[0]
|
self.current = self.screen_list[0]
|
||||||
self.override = copy.deepcopy(self.current)
|
self.override = copy.deepcopy(self.current)
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -27,7 +27,7 @@
|
|||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import translate
|
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
|
create_delete_push_button, create_up_down_push_button_set
|
||||||
|
|
||||||
class Ui_ServiceItemEditDialog(object):
|
class Ui_ServiceItemEditDialog(object):
|
||||||
@ -50,7 +50,7 @@ class Ui_ServiceItemEditDialog(object):
|
|||||||
self.buttonLayout.addWidget(self.downButton)
|
self.buttonLayout.addWidget(self.downButton)
|
||||||
self.dialogLayout.addLayout(self.buttonLayout, 0, 1)
|
self.dialogLayout.addLayout(self.buttonLayout, 0, 1)
|
||||||
self.dialogLayout.addWidget(
|
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)
|
self.retranslateUi(serviceItemEditDialog)
|
||||||
QtCore.QMetaObject.connectSlotsByName(serviceItemEditDialog)
|
QtCore.QMetaObject.connectSlotsByName(serviceItemEditDialog)
|
||||||
|
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -110,11 +110,12 @@ class ServiceItemEditForm(QtGui.QDialog, Ui_ServiceItemEditDialog):
|
|||||||
temp = self.itemList[row]
|
temp = self.itemList[row]
|
||||||
self.itemList.remove(self.itemList[row])
|
self.itemList.remove(self.itemList[row])
|
||||||
if direction == u'up':
|
if direction == u'up':
|
||||||
self.itemList.insert(row - 1, temp)
|
row -= 1
|
||||||
else:
|
else:
|
||||||
self.itemList.insert(row + 1, temp)
|
row += 1
|
||||||
|
self.itemList.insert(row, temp)
|
||||||
self.loadData()
|
self.loadData()
|
||||||
self.listWidget.setCurrentRow(row + 1)
|
self.listWidget.setCurrentRow(row)
|
||||||
|
|
||||||
def onCurrentRowChanged(self, row):
|
def onCurrentRowChanged(self, row):
|
||||||
"""
|
"""
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -23,10 +23,9 @@
|
|||||||
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
|
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
|
||||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
import os
|
|
||||||
import logging
|
|
||||||
import cPickle
|
import cPickle
|
||||||
|
import logging
|
||||||
|
import os
|
||||||
import zipfile
|
import zipfile
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
@ -34,10 +33,11 @@ log = logging.getLogger(__name__)
|
|||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import OpenLPToolbar, ServiceItem, context_menu_action, \
|
from openlp.core.lib import OpenLPToolbar, ServiceItem, context_menu_action, \
|
||||||
Receiver, build_icon, ItemCapabilities, SettingsManager, translate, \
|
Receiver, build_icon, ItemCapabilities, SettingsManager, translate
|
||||||
ThemeLevel
|
from openlp.core.lib.theme import 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 import ServiceNoteForm, ServiceItemEditForm, StartTimeForm
|
||||||
|
from openlp.core.ui.printserviceform import PrintServiceForm
|
||||||
from openlp.core.utils import AppLocation, delete_file, file_is_unicode, \
|
from openlp.core.utils import AppLocation, delete_file, file_is_unicode, \
|
||||||
split_filename
|
split_filename
|
||||||
|
|
||||||
@ -88,6 +88,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
self._fileName = u''
|
self._fileName = u''
|
||||||
self.serviceNoteForm = ServiceNoteForm(self.mainwindow)
|
self.serviceNoteForm = ServiceNoteForm(self.mainwindow)
|
||||||
self.serviceItemEditForm = ServiceItemEditForm(self.mainwindow)
|
self.serviceItemEditForm = ServiceItemEditForm(self.mainwindow)
|
||||||
|
self.startTimeForm = StartTimeForm(self.mainwindow)
|
||||||
# start with the layout
|
# start with the layout
|
||||||
self.layout = QtGui.QVBoxLayout(self)
|
self.layout = QtGui.QVBoxLayout(self)
|
||||||
self.layout.setSpacing(0)
|
self.layout.setSpacing(0)
|
||||||
@ -95,23 +96,18 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
# Create the top toolbar
|
# Create the top toolbar
|
||||||
self.toolbar = OpenLPToolbar(self)
|
self.toolbar = OpenLPToolbar(self)
|
||||||
self.toolbar.addToolbarButton(
|
self.toolbar.addToolbarButton(
|
||||||
translate('OpenLP.ServiceManager', 'New Service'),
|
UiStrings.NewService, u':/general/general_new.png',
|
||||||
u':/general/general_new.png',
|
UiStrings.CreateService, self.onNewServiceClicked)
|
||||||
translate('OpenLP.ServiceManager', 'Create a new service'),
|
|
||||||
self.onNewServiceClicked)
|
|
||||||
self.toolbar.addToolbarButton(
|
self.toolbar.addToolbarButton(
|
||||||
translate('OpenLP.ServiceManager', 'Open Service'),
|
UiStrings.OpenService, u':/general/general_open.png',
|
||||||
u':/general/general_open.png',
|
|
||||||
translate('OpenLP.ServiceManager', 'Load an existing service'),
|
translate('OpenLP.ServiceManager', 'Load an existing service'),
|
||||||
self.onLoadServiceClicked)
|
self.onLoadServiceClicked)
|
||||||
self.toolbar.addToolbarButton(
|
self.toolbar.addToolbarButton(
|
||||||
translate('OpenLP.ServiceManager', 'Save Service'),
|
UiStrings.SaveService, u':/general/general_save.png',
|
||||||
u':/general/general_save.png',
|
|
||||||
translate('OpenLP.ServiceManager', 'Save this service'),
|
translate('OpenLP.ServiceManager', 'Save this service'),
|
||||||
self.saveFile)
|
self.saveFile)
|
||||||
self.toolbar.addSeparator()
|
self.toolbar.addSeparator()
|
||||||
self.themeLabel = QtGui.QLabel(translate('OpenLP.ServiceManager',
|
self.themeLabel = QtGui.QLabel(u'%s:' % UiStrings.Theme, self)
|
||||||
'Theme:'), self)
|
|
||||||
self.themeLabel.setMargin(3)
|
self.themeLabel.setMargin(3)
|
||||||
self.themeLabel.setObjectName(u'themeLabel')
|
self.themeLabel.setObjectName(u'themeLabel')
|
||||||
self.toolbar.addToolbarWidget(u'ThemeLabel', self.themeLabel)
|
self.toolbar.addToolbarWidget(u'ThemeLabel', self.themeLabel)
|
||||||
@ -270,16 +266,19 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
self.notesAction = self.menu.addAction(
|
self.notesAction = self.menu.addAction(
|
||||||
translate('OpenLP.ServiceManager', '&Notes'))
|
translate('OpenLP.ServiceManager', '&Notes'))
|
||||||
self.notesAction.setIcon(build_icon(u':/services/service_notes.png'))
|
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(
|
self.deleteAction = self.menu.addAction(
|
||||||
translate('OpenLP.ServiceManager', '&Delete From Service'))
|
translate('OpenLP.ServiceManager', '&Delete From Service'))
|
||||||
self.deleteAction.setIcon(build_icon(u':/general/general_delete.png'))
|
self.deleteAction.setIcon(build_icon(u':/general/general_delete.png'))
|
||||||
self.sep1 = self.menu.addAction(u'')
|
self.sep1 = self.menu.addAction(u'')
|
||||||
self.sep1.setSeparator(True)
|
self.sep1.setSeparator(True)
|
||||||
self.previewAction = self.menu.addAction(
|
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.previewAction.setIcon(build_icon(u':/general/general_preview.png'))
|
||||||
self.liveAction = self.menu.addAction(
|
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.liveAction.setIcon(build_icon(u':/general/general_live.png'))
|
||||||
self.sep2 = self.menu.addAction(u'')
|
self.sep2 = self.menu.addAction(u'')
|
||||||
self.sep2.setSeparator(True)
|
self.sep2.setSeparator(True)
|
||||||
@ -461,11 +460,11 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
|
|
||||||
def saveFileAs(self):
|
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.
|
save the file.
|
||||||
"""
|
"""
|
||||||
fileName = unicode(QtGui.QFileDialog.getSaveFileName(self.mainwindow,
|
fileName = unicode(QtGui.QFileDialog.getSaveFileName(self.mainwindow,
|
||||||
translate('OpenLP.ServiceManager', 'Save Service'),
|
UiStrings.SaveService,
|
||||||
SettingsManager.get_last_dir(
|
SettingsManager.get_last_dir(
|
||||||
self.mainwindow.serviceSettingsSection),
|
self.mainwindow.serviceSettingsSection),
|
||||||
translate('OpenLP.ServiceManager', 'OpenLP Service Files (*.osz)')))
|
translate('OpenLP.ServiceManager', 'OpenLP Service Files (*.osz)')))
|
||||||
@ -563,6 +562,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
self.editAction.setVisible(False)
|
self.editAction.setVisible(False)
|
||||||
self.maintainAction.setVisible(False)
|
self.maintainAction.setVisible(False)
|
||||||
self.notesAction.setVisible(False)
|
self.notesAction.setVisible(False)
|
||||||
|
self.timeAction.setVisible(False)
|
||||||
if serviceItem[u'service_item'].is_capable(ItemCapabilities.AllowsEdit)\
|
if serviceItem[u'service_item'].is_capable(ItemCapabilities.AllowsEdit)\
|
||||||
and serviceItem[u'service_item'].edit_id:
|
and serviceItem[u'service_item'].edit_id:
|
||||||
self.editAction.setVisible(True)
|
self.editAction.setVisible(True)
|
||||||
@ -571,6 +571,9 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
self.maintainAction.setVisible(True)
|
self.maintainAction.setVisible(True)
|
||||||
if item.parent() is None:
|
if item.parent() is None:
|
||||||
self.notesAction.setVisible(True)
|
self.notesAction.setVisible(True)
|
||||||
|
if serviceItem[u'service_item']\
|
||||||
|
.is_capable(ItemCapabilities.AllowsVarableStartTime):
|
||||||
|
self.timeAction.setVisible(True)
|
||||||
self.themeMenu.menuAction().setVisible(False)
|
self.themeMenu.menuAction().setVisible(False)
|
||||||
if serviceItem[u'service_item'].is_text():
|
if serviceItem[u'service_item'].is_text():
|
||||||
self.themeMenu.menuAction().setVisible(True)
|
self.themeMenu.menuAction().setVisible(True)
|
||||||
@ -583,6 +586,8 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
self.onDeleteFromService()
|
self.onDeleteFromService()
|
||||||
if action == self.notesAction:
|
if action == self.notesAction:
|
||||||
self.onServiceItemNoteForm()
|
self.onServiceItemNoteForm()
|
||||||
|
if action == self.timeAction:
|
||||||
|
self.onStartTimeForm()
|
||||||
if action == self.previewAction:
|
if action == self.previewAction:
|
||||||
self.makePreview()
|
self.makePreview()
|
||||||
if action == self.liveAction:
|
if action == self.liveAction:
|
||||||
@ -597,6 +602,16 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
self.serviceNoteForm.textEdit.toPlainText()
|
self.serviceNoteForm.textEdit.toPlainText()
|
||||||
self.repaintServiceList(item, -1)
|
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 = \
|
||||||
|
self.startTimeForm.hourSpinBox.value() * 3600 + \
|
||||||
|
self.startTimeForm.minuteSpinBox.value() * 60 + \
|
||||||
|
self.startTimeForm.secondSpinBox.value()
|
||||||
|
self.repaintServiceList(item, -1)
|
||||||
|
|
||||||
def onServiceItemEditForm(self):
|
def onServiceItemEditForm(self):
|
||||||
item = self.findServiceItem()[0]
|
item = self.findServiceItem()[0]
|
||||||
self.serviceItemEditForm.setServiceItem(
|
self.serviceItemEditForm.setServiceItem(
|
||||||
@ -843,6 +858,11 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
text = frame[u'title'].replace(u'\n', u' ')
|
text = frame[u'title'].replace(u'\n', u' ')
|
||||||
child.setText(0, text[:40])
|
child.setText(0, text[:40])
|
||||||
child.setData(0, QtCore.Qt.UserRole, QtCore.QVariant(count))
|
child.setData(0, QtCore.Qt.UserRole, QtCore.QVariant(count))
|
||||||
|
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 serviceItem == itemcount:
|
||||||
if item[u'expanded'] and serviceItemChild == count:
|
if item[u'expanded'] and serviceItemChild == count:
|
||||||
self.serviceManagerList.setCurrentItem(child)
|
self.serviceManagerList.setCurrentItem(child)
|
||||||
@ -1041,8 +1061,8 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
if self.serviceItems[item][u'service_item']\
|
if self.serviceItems[item][u'service_item']\
|
||||||
.is_capable(ItemCapabilities.AllowsEdit):
|
.is_capable(ItemCapabilities.AllowsEdit):
|
||||||
Receiver.send_message(u'%s_edit' %
|
Receiver.send_message(u'%s_edit' %
|
||||||
self.serviceItems[item][u'service_item'].name.lower(), u'L:%s' %
|
self.serviceItems[item][u'service_item'].name.lower(),
|
||||||
self.serviceItems[item][u'service_item'].edit_id )
|
u'L:%s' % self.serviceItems[item][u'service_item'].edit_id)
|
||||||
|
|
||||||
def findServiceItem(self):
|
def findServiceItem(self):
|
||||||
"""
|
"""
|
||||||
@ -1187,41 +1207,5 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
"""
|
"""
|
||||||
Print a Service Order Sheet.
|
Print a Service Order Sheet.
|
||||||
"""
|
"""
|
||||||
if not self.serviceItems:
|
settingDialog = PrintServiceForm(self.mainwindow, self)
|
||||||
critical_error_message_box(
|
settingDialog.exec_()
|
||||||
message=translate('OpenLP.ServiceManager',
|
|
||||||
'There is no service item in this service.'))
|
|
||||||
return
|
|
||||||
printDialog = QtGui.QPrintDialog()
|
|
||||||
if not printDialog.exec_():
|
|
||||||
return
|
|
||||||
text = u'<h2>%s</h2>' % translate('OpenLP.ServiceManager',
|
|
||||||
'Service Order Sheet')
|
|
||||||
for item in self.serviceItems:
|
|
||||||
item = item[u'service_item']
|
|
||||||
# add the title
|
|
||||||
text += u'<h4><img src="%s" /> %s</h4>' % (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'<p>' + slide[u'text'] + u'</p>'
|
|
||||||
elif item.is_image():
|
|
||||||
# Add the image names of the service item.
|
|
||||||
text += u'<ol>'
|
|
||||||
for slide in range(len(item.get_frames())):
|
|
||||||
text += u'<li><p>%s</p></li>' % item.get_frame_title(slide)
|
|
||||||
text += u'</ol>'
|
|
||||||
if item.foot_text:
|
|
||||||
# add footer
|
|
||||||
text += u'<p>%s</p>' % item.foot_text
|
|
||||||
if item.notes:
|
|
||||||
# add notes
|
|
||||||
text += u'<p><b>%s</b> %s</p>' % (translate(
|
|
||||||
'OpenLP.ServiceManager', 'Notes:'), item.notes)
|
|
||||||
serviceDocument = QtGui.QTextDocument()
|
|
||||||
serviceDocument.setHtml(text)
|
|
||||||
serviceDocument.print_(printDialog.printer())
|
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -27,7 +27,7 @@
|
|||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import translate
|
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):
|
class ServiceNoteForm(QtGui.QDialog):
|
||||||
"""
|
"""
|
||||||
@ -48,7 +48,7 @@ class ServiceNoteForm(QtGui.QDialog):
|
|||||||
self.textEdit = QtGui.QTextEdit(self)
|
self.textEdit = QtGui.QTextEdit(self)
|
||||||
self.textEdit.setObjectName(u'textEdit')
|
self.textEdit.setObjectName(u'textEdit')
|
||||||
self.dialogLayout.addWidget(self.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)
|
QtCore.QMetaObject.connectSlotsByName(self)
|
||||||
|
|
||||||
def retranslateUi(self):
|
def retranslateUi(self):
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -27,6 +27,7 @@
|
|||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import translate, build_icon
|
from openlp.core.lib import translate, build_icon
|
||||||
|
from openlp.core.lib.ui import create_accept_reject_button_box
|
||||||
|
|
||||||
class Ui_SettingsDialog(object):
|
class Ui_SettingsDialog(object):
|
||||||
def setupUi(self, settingsDialog):
|
def setupUi(self, settingsDialog):
|
||||||
@ -35,21 +36,13 @@ class Ui_SettingsDialog(object):
|
|||||||
settingsDialog.setWindowIcon(
|
settingsDialog.setWindowIcon(
|
||||||
build_icon(u':/system/system_settings.png'))
|
build_icon(u':/system/system_settings.png'))
|
||||||
self.settingsLayout = QtGui.QVBoxLayout(settingsDialog)
|
self.settingsLayout = QtGui.QVBoxLayout(settingsDialog)
|
||||||
margins = self.settingsLayout.contentsMargins()
|
|
||||||
self.settingsLayout.setObjectName(u'settingsLayout')
|
self.settingsLayout.setObjectName(u'settingsLayout')
|
||||||
self.settingsTabWidget = QtGui.QTabWidget(settingsDialog)
|
self.settingsTabWidget = QtGui.QTabWidget(settingsDialog)
|
||||||
self.settingsTabWidget.setObjectName(u'settingsTabWidget')
|
self.settingsTabWidget.setObjectName(u'settingsTabWidget')
|
||||||
self.settingsLayout.addWidget(self.settingsTabWidget)
|
self.settingsLayout.addWidget(self.settingsTabWidget)
|
||||||
self.buttonBox = QtGui.QDialogButtonBox(settingsDialog)
|
self.buttonBox = create_accept_reject_button_box(settingsDialog, True)
|
||||||
self.buttonBox.setStandardButtons(
|
|
||||||
QtGui.QDialogButtonBox.Cancel | QtGui.QDialogButtonBox.Ok)
|
|
||||||
self.buttonBox.setObjectName(u'buttonBox')
|
|
||||||
self.settingsLayout.addWidget(self.buttonBox)
|
self.settingsLayout.addWidget(self.buttonBox)
|
||||||
self.retranslateUi(settingsDialog)
|
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)
|
QtCore.QMetaObject.connectSlotsByName(settingsDialog)
|
||||||
|
|
||||||
def retranslateUi(self, settingsDialog):
|
def retranslateUi(self, settingsDialog):
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -31,7 +31,7 @@ import logging
|
|||||||
from PyQt4 import QtGui
|
from PyQt4 import QtGui
|
||||||
|
|
||||||
from openlp.core.lib import Receiver
|
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
|
from settingsdialog import Ui_SettingsDialog
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
@ -47,17 +47,14 @@ class SettingsForm(QtGui.QDialog, Ui_SettingsDialog):
|
|||||||
QtGui.QDialog.__init__(self, parent)
|
QtGui.QDialog.__init__(self, parent)
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
# General tab
|
# General tab
|
||||||
self.generalTab = GeneralTab(screens)
|
generalTab = GeneralTab(screens)
|
||||||
self.addTab(u'General', self.generalTab)
|
self.addTab(u'General', generalTab)
|
||||||
# Themes tab
|
# Themes tab
|
||||||
self.themesTab = ThemesTab(mainWindow)
|
themesTab = ThemesTab(mainWindow)
|
||||||
self.addTab(u'Themes', self.themesTab)
|
self.addTab(u'Themes', themesTab)
|
||||||
# Advanced tab
|
# Advanced tab
|
||||||
self.advancedTab = AdvancedTab()
|
advancedTab = AdvancedTab()
|
||||||
self.addTab(u'Advanced', self.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):
|
def addTab(self, name, tab):
|
||||||
"""
|
"""
|
||||||
@ -71,9 +68,9 @@ class SettingsForm(QtGui.QDialog, Ui_SettingsDialog):
|
|||||||
Add a tab to the form at a specific location
|
Add a tab to the form at a specific location
|
||||||
"""
|
"""
|
||||||
log.debug(u'Inserting %s tab' % tab.tabTitle)
|
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(
|
self.settingsTabWidget.insertTab(
|
||||||
location + 15, tab, tab.tabTitleVisible)
|
location + 14, tab, tab.tabTitleVisible)
|
||||||
|
|
||||||
def removeTab(self, tab):
|
def removeTab(self, tab):
|
||||||
"""
|
"""
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -36,7 +36,7 @@ class Ui_ShortcutListDialog(object):
|
|||||||
self.treeWidget = QtGui.QTreeWidget(shortcutListDialog)
|
self.treeWidget = QtGui.QTreeWidget(shortcutListDialog)
|
||||||
self.treeWidget.setAlternatingRowColors(True)
|
self.treeWidget.setAlternatingRowColors(True)
|
||||||
self.treeWidget.setObjectName(u'treeWidget')
|
self.treeWidget.setObjectName(u'treeWidget')
|
||||||
self.treeWidget.setColumnCount(2)
|
self.treeWidget.setColumnCount(3)
|
||||||
self.dialogLayout.addWidget(self.treeWidget)
|
self.dialogLayout.addWidget(self.treeWidget)
|
||||||
self.defaultButton = QtGui.QRadioButton(shortcutListDialog)
|
self.defaultButton = QtGui.QRadioButton(shortcutListDialog)
|
||||||
self.defaultButton.setChecked(True)
|
self.defaultButton.setChecked(True)
|
||||||
@ -78,7 +78,8 @@ class Ui_ShortcutListDialog(object):
|
|||||||
translate('OpenLP.ShortcutListDialog', 'Customize Shortcuts'))
|
translate('OpenLP.ShortcutListDialog', 'Customize Shortcuts'))
|
||||||
self.treeWidget.setHeaderLabels([
|
self.treeWidget.setHeaderLabels([
|
||||||
translate('OpenLP.ShortcutListDialog', 'Action'),
|
translate('OpenLP.ShortcutListDialog', 'Action'),
|
||||||
translate('OpenLP.ShortcutListDialog', 'Shortcut')])
|
translate('OpenLP.ShortcutListDialog', 'Shortcut'),
|
||||||
|
translate('OpenLP.ShortcutListDialog', 'Alternate')])
|
||||||
self.defaultButton.setText(
|
self.defaultButton.setText(
|
||||||
translate('OpenLP.ShortcutListDialog', 'Default: %s'))
|
translate('OpenLP.ShortcutListDialog', 'Default: %s'))
|
||||||
self.customButton.setText(
|
self.customButton.setText(
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -95,8 +95,14 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog):
|
|||||||
item = QtGui.QTreeWidgetItem([category.name])
|
item = QtGui.QTreeWidgetItem([category.name])
|
||||||
for action in category.actions:
|
for action in category.actions:
|
||||||
actionText = REMOVE_AMPERSAND.sub('', unicode(action.text()))
|
actionText = REMOVE_AMPERSAND.sub('', unicode(action.text()))
|
||||||
|
if (len(action.shortcuts()) == 2):
|
||||||
|
shortcutText = action.shortcuts()[0].toString()
|
||||||
|
alternateText = action.shortcuts()[1].toString()
|
||||||
|
else:
|
||||||
shortcutText = action.shortcut().toString()
|
shortcutText = action.shortcut().toString()
|
||||||
actionItem = QtGui.QTreeWidgetItem([actionText, shortcutText])
|
alternateText = u''
|
||||||
|
actionItem = QtGui.QTreeWidgetItem(
|
||||||
|
[actionText, shortcutText, alternateText])
|
||||||
actionItem.setIcon(0, action.icon())
|
actionItem.setIcon(0, action.icon())
|
||||||
item.addChild(actionItem)
|
item.addChild(actionItem)
|
||||||
item.setExpanded(True)
|
item.setExpanded(True)
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -32,7 +32,7 @@ from PyQt4.phonon import Phonon
|
|||||||
|
|
||||||
from openlp.core.lib import OpenLPToolbar, Receiver, resize_image, \
|
from openlp.core.lib import OpenLPToolbar, Receiver, resize_image, \
|
||||||
ItemCapabilities, translate
|
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
|
from openlp.core.ui import HideMode, MainDisplay
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
@ -78,7 +78,7 @@ class SlideController(QtGui.QWidget):
|
|||||||
self.selectedRow = 0
|
self.selectedRow = 0
|
||||||
self.serviceItem = None
|
self.serviceItem = None
|
||||||
self.alertTab = None
|
self.alertTab = None
|
||||||
self.panel = QtGui.QWidget(parent.ControlSplitter)
|
self.panel = QtGui.QWidget(parent.controlSplitter)
|
||||||
self.slideList = {}
|
self.slideList = {}
|
||||||
# Layout for holding panel
|
# Layout for holding panel
|
||||||
self.panelLayout = QtGui.QVBoxLayout(self.panel)
|
self.panelLayout = QtGui.QVBoxLayout(self.panel)
|
||||||
@ -87,12 +87,11 @@ class SlideController(QtGui.QWidget):
|
|||||||
# Type label for the top of the slide controller
|
# Type label for the top of the slide controller
|
||||||
self.typeLabel = QtGui.QLabel(self.panel)
|
self.typeLabel = QtGui.QLabel(self.panel)
|
||||||
if self.isLive:
|
if self.isLive:
|
||||||
self.typeLabel.setText(translate('OpenLP.SlideController', 'Live'))
|
self.typeLabel.setText(UiStrings.Live)
|
||||||
self.split = 1
|
self.split = 1
|
||||||
self.typePrefix = u'live'
|
self.typePrefix = u'live'
|
||||||
else:
|
else:
|
||||||
self.typeLabel.setText(translate('OpenLP.SlideController',
|
self.typeLabel.setText(UiStrings.Preview)
|
||||||
'Preview'))
|
|
||||||
self.split = 0
|
self.split = 0
|
||||||
self.typePrefix = u'preview'
|
self.typePrefix = u'preview'
|
||||||
self.typeLabel.setStyleSheet(u'font-weight: bold; font-size: 12pt;')
|
self.typeLabel.setStyleSheet(u'font-weight: bold; font-size: 12pt;')
|
||||||
@ -179,10 +178,12 @@ class SlideController(QtGui.QWidget):
|
|||||||
QtCore.SIGNAL(u'triggered(bool)'), self.onHideDisplay)
|
QtCore.SIGNAL(u'triggered(bool)'), self.onHideDisplay)
|
||||||
self.toolbar.addToolbarSeparator(u'Loop Separator')
|
self.toolbar.addToolbarSeparator(u'Loop Separator')
|
||||||
self.toolbar.addToolbarButton(
|
self.toolbar.addToolbarButton(
|
||||||
|
# Does not need translating - control string.
|
||||||
u'Start Loop', u':/media/media_time.png',
|
u'Start Loop', u':/media/media_time.png',
|
||||||
translate('OpenLP.SlideController', 'Start continuous loop'),
|
translate('OpenLP.SlideController', 'Start continuous loop'),
|
||||||
self.onStartLoop)
|
self.onStartLoop)
|
||||||
self.toolbar.addToolbarButton(
|
self.toolbar.addToolbarButton(
|
||||||
|
# Does not need translating - control string.
|
||||||
u'Stop Loop', u':/media/media_stop.png',
|
u'Stop Loop', u':/media/media_stop.png',
|
||||||
translate('OpenLP.SlideController', 'Stop continuous loop'),
|
translate('OpenLP.SlideController', 'Stop continuous loop'),
|
||||||
self.onStopLoop)
|
self.onStopLoop)
|
||||||
@ -190,18 +191,19 @@ class SlideController(QtGui.QWidget):
|
|||||||
self.delaySpinBox.setMinimum(1)
|
self.delaySpinBox.setMinimum(1)
|
||||||
self.delaySpinBox.setMaximum(180)
|
self.delaySpinBox.setMaximum(180)
|
||||||
self.toolbar.addToolbarWidget(u'Image SpinBox', self.delaySpinBox)
|
self.toolbar.addToolbarWidget(u'Image SpinBox', self.delaySpinBox)
|
||||||
self.delaySpinBox.setSuffix(translate('OpenLP.SlideController',
|
self.delaySpinBox.setSuffix(UiStrings.S)
|
||||||
's'))
|
|
||||||
self.delaySpinBox.setToolTip(translate('OpenLP.SlideController',
|
self.delaySpinBox.setToolTip(translate('OpenLP.SlideController',
|
||||||
'Delay between slides in seconds'))
|
'Delay between slides in seconds'))
|
||||||
else:
|
else:
|
||||||
self.toolbar.addToolbarSeparator(u'Close Separator')
|
self.toolbar.addToolbarSeparator(u'Close Separator')
|
||||||
self.toolbar.addToolbarButton(
|
self.toolbar.addToolbarButton(
|
||||||
|
# Does not need translating - control string.
|
||||||
u'Go Live', u':/general/general_live.png',
|
u'Go Live', u':/general/general_live.png',
|
||||||
translate('OpenLP.SlideController', 'Move to live'),
|
translate('OpenLP.SlideController', 'Move to live'),
|
||||||
self.onGoLive)
|
self.onGoLive)
|
||||||
self.toolbar.addToolbarSeparator(u'Close Separator')
|
self.toolbar.addToolbarSeparator(u'Close Separator')
|
||||||
self.toolbar.addToolbarButton(
|
self.toolbar.addToolbarButton(
|
||||||
|
# Does not need translating - control string.
|
||||||
u'Edit Song', u':/general/general_edit.png',
|
u'Edit Song', u':/general/general_edit.png',
|
||||||
translate('OpenLP.SlideController',
|
translate('OpenLP.SlideController',
|
||||||
'Edit and reload song preview'),
|
'Edit and reload song preview'),
|
||||||
@ -377,7 +379,7 @@ class SlideController(QtGui.QWidget):
|
|||||||
self.previousItem.setShortcuts([QtCore.Qt.Key_Up, QtCore.Qt.Key_PageUp])
|
self.previousItem.setShortcuts([QtCore.Qt.Key_Up, QtCore.Qt.Key_PageUp])
|
||||||
self.previousItem.setShortcutContext(
|
self.previousItem.setShortcutContext(
|
||||||
QtCore.Qt.WidgetWithChildrenShortcut)
|
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.setShortcuts([QtCore.Qt.Key_Down, QtCore.Qt.Key_PageDown])
|
||||||
self.nextItem.setShortcutContext(QtCore.Qt.WidgetWithChildrenShortcut)
|
self.nextItem.setShortcutContext(QtCore.Qt.WidgetWithChildrenShortcut)
|
||||||
actionList.add_action(self.nextItem, u'Live')
|
actionList.add_action(self.nextItem, u'Live')
|
||||||
@ -455,7 +457,7 @@ class SlideController(QtGui.QWidget):
|
|||||||
self.previewListWidget.resizeRowsToContents()
|
self.previewListWidget.resizeRowsToContents()
|
||||||
else:
|
else:
|
||||||
# Sort out image heights.
|
# 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())):
|
for framenumber in range(len(self.serviceItem.get_frames())):
|
||||||
self.previewListWidget.setRowHeight(
|
self.previewListWidget.setRowHeight(
|
||||||
framenumber, width / self.ratio)
|
framenumber, width / self.ratio)
|
||||||
@ -584,7 +586,7 @@ class SlideController(QtGui.QWidget):
|
|||||||
Receiver.send_message(u'%s_start' % serviceItem.name.lower(),
|
Receiver.send_message(u'%s_start' % serviceItem.name.lower(),
|
||||||
[serviceItem, self.isLive, blanked, slideno])
|
[serviceItem, self.isLive, blanked, slideno])
|
||||||
self.slideList = {}
|
self.slideList = {}
|
||||||
width = self.parent.ControlSplitter.sizes()[self.split]
|
width = self.parent.controlSplitter.sizes()[self.split]
|
||||||
self.serviceItem = serviceItem
|
self.serviceItem = serviceItem
|
||||||
self.previewListWidget.clear()
|
self.previewListWidget.clear()
|
||||||
self.previewListWidget.setRowCount(0)
|
self.previewListWidget.setRowCount(0)
|
||||||
@ -600,14 +602,15 @@ class SlideController(QtGui.QWidget):
|
|||||||
slideHeight = 0
|
slideHeight = 0
|
||||||
if self.serviceItem.is_text():
|
if self.serviceItem.is_text():
|
||||||
if frame[u'verseTag']:
|
if frame[u'verseTag']:
|
||||||
bits = frame[u'verseTag'].split(u':')
|
# These tags are already translated.
|
||||||
tag = u'%s\n%s' % (bits[0][0], bits[1][0:] )
|
verse_def = frame[u'verseTag']
|
||||||
tag1 = u'%s%s' % (bits[0][0], bits[1][0:] )
|
verse_def = u'%s%s' % (verse_def[0].upper(), verse_def[1:])
|
||||||
row = tag
|
two_line_def = u'%s\n%s' % (verse_def[0], verse_def[1:])
|
||||||
|
row = two_line_def
|
||||||
if self.isLive:
|
if self.isLive:
|
||||||
if tag1 not in self.slideList:
|
if verse_def not in self.slideList:
|
||||||
self.slideList[tag1] = framenumber
|
self.slideList[verse_def] = framenumber
|
||||||
self.songMenu.menu().addAction(tag1,
|
self.songMenu.menu().addAction(verse_def,
|
||||||
self.onSongBarHandler)
|
self.onSongBarHandler)
|
||||||
else:
|
else:
|
||||||
row += 1
|
row += 1
|
||||||
@ -874,7 +877,8 @@ class SlideController(QtGui.QWidget):
|
|||||||
using *Blank to Theme*.
|
using *Blank to Theme*.
|
||||||
"""
|
"""
|
||||||
log.debug(u'updatePreview %s ' % self.screens.current[u'primary'])
|
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 and \
|
||||||
|
self.serviceItem.is_capable(ItemCapabilities.ProvidesOwnDisplay):
|
||||||
# Grab now, but try again in a couple of seconds if slide change
|
# Grab now, but try again in a couple of seconds if slide change
|
||||||
# is slow
|
# is slow
|
||||||
QtCore.QTimer.singleShot(0.5, self.grabMainDisplay)
|
QtCore.QTimer.singleShot(0.5, self.grabMainDisplay)
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
70
openlp/core/ui/starttimedialog.py
Normal file
70
openlp/core/ui/starttimedialog.py
Normal file
@ -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, 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 PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
|
from openlp.core.lib import translate
|
||||||
|
from openlp.core.lib.ui import UiStrings, 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(UiStrings.S)
|
||||||
|
self.minuteLabel.setText(translate('OpenLP.StartTimeForm', 'Minutes:'))
|
||||||
|
self.secondLabel.setText(translate('OpenLP.StartTimeForm', 'Seconds:'))
|
52
openlp/core/ui/starttimeform.py
Normal file
52
openlp/core/ui/starttimeform.py
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
# -*- 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 PyQt4 import QtGui
|
||||||
|
|
||||||
|
from starttimedialog import Ui_StartTimeDialog
|
||||||
|
|
||||||
|
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.
|
||||||
|
"""
|
||||||
|
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)
|
||||||
|
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -29,9 +29,9 @@ import os
|
|||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import translate, BackgroundType, BackgroundGradientType, \
|
from openlp.core.lib import Receiver, translate
|
||||||
Receiver
|
from openlp.core.lib.theme import BackgroundType, BackgroundGradientType
|
||||||
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 openlp.core.utils import get_images_filter
|
||||||
from themewizard import Ui_ThemeWizard
|
from themewizard import Ui_ThemeWizard
|
||||||
|
|
||||||
@ -204,7 +204,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
|
|||||||
# Do not trigger on start up
|
# Do not trigger on start up
|
||||||
if self.currentPage != self.welcomePage:
|
if self.currentPage != self.welcomePage:
|
||||||
self.updateTheme()
|
self.updateTheme()
|
||||||
frame = self.thememanager.generateImage(self.theme, True)
|
self.thememanager.generateImage(self.theme, True)
|
||||||
|
|
||||||
def updateLinesText(self, lines):
|
def updateLinesText(self, lines):
|
||||||
"""
|
"""
|
||||||
@ -301,7 +301,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
|
|||||||
'Edit Theme - %s')) % self.theme.theme_name)
|
'Edit Theme - %s')) % self.theme.theme_name)
|
||||||
self.next()
|
self.next()
|
||||||
else:
|
else:
|
||||||
self.setWindowTitle(translate('OpenLP.ThemeWizard', 'New Theme'))
|
self.setWindowTitle(UiStrings.NewTheme)
|
||||||
return QtGui.QWizard.exec_(self)
|
return QtGui.QWizard.exec_(self)
|
||||||
|
|
||||||
def initializePage(self, id):
|
def initializePage(self, id):
|
||||||
@ -483,8 +483,8 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
|
|||||||
Background Image button pushed.
|
Background Image button pushed.
|
||||||
"""
|
"""
|
||||||
images_filter = get_images_filter()
|
images_filter = get_images_filter()
|
||||||
images_filter = '%s;;%s (*.*) (*)' % (images_filter,
|
images_filter = u'%s;;%s (*.*) (*)' % (
|
||||||
translate('OpenLP.ThemeForm', 'All Files'))
|
images_filter, UiStrings.AllFiles)
|
||||||
filename = QtGui.QFileDialog.getOpenFileName(self,
|
filename = QtGui.QFileDialog.getOpenFileName(self,
|
||||||
translate('OpenLP.ThemeForm', 'Select Image'), u'',
|
translate('OpenLP.ThemeForm', 'Select Image'), u'',
|
||||||
images_filter)
|
images_filter)
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -32,10 +32,12 @@ import logging
|
|||||||
from xml.etree.ElementTree import ElementTree, XML
|
from xml.etree.ElementTree import ElementTree, XML
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import OpenLPToolbar, ThemeXML, get_text_file_string, \
|
from openlp.core.lib import OpenLPToolbar, get_text_file_string, build_icon, \
|
||||||
build_icon, Receiver, SettingsManager, translate, check_item_selected, \
|
Receiver, SettingsManager, translate, check_item_selected, \
|
||||||
BackgroundType, BackgroundGradientType, check_directory_exists
|
check_directory_exists
|
||||||
from openlp.core.lib.ui import critical_error_message_box
|
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.theme import Theme
|
||||||
from openlp.core.ui import FileRenameForm, ThemeForm
|
from openlp.core.ui import FileRenameForm, ThemeForm
|
||||||
from openlp.core.utils import AppLocation, delete_file, file_is_unicode, \
|
from openlp.core.utils import AppLocation, delete_file, file_is_unicode, \
|
||||||
@ -61,8 +63,7 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
self.layout.setMargin(0)
|
self.layout.setMargin(0)
|
||||||
self.layout.setObjectName(u'layout')
|
self.layout.setObjectName(u'layout')
|
||||||
self.toolbar = OpenLPToolbar(self)
|
self.toolbar = OpenLPToolbar(self)
|
||||||
self.toolbar.addToolbarButton(
|
self.toolbar.addToolbarButton(UiStrings.NewTheme,
|
||||||
translate('OpenLP.ThemeManager', 'New Theme'),
|
|
||||||
u':/themes/theme_new.png',
|
u':/themes/theme_new.png',
|
||||||
translate('OpenLP.ThemeManager', 'Create a new theme.'),
|
translate('OpenLP.ThemeManager', 'Create a new theme.'),
|
||||||
self.onAddTheme)
|
self.onAddTheme)
|
||||||
@ -313,7 +314,6 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
translate('OpenLP.ThemeManager',
|
translate('OpenLP.ThemeManager',
|
||||||
'You must select a theme to edit.')):
|
'You must select a theme to edit.')):
|
||||||
item = self.themeListWidget.currentItem()
|
item = self.themeListWidget.currentItem()
|
||||||
themeName = unicode(item.text())
|
|
||||||
theme = self.getThemeData(
|
theme = self.getThemeData(
|
||||||
unicode(item.data(QtCore.Qt.UserRole).toString()))
|
unicode(item.data(QtCore.Qt.UserRole).toString()))
|
||||||
if theme.background_type == u'image':
|
if theme.background_type == u'image':
|
||||||
@ -334,9 +334,8 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
row = self.themeListWidget.row(item)
|
row = self.themeListWidget.row(item)
|
||||||
self.themeListWidget.takeItem(row)
|
self.themeListWidget.takeItem(row)
|
||||||
self.deleteTheme(theme)
|
self.deleteTheme(theme)
|
||||||
# As we do not reload the themes, push out the change
|
# As we do not reload the themes, push out the change. Reload the
|
||||||
# Reaload the list as the internal lists and events need
|
# list as the internal lists and events need to be triggered.
|
||||||
# to be triggered
|
|
||||||
self._pushThemes()
|
self._pushThemes()
|
||||||
|
|
||||||
def deleteTheme(self, theme):
|
def deleteTheme(self, theme):
|
||||||
@ -406,8 +405,8 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
files = QtGui.QFileDialog.getOpenFileNames(self,
|
files = QtGui.QFileDialog.getOpenFileNames(self,
|
||||||
translate('OpenLP.ThemeManager', 'Select Theme Import File'),
|
translate('OpenLP.ThemeManager', 'Select Theme Import File'),
|
||||||
SettingsManager.get_last_dir(self.settingsSection),
|
SettingsManager.get_last_dir(self.settingsSection),
|
||||||
translate('OpenLP.ThemeManager', 'Theme v1 (*.theme);;'
|
unicode(translate('OpenLP.ThemeManager',
|
||||||
'Theme v2 (*.otz);;All Files (*.*)'))
|
'OpenLP Themes (*.theme *.otz)')))
|
||||||
log.info(u'New Themes %s', unicode(files))
|
log.info(u'New Themes %s', unicode(files))
|
||||||
if files:
|
if files:
|
||||||
for file in files:
|
for file in files:
|
||||||
@ -530,6 +529,18 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
else:
|
else:
|
||||||
outfile = open(fullpath, u'wb')
|
outfile = open(fullpath, u'wb')
|
||||||
outfile.write(zip.read(file))
|
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:
|
if filexml:
|
||||||
theme = self._createThemeFromXml(filexml, self.path)
|
theme = self._createThemeFromXml(filexml, self.path)
|
||||||
self.generateAndSaveImage(dir, themename, theme)
|
self.generateAndSaveImage(dir, themename, theme)
|
||||||
@ -540,17 +551,6 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
'File is not a valid theme.'))
|
'File is not a valid theme.'))
|
||||||
log.exception(u'Theme file does not contain XML data %s' %
|
log.exception(u'Theme file does not contain XML data %s' %
|
||||||
filename)
|
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):
|
def checkIfThemeExists(self, themeName):
|
||||||
"""
|
"""
|
||||||
@ -763,11 +763,11 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
newtheme.font_main_outline = True
|
newtheme.font_main_outline = True
|
||||||
newtheme.font_main_outline_color = \
|
newtheme.font_main_outline_color = \
|
||||||
unicode(theme.OutlineColor.name())
|
unicode(theme.OutlineColor.name())
|
||||||
vAlignCorrection = 0
|
vAlignCorrection = VerticalType.Top
|
||||||
if theme.VerticalAlign == 2:
|
if theme.VerticalAlign == 2:
|
||||||
vAlignCorrection = 1
|
vAlignCorrection = VerticalType.Middle
|
||||||
elif theme.VerticalAlign == 1:
|
elif theme.VerticalAlign == 1:
|
||||||
vAlignCorrection = 2
|
vAlignCorrection = VerticalType.Bottom
|
||||||
newtheme.display_horizontal_align = theme.HorizontalAlign
|
newtheme.display_horizontal_align = theme.HorizontalAlign
|
||||||
newtheme.display_vertical_align = vAlignCorrection
|
newtheme.display_vertical_align = vAlignCorrection
|
||||||
return newtheme.extract_xml()
|
return newtheme.extract_xml()
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -26,7 +26,9 @@
|
|||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
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):
|
class ThemesTab(SettingsTab):
|
||||||
"""
|
"""
|
||||||
@ -98,7 +100,7 @@ class ThemesTab(SettingsTab):
|
|||||||
QtCore.SIGNAL(u'theme_update_list'), self.updateThemeList)
|
QtCore.SIGNAL(u'theme_update_list'), self.updateThemeList)
|
||||||
|
|
||||||
def retranslateUi(self):
|
def retranslateUi(self):
|
||||||
self.tabTitleVisible = translate('OpenLP.ThemesTab', 'Themes')
|
self.tabTitleVisible = UiStrings.Themes
|
||||||
self.GlobalGroupBox.setTitle(
|
self.GlobalGroupBox.setTitle(
|
||||||
translate('OpenLP.ThemesTab', 'Global Theme'))
|
translate('OpenLP.ThemesTab', 'Global Theme'))
|
||||||
self.LevelGroupBox.setTitle(
|
self.LevelGroupBox.setTitle(
|
||||||
@ -198,7 +200,7 @@ class ThemesTab(SettingsTab):
|
|||||||
"""
|
"""
|
||||||
Utility method to update the global theme preview image.
|
Utility method to update the global theme preview image.
|
||||||
"""
|
"""
|
||||||
image = self.parent.ThemeManagerContents.getPreviewImage(
|
image = self.parent.themeManagerContents.getPreviewImage(
|
||||||
self.global_theme)
|
self.global_theme)
|
||||||
preview = QtGui.QPixmap(unicode(image))
|
preview = QtGui.QPixmap(unicode(image))
|
||||||
if not preview.isNull():
|
if not preview.isNull():
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -27,7 +27,9 @@
|
|||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import translate, build_icon
|
from openlp.core.lib import translate, build_icon
|
||||||
from openlp.core.lib.ui import add_welcome_page
|
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):
|
class Ui_ThemeWizard(object):
|
||||||
def setupUi(self, themeWizard):
|
def setupUi(self, themeWizard):
|
||||||
@ -242,12 +244,8 @@ class Ui_ThemeWizard(object):
|
|||||||
self.horizontalComboBox.setObjectName(u'HorizontalComboBox')
|
self.horizontalComboBox.setObjectName(u'HorizontalComboBox')
|
||||||
self.alignmentLayout.addRow(self.horizontalLabel,
|
self.alignmentLayout.addRow(self.horizontalLabel,
|
||||||
self.horizontalComboBox)
|
self.horizontalComboBox)
|
||||||
self.verticalLabel = QtGui.QLabel(self.alignmentPage)
|
create_valign_combo(themeWizard, self.alignmentPage,
|
||||||
self.verticalLabel.setObjectName(u'VerticalLabel')
|
self.alignmentLayout)
|
||||||
self.verticalComboBox = QtGui.QComboBox(self.alignmentPage)
|
|
||||||
self.verticalComboBox.addItems([u'', u'', u''])
|
|
||||||
self.verticalComboBox.setObjectName(u'VerticalComboBox')
|
|
||||||
self.alignmentLayout.addRow(self.verticalLabel, self.verticalComboBox)
|
|
||||||
self.transitionsLabel = QtGui.QLabel(self.alignmentPage)
|
self.transitionsLabel = QtGui.QLabel(self.alignmentPage)
|
||||||
self.transitionsLabel.setObjectName(u'TransitionsLabel')
|
self.transitionsLabel.setObjectName(u'TransitionsLabel')
|
||||||
self.transitionsCheckBox = QtGui.QCheckBox(self.alignmentPage)
|
self.transitionsCheckBox = QtGui.QCheckBox(self.alignmentPage)
|
||||||
@ -421,12 +419,12 @@ class Ui_ThemeWizard(object):
|
|||||||
'according to the parameters below.'))
|
'according to the parameters below.'))
|
||||||
self.backgroundLabel.setText(
|
self.backgroundLabel.setText(
|
||||||
translate('OpenLP.ThemeWizard', 'Background type:'))
|
translate('OpenLP.ThemeWizard', 'Background type:'))
|
||||||
self.backgroundComboBox.setItemText(0,
|
self.backgroundComboBox.setItemText(BackgroundType.Solid,
|
||||||
translate('OpenLP.ThemeWizard', 'Solid Color'))
|
translate('OpenLP.ThemeWizard', 'Solid Color'))
|
||||||
self.backgroundComboBox.setItemText(1,
|
self.backgroundComboBox.setItemText(BackgroundType.Gradient,
|
||||||
translate('OpenLP.ThemeWizard', 'Gradient'))
|
translate('OpenLP.ThemeWizard', 'Gradient'))
|
||||||
self.backgroundComboBox.setItemText(2,
|
self.backgroundComboBox.setItemText(
|
||||||
translate('OpenLP.ThemeWizard', 'Image'))
|
BackgroundType.Image, UiStrings.Image)
|
||||||
self.colorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:'))
|
self.colorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:'))
|
||||||
self.gradientStartLabel.setText(
|
self.gradientStartLabel.setText(
|
||||||
translate(u'OpenLP.ThemeWizard', 'Starting color:'))
|
translate(u'OpenLP.ThemeWizard', 'Starting color:'))
|
||||||
@ -434,39 +432,37 @@ class Ui_ThemeWizard(object):
|
|||||||
translate(u'OpenLP.ThemeWizard', 'Ending color:'))
|
translate(u'OpenLP.ThemeWizard', 'Ending color:'))
|
||||||
self.gradientTypeLabel.setText(
|
self.gradientTypeLabel.setText(
|
||||||
translate('OpenLP.ThemeWizard', 'Gradient:'))
|
translate('OpenLP.ThemeWizard', 'Gradient:'))
|
||||||
self.gradientComboBox.setItemText(0,
|
self.gradientComboBox.setItemText(BackgroundGradientType.Horizontal,
|
||||||
translate('OpenLP.ThemeWizard', 'Horizontal'))
|
translate('OpenLP.ThemeWizard', 'Horizontal'))
|
||||||
self.gradientComboBox.setItemText(1,
|
self.gradientComboBox.setItemText(BackgroundGradientType.Vertical,
|
||||||
translate('OpenLP.ThemeWizard', 'Vertical'))
|
translate('OpenLP.ThemeWizard', 'Vertical'))
|
||||||
self.gradientComboBox.setItemText(2,
|
self.gradientComboBox.setItemText(BackgroundGradientType.Circular,
|
||||||
translate('OpenLP.ThemeWizard', 'Circular'))
|
translate('OpenLP.ThemeWizard', 'Circular'))
|
||||||
self.gradientComboBox.setItemText(3,
|
self.gradientComboBox.setItemText(BackgroundGradientType.LeftTop,
|
||||||
translate('OpenLP.ThemeWizard', 'Top Left - Bottom Right'))
|
translate('OpenLP.ThemeWizard', 'Top Left - Bottom Right'))
|
||||||
self.gradientComboBox.setItemText(4,
|
self.gradientComboBox.setItemText(BackgroundGradientType.LeftBottom,
|
||||||
translate('OpenLP.ThemeWizard', 'Bottom Left - Top Right'))
|
translate('OpenLP.ThemeWizard', 'Bottom Left - Top Right'))
|
||||||
self.imageLabel.setText(translate('OpenLP.ThemeWizard', 'Image:'))
|
self.imageLabel.setText(u'%s:' % UiStrings.Image)
|
||||||
self.mainAreaPage.setTitle(
|
self.mainAreaPage.setTitle(
|
||||||
translate('OpenLP.ThemeWizard', 'Main Area Font Details'))
|
translate('OpenLP.ThemeWizard', 'Main Area Font Details'))
|
||||||
self.mainAreaPage.setSubTitle(
|
self.mainAreaPage.setSubTitle(
|
||||||
translate('OpenLP.ThemeWizard', 'Define the font and display '
|
translate('OpenLP.ThemeWizard', 'Define the font and display '
|
||||||
'characteristics for the Display text'))
|
'characteristics for the Display text'))
|
||||||
self.mainFontLabel.setText(
|
self.mainFontLabel.setText(translate('OpenLP.ThemeWizard', 'Font:'))
|
||||||
translate('OpenLP.ThemeWizard', 'Font:'))
|
|
||||||
self.mainColorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:'))
|
self.mainColorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:'))
|
||||||
self.mainSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:'))
|
self.mainSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:'))
|
||||||
self.mainSizeSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt'))
|
self.mainSizeSpinBox.setSuffix(UiStrings.FontSizePtUnit)
|
||||||
self.lineSpacingLabel.setText(
|
self.lineSpacingLabel.setText(
|
||||||
translate('OpenLP.ThemeWizard', 'Line Spacing:'))
|
translate('OpenLP.ThemeWizard', 'Line Spacing:'))
|
||||||
self.lineSpacingSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt'))
|
self.lineSpacingSpinBox.setSuffix(UiStrings.FontSizePtUnit)
|
||||||
self.outlineCheckBox.setText(
|
self.outlineCheckBox.setText(
|
||||||
translate('OpenLP.ThemeWizard', '&Outline:'))
|
translate('OpenLP.ThemeWizard', '&Outline:'))
|
||||||
self.outlineSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:'))
|
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.shadowCheckBox.setText(translate('OpenLP.ThemeWizard', '&Shadow:'))
|
||||||
self.shadowSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:'))
|
self.shadowSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:'))
|
||||||
self.shadowSizeSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt'))
|
self.shadowSizeSpinBox.setSuffix(UiStrings.FontSizePtUnit)
|
||||||
self.mainBoldCheckBox.setText(
|
self.mainBoldCheckBox.setText(translate('OpenLP.ThemeWizard', 'Bold'))
|
||||||
translate('OpenLP.ThemeWizard', 'Bold'))
|
|
||||||
self.mainItalicsCheckBox.setText(
|
self.mainItalicsCheckBox.setText(
|
||||||
translate('OpenLP.ThemeWizard', 'Italic'))
|
translate('OpenLP.ThemeWizard', 'Italic'))
|
||||||
self.footerAreaPage.setTitle(
|
self.footerAreaPage.setTitle(
|
||||||
@ -477,7 +473,7 @@ class Ui_ThemeWizard(object):
|
|||||||
self.footerFontLabel.setText(translate('OpenLP.ThemeWizard', 'Font:'))
|
self.footerFontLabel.setText(translate('OpenLP.ThemeWizard', 'Font:'))
|
||||||
self.footerColorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:'))
|
self.footerColorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:'))
|
||||||
self.footerSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:'))
|
self.footerSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:'))
|
||||||
self.footerSizeSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt'))
|
self.footerSizeSpinBox.setSuffix(UiStrings.FontSizePtUnit)
|
||||||
self.alignmentPage.setTitle(
|
self.alignmentPage.setTitle(
|
||||||
translate('OpenLP.ThemeWizard', 'Text Formatting Details'))
|
translate('OpenLP.ThemeWizard', 'Text Formatting Details'))
|
||||||
self.alignmentPage.setSubTitle(
|
self.alignmentPage.setSubTitle(
|
||||||
@ -485,20 +481,12 @@ class Ui_ThemeWizard(object):
|
|||||||
'formatting information to be defined'))
|
'formatting information to be defined'))
|
||||||
self.horizontalLabel.setText(
|
self.horizontalLabel.setText(
|
||||||
translate('OpenLP.ThemeWizard', 'Horizontal Align:'))
|
translate('OpenLP.ThemeWizard', 'Horizontal Align:'))
|
||||||
self.horizontalComboBox.setItemText(0,
|
self.horizontalComboBox.setItemText(HorizontalType.Left,
|
||||||
translate('OpenLP.ThemeWizard', 'Left'))
|
translate('OpenLP.ThemeWizard', 'Left'))
|
||||||
self.horizontalComboBox.setItemText(1,
|
self.horizontalComboBox.setItemText(HorizontalType.Right,
|
||||||
translate('OpenLP.ThemeWizard', 'Right'))
|
translate('OpenLP.ThemeWizard', 'Right'))
|
||||||
self.horizontalComboBox.setItemText(2,
|
self.horizontalComboBox.setItemText(HorizontalType.Center,
|
||||||
translate('OpenLP.ThemeWizard', 'Center'))
|
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(
|
self.transitionsLabel.setText(
|
||||||
translate('OpenLP.ThemeWizard', 'Transitions:'))
|
translate('OpenLP.ThemeWizard', 'Transitions:'))
|
||||||
self.areaPositionPage.setTitle(
|
self.areaPositionPage.setTitle(
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -27,14 +27,55 @@
|
|||||||
The :mod:``wizard`` module provides generic wizard tools for OpenLP.
|
The :mod:``wizard`` module provides generic wizard tools for OpenLP.
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
|
import os
|
||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import build_icon, Receiver
|
from openlp.core.lib import build_icon, Receiver, SettingsManager, translate
|
||||||
from openlp.core.lib.ui import add_welcome_page
|
from openlp.core.lib.ui import UiStrings, add_welcome_page
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
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'
|
||||||
|
FP = u'Foilpresenter'
|
||||||
|
OL = u'OpenLyrics'
|
||||||
|
OS = u'OpenSong'
|
||||||
|
OSIS = u'OSIS'
|
||||||
|
SB = u'SongBeamer'
|
||||||
|
SoF = u'Songs of Fellowship'
|
||||||
|
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:')
|
||||||
|
HeaderStyle = u'<span style="font-size:14pt; font-weight:600;">%s</span>'
|
||||||
|
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'))
|
||||||
|
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 '
|
||||||
|
'least one %s file to import from.', 'A file type e.g. OpenSong'))
|
||||||
|
|
||||||
|
|
||||||
class OpenLPWizard(QtGui.QWizard):
|
class OpenLPWizard(QtGui.QWizard):
|
||||||
"""
|
"""
|
||||||
Generic OpenLP wizard to provide generic functionality and a unified look
|
Generic OpenLP wizard to provide generic functionality and a unified look
|
||||||
@ -42,6 +83,7 @@ class OpenLPWizard(QtGui.QWizard):
|
|||||||
"""
|
"""
|
||||||
def __init__(self, parent, plugin, name, image):
|
def __init__(self, parent, plugin, name, image):
|
||||||
QtGui.QWizard.__init__(self, parent)
|
QtGui.QWizard.__init__(self, parent)
|
||||||
|
self.plugin = plugin
|
||||||
self.setObjectName(name)
|
self.setObjectName(name)
|
||||||
self.openIcon = build_icon(u':/general/general_open.png')
|
self.openIcon = build_icon(u':/general/general_open.png')
|
||||||
self.deleteIcon = build_icon(u':/general/general_delete.png')
|
self.deleteIcon = build_icon(u':/general/general_delete.png')
|
||||||
@ -49,7 +91,6 @@ class OpenLPWizard(QtGui.QWizard):
|
|||||||
self.cancelButton = self.button(QtGui.QWizard.CancelButton)
|
self.cancelButton = self.button(QtGui.QWizard.CancelButton)
|
||||||
self.setupUi(image)
|
self.setupUi(image)
|
||||||
self.registerFields()
|
self.registerFields()
|
||||||
self.plugin = plugin
|
|
||||||
self.customInit()
|
self.customInit()
|
||||||
self.customSignals()
|
self.customSignals()
|
||||||
QtCore.QObject.connect(self, QtCore.SIGNAL(u'currentIdChanged(int)'),
|
QtCore.QObject.connect(self, QtCore.SIGNAL(u'currentIdChanged(int)'),
|
||||||
@ -70,6 +111,12 @@ class OpenLPWizard(QtGui.QWizard):
|
|||||||
self.retranslateUi()
|
self.retranslateUi()
|
||||||
QtCore.QMetaObject.connectSlotsByName(self)
|
QtCore.QMetaObject.connectSlotsByName(self)
|
||||||
|
|
||||||
|
def registerFields(self):
|
||||||
|
"""
|
||||||
|
Hook method for wizards to register any fields they need.
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
def addProgressPage(self):
|
def addProgressPage(self):
|
||||||
"""
|
"""
|
||||||
Add the progress page for the wizard. This page informs the user how
|
Add the progress page for the wizard. This page informs the user how
|
||||||
@ -146,3 +193,30 @@ class OpenLPWizard(QtGui.QWizard):
|
|||||||
self.finishButton.setVisible(True)
|
self.finishButton.setVisible(True)
|
||||||
self.cancelButton.setVisible(False)
|
self.cancelButton.setVisible(False)
|
||||||
Receiver.send_message(u'openlp_process_events')
|
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)
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -24,7 +24,7 @@
|
|||||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
# 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
|
import logging
|
||||||
import os
|
import os
|
||||||
@ -164,24 +164,34 @@ def _get_os_dir_path(dir_type):
|
|||||||
"""
|
"""
|
||||||
Return a path based on which OS and environment we are running in.
|
Return a path based on which OS and environment we are running in.
|
||||||
"""
|
"""
|
||||||
|
encoding = sys.getfilesystemencoding()
|
||||||
if sys.platform == u'win32':
|
if sys.platform == u'win32':
|
||||||
return os.path.join(os.getenv(u'APPDATA'), u'openlp')
|
if dir_type == AppLocation.DataDir:
|
||||||
|
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':
|
elif sys.platform == u'darwin':
|
||||||
if dir_type == AppLocation.DataDir:
|
if dir_type == AppLocation.DataDir:
|
||||||
return os.path.join(os.getenv(u'HOME'), u'Library',
|
return os.path.join(unicode(os.getenv(u'HOME'), encoding),
|
||||||
u'Application Support', u'openlp', u'Data')
|
u'Library', u'Application Support', u'openlp', u'Data')
|
||||||
return os.path.join(os.getenv(u'HOME'), u'Library',
|
return os.path.join(unicode(os.getenv(u'HOME'), encoding),
|
||||||
u'Application Support', u'openlp')
|
u'Library', u'Application Support', u'openlp')
|
||||||
else:
|
else:
|
||||||
if XDG_BASE_AVAILABLE:
|
if XDG_BASE_AVAILABLE:
|
||||||
if dir_type == AppLocation.ConfigDir:
|
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:
|
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:
|
elif dir_type == AppLocation.CacheDir:
|
||||||
return os.path.join(BaseDirectory.xdg_cache_home, u'openlp')
|
return os.path.join(unicode(BaseDirectory.xdg_cache_home,
|
||||||
else:
|
encoding), u'openlp')
|
||||||
return os.path.join(os.getenv(u'HOME'), u'.openlp')
|
if dir_type == AppLocation.DataDir:
|
||||||
|
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):
|
def _get_frozen_path(frozen_option, non_frozen_option):
|
||||||
"""
|
"""
|
||||||
@ -189,7 +199,6 @@ def _get_frozen_path(frozen_option, non_frozen_option):
|
|||||||
"""
|
"""
|
||||||
if hasattr(sys, u'frozen') and sys.frozen == 1:
|
if hasattr(sys, u'frozen') and sys.frozen == 1:
|
||||||
return frozen_option
|
return frozen_option
|
||||||
else:
|
|
||||||
return non_frozen_option
|
return non_frozen_option
|
||||||
|
|
||||||
def check_latest_version(current_version):
|
def check_latest_version(current_version):
|
||||||
@ -373,13 +382,13 @@ def get_uno_command():
|
|||||||
"""
|
"""
|
||||||
Returns the UNO command to launch an openoffice.org instance.
|
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':
|
if UNO_CONNECTION_TYPE == u'pipe':
|
||||||
return u'openoffice.org -nologo -norestore -minimized -invisible ' \
|
CONNECTION = u'"-accept=pipe,name=openlp_pipe;urp;"'
|
||||||
+ u'-nofirststartwizard -accept=pipe,name=openlp_pipe;urp;'
|
|
||||||
else:
|
else:
|
||||||
return u'openoffice.org -nologo -norestore -minimized ' \
|
CONNECTION = u'"-accept=socket,host=localhost,port=2002;urp;"'
|
||||||
+ u'-invisible -nofirststartwizard ' \
|
return u'%s %s %s' % (COMMAND, OPTIONS, CONNECTION)
|
||||||
+ u'-accept=socket,host=localhost,port=2002;urp;'
|
|
||||||
|
|
||||||
def get_uno_instance(resolver):
|
def get_uno_instance(resolver):
|
||||||
"""
|
"""
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -40,21 +40,14 @@ class AlertsPlugin(Plugin):
|
|||||||
log.info(u'Alerts Plugin loaded')
|
log.info(u'Alerts Plugin loaded')
|
||||||
|
|
||||||
def __init__(self, plugin_helpers):
|
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.weight = -3
|
||||||
self.icon = build_icon(u':/plugins/plugin_alerts.png')
|
self.icon = build_icon(u':/plugins/plugin_alerts.png')
|
||||||
self.alertsmanager = AlertsManager(self)
|
self.alertsmanager = AlertsManager(self)
|
||||||
self.manager = Manager(u'alerts', init_schema)
|
self.manager = Manager(u'alerts', init_schema)
|
||||||
self.visible_name = self.getString(StringContent.VisibleName)
|
|
||||||
self.alertForm = AlertForm(self)
|
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):
|
def addToolsMenuItem(self, tools_menu):
|
||||||
"""
|
"""
|
||||||
Give the alerts plugin the opportunity to add items to the
|
Give the alerts plugin the opportunity to add items to the
|
||||||
@ -81,7 +74,7 @@ class AlertsPlugin(Plugin):
|
|||||||
log.info(u'Alerts Initialising')
|
log.info(u'Alerts Initialising')
|
||||||
Plugin.initialise(self)
|
Plugin.initialise(self)
|
||||||
self.toolsAlertItem.setVisible(True)
|
self.toolsAlertItem.setVisible(True)
|
||||||
self.liveController.alertTab = self.alertsTab
|
self.liveController.alertTab = self.settings_tab
|
||||||
|
|
||||||
def finalise(self):
|
def finalise(self):
|
||||||
"""
|
"""
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -84,7 +84,7 @@ class AlertsManager(QtCore.QObject):
|
|||||||
if len(self.alertList) == 0:
|
if len(self.alertList) == 0:
|
||||||
return
|
return
|
||||||
text = self.alertList.pop(0)
|
text = self.alertList.pop(0)
|
||||||
alertTab = self.parent.alertsTab
|
alertTab = self.parent.settings_tab
|
||||||
self.parent.liveController.display.alert(text)
|
self.parent.liveController.display.alert(text)
|
||||||
# Check to see if we have a timer running.
|
# Check to see if we have a timer running.
|
||||||
if self.timer_id == 0:
|
if self.timer_id == 0:
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -27,61 +27,55 @@
|
|||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import SettingsTab, translate
|
from openlp.core.lib import SettingsTab, translate
|
||||||
|
from openlp.core.lib.ui import UiStrings, create_valign_combo
|
||||||
|
|
||||||
class AlertsTab(SettingsTab):
|
class AlertsTab(SettingsTab):
|
||||||
"""
|
"""
|
||||||
AlertsTab is the alerts settings tab in the settings dialog.
|
AlertsTab is the alerts settings tab in the settings dialog.
|
||||||
"""
|
"""
|
||||||
def __init__(self, parent, visible_title):
|
def __init__(self, name, visible_title):
|
||||||
self.parent = parent
|
SettingsTab.__init__(self, name, visible_title)
|
||||||
self.manager = parent.manager
|
|
||||||
SettingsTab.__init__(self, parent.name, visible_title)
|
|
||||||
|
|
||||||
def setupUi(self):
|
def setupUi(self):
|
||||||
self.setObjectName(u'AlertsTab')
|
self.setObjectName(u'AlertsTab')
|
||||||
SettingsTab.setupUi(self)
|
SettingsTab.setupUi(self)
|
||||||
self.FontGroupBox = QtGui.QGroupBox(self.leftColumn)
|
self.fontGroupBox = QtGui.QGroupBox(self.leftColumn)
|
||||||
self.FontGroupBox.setObjectName(u'FontGroupBox')
|
self.fontGroupBox.setObjectName(u'fontGroupBox')
|
||||||
self.FontLayout = QtGui.QFormLayout(self.FontGroupBox)
|
self.fontLayout = QtGui.QFormLayout(self.fontGroupBox)
|
||||||
self.FontLayout.setObjectName(u'FontLayout')
|
self.fontLayout.setObjectName(u'fontLayout')
|
||||||
self.FontLabel = QtGui.QLabel(self.FontGroupBox)
|
self.FontLabel = QtGui.QLabel(self.fontGroupBox)
|
||||||
self.FontLabel.setObjectName(u'FontLabel')
|
self.FontLabel.setObjectName(u'FontLabel')
|
||||||
self.FontComboBox = QtGui.QFontComboBox(self.FontGroupBox)
|
self.FontComboBox = QtGui.QFontComboBox(self.fontGroupBox)
|
||||||
self.FontComboBox.setObjectName(u'FontComboBox')
|
self.FontComboBox.setObjectName(u'FontComboBox')
|
||||||
self.FontLayout.addRow(self.FontLabel, self.FontComboBox)
|
self.fontLayout.addRow(self.FontLabel, self.FontComboBox)
|
||||||
self.FontColorLabel = QtGui.QLabel(self.FontGroupBox)
|
self.FontColorLabel = QtGui.QLabel(self.fontGroupBox)
|
||||||
self.FontColorLabel.setObjectName(u'FontColorLabel')
|
self.FontColorLabel.setObjectName(u'FontColorLabel')
|
||||||
self.ColorLayout = QtGui.QHBoxLayout()
|
self.ColorLayout = QtGui.QHBoxLayout()
|
||||||
self.ColorLayout.setObjectName(u'ColorLayout')
|
self.ColorLayout.setObjectName(u'ColorLayout')
|
||||||
self.FontColorButton = QtGui.QPushButton(self.FontGroupBox)
|
self.FontColorButton = QtGui.QPushButton(self.fontGroupBox)
|
||||||
self.FontColorButton.setObjectName(u'FontColorButton')
|
self.FontColorButton.setObjectName(u'FontColorButton')
|
||||||
self.ColorLayout.addWidget(self.FontColorButton)
|
self.ColorLayout.addWidget(self.FontColorButton)
|
||||||
self.ColorLayout.addSpacing(20)
|
self.ColorLayout.addSpacing(20)
|
||||||
self.BackgroundColorLabel = QtGui.QLabel(self.FontGroupBox)
|
self.BackgroundColorLabel = QtGui.QLabel(self.fontGroupBox)
|
||||||
self.BackgroundColorLabel.setObjectName(u'BackgroundColorLabel')
|
self.BackgroundColorLabel.setObjectName(u'BackgroundColorLabel')
|
||||||
self.ColorLayout.addWidget(self.BackgroundColorLabel)
|
self.ColorLayout.addWidget(self.BackgroundColorLabel)
|
||||||
self.BackgroundColorButton = QtGui.QPushButton(self.FontGroupBox)
|
self.BackgroundColorButton = QtGui.QPushButton(self.fontGroupBox)
|
||||||
self.BackgroundColorButton.setObjectName(u'BackgroundColorButton')
|
self.BackgroundColorButton.setObjectName(u'BackgroundColorButton')
|
||||||
self.ColorLayout.addWidget(self.BackgroundColorButton)
|
self.ColorLayout.addWidget(self.BackgroundColorButton)
|
||||||
self.FontLayout.addRow(self.FontColorLabel, self.ColorLayout)
|
self.fontLayout.addRow(self.FontColorLabel, self.ColorLayout)
|
||||||
self.FontSizeLabel = QtGui.QLabel(self.FontGroupBox)
|
self.FontSizeLabel = QtGui.QLabel(self.fontGroupBox)
|
||||||
self.FontSizeLabel.setObjectName(u'FontSizeLabel')
|
self.FontSizeLabel.setObjectName(u'FontSizeLabel')
|
||||||
self.FontSizeSpinBox = QtGui.QSpinBox(self.FontGroupBox)
|
self.FontSizeSpinBox = QtGui.QSpinBox(self.fontGroupBox)
|
||||||
self.FontSizeSpinBox.setObjectName(u'FontSizeSpinBox')
|
self.FontSizeSpinBox.setObjectName(u'FontSizeSpinBox')
|
||||||
self.FontLayout.addRow(self.FontSizeLabel, self.FontSizeSpinBox)
|
self.fontLayout.addRow(self.FontSizeLabel, self.FontSizeSpinBox)
|
||||||
self.TimeoutLabel = QtGui.QLabel(self.FontGroupBox)
|
self.TimeoutLabel = QtGui.QLabel(self.fontGroupBox)
|
||||||
self.TimeoutLabel.setObjectName(u'TimeoutLabel')
|
self.TimeoutLabel.setObjectName(u'TimeoutLabel')
|
||||||
self.TimeoutSpinBox = QtGui.QSpinBox(self.FontGroupBox)
|
self.TimeoutSpinBox = QtGui.QSpinBox(self.fontGroupBox)
|
||||||
self.TimeoutSpinBox.setMaximum(180)
|
self.TimeoutSpinBox.setMaximum(180)
|
||||||
self.TimeoutSpinBox.setObjectName(u'TimeoutSpinBox')
|
self.TimeoutSpinBox.setObjectName(u'TimeoutSpinBox')
|
||||||
self.FontLayout.addRow(self.TimeoutLabel, self.TimeoutSpinBox)
|
self.fontLayout.addRow(self.TimeoutLabel, self.TimeoutSpinBox)
|
||||||
self.LocationLabel = QtGui.QLabel(self.FontGroupBox)
|
create_valign_combo(self, self.fontGroupBox, self.fontLayout)
|
||||||
self.LocationLabel.setObjectName(u'LocationLabel')
|
self.leftLayout.addWidget(self.fontGroupBox)
|
||||||
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.leftLayout.addStretch()
|
self.leftLayout.addStretch()
|
||||||
self.PreviewGroupBox = QtGui.QGroupBox(self.rightColumn)
|
self.PreviewGroupBox = QtGui.QGroupBox(self.rightColumn)
|
||||||
self.PreviewGroupBox.setObjectName(u'PreviewGroupBox')
|
self.PreviewGroupBox.setObjectName(u'PreviewGroupBox')
|
||||||
@ -99,15 +93,13 @@ class AlertsTab(SettingsTab):
|
|||||||
QtCore.SIGNAL(u'pressed()'), self.onFontColorButtonClicked)
|
QtCore.SIGNAL(u'pressed()'), self.onFontColorButtonClicked)
|
||||||
QtCore.QObject.connect(self.FontComboBox,
|
QtCore.QObject.connect(self.FontComboBox,
|
||||||
QtCore.SIGNAL(u'activated(int)'), self.onFontComboBoxClicked)
|
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.QObject.connect(self.TimeoutSpinBox,
|
||||||
QtCore.SIGNAL(u'valueChanged(int)'), self.onTimeoutSpinBoxChanged)
|
QtCore.SIGNAL(u'valueChanged(int)'), self.onTimeoutSpinBoxChanged)
|
||||||
QtCore.QObject.connect(self.FontSizeSpinBox,
|
QtCore.QObject.connect(self.FontSizeSpinBox,
|
||||||
QtCore.SIGNAL(u'valueChanged(int)'), self.onFontSizeSpinBoxChanged)
|
QtCore.SIGNAL(u'valueChanged(int)'), self.onFontSizeSpinBoxChanged)
|
||||||
|
|
||||||
def retranslateUi(self):
|
def retranslateUi(self):
|
||||||
self.FontGroupBox.setTitle(
|
self.fontGroupBox.setTitle(
|
||||||
translate('AlertsPlugin.AlertsTab', 'Font'))
|
translate('AlertsPlugin.AlertsTab', 'Font'))
|
||||||
self.FontLabel.setText(
|
self.FontLabel.setText(
|
||||||
translate('AlertsPlugin.AlertsTab', 'Font name:'))
|
translate('AlertsPlugin.AlertsTab', 'Font name:'))
|
||||||
@ -117,24 +109,12 @@ class AlertsTab(SettingsTab):
|
|||||||
translate('AlertsPlugin.AlertsTab', 'Background color:'))
|
translate('AlertsPlugin.AlertsTab', 'Background color:'))
|
||||||
self.FontSizeLabel.setText(
|
self.FontSizeLabel.setText(
|
||||||
translate('AlertsPlugin.AlertsTab', 'Font size:'))
|
translate('AlertsPlugin.AlertsTab', 'Font size:'))
|
||||||
self.FontSizeSpinBox.setSuffix(
|
self.FontSizeSpinBox.setSuffix(UiStrings.FontSizePtUnit)
|
||||||
translate('AlertsPlugin.AlertsTab', 'pt'))
|
|
||||||
self.TimeoutLabel.setText(
|
self.TimeoutLabel.setText(
|
||||||
translate('AlertsPlugin.AlertsTab', 'Alert timeout:'))
|
translate('AlertsPlugin.AlertsTab', 'Alert timeout:'))
|
||||||
self.TimeoutSpinBox.setSuffix(
|
self.TimeoutSpinBox.setSuffix(UiStrings.S)
|
||||||
translate('AlertsPlugin.AlertsTab', 's'))
|
self.PreviewGroupBox.setTitle(UiStrings.Preview)
|
||||||
self.LocationLabel.setText(
|
self.FontPreview.setText(UiStrings.OLPV2)
|
||||||
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):
|
def onBackgroundColorButtonClicked(self):
|
||||||
new_color = QtGui.QColorDialog.getColor(
|
new_color = QtGui.QColorDialog.getColor(
|
||||||
@ -148,9 +128,6 @@ class AlertsTab(SettingsTab):
|
|||||||
def onFontComboBoxClicked(self):
|
def onFontComboBoxClicked(self):
|
||||||
self.updateDisplay()
|
self.updateDisplay()
|
||||||
|
|
||||||
def onLocationComboBoxClicked(self, location):
|
|
||||||
self.location = location
|
|
||||||
|
|
||||||
def onFontColorButtonClicked(self):
|
def onFontColorButtonClicked(self):
|
||||||
new_color = QtGui.QColorDialog.getColor(
|
new_color = QtGui.QColorDialog.getColor(
|
||||||
QtGui.QColor(self.font_color), self)
|
QtGui.QColor(self.font_color), self)
|
||||||
@ -188,7 +165,7 @@ class AlertsTab(SettingsTab):
|
|||||||
u'background-color: %s' % self.font_color)
|
u'background-color: %s' % self.font_color)
|
||||||
self.BackgroundColorButton.setStyleSheet(
|
self.BackgroundColorButton.setStyleSheet(
|
||||||
u'background-color: %s' % self.bg_color)
|
u'background-color: %s' % self.bg_color)
|
||||||
self.LocationComboBox.setCurrentIndex(self.location)
|
self.verticalComboBox.setCurrentIndex(self.location)
|
||||||
font = QtGui.QFont()
|
font = QtGui.QFont()
|
||||||
font.setFamily(self.font_face)
|
font.setFamily(self.font_face)
|
||||||
self.FontComboBox.setCurrentFont(font)
|
self.FontComboBox.setCurrentFont(font)
|
||||||
@ -197,14 +174,14 @@ class AlertsTab(SettingsTab):
|
|||||||
def save(self):
|
def save(self):
|
||||||
settings = QtCore.QSettings()
|
settings = QtCore.QSettings()
|
||||||
settings.beginGroup(self.settingsSection)
|
settings.beginGroup(self.settingsSection)
|
||||||
self.font_face = self.FontComboBox.currentFont().family()
|
|
||||||
settings.setValue(u'background color', QtCore.QVariant(self.bg_color))
|
settings.setValue(u'background color', QtCore.QVariant(self.bg_color))
|
||||||
settings.setValue(u'font color', QtCore.QVariant(self.font_color))
|
settings.setValue(u'font color', QtCore.QVariant(self.font_color))
|
||||||
settings.setValue(u'font size', QtCore.QVariant(self.font_size))
|
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'font face', QtCore.QVariant(self.font_face))
|
||||||
settings.setValue(u'timeout', QtCore.QVariant(self.timeout))
|
settings.setValue(u'timeout', QtCore.QVariant(self.timeout))
|
||||||
settings.setValue(u'location',
|
self.location = self.verticalComboBox.currentIndex()
|
||||||
QtCore.QVariant(self.LocationComboBox.currentIndex()))
|
settings.setValue(u'location', QtCore.QVariant(self.location))
|
||||||
settings.endGroup()
|
settings.endGroup()
|
||||||
|
|
||||||
def updateDisplay(self):
|
def updateDisplay(self):
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -37,7 +37,8 @@ class BiblePlugin(Plugin):
|
|||||||
log.info(u'Bible Plugin loaded')
|
log.info(u'Bible Plugin loaded')
|
||||||
|
|
||||||
def __init__(self, plugin_helpers):
|
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.weight = -9
|
||||||
self.icon_path = u':/plugins/plugin_bibles.png'
|
self.icon_path = u':/plugins/plugin_bibles.png'
|
||||||
self.icon = build_icon(self.icon_path)
|
self.icon = build_icon(self.icon_path)
|
||||||
@ -61,14 +62,6 @@ class BiblePlugin(Plugin):
|
|||||||
self.importBibleItem.setVisible(False)
|
self.importBibleItem.setVisible(False)
|
||||||
self.exportBibleItem.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):
|
def addImportMenuItem(self, import_menu):
|
||||||
self.importBibleItem = QtGui.QAction(import_menu)
|
self.importBibleItem = QtGui.QAction(import_menu)
|
||||||
self.importBibleItem.setObjectName(u'importBibleItem')
|
self.importBibleItem.setObjectName(u'importBibleItem')
|
||||||
@ -135,40 +128,15 @@ class BiblePlugin(Plugin):
|
|||||||
u'title': translate('BiblesPlugin', 'Bibles', 'container title')
|
u'title': translate('BiblesPlugin', 'Bibles', 'container title')
|
||||||
}
|
}
|
||||||
# Middle Header Bar
|
# Middle Header Bar
|
||||||
## Import Action ##
|
tooltips = {
|
||||||
self.textStrings[StringContent.Import] = {
|
u'load': u'',
|
||||||
u'title': translate('BiblesPlugin', '&Import'),
|
u'import': translate('BiblesPlugin', 'Import a Bible'),
|
||||||
u'tooltip': translate('BiblesPlugin', 'Import a Bible')
|
u'new': translate('BiblesPlugin', 'Add a new Bible'),
|
||||||
}
|
u'edit': translate('BiblesPlugin', 'Edit the selected Bible'),
|
||||||
## New Action ##
|
u'delete': translate('BiblesPlugin', 'Delete the selected Bible'),
|
||||||
self.textStrings[StringContent.New] = {
|
u'preview': translate('BiblesPlugin', 'Preview the selected Bible'),
|
||||||
u'title': translate('BiblesPlugin', '&Add'),
|
u'live': translate('BiblesPlugin', 'Send the selected Bible live'),
|
||||||
u'tooltip': translate('BiblesPlugin', 'Add a new Bible')
|
u'service': translate('BiblesPlugin',
|
||||||
}
|
|
||||||
## Edit Action ##
|
|
||||||
self.textStrings[StringContent.Edit] = {
|
|
||||||
u'title': translate('BiblesPlugin', '&Edit'),
|
|
||||||
u'tooltip': translate('BiblesPlugin', 'Edit the selected Bible')
|
|
||||||
}
|
|
||||||
## Delete Action ##
|
|
||||||
self.textStrings[StringContent.Delete] = {
|
|
||||||
u'title': translate('BiblesPlugin', '&Delete'),
|
|
||||||
u'tooltip': translate('BiblesPlugin', 'Delete the selected Bible')
|
|
||||||
}
|
|
||||||
## Preview Action ##
|
|
||||||
self.textStrings[StringContent.Preview] = {
|
|
||||||
u'title': translate('BiblesPlugin', 'Preview'),
|
|
||||||
u'tooltip': translate('BiblesPlugin', 'Preview the selected Bible')
|
|
||||||
}
|
|
||||||
## Send Live Action ##
|
|
||||||
self.textStrings[StringContent.Live] = {
|
|
||||||
u'title': translate('BiblesPlugin', 'Live'),
|
|
||||||
u'tooltip': translate('BiblesPlugin',
|
|
||||||
'Send the selected Bible live')
|
|
||||||
}
|
|
||||||
## Add to Service Action ##
|
|
||||||
self.textStrings[StringContent.Service] = {
|
|
||||||
u'title': translate('BiblesPlugin', 'Service'),
|
|
||||||
u'tooltip': translate('BiblesPlugin',
|
|
||||||
'Add the selected Bible to the service')
|
'Add the selected Bible to the service')
|
||||||
}
|
}
|
||||||
|
self.setPluginUiTextStrings(tooltips)
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -33,10 +33,10 @@ import os.path
|
|||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
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.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.ui.wizard import OpenLPWizard, WizardStrings
|
||||||
from openlp.core.utils import AppLocation, string_is_unicode
|
from openlp.core.utils import AppLocation, string_is_unicode
|
||||||
from openlp.plugins.bibles.lib.manager import BibleFormat
|
from openlp.plugins.bibles.lib.manager import BibleFormat
|
||||||
|
|
||||||
@ -51,18 +51,7 @@ class WebDownload(object):
|
|||||||
BibleGateway = 1
|
BibleGateway = 1
|
||||||
Bibleserver = 2
|
Bibleserver = 2
|
||||||
|
|
||||||
Names = {
|
Names = [u'Crosswalk', u'BibleGateway', u'Bibleserver']
|
||||||
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]
|
|
||||||
|
|
||||||
|
|
||||||
class BibleImportForm(OpenLPWizard):
|
class BibleImportForm(OpenLPWizard):
|
||||||
@ -363,32 +352,22 @@ class BibleImportForm(OpenLPWizard):
|
|||||||
"""
|
"""
|
||||||
self.setWindowTitle(
|
self.setWindowTitle(
|
||||||
translate('BiblesPlugin.ImportWizardForm', 'Bible Import Wizard'))
|
translate('BiblesPlugin.ImportWizardForm', 'Bible Import Wizard'))
|
||||||
self.titleLabel.setText(
|
self.titleLabel.setText(WizardStrings.HeaderStyle %
|
||||||
u'<span style="font-size:14pt; font-weight:600;">%s</span>' % \
|
translate('OpenLP.Ui', 'Welcome to the Bible Import Wizard'))
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
|
||||||
'Welcome to the Bible Import Wizard'))
|
|
||||||
self.informationLabel.setText(
|
self.informationLabel.setText(
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
translate('BiblesPlugin.ImportWizardForm',
|
||||||
'This wizard will help you to import Bibles from a '
|
'This wizard will help you to import Bibles from a variety of '
|
||||||
'variety of formats. Click the next button below to start the '
|
'formats. Click the next button below to start the process by '
|
||||||
'process by selecting a format to import from.'))
|
'selecting a format to import from.'))
|
||||||
self.selectPage.setTitle(translate('BiblesPlugin.ImportWizardForm',
|
self.selectPage.setTitle(WizardStrings.ImportSelect)
|
||||||
'Select Import Source'))
|
self.selectPage.setSubTitle(WizardStrings.ImportSelectLong)
|
||||||
self.selectPage.setSubTitle(
|
self.formatLabel.setText(WizardStrings.FormatLabel)
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
self.formatComboBox.setItemText(BibleFormat.OSIS, WizardStrings.OSIS)
|
||||||
'Select the import format, and where to import from.'))
|
self.formatComboBox.setItemText(BibleFormat.CSV, WizardStrings.CSV)
|
||||||
self.formatLabel.setText(
|
self.formatComboBox.setItemText(BibleFormat.OpenSong, WizardStrings.OS)
|
||||||
translate('BiblesPlugin.ImportWizardForm', 'Format:'))
|
self.formatComboBox.setItemText(BibleFormat.WebDownload,
|
||||||
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(3,
|
|
||||||
translate('BiblesPlugin.ImportWizardForm', 'Web Download'))
|
translate('BiblesPlugin.ImportWizardForm', 'Web Download'))
|
||||||
self.formatComboBox.setItemText(4,
|
self.formatComboBox.setItemText(BibleFormat.OpenLP1, UiStrings.OLPV1)
|
||||||
translate('BiblesPlugin.ImportWizardForm', 'openlp.org 1.x'))
|
|
||||||
self.openlp1FileLabel.setText(
|
self.openlp1FileLabel.setText(
|
||||||
translate('BiblesPlugin.ImportWizardForm', 'Bible file:'))
|
translate('BiblesPlugin.ImportWizardForm', 'Bible file:'))
|
||||||
self.osisFileLabel.setText(
|
self.osisFileLabel.setText(
|
||||||
@ -403,11 +382,11 @@ class BibleImportForm(OpenLPWizard):
|
|||||||
translate('BiblesPlugin.ImportWizardForm', 'Bible file:'))
|
translate('BiblesPlugin.ImportWizardForm', 'Bible file:'))
|
||||||
self.webSourceLabel.setText(
|
self.webSourceLabel.setText(
|
||||||
translate('BiblesPlugin.ImportWizardForm', 'Location:'))
|
translate('BiblesPlugin.ImportWizardForm', 'Location:'))
|
||||||
self.webSourceComboBox.setItemText(0,
|
self.webSourceComboBox.setItemText(WebDownload.Crosswalk,
|
||||||
translate('BiblesPlugin.ImportWizardForm', 'Crosswalk'))
|
translate('BiblesPlugin.ImportWizardForm', 'Crosswalk'))
|
||||||
self.webSourceComboBox.setItemText(1,
|
self.webSourceComboBox.setItemText(WebDownload.BibleGateway,
|
||||||
translate('BiblesPlugin.ImportWizardForm', 'BibleGateway'))
|
translate('BiblesPlugin.ImportWizardForm', 'BibleGateway'))
|
||||||
self.webSourceComboBox.setItemText(2,
|
self.webSourceComboBox.setItemText(WebDownload.Bibleserver,
|
||||||
translate('BiblesPlugin.ImportWizardForm', 'Bibleserver'))
|
translate('BiblesPlugin.ImportWizardForm', 'Bibleserver'))
|
||||||
self.webTranslationLabel.setText(
|
self.webTranslationLabel.setText(
|
||||||
translate('BiblesPlugin.ImportWizardForm', 'Bible:'))
|
translate('BiblesPlugin.ImportWizardForm', 'Bible:'))
|
||||||
@ -435,19 +414,13 @@ class BibleImportForm(OpenLPWizard):
|
|||||||
translate('BiblesPlugin.ImportWizardForm', 'Copyright:'))
|
translate('BiblesPlugin.ImportWizardForm', 'Copyright:'))
|
||||||
self.permissionsLabel.setText(
|
self.permissionsLabel.setText(
|
||||||
translate('BiblesPlugin.ImportWizardForm', 'Permissions:'))
|
translate('BiblesPlugin.ImportWizardForm', 'Permissions:'))
|
||||||
self.progressPage.setTitle(
|
self.progressPage.setTitle(WizardStrings.Importing)
|
||||||
translate('BiblesPlugin.ImportWizardForm', 'Importing'))
|
|
||||||
self.progressPage.setSubTitle(
|
self.progressPage.setSubTitle(
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
translate('BiblesPlugin.ImportWizardForm',
|
||||||
'Please wait while your Bible is imported.'))
|
'Please wait while your Bible is imported.'))
|
||||||
self.progressLabel.setText(
|
self.progressLabel.setText(WizardStrings.Ready)
|
||||||
translate('BiblesPlugin.ImportWizardForm', 'Ready.'))
|
|
||||||
self.progressBar.setFormat(u'%p%')
|
self.progressBar.setFormat(u'%p%')
|
||||||
self.openlp1DisabledLabel.setText(
|
self.openlp1DisabledLabel.setText(WizardStrings.NoSqlite)
|
||||||
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.'))
|
|
||||||
# Align all QFormLayouts towards each other.
|
# Align all QFormLayouts towards each other.
|
||||||
labelWidth = max(self.formatLabel.minimumSizeHint().width(),
|
labelWidth = max(self.formatLabel.minimumSizeHint().width(),
|
||||||
self.osisFileLabel.minimumSizeHint().width(),
|
self.osisFileLabel.minimumSizeHint().width(),
|
||||||
@ -468,37 +441,28 @@ class BibleImportForm(OpenLPWizard):
|
|||||||
elif self.currentPage() == self.selectPage:
|
elif self.currentPage() == self.selectPage:
|
||||||
if self.field(u'source_format').toInt()[0] == BibleFormat.OSIS:
|
if self.field(u'source_format').toInt()[0] == BibleFormat.OSIS:
|
||||||
if not self.field(u'osis_location').toString():
|
if not self.field(u'osis_location').toString():
|
||||||
critical_error_message_box(
|
critical_error_message_box(UiStrings.NFSs,
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
WizardStrings.YouSpecifyFile % WizardStrings.OSIS)
|
||||||
'Invalid Bible Location'),
|
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
|
||||||
'You need to specify a file to import your '
|
|
||||||
'Bible from.'))
|
|
||||||
self.osisFileEdit.setFocus()
|
self.osisFileEdit.setFocus()
|
||||||
return False
|
return False
|
||||||
elif self.field(u'source_format').toInt()[0] == BibleFormat.CSV:
|
elif self.field(u'source_format').toInt()[0] == BibleFormat.CSV:
|
||||||
if not self.field(u'csv_testamentsfile').toString():
|
if not self.field(u'csv_testamentsfile').toString():
|
||||||
answer = critical_error_message_box(translate(
|
answer = critical_error_message_box(UiStrings.NFSs,
|
||||||
'BiblesPlugin.ImportWizardForm', 'No Testaments File'),
|
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
translate('BiblesPlugin.ImportWizardForm',
|
||||||
'You have not specified a testaments file. Do you '
|
'You have not specified a testaments file. Do you '
|
||||||
'want to proceed with the import?'), question=True)
|
'want to proceed with the import?'), question=True)
|
||||||
if answer == QtGui.QMessageBox.No:
|
if answer == QtGui.QMessageBox.No:
|
||||||
self.csvTestamentsEdit.setFocus()
|
self.csvTestamentsEdit.setFocus()
|
||||||
return False
|
return False
|
||||||
elif not self.field(u'csv_booksfile').toString():
|
if not self.field(u'csv_booksfile').toString():
|
||||||
critical_error_message_box(
|
critical_error_message_box(UiStrings.NFSs,
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
|
||||||
'Invalid Books File'),
|
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
translate('BiblesPlugin.ImportWizardForm',
|
||||||
'You need to specify a file with books of '
|
'You need to specify a file with books of '
|
||||||
'the Bible to use in the import.'))
|
'the Bible to use in the import.'))
|
||||||
self.csvBooksEdit.setFocus()
|
self.csvBooksEdit.setFocus()
|
||||||
return False
|
return False
|
||||||
elif not self.field(u'csv_versefile').toString():
|
elif not self.field(u'csv_versefile').toString():
|
||||||
critical_error_message_box(
|
critical_error_message_box(UiStrings.NFSs,
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
|
||||||
'Invalid Verse File'),
|
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
translate('BiblesPlugin.ImportWizardForm',
|
||||||
'You need to specify a file of Bible '
|
'You need to specify a file of Bible '
|
||||||
'verses to import.'))
|
'verses to import.'))
|
||||||
@ -507,22 +471,14 @@ class BibleImportForm(OpenLPWizard):
|
|||||||
elif self.field(u'source_format').toInt()[0] == \
|
elif self.field(u'source_format').toInt()[0] == \
|
||||||
BibleFormat.OpenSong:
|
BibleFormat.OpenSong:
|
||||||
if not self.field(u'opensong_file').toString():
|
if not self.field(u'opensong_file').toString():
|
||||||
critical_error_message_box(
|
critical_error_message_box(UiStrings.NFSs,
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
WizardStrings.YouSpecifyFile % WizardStrings.OS)
|
||||||
'Invalid OpenSong Bible'),
|
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
|
||||||
'You need to specify an OpenSong Bible '
|
|
||||||
'file to import.'))
|
|
||||||
self.openSongFileEdit.setFocus()
|
self.openSongFileEdit.setFocus()
|
||||||
return False
|
return False
|
||||||
elif self.field(u'source_format').toInt()[0] == BibleFormat.OpenLP1:
|
elif self.field(u'source_format').toInt()[0] == BibleFormat.OpenLP1:
|
||||||
if not self.field(u'openlp1_location').toString():
|
if not self.field(u'openlp1_location').toString():
|
||||||
critical_error_message_box(
|
critical_error_message_box(UiStrings.NFSs,
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
WizardStrings.YouSpecifyFile % UiStrings.OLPV1)
|
||||||
'Invalid Bible Location'),
|
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
|
||||||
'You need to specify a file to import your '
|
|
||||||
'Bible from.'))
|
|
||||||
self.openlp1FileEdit.setFocus()
|
self.openlp1FileEdit.setFocus()
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
@ -531,17 +487,13 @@ class BibleImportForm(OpenLPWizard):
|
|||||||
license_copyright = \
|
license_copyright = \
|
||||||
unicode(self.field(u'license_copyright').toString())
|
unicode(self.field(u'license_copyright').toString())
|
||||||
if not license_version:
|
if not license_version:
|
||||||
critical_error_message_box(
|
critical_error_message_box(UiStrings.EmptyField,
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
|
||||||
'Empty Version Name'),
|
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
translate('BiblesPlugin.ImportWizardForm',
|
||||||
'You need to specify a version name for your Bible.'))
|
'You need to specify a version name for your Bible.'))
|
||||||
self.versionNameEdit.setFocus()
|
self.versionNameEdit.setFocus()
|
||||||
return False
|
return False
|
||||||
elif not license_copyright:
|
elif not license_copyright:
|
||||||
critical_error_message_box(
|
critical_error_message_box(UiStrings.EmptyField,
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
|
||||||
'Empty Copyright'),
|
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
translate('BiblesPlugin.ImportWizardForm',
|
||||||
'You need to set a copyright for your Bible. '
|
'You need to set a copyright for your Bible. '
|
||||||
'Bibles in the Public Domain need to be marked as such.'))
|
'Bibles in the Public Domain need to be marked as such.'))
|
||||||
@ -576,24 +528,22 @@ class BibleImportForm(OpenLPWizard):
|
|||||||
"""
|
"""
|
||||||
Show the file open dialog for the OSIS file.
|
Show the file open dialog for the OSIS file.
|
||||||
"""
|
"""
|
||||||
self.getFileName(
|
self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.OSIS,
|
||||||
translate('BiblesPlugin.ImportWizardForm', 'Open OSIS File'),
|
|
||||||
self.osisFileEdit)
|
self.osisFileEdit)
|
||||||
|
|
||||||
def onCsvTestamentsBrowseButtonClicked(self):
|
def onCsvTestamentsBrowseButtonClicked(self):
|
||||||
"""
|
"""
|
||||||
Show the file open dialog for the testaments CSV file.
|
Show the file open dialog for the testaments CSV file.
|
||||||
"""
|
"""
|
||||||
self.getFileName(translate('BiblesPlugin.ImportWizardForm',
|
self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.CSV,
|
||||||
'Open Testaments CSV File'), self.csvTestamentsEdit, u'%s (*.csv)'
|
self.csvTestamentsEdit, u'%s (*.csv)'
|
||||||
% translate('BiblesPlugin.ImportWizardForm', 'CSV File'))
|
% translate('BiblesPlugin.ImportWizardForm', 'CSV File'))
|
||||||
|
|
||||||
def onCsvBooksBrowseButtonClicked(self):
|
def onCsvBooksBrowseButtonClicked(self):
|
||||||
"""
|
"""
|
||||||
Show the file open dialog for the books CSV file.
|
Show the file open dialog for the books CSV file.
|
||||||
"""
|
"""
|
||||||
self.getFileName(
|
self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.CSV,
|
||||||
translate('BiblesPlugin.ImportWizardForm', 'Open Books CSV File'),
|
|
||||||
self.csvBooksEdit, u'%s (*.csv)'
|
self.csvBooksEdit, u'%s (*.csv)'
|
||||||
% translate('BiblesPlugin.ImportWizardForm', 'CSV File'))
|
% translate('BiblesPlugin.ImportWizardForm', 'CSV File'))
|
||||||
|
|
||||||
@ -601,27 +551,24 @@ class BibleImportForm(OpenLPWizard):
|
|||||||
"""
|
"""
|
||||||
Show the file open dialog for the verses CSV file.
|
Show the file open dialog for the verses CSV file.
|
||||||
"""
|
"""
|
||||||
self.getFileName(translate('BiblesPlugin.ImportWizardForm',
|
self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.CSV,
|
||||||
'Open Verses CSV File'), self.csvVersesEdit, u'%s (*.csv)'
|
self.csvVersesEdit, u'%s (*.csv)'
|
||||||
% translate('BiblesPlugin.ImportWizardForm', 'CSV File'))
|
% translate('BiblesPlugin.ImportWizardForm', 'CSV File'))
|
||||||
|
|
||||||
def onOpenSongBrowseButtonClicked(self):
|
def onOpenSongBrowseButtonClicked(self):
|
||||||
"""
|
"""
|
||||||
Show the file open dialog for the OpenSong file.
|
Show the file open dialog for the OpenSong file.
|
||||||
"""
|
"""
|
||||||
self.getFileName(
|
self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.OS,
|
||||||
translate('BiblesPlugin.ImportWizardForm', 'Open OpenSong Bible'),
|
|
||||||
self.openSongFileEdit)
|
self.openSongFileEdit)
|
||||||
|
|
||||||
def onOpenlp1BrowseButtonClicked(self):
|
def onOpenlp1BrowseButtonClicked(self):
|
||||||
"""
|
"""
|
||||||
Show the file open dialog for the openlp.org 1.x file.
|
Show the file open dialog for the openlp.org 1.x file.
|
||||||
"""
|
"""
|
||||||
self.getFileName(
|
self.getFileName(WizardStrings.OpenTypeFile % UiStrings.OLPV1,
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
self.openlp1FileEdit, u'%s (*.bible)' %
|
||||||
'Open openlp.org 1.x Bible'), self.openlp1FileEdit,
|
translate('BiblesPlugin.ImportWizardForm', 'openlp.org 1.x bible'))
|
||||||
u'%s (*.bible)' % translate('BiblesPlugin.ImportWizardForm',
|
|
||||||
'openlp.org 1.x bible'))
|
|
||||||
|
|
||||||
def registerFields(self):
|
def registerFields(self):
|
||||||
"""
|
"""
|
||||||
@ -722,39 +669,11 @@ class BibleImportForm(OpenLPWizard):
|
|||||||
self.web_bible_list[download_type][ver] = name.strip()
|
self.web_bible_list[download_type][ver] = name.strip()
|
||||||
except IOError:
|
except IOError:
|
||||||
log.exception(u'%s resources missing' %
|
log.exception(u'%s resources missing' %
|
||||||
WebDownload.get_name(download_type))
|
WebDownload.Names[download_type])
|
||||||
finally:
|
finally:
|
||||||
if books_file:
|
if books_file:
|
||||||
books_file.close()
|
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 (*)' % translate('BiblesPlugin.ImportWizardForm',
|
|
||||||
'All Files')
|
|
||||||
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):
|
def preWizard(self):
|
||||||
"""
|
"""
|
||||||
Prepare the UI for the import.
|
Prepare the UI for the import.
|
||||||
@ -766,8 +685,7 @@ class BibleImportForm(OpenLPWizard):
|
|||||||
'BiblesPlugin.ImportWizardForm',
|
'BiblesPlugin.ImportWizardForm',
|
||||||
'Starting Registering bible...'))
|
'Starting Registering bible...'))
|
||||||
else:
|
else:
|
||||||
self.progressLabel.setText(translate(
|
self.progressLabel.setText(WizardStrings.StartingImport)
|
||||||
'BiblesPlugin.ImportWizardForm', 'Starting import...'))
|
|
||||||
Receiver.send_message(u'openlp_process_events')
|
Receiver.send_message(u'openlp_process_events')
|
||||||
|
|
||||||
def performWizard(self):
|
def performWizard(self):
|
||||||
@ -805,18 +723,10 @@ class BibleImportForm(OpenLPWizard):
|
|||||||
self.progressBar.setMaximum(1)
|
self.progressBar.setMaximum(1)
|
||||||
download_location = self.field(u'web_location').toInt()[0]
|
download_location = self.field(u'web_location').toInt()[0]
|
||||||
bible_version = unicode(self.webTranslationComboBox.currentText())
|
bible_version = unicode(self.webTranslationComboBox.currentText())
|
||||||
if download_location == WebDownload.Crosswalk:
|
bible = self.web_bible_list[download_location][bible_version]
|
||||||
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]
|
|
||||||
importer = self.manager.import_bible(
|
importer = self.manager.import_bible(
|
||||||
BibleFormat.WebDownload, name=license_version,
|
BibleFormat.WebDownload, name=license_version,
|
||||||
download_source=WebDownload.get_name(download_location),
|
download_source=WebDownload.Names[download_location],
|
||||||
download_name=bible,
|
download_name=bible,
|
||||||
proxy_server=unicode(self.field(u'proxy_server').toString()),
|
proxy_server=unicode(self.field(u'proxy_server').toString()),
|
||||||
proxy_username=\
|
proxy_username=\
|
||||||
@ -839,9 +749,9 @@ class BibleImportForm(OpenLPWizard):
|
|||||||
'bible. Please note, that verses will be downloaded on\n'
|
'bible. Please note, that verses will be downloaded on\n'
|
||||||
'demand and thus an internet connection is required.'))
|
'demand and thus an internet connection is required.'))
|
||||||
else:
|
else:
|
||||||
self.progressLabel.setText(translate(
|
self.progressLabel.setText(WizardStrings.FinishedImport)
|
||||||
'BiblesPlugin.ImportWizardForm', 'Finished import.'))
|
|
||||||
else:
|
else:
|
||||||
self.progressLabel.setText(translate(
|
self.progressLabel.setText(translate(
|
||||||
'BiblesPlugin.ImportWizardForm', 'Your Bible import failed.'))
|
'BiblesPlugin.ImportWizardForm', 'Your Bible import failed.'))
|
||||||
|
del self.manager.db_cache[importer.name]
|
||||||
delete_database(self.plugin.settingsSection, importer.file)
|
delete_database(self.plugin.settingsSection, importer.file)
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -32,7 +32,33 @@ import re
|
|||||||
|
|
||||||
log = logging.getLogger(__name__)
|
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):
|
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'
|
local_separator = unicode(u':;;\s*[:vV]\s*;;-;;\s*-\s*;;,;;\s*,\s*;;end'
|
||||||
).split(u';;') # English
|
).split(u';;') # English
|
||||||
# local_separator = unicode(u',;;\s*,\s*;;-;;\s*-\s*;;.;;\.;;[Ee]nde'
|
# local_separator = unicode(u',;;\s*,\s*;;-;;\s*-\s*;;.;;\.;;[Ee]nde'
|
||||||
@ -62,69 +88,90 @@ def get_reference_match(match_type):
|
|||||||
def parse_reference(reference):
|
def parse_reference(reference):
|
||||||
"""
|
"""
|
||||||
This is the next generation über-awesome function that takes a person's
|
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
|
typed in string and converts it to a list of references to be queried from
|
||||||
be queried from the Bible database files.
|
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.
|
Returns ``None`` or a reference list.
|
||||||
``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<from_chapter>[0-9]+)%(sep_v)s)?``
|
|
||||||
It starts with a optional chapter reference ``from_chapter`` followed by
|
|
||||||
a verse separator.
|
|
||||||
2. ``(?P<from_verse>[0-9]+)``
|
|
||||||
The verse reference ``from_verse`` is manditory
|
|
||||||
3. ``(?P<range_to>%(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<to_chapter>[0-9]+)%(sep_v)s)?``
|
|
||||||
The ``to_chapter`` reference with separator is equivalent to group 1.
|
|
||||||
5. ``(?P<to_verse>[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<book>[\d]*[^\d]+)(?<!\s)\s*``
|
|
||||||
The ``book`` group starts with the first non-whitespace character. There
|
|
||||||
are optional leading digits followed by non-digits. The group ends
|
|
||||||
before the whitspace in front of the next digit.
|
|
||||||
2. ``(?P<ranges>(?:`` + 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.
|
|
||||||
|
|
||||||
The reference list is a list of tuples, with each tuple structured like
|
The reference list is a list of tuples, with each tuple structured like
|
||||||
this::
|
this::
|
||||||
|
|
||||||
(book, chapter, from_verse, to_verse)
|
(book, chapter, from_verse, to_verse)
|
||||||
|
|
||||||
``reference``
|
For example::
|
||||||
The bible reference to parse.
|
|
||||||
|
[(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
|
||||||
|
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<from_chapter>[0-9]+)%(sep_v)s)?``
|
||||||
|
It starts with a optional chapter reference ``from_chapter`` followed by
|
||||||
|
a verse separator.
|
||||||
|
|
||||||
|
``(?P<from_verse>[0-9]+)``
|
||||||
|
The verse reference ``from_verse`` is manditory
|
||||||
|
|
||||||
|
``(?P<range_to>%(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<to_chapter>[0-9]+)%(sep_v)s)?``
|
||||||
|
The ``to_chapter`` reference with separator is equivalent to group 1.
|
||||||
|
|
||||||
|
``(?P<to_verse>[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<book>[\d]*[^\d]+)(?<!\s)\s*``
|
||||||
|
The ``book`` group starts with the first non-whitespace character. There
|
||||||
|
are optional leading digits followed by non-digits. The group ends
|
||||||
|
before the whitspace in front of the next digit.
|
||||||
|
|
||||||
|
``(?P<ranges>(?:`` + 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)
|
log.debug(u'parse_reference("%s")', reference)
|
||||||
match = get_reference_match(u'full').match(reference)
|
match = get_reference_match(u'full').match(reference)
|
||||||
@ -207,7 +254,8 @@ class SearchResults(object):
|
|||||||
The chapter of the book.
|
The chapter of the book.
|
||||||
|
|
||||||
``verselist``
|
``verselist``
|
||||||
The list of verses for this reading
|
The list of verses for this reading.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
self.book = book
|
self.book = book
|
||||||
self.chapter = chapter
|
self.chapter = chapter
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -29,6 +29,7 @@ import logging
|
|||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import Receiver, SettingsTab, translate
|
from openlp.core.lib import Receiver, SettingsTab, translate
|
||||||
|
from openlp.plugins.bibles.lib import LayoutStyle, DisplayStyle
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -122,19 +123,19 @@ class BiblesTab(SettingsTab):
|
|||||||
translate('BiblesPlugin.BiblesTab', 'Display style:'))
|
translate('BiblesPlugin.BiblesTab', 'Display style:'))
|
||||||
self.BibleThemeLabel.setText(
|
self.BibleThemeLabel.setText(
|
||||||
translate('BiblesPlugin.BiblesTab', 'Bible theme:'))
|
translate('BiblesPlugin.BiblesTab', 'Bible theme:'))
|
||||||
self.LayoutStyleComboBox.setItemText(0,
|
self.LayoutStyleComboBox.setItemText(LayoutStyle.VersePerSlide,
|
||||||
translate('BiblesPlugin.BiblesTab', 'Verse Per Slide'))
|
translate('BiblesPlugin.BiblesTab', 'Verse Per Slide'))
|
||||||
self.LayoutStyleComboBox.setItemText(1,
|
self.LayoutStyleComboBox.setItemText(LayoutStyle.VersePerLine,
|
||||||
translate('BiblesPlugin.BiblesTab', 'Verse Per Line'))
|
translate('BiblesPlugin.BiblesTab', 'Verse Per Line'))
|
||||||
self.LayoutStyleComboBox.setItemText(2,
|
self.LayoutStyleComboBox.setItemText(LayoutStyle.Continuous,
|
||||||
translate('BiblesPlugin.BiblesTab', 'Continuous'))
|
translate('BiblesPlugin.BiblesTab', 'Continuous'))
|
||||||
self.DisplayStyleComboBox.setItemText(0,
|
self.DisplayStyleComboBox.setItemText(DisplayStyle.NoBrackets,
|
||||||
translate('BiblesPlugin.BiblesTab', 'No Brackets'))
|
translate('BiblesPlugin.BiblesTab', 'No Brackets'))
|
||||||
self.DisplayStyleComboBox.setItemText(1,
|
self.DisplayStyleComboBox.setItemText(DisplayStyle.Round,
|
||||||
translate('BiblesPlugin.BiblesTab', '( And )'))
|
translate('BiblesPlugin.BiblesTab', '( And )'))
|
||||||
self.DisplayStyleComboBox.setItemText(2,
|
self.DisplayStyleComboBox.setItemText(DisplayStyle.Curly,
|
||||||
translate('BiblesPlugin.BiblesTab', '{ And }'))
|
translate('BiblesPlugin.BiblesTab', '{ And }'))
|
||||||
self.DisplayStyleComboBox.setItemText(3,
|
self.DisplayStyleComboBox.setItemText(DisplayStyle.Square,
|
||||||
translate('BiblesPlugin.BiblesTab', '[ And ]'))
|
translate('BiblesPlugin.BiblesTab', '[ And ]'))
|
||||||
self.ChangeNoteLabel.setText(translate('BiblesPlugin.BiblesTab',
|
self.ChangeNoteLabel.setText(translate('BiblesPlugin.BiblesTab',
|
||||||
'Note:\nChanges do not affect verses already in the service.'))
|
'Note:\nChanges do not affect verses already in the service.'))
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -94,8 +94,6 @@ class CSVBible(BibleDB):
|
|||||||
self.testamentsfile = None
|
self.testamentsfile = None
|
||||||
self.booksfile = kwargs[u'booksfile']
|
self.booksfile = kwargs[u'booksfile']
|
||||||
self.versesfile = kwargs[u'versefile']
|
self.versesfile = kwargs[u'versefile']
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
|
||||||
QtCore.SIGNAL(u'openlp_stop_wizard'), self.stop_import)
|
|
||||||
|
|
||||||
def setup_testaments(self):
|
def setup_testaments(self):
|
||||||
"""
|
"""
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# 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 #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
@ -33,7 +33,7 @@ from sqlalchemy import Column, ForeignKey, or_, Table, types
|
|||||||
from sqlalchemy.orm import class_mapper, mapper, relation
|
from sqlalchemy.orm import class_mapper, mapper, relation
|
||||||
from sqlalchemy.orm.exc import UnmappedClassError
|
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.db import BaseModel, init_db, Manager
|
||||||
from openlp.core.lib.ui import critical_error_message_box
|
from openlp.core.lib.ui import critical_error_message_box
|
||||||
|
|
||||||
@ -162,6 +162,8 @@ class BibleDB(QtCore.QObject, Manager):
|
|||||||
if u'file' in kwargs:
|
if u'file' in kwargs:
|
||||||
self.get_name()
|
self.get_name()
|
||||||
self.wizard = None
|
self.wizard = None
|
||||||
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
|
QtCore.SIGNAL(u'openlp_stop_wizard'), self.stop_import)
|
||||||
|
|
||||||
def stop_import(self):
|
def stop_import(self):
|
||||||
"""
|
"""
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user