forked from openlp/openlp
first run wizard
This commit is contained in:
commit
f800b4fcd8
10
MANIFEST.in
10
MANIFEST.in
@ -4,13 +4,11 @@ recursive-include openlp *.csv
|
||||
recursive-include openlp *.html
|
||||
recursive-include openlp *.js
|
||||
recursive-include openlp *.css
|
||||
recursive-include openlp *.qm
|
||||
recursive-include openlp *.png
|
||||
recursive-include documentation *
|
||||
recursive-include resources/forms *
|
||||
recursive-include resources/i18n *
|
||||
recursive-include resources/images *
|
||||
recursive-include scripts *.py
|
||||
include resources/*.desktop
|
||||
recursive-include resources *
|
||||
recursive-include scripts *
|
||||
include copyright.txt
|
||||
include LICENSE
|
||||
include README.txt
|
||||
include openlp/.version
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -17,3 +17,9 @@ Helper Classes & Functions
|
||||
|
||||
.. automodule:: openlp.plugins.remotes.lib
|
||||
:members:
|
||||
|
||||
.. autoclass:: openlp.plugins.remotes.lib.httpserver.HttpConnection
|
||||
:members:
|
||||
|
||||
.. autoclass:: openlp.plugins.remotes.lib.httpserver.HttpResponse
|
||||
:members:
|
||||
|
@ -1,112 +1,112 @@
|
||||
@ECHO OFF
|
||||
|
||||
REM Command file for Sphinx documentation
|
||||
|
||||
set SPHINXBUILD=sphinx-build
|
||||
set ALLSPHINXOPTS=-d build/doctrees %SPHINXOPTS% source
|
||||
if NOT "%PAPER%" == "" (
|
||||
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
|
||||
)
|
||||
|
||||
if "%1" == "" goto help
|
||||
|
||||
if "%1" == "help" (
|
||||
:help
|
||||
echo.Please use `make ^<target^>` where ^<target^> is one of
|
||||
echo. html to make standalone HTML files
|
||||
echo. dirhtml to make HTML files named index.html in directories
|
||||
echo. pickle to make pickle files
|
||||
echo. json to make JSON files
|
||||
echo. htmlhelp to make HTML files and a HTML help project
|
||||
echo. qthelp to make HTML files and a qthelp project
|
||||
echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
|
||||
echo. changes to make an overview over all changed/added/deprecated items
|
||||
echo. linkcheck to check all external links for integrity
|
||||
echo. doctest to run all doctests embedded in the documentation if enabled
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "clean" (
|
||||
for /d %%i in (build\*) do rmdir /q /s %%i
|
||||
del /q /s build\*
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "html" (
|
||||
%SPHINXBUILD% -b html %ALLSPHINXOPTS% build/html
|
||||
echo.
|
||||
echo.Build finished. The HTML pages are in build/html.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "dirhtml" (
|
||||
%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% build/dirhtml
|
||||
echo.
|
||||
echo.Build finished. The HTML pages are in build/dirhtml.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "pickle" (
|
||||
%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% build/pickle
|
||||
echo.
|
||||
echo.Build finished; now you can process the pickle files.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "json" (
|
||||
%SPHINXBUILD% -b json %ALLSPHINXOPTS% build/json
|
||||
echo.
|
||||
echo.Build finished; now you can process the JSON files.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "htmlhelp" (
|
||||
%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% build/htmlhelp
|
||||
echo.
|
||||
echo.Build finished; now you can run HTML Help Workshop with the ^
|
||||
.hhp project file in build/htmlhelp.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "qthelp" (
|
||||
%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% build/qthelp
|
||||
echo.
|
||||
echo.Build finished; now you can run "qcollectiongenerator" with the ^
|
||||
.qhcp project file in build/qthelp, like this:
|
||||
echo.^> qcollectiongenerator build\qthelp\OpenLP.qhcp
|
||||
echo.To view the help file:
|
||||
echo.^> assistant -collectionFile build\qthelp\OpenLP.ghc
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "latex" (
|
||||
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% build/latex
|
||||
echo.
|
||||
echo.Build finished; the LaTeX files are in build/latex.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "changes" (
|
||||
%SPHINXBUILD% -b changes %ALLSPHINXOPTS% build/changes
|
||||
echo.
|
||||
echo.The overview file is in build/changes.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "linkcheck" (
|
||||
%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% build/linkcheck
|
||||
echo.
|
||||
echo.Link check complete; look for any errors in the above output ^
|
||||
or in build/linkcheck/output.txt.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "doctest" (
|
||||
%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% build/doctest
|
||||
echo.
|
||||
echo.Testing of doctests in the sources finished, look at the ^
|
||||
results in build/doctest/output.txt.
|
||||
goto end
|
||||
)
|
||||
|
||||
:end
|
||||
@ECHO OFF
|
||||
|
||||
REM Command file for Sphinx documentation
|
||||
|
||||
set SPHINXBUILD=sphinx-build
|
||||
set ALLSPHINXOPTS=-d build/doctrees %SPHINXOPTS% source
|
||||
if NOT "%PAPER%" == "" (
|
||||
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
|
||||
)
|
||||
|
||||
if "%1" == "" goto help
|
||||
|
||||
if "%1" == "help" (
|
||||
:help
|
||||
echo.Please use `make ^<target^>` where ^<target^> is one of
|
||||
echo. html to make standalone HTML files
|
||||
echo. dirhtml to make HTML files named index.html in directories
|
||||
echo. pickle to make pickle files
|
||||
echo. json to make JSON files
|
||||
echo. htmlhelp to make HTML files and a HTML help project
|
||||
echo. qthelp to make HTML files and a qthelp project
|
||||
echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
|
||||
echo. changes to make an overview over all changed/added/deprecated items
|
||||
echo. linkcheck to check all external links for integrity
|
||||
echo. doctest to run all doctests embedded in the documentation if enabled
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "clean" (
|
||||
for /d %%i in (build\*) do rmdir /q /s %%i
|
||||
del /q /s build\*
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "html" (
|
||||
%SPHINXBUILD% -b html %ALLSPHINXOPTS% build/html
|
||||
echo.
|
||||
echo.Build finished. The HTML pages are in build/html.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "dirhtml" (
|
||||
%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% build/dirhtml
|
||||
echo.
|
||||
echo.Build finished. The HTML pages are in build/dirhtml.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "pickle" (
|
||||
%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% build/pickle
|
||||
echo.
|
||||
echo.Build finished; now you can process the pickle files.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "json" (
|
||||
%SPHINXBUILD% -b json %ALLSPHINXOPTS% build/json
|
||||
echo.
|
||||
echo.Build finished; now you can process the JSON files.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "htmlhelp" (
|
||||
%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% build/htmlhelp
|
||||
echo.
|
||||
echo.Build finished; now you can run HTML Help Workshop with the ^
|
||||
.hhp project file in build/htmlhelp.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "qthelp" (
|
||||
%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% build/qthelp
|
||||
echo.
|
||||
echo.Build finished; now you can run "qcollectiongenerator" with the ^
|
||||
.qhcp project file in build/qthelp, like this:
|
||||
echo.^> qcollectiongenerator build\qthelp\OpenLP.qhcp
|
||||
echo.To view the help file:
|
||||
echo.^> assistant -collectionFile build\qthelp\OpenLP.ghc
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "latex" (
|
||||
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% build/latex
|
||||
echo.
|
||||
echo.Build finished; the LaTeX files are in build/latex.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "changes" (
|
||||
%SPHINXBUILD% -b changes %ALLSPHINXOPTS% build/changes
|
||||
echo.
|
||||
echo.The overview file is in build/changes.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "linkcheck" (
|
||||
%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% build/linkcheck
|
||||
echo.
|
||||
echo.Link check complete; look for any errors in the above output ^
|
||||
or in build/linkcheck/output.txt.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "doctest" (
|
||||
%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% build/doctest
|
||||
echo.
|
||||
echo.Testing of doctests in the sources finished, look at the ^
|
||||
results in build/doctest/output.txt.
|
||||
goto end
|
||||
)
|
||||
|
||||
:end
|
||||
|
@ -42,7 +42,7 @@ master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = u'OpenLP'
|
||||
copyright = u'2010, Raoul Snyman'
|
||||
copyright = u'2004 - 2011, Raoul Snyman'
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
@ -92,19 +92,30 @@ pygments_style = 'sphinx'
|
||||
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
html_theme = 'default'
|
||||
if sys.argv[2] == 'qthelp' or sys.argv[2] == 'htmlhelp':
|
||||
html_theme = 'openlp_qthelp'
|
||||
else:
|
||||
html_theme = 'default'
|
||||
|
||||
# Theme options are theme-specific and customize the look and feel of a theme
|
||||
# further. For a list of options available for each theme, see the
|
||||
# documentation.
|
||||
#html_theme_options = {}
|
||||
if sys.argv[2] == 'html':
|
||||
html_theme_options = {
|
||||
'sidebarbgcolor': '#3a60a9',
|
||||
'relbarbgcolor': '#203b6f',
|
||||
'footerbgcolor': '#26437c',
|
||||
'headtextcolor': '#203b6f',
|
||||
'linkcolor': '#26437c',
|
||||
'sidebarlinkcolor': '#ceceff'
|
||||
}
|
||||
|
||||
# Add any paths that contain custom themes here, relative to this directory.
|
||||
#html_theme_path = []
|
||||
html_theme_path = [os.path.join(os.path.abspath('..'), 'themes')]
|
||||
|
||||
# The name for this set of Sphinx documents. If None, it defaults to
|
||||
# "<project> v<release> documentation".
|
||||
#html_title = None
|
||||
html_title = u'OpenLP 2.0 Reference Manual'
|
||||
|
||||
# A shorter title for the navigation bar. Default is the same as html_title.
|
||||
#html_short_title = None
|
||||
@ -125,7 +136,7 @@ html_static_path = ['_static']
|
||||
|
||||
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
|
||||
# using the given strftime format.
|
||||
#html_last_updated_fmt = '%b %d, %Y'
|
||||
html_last_updated_fmt = '%b %d, %Y'
|
||||
|
||||
# If true, SmartyPants will be used to convert quotes and dashes to
|
||||
# typographically correct entities.
|
||||
@ -165,7 +176,7 @@ html_static_path = ['_static']
|
||||
#html_file_suffix = None
|
||||
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = 'OpenLPdoc'
|
||||
htmlhelp_basename = 'OpenLP'
|
||||
|
||||
|
||||
# -- Options for LaTeX output --------------------------------------------------
|
||||
@ -179,7 +190,7 @@ htmlhelp_basename = 'OpenLPdoc'
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
# (source start file, target name, title, author, documentclass [howto/manual]).
|
||||
latex_documents = [
|
||||
('index', 'OpenLP.tex', u'OpenLP Documentation',
|
||||
('index', 'OpenLP.tex', u'OpenLP Reference Manual',
|
||||
u'Wesley Stout', 'manual'),
|
||||
]
|
||||
|
||||
@ -212,6 +223,6 @@ latex_documents = [
|
||||
# One entry per manual page. List of tuples
|
||||
# (source start file, name, description, authors, manual section).
|
||||
man_pages = [
|
||||
('index', 'openlp', u'OpenLP Documentation',
|
||||
('index', 'openlp', u'OpenLP Reference Manual',
|
||||
[u'Wesley Stout'], 1)
|
||||
]
|
||||
|
@ -180,3 +180,42 @@ on :guilabel:`Save to X Configuration File`.
|
||||
Click :guilabel:`Save` and you should be set. You may want to restart X or
|
||||
your machine just to make sure all the settings carry over the next time you log
|
||||
in.
|
||||
|
||||
Linux Systems With Intel Video
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Generally systems with Intel video cards work very well. They are well supported
|
||||
by open source drivers. There are, however, a couple of issues that may require
|
||||
some work arounds.
|
||||
|
||||
**Resolution Issue**
|
||||
|
||||
There is a limitation with certain cards which limits the total resolution to
|
||||
2048x2048, so both monitors can not have a total resolution totaling more than
|
||||
that. To work around this it may be necessary to position your monitor as a top
|
||||
or bottom monitor as opposed to the typical side by side setup. This can easily
|
||||
be accomplished through your desktop's control of monitors. Please see the
|
||||
sections on dual monitors with KDE and GNOME above.
|
||||
|
||||
**Primary Monitor Issues**
|
||||
|
||||
With certain cards your system may get confused on what is the primary display.
|
||||
For example many users will be using a laptop. You will want your laptop screen
|
||||
to be the primary screen, and your projector to be the secondary monitor.
|
||||
Certain Intel cards reverse this. To work around this you will need to know the
|
||||
name of your monitor. If you are a KDE user this info is given to you in the
|
||||
display settings. If you are not using KDE enter the following in a terminal
|
||||
without your projector connected to your computer::
|
||||
|
||||
user@linux:~ $ xrandr -q
|
||||
|
||||
This will give you a long string of output. Screen names will be something along
|
||||
the lines of LVDM, VGA-0 or some convention similar to that. Without your
|
||||
projector connected to your computer only one monitor will show as being
|
||||
connected. That will be the monitor you will need to use as the primary. Now
|
||||
connect your projector and enter::
|
||||
|
||||
user@linux:~ $ xrandr --output LVDM --primary
|
||||
|
||||
**Note** it has been reported that when this issue is occurring you will not
|
||||
want to connect your projector until your desktop is running.
|
||||
|
@ -20,4 +20,4 @@ Contents:
|
||||
themes
|
||||
mediamanager
|
||||
songs
|
||||
alert
|
||||
troubleshooting
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 58 KiB |
BIN
documentation/manual/source/pics/phononcheckbox.png
Normal file
BIN
documentation/manual/source/pics/phononcheckbox.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 21 KiB |
Binary file not shown.
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 36 KiB |
132
documentation/manual/source/troubleshooting.rst
Normal file
132
documentation/manual/source/troubleshooting.rst
Normal file
@ -0,0 +1,132 @@
|
||||
===============
|
||||
Troubleshooting
|
||||
===============
|
||||
|
||||
I can not play videos or other media
|
||||
====================================
|
||||
|
||||
If you can not play video or audio through openlp, there are several areas that
|
||||
could be an issue. First thing is to make sure you can play the media file
|
||||
through your default media player. OpenLP should be able to play any file that
|
||||
you can play through your default media player.
|
||||
|
||||
If you can play a file through your media player but not on OpenLP it may help
|
||||
to enable Phonon for multimedia playback. Go to the OpenLP configuration
|
||||
:menuselection:`Settings --> Configure OpenLP...` and select the Media tab.
|
||||
Make sure the check box for `Use Phonon for video playback` is checked.
|
||||
|
||||
.. image:: pics/phononcheckbox.png
|
||||
|
||||
Codecs
|
||||
------
|
||||
|
||||
You may need to install codecs for certain files to play. Most newer versions
|
||||
of Windows and OS X will support most media types. Most Linux distributions
|
||||
will require a little more help to get certain media types to play.
|
||||
|
||||
Microsoft Windows
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
||||
Later versions of Microsoft Windows (Vista, Windows 7) generally come with
|
||||
everything you need to play most media formats. If for some reason you need
|
||||
additional codecs we have seen success from the Combined Community Codec Pack
|
||||
(CCCP): `<http://www.cccp-project.net/>`_. You might also wish to check out the
|
||||
K-Lite Codec Pack. If you are having issues, results do seem to vary with the
|
||||
different options. What works for some may not for others, so some trial and
|
||||
error may be required.
|
||||
|
||||
Mac
|
||||
^^^
|
||||
|
||||
If you are using a Mac. You may wish to play Windows formats. flip4mac enables
|
||||
you to use popular Windows formats such as .wmv on your Mac. You can get it
|
||||
here `<http://dynamic.telestream.net/downloads/download-flip4macwmv.htm>`_.
|
||||
|
||||
Ubuntu Linux (and variants)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
If you are using Ubuntu Linux, or one of its variants (Kubuntu, Edubuntu, etc...)
|
||||
it is a fairly quick and easy process to get all the codecs you need to make
|
||||
things work. You will need to install two meta-packages that contain all the
|
||||
multimedia codecs that you will generally need. From the Software Center install
|
||||
ubuntu-restricted-extras and Kubuntu-restricted-extras, or from the terminal::
|
||||
|
||||
user@linux:~ $ sudo apt-get install ubuntu-restricted-extras kubuntu-restricted-extras
|
||||
|
||||
**Note** if you are running Kubuntu there is no need to install the
|
||||
ubuntu-restricted-extras meta-package
|
||||
|
||||
For more information on Ubuntu and multimedia issues please check out
|
||||
`<https://help.ubuntu.com/community/RestrictedFormats/>`_.
|
||||
|
||||
Arch Linux
|
||||
^^^^^^^^^^
|
||||
|
||||
The following command provides the most complete solution for codecs on Arch
|
||||
Linux::
|
||||
|
||||
root@linux:~ # pacman -S gstreamer0.10-{base,good,bad,ugly}-plugins gstreamer0.10-ffmpeg
|
||||
|
||||
If you need more help with Arch Linux and multimedia please see the Arch Linux
|
||||
documentation at `<https://wiki.archlinux.org/index.php/Codecs>`_.
|
||||
|
||||
Debian Linux
|
||||
^^^^^^^^^^^^
|
||||
|
||||
You will need to add the Debian Multimedia Repository. So add the folowing to
|
||||
/etc/apt/sources.list::
|
||||
|
||||
deb http://www.debian-multimedia.org testing main non-free
|
||||
|
||||
Then update the repository info::
|
||||
|
||||
root@linux:~ # apt-get update
|
||||
|
||||
Then install the following packages::
|
||||
|
||||
root@linux:~ # apt-get install gstreamer0.10-ffmpeg gstreamer0.10-lame gstreamer0.10-plugins-really-bad gstreamer0.10-plugins-bad gstreamer0.10-plugins-ugly gstreamer0.10-plugins-good gstreamer0.10-x264
|
||||
|
||||
Fedora Linux
|
||||
^^^^^^^^^^^^
|
||||
You will need to set up Fedora to play most media formats. This is relatively
|
||||
simple using the rpmfusion repository.
|
||||
|
||||
**Note** the following commands will enable a third party repository to your
|
||||
system. Please check out `<http://rpmfusion.org>`_. for more information.
|
||||
|
||||
To enable both the free and nonfree components for any Fedora official release
|
||||
enter the following commands::
|
||||
|
||||
su -c 'yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm'
|
||||
|
||||
After enabling the rpmfusion repository you will want to refresh your package
|
||||
list, perform any updates and search for gstreamer-good, bad, and ugly and
|
||||
install.
|
||||
|
||||
Here is a good tutorial video on the rpmfusion repository
|
||||
`<http://www.linuxjournal.com/video/getting-mp3-support-fedora-using-rpmfusion-repositories>`_.
|
||||
|
||||
The Media Manager appears to be missing some features
|
||||
=====================================================
|
||||
|
||||
If you do not see all the features listed in the Media Manager, you may need
|
||||
to enable them.
|
||||
|
||||
To enable the plugins navigate to :menuselection:`Settings --> Plugins` or
|
||||
press `F7`. You will want to click on the plugin to the left that you want to
|
||||
enable and select **active** from the drop down box to the right.
|
||||
|
||||
.. image:: pics/plugins.png
|
||||
|
||||
By default all plugins should be enabled during the first run wizard except the
|
||||
remotes plugin, unless you specify differently.
|
||||
|
||||
I can not see the book, chapter, and verse when I display scripture
|
||||
===================================================================
|
||||
|
||||
The book, chapter, and verse should be displayed when you display scripture. If
|
||||
you can not see this your theme probably has the text size too small for the
|
||||
info to be seen. See the section of the manual on themes if you need more info
|
||||
on text sizes in themes.
|
||||
|
||||
|
153
openlp.pyw
153
openlp.pyw
@ -7,9 +7,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode Woldsund #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# This program is free software; you can redistribute it and/or modify it #
|
||||
# under the terms of the GNU General Public License as published by the Free #
|
||||
@ -27,20 +27,26 @@
|
||||
import os
|
||||
import sys
|
||||
import logging
|
||||
# Import uuid now, to avoid the rare bug described in the support system:
|
||||
# http://support.openlp.org/issues/102
|
||||
# If https://bugs.gentoo.org/show_bug.cgi?id=317557 is fixed, the import can be
|
||||
# removed.
|
||||
import uuid
|
||||
from optparse import OptionParser
|
||||
from traceback import format_exception
|
||||
from subprocess import Popen, PIPE
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.lib import Receiver, check_directory_exists
|
||||
from openlp.core.lib.ui import UiStrings
|
||||
from openlp.core.resources import qInitResources
|
||||
from openlp.core.ui.mainwindow import MainWindow
|
||||
from openlp.core.ui.firsttimelanguageform import FirstTimeLanguageForm
|
||||
from openlp.core.ui.firsttimeform import FirstTimeForm
|
||||
from openlp.core.ui.exceptionform import ExceptionForm
|
||||
from openlp.core.ui import SplashScreen, ScreenList
|
||||
from openlp.core.utils import AppLocation, LanguageManager, VersionThread
|
||||
from openlp.core.utils import AppLocation, LanguageManager, VersionThread, \
|
||||
get_application_version
|
||||
|
||||
log = logging.getLogger()
|
||||
|
||||
@ -71,91 +77,18 @@ class OpenLP(QtGui.QApplication):
|
||||
The core application class. This class inherits from Qt's QApplication
|
||||
class in order to provide the core of the application.
|
||||
"""
|
||||
log.info(u'OpenLP Application Loaded')
|
||||
|
||||
def _get_version(self):
|
||||
def exec_(self):
|
||||
"""
|
||||
Load and store current Application Version
|
||||
Override exec method to allow the shared memory to be released on exit
|
||||
"""
|
||||
if u'--dev-version' in sys.argv or u'-d' in sys.argv:
|
||||
# If we're running the dev version, let's use bzr to get the version
|
||||
try:
|
||||
# If bzrlib is availble, use it
|
||||
from bzrlib.branch import Branch
|
||||
b = Branch.open_containing('.')[0]
|
||||
b.lock_read()
|
||||
try:
|
||||
# Get the branch's latest revision number.
|
||||
revno = b.revno()
|
||||
# Convert said revision number into a bzr revision id.
|
||||
revision_id = b.dotted_revno_to_revision_id((revno,))
|
||||
# Get a dict of tags, with the revision id as the key.
|
||||
tags = b.tags.get_reverse_tag_dict()
|
||||
# Check if the latest
|
||||
if revision_id in tags:
|
||||
full_version = u'%s' % tags[revision_id][0]
|
||||
else:
|
||||
full_version = '%s-bzr%s' % \
|
||||
(sorted(b.tags.get_tag_dict().keys())[-1], revno)
|
||||
finally:
|
||||
b.unlock()
|
||||
except:
|
||||
# Otherwise run the command line bzr client
|
||||
bzr = Popen((u'bzr', u'tags', u'--sort', u'time'), stdout=PIPE)
|
||||
output, error = bzr.communicate()
|
||||
code = bzr.wait()
|
||||
if code != 0:
|
||||
raise Exception(u'Error running bzr tags')
|
||||
lines = output.splitlines()
|
||||
if len(lines) == 0:
|
||||
tag = u'0.0.0'
|
||||
revision = u'0'
|
||||
else:
|
||||
tag, revision = lines[-1].split()
|
||||
bzr = Popen((u'bzr', u'log', u'--line', u'-r', u'-1'),
|
||||
stdout=PIPE)
|
||||
output, error = bzr.communicate()
|
||||
code = bzr.wait()
|
||||
if code != 0:
|
||||
raise Exception(u'Error running bzr log')
|
||||
latest = output.split(u':')[0]
|
||||
full_version = latest == revision and tag or \
|
||||
u'%s-bzr%s' % (tag, latest)
|
||||
else:
|
||||
# We're not running the development version, let's use the file
|
||||
filepath = AppLocation.get_directory(AppLocation.VersionDir)
|
||||
filepath = os.path.join(filepath, u'.version')
|
||||
fversion = None
|
||||
try:
|
||||
fversion = open(filepath, u'r')
|
||||
full_version = unicode(fversion.read()).rstrip()
|
||||
except IOError:
|
||||
log.exception('Error in version file.')
|
||||
full_version = u'0.0.0-bzr000'
|
||||
finally:
|
||||
if fversion:
|
||||
fversion.close()
|
||||
bits = full_version.split(u'-')
|
||||
app_version = {
|
||||
u'full': full_version,
|
||||
u'version': bits[0],
|
||||
u'build': bits[1] if len(bits) > 1 else None
|
||||
}
|
||||
if app_version[u'build']:
|
||||
log.info(
|
||||
u'Openlp version %s build %s',
|
||||
app_version[u'version'],
|
||||
app_version[u'build']
|
||||
)
|
||||
else:
|
||||
log.info(u'Openlp version %s' % app_version[u'version'])
|
||||
return app_version
|
||||
QtGui.QApplication.exec_()
|
||||
self.sharedMemory.detach()
|
||||
|
||||
def run(self):
|
||||
"""
|
||||
Run the OpenLP application.
|
||||
"""
|
||||
app_version = self._get_version()
|
||||
# provide a listener for widgets to reqest a screen update.
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'openlp_process_events'), self.processEvents)
|
||||
@ -163,17 +96,15 @@ class OpenLP(QtGui.QApplication):
|
||||
QtCore.SIGNAL(u'cursor_busy'), self.setBusyCursor)
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'cursor_normal'), self.setNormalCursor)
|
||||
self.setOrganizationName(u'OpenLP')
|
||||
self.setOrganizationDomain(u'openlp.org')
|
||||
self.setApplicationName(u'OpenLP')
|
||||
self.setApplicationVersion(app_version[u'version'])
|
||||
# Decide how many screens we have and their size
|
||||
screens = ScreenList(self.desktop())
|
||||
# First time checks in settings
|
||||
firstTime = QtCore.QSettings().value(
|
||||
u'general/first time', QtCore.QVariant(True)).toBool()
|
||||
if firstTime:
|
||||
FirstTimeForm(screens).exec_()
|
||||
has_run_wizard = QtCore.QSettings().value(
|
||||
u'general/has run wizard', QtCore.QVariant(False)).toBool()
|
||||
if not has_run_wizard:
|
||||
if FirstTimeForm(screens).exec_() == QtGui.QDialog.Accepted:
|
||||
QtCore.QSettings().setValue(u'general/has run wizard',
|
||||
QtCore.QVariant(True))
|
||||
if os.name == u'nt':
|
||||
self.setStyleSheet(application_stylesheet)
|
||||
show_splash = QtCore.QSettings().value(
|
||||
@ -184,20 +115,40 @@ class OpenLP(QtGui.QApplication):
|
||||
# make sure Qt really display the splash screen
|
||||
self.processEvents()
|
||||
# start the main app window
|
||||
self.appClipboard = self.clipboard()
|
||||
self.mainWindow = MainWindow(screens, app_version, self.appClipboard,
|
||||
firstTime)
|
||||
self.mainWindow = MainWindow(screens, self.clipboard(),
|
||||
self.arguments())
|
||||
self.mainWindow.show()
|
||||
if show_splash:
|
||||
# now kill the splashscreen
|
||||
self.splash.finish(self.mainWindow)
|
||||
self.mainWindow.repaint()
|
||||
self.processEvents()
|
||||
if not has_run_wizard:
|
||||
self.mainWindow.firstTime()
|
||||
update_check = QtCore.QSettings().value(
|
||||
u'general/update check', QtCore.QVariant(True)).toBool()
|
||||
if update_check:
|
||||
VersionThread(self.mainWindow, app_version).start()
|
||||
VersionThread(self.mainWindow).start()
|
||||
return self.exec_()
|
||||
|
||||
def isAlreadyRunning(self):
|
||||
"""
|
||||
Look to see if OpenLP is already running and ask if a 2nd copy
|
||||
is to be started.
|
||||
"""
|
||||
self.sharedMemory = QtCore.QSharedMemory('OpenLP')
|
||||
if self.sharedMemory.attach():
|
||||
status = QtGui.QMessageBox.critical(None,
|
||||
UiStrings.Error, UiStrings.OpenLPStart,
|
||||
QtGui.QMessageBox.StandardButtons(
|
||||
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No))
|
||||
if status == QtGui.QMessageBox.No:
|
||||
return True
|
||||
return False
|
||||
else:
|
||||
self.sharedMemory.create(1)
|
||||
return False
|
||||
|
||||
def hookException(self, exctype, value, traceback):
|
||||
if not hasattr(self, u'mainWindow'):
|
||||
log.exception(''.join(format_exception(exctype, value, traceback)))
|
||||
@ -270,12 +221,16 @@ def main():
|
||||
qInitResources()
|
||||
# Now create and actually run the application.
|
||||
app = OpenLP(qt_args)
|
||||
# Define the settings environment
|
||||
QtCore.QSettings(u'OpenLP', u'OpenLP')
|
||||
# Instance check
|
||||
if app.isAlreadyRunning():
|
||||
sys.exit()
|
||||
app.setOrganizationName(u'OpenLP')
|
||||
app.setOrganizationDomain(u'openlp.org')
|
||||
app.setApplicationName(u'OpenLP')
|
||||
app.setApplicationVersion(get_application_version()[u'version'])
|
||||
# First time checks in settings
|
||||
# Use explicit reference as not inside a QT environment yet
|
||||
if QtCore.QSettings(u'OpenLP', u'OpenLP').value(
|
||||
u'general/first time', QtCore.QVariant(True)).toBool():
|
||||
if not QtCore.QSettings().value(u'general/has run wizard',
|
||||
QtCore.QVariant(False)).toBool():
|
||||
if not FirstTimeLanguageForm().exec_():
|
||||
# if cancel then stop processing
|
||||
sys.exit()
|
||||
|
@ -1 +1 @@
|
||||
1.9.2-bzr987
|
||||
1.9.5-bzr1421
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
@ -248,9 +248,8 @@ def resize_image(image, width, height, background=QtCore.Qt.black):
|
||||
``height``
|
||||
The new image height.
|
||||
|
||||
``background``
|
||||
``background``
|
||||
The background colour defaults to black.
|
||||
|
||||
"""
|
||||
log.debug(u'resize_image - start')
|
||||
if isinstance(image, QtGui.QImage):
|
||||
@ -317,8 +316,11 @@ def check_directory_exists(dir):
|
||||
Theme directory to make sure exists
|
||||
"""
|
||||
log.debug(u'check_directory_exists %s' % dir)
|
||||
if not os.path.exists(dir):
|
||||
os.makedirs(dir)
|
||||
try:
|
||||
if not os.path.exists(dir):
|
||||
os.makedirs(dir)
|
||||
except IOError:
|
||||
pass
|
||||
|
||||
from listwidgetwithdnd import ListWidgetWithDnD
|
||||
from displaytags import DisplayTags
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
@ -101,6 +101,10 @@ class EventReceiver(QtCore.QObject):
|
||||
``servicemanager_previous_item``
|
||||
Display the previous item in the service
|
||||
|
||||
``servicemanager_preview_live``
|
||||
Requests a Preview item from the Service Manager to update live and
|
||||
add a new item to the preview panel
|
||||
|
||||
``servicemanager_next_item``
|
||||
Display the next item in the service
|
||||
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode Woldsund #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# This program is free software; you can redistribute it and/or modify it #
|
||||
# under the terms of the GNU General Public License as published by the Free #
|
||||
@ -85,7 +85,12 @@ body {
|
||||
}
|
||||
/* lyric css */
|
||||
%s
|
||||
|
||||
sup {
|
||||
font-size:0.6em;
|
||||
vertical-align:top;
|
||||
position:relative;
|
||||
top:-0.3em;
|
||||
}
|
||||
</style>
|
||||
<script language="javascript">
|
||||
var timer = null;
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
@ -349,11 +349,11 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
Validates whether an image still exists and, if it does, is the
|
||||
thumbnail representation of the image up to date.
|
||||
"""
|
||||
if not os.path.exists(image):
|
||||
if not os.path.exists(unicode(image)):
|
||||
return False
|
||||
if os.path.exists(thumb):
|
||||
imageDate = os.stat(image).st_mtime
|
||||
thumbDate = os.stat(thumb).st_mtime
|
||||
imageDate = os.stat(unicode(image)).st_mtime
|
||||
thumbDate = os.stat(unicode(thumb)).st_mtime
|
||||
# If image has been updated rebuild icon
|
||||
if imageDate > thumbDate:
|
||||
self.iconFromFile(image, thumb)
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
@ -32,6 +32,7 @@ from PyQt4 import QtCore
|
||||
|
||||
from openlp.core.lib import Receiver
|
||||
from openlp.core.lib.ui import UiStrings
|
||||
from openlp.core.utils import get_application_version
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@ -114,8 +115,8 @@ class Plugin(QtCore.QObject):
|
||||
"""
|
||||
log.info(u'loaded')
|
||||
|
||||
def __init__(self, name, version=None, pluginHelpers=None,
|
||||
mediaItemClass=None, settingsTabClass=None):
|
||||
def __init__(self, name, pluginHelpers=None, mediaItemClass=None,
|
||||
settingsTabClass=None, version=None):
|
||||
"""
|
||||
This is the constructor for the plugin object. This provides an easy
|
||||
way for descendent plugins to populate common data. This method *must*
|
||||
@ -123,7 +124,7 @@ class Plugin(QtCore.QObject):
|
||||
|
||||
class MyPlugin(Plugin):
|
||||
def __init__(self):
|
||||
Plugin.__init__(self, u'MyPlugin', u'0.1')
|
||||
Plugin.__init__(self, u'MyPlugin', version=u'0.1')
|
||||
|
||||
``name``
|
||||
Defaults to *None*. The name of the plugin.
|
||||
@ -147,6 +148,8 @@ class Plugin(QtCore.QObject):
|
||||
self.nameStrings = self.textStrings[StringContent.Name]
|
||||
if version:
|
||||
self.version = version
|
||||
else:
|
||||
self.version = get_application_version()[u'version']
|
||||
self.settingsSection = self.name.lower()
|
||||
self.icon = None
|
||||
self.mediaItemClass = mediaItemClass
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
@ -49,16 +49,13 @@ class PluginManager(object):
|
||||
``plugin_dir``
|
||||
The directory to search for plugins.
|
||||
"""
|
||||
log.info(u'Plugin manager initing')
|
||||
log.info(u'Plugin manager Initialising')
|
||||
if not plugin_dir in sys.path:
|
||||
log.debug(u'Inserting %s into sys.path', plugin_dir)
|
||||
sys.path.insert(0, plugin_dir)
|
||||
self.basepath = os.path.abspath(plugin_dir)
|
||||
log.debug(u'Base path %s ', self.basepath)
|
||||
self.plugin_helpers = []
|
||||
self.plugins = []
|
||||
# this has to happen after the UI is sorted
|
||||
# self.find_plugins(plugin_dir)
|
||||
log.info(u'Plugin manager Initialised')
|
||||
|
||||
def find_plugins(self, plugin_dir, plugin_helpers):
|
||||
@ -73,7 +70,7 @@ class PluginManager(object):
|
||||
A list of helper objects to pass to the plugins.
|
||||
|
||||
"""
|
||||
self.plugin_helpers = plugin_helpers
|
||||
log.info(u'Finding plugins')
|
||||
startdepth = len(os.path.abspath(plugin_dir).split(os.sep))
|
||||
log.debug(u'finding plugins in %s at depth %d',
|
||||
unicode(plugin_dir), startdepth)
|
||||
@ -102,11 +99,11 @@ class PluginManager(object):
|
||||
plugin_objects = []
|
||||
for p in plugin_classes:
|
||||
try:
|
||||
plugin = p(self.plugin_helpers)
|
||||
log.debug(u'Loaded plugin %s with helpers', unicode(p))
|
||||
plugin = p(plugin_helpers)
|
||||
log.debug(u'Loaded plugin %s', unicode(p))
|
||||
plugin_objects.append(plugin)
|
||||
except TypeError:
|
||||
log.exception(u'loaded plugin %s has no helpers', unicode(p))
|
||||
log.exception(u'Failed to load plugin %s', unicode(p))
|
||||
plugins_list = sorted(plugin_objects, self.order_by_weight)
|
||||
for plugin in plugins_list:
|
||||
if plugin.checkPreConditions():
|
||||
@ -203,6 +200,7 @@ class PluginManager(object):
|
||||
Loop through all the plugins and give them an opportunity to
|
||||
initialise themselves.
|
||||
"""
|
||||
log.info(u'Initialise Plugins - Started')
|
||||
for plugin in self.plugins:
|
||||
log.info(u'initialising plugins %s in a %s state'
|
||||
% (plugin.name, plugin.isActive()))
|
||||
@ -211,6 +209,7 @@ class PluginManager(object):
|
||||
log.info(u'Initialisation Complete for %s ' % plugin.name)
|
||||
if not plugin.isActive():
|
||||
plugin.removeToolboxItem()
|
||||
log.info(u'Initialise Plugins - Finished')
|
||||
|
||||
def finalise_plugins(self):
|
||||
"""
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
@ -145,7 +145,8 @@ class RenderManager(object):
|
||||
else:
|
||||
self.theme = self.service_theme
|
||||
else:
|
||||
if theme:
|
||||
# Images have a theme of -1
|
||||
if theme and theme != -1:
|
||||
self.theme = theme
|
||||
elif theme_level == ThemeLevel.Song or \
|
||||
theme_level == ThemeLevel.Service:
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
@ -62,7 +62,7 @@ class ItemCapabilities(object):
|
||||
AddIfNewItem = 9
|
||||
ProvidesOwnDisplay = 10
|
||||
AllowsDetailedTitleDisplay = 11
|
||||
AllowsVarableStartTime = 12
|
||||
AllowsVariableStartTime = 12
|
||||
|
||||
|
||||
class ServiceItem(object):
|
||||
@ -109,7 +109,9 @@ class ServiceItem(object):
|
||||
self.edit_id = None
|
||||
self.xml_version = None
|
||||
self.start_time = 0
|
||||
self.end_time = 0
|
||||
self.media_length = 0
|
||||
self.from_service = False
|
||||
self._new_item()
|
||||
|
||||
def _new_item(self):
|
||||
@ -183,6 +185,11 @@ class ServiceItem(object):
|
||||
else:
|
||||
log.error(u'Invalid value renderer :%s' % self.service_item_type)
|
||||
self.title = clean_tags(self.title)
|
||||
# The footer should never be None, but to be compatible with a few
|
||||
# nightly builds between 1.9.4 and 1.9.5, we have to correct this to
|
||||
# avoid tracebacks.
|
||||
if self.raw_footer is None:
|
||||
self.raw_footer = []
|
||||
self.foot_text = \
|
||||
u'<br>'.join([footer for footer in self.raw_footer if footer])
|
||||
|
||||
@ -256,6 +263,7 @@ class ServiceItem(object):
|
||||
u'data': self.data_string,
|
||||
u'xml_version': self.xml_version,
|
||||
u'start_time': self.start_time,
|
||||
u'end_time': self.end_time,
|
||||
u'media_length': self.media_length
|
||||
}
|
||||
service_data = []
|
||||
@ -302,6 +310,8 @@ class ServiceItem(object):
|
||||
self.xml_version = header[u'xml_version']
|
||||
if u'start_time' in header:
|
||||
self.start_time = header[u'start_time']
|
||||
if u'end_time' in header:
|
||||
self.end_time = header[u'end_time']
|
||||
if u'media_length' in header:
|
||||
self.media_length = header[u'media_length']
|
||||
if self.service_item_type == ServiceItemType.Text:
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
@ -48,7 +48,7 @@ class OpenLPToolbar(QtGui.QToolBar):
|
||||
self.icons = {}
|
||||
self.setIconSize(QtCore.QSize(20, 20))
|
||||
self.actions = {}
|
||||
log.debug(u'Init done')
|
||||
log.debug(u'Init done for %s' % parent.__class__.__name__)
|
||||
|
||||
def addToolbarButton(self, title, icon, tooltip=None, slot=None,
|
||||
checkable=False, shortcut=0, alternate=0,
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
@ -49,6 +49,7 @@ class UiStrings(object):
|
||||
Cancel = translate('OpenLP.Ui', 'Cancel')
|
||||
CCLINumberLabel = translate('OpenLP.Ui', 'CCLI number:')
|
||||
CreateService = translate('OpenLP.Ui', 'Create a new service.')
|
||||
Default = unicode(translate('OpenLP.Ui', 'Default'))
|
||||
Delete = translate('OpenLP.Ui', '&Delete')
|
||||
Edit = translate('OpenLP.Ui', '&Edit')
|
||||
EmptyField = translate('OpenLP.Ui', 'Empty Field')
|
||||
@ -56,6 +57,7 @@ class UiStrings(object):
|
||||
Export = translate('OpenLP.Ui', 'Export')
|
||||
FontSizePtUnit = translate('OpenLP.Ui', 'pt',
|
||||
'Abbreviated font pointsize unit')
|
||||
Hours = translate('OpenLP.Ui', 'h', 'The abbreviated unit for hours')
|
||||
Image = translate('OpenLP.Ui', 'Image')
|
||||
Import = translate('OpenLP.Ui', 'Import')
|
||||
LengthTime = unicode(translate('OpenLP.Ui', 'Length %s'))
|
||||
@ -63,6 +65,7 @@ class UiStrings(object):
|
||||
LiveBGError = translate('OpenLP.Ui', 'Live Background Error')
|
||||
LivePanel = translate('OpenLP.Ui', 'Live Panel')
|
||||
Load = translate('OpenLP.Ui', 'Load')
|
||||
Minutes = translate('OpenLP.Ui', 'm', 'The abbreviated unit for minutes')
|
||||
Middle = translate('OpenLP.Ui', 'Middle')
|
||||
New = translate('OpenLP.Ui', 'New')
|
||||
NewService = translate('OpenLP.Ui', 'New Service')
|
||||
@ -73,6 +76,8 @@ class UiStrings(object):
|
||||
NISp = translate('OpenLP.Ui', 'No Items Selected', 'Plural')
|
||||
OLPV1 = translate('OpenLP.Ui', 'openlp.org 1.x')
|
||||
OLPV2 = translate('OpenLP.Ui', 'OpenLP 2.0')
|
||||
OpenLPStart = translate('OpenLP.Ui', 'OpenLP is already running. Do you '
|
||||
'wish to continue?')
|
||||
OpenService = translate('OpenLP.Ui', 'Open Service')
|
||||
Preview = translate('OpenLP.Ui', 'Preview')
|
||||
PreviewPanel = translate('OpenLP.Ui', 'Preview Panel')
|
||||
@ -81,7 +86,7 @@ class UiStrings(object):
|
||||
ReplaceLiveBG = translate('OpenLP.Ui', 'Replace Live Background')
|
||||
ResetBG = translate('OpenLP.Ui', 'Reset Background')
|
||||
ResetLiveBG = translate('OpenLP.Ui', 'Reset Live Background')
|
||||
S = translate('OpenLP.Ui', 's', 'The abbreviated unit for seconds')
|
||||
Seconds = 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.')
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
@ -112,32 +112,32 @@ class Ui_AboutDialog(object):
|
||||
u'Andreas "googol" Preikschat', u'Raoul "superfly" Snyman',
|
||||
u'Martin "mijiti" Thompson', u'Jon "Meths" Tibble']
|
||||
contributors = [u'Scott "sguerrieri" Guerrieri',
|
||||
u'Meinert "m2j" Jordan', u'Armin "orangeshirt" K\xf6hler',
|
||||
u'Matthias "matthub" Hub', u'Meinert "m2j" Jordan',
|
||||
u'Armin "orangeshirt" K\xf6hler', u'Mattias "mahfiaz" P\xf5ldaru',
|
||||
u'Christian "crichter" Richter', u'Philip "Phill" Ridout',
|
||||
u'Jeffrey "whydoubt" Smith', u'Maikel Stuivenberg',
|
||||
u'Carsten "catini" Tingaard', u'Frode "frodus" Woldsund']
|
||||
u'Frode "frodus" Woldsund']
|
||||
testers = [u'Philip "Phill" Ridout', u'Wesley "wrst" Stout',
|
||||
u'John "jseagull1" Cegalis (lead)']
|
||||
packagers = ['Thomas "tabthorpe" Abthorpe (FreeBSD)',
|
||||
u'Tim "TRB143" Bentley (Fedora)',
|
||||
u'Michael "cocooncrash" Gorven (Ubuntu)',
|
||||
u'Matthias "matthub" Hub (Mac OS X)',
|
||||
u'Raoul "superfly" Snyman (Windows, Ubuntu)']
|
||||
u'Stevan "StevanP" Pettit (Windows)',
|
||||
u'Raoul "superfly" Snyman (Ubuntu)']
|
||||
translators = {
|
||||
u'af': [u'Johan "nuvolari" Mynhardt'],
|
||||
u'de': [u'Patrick "madmuffin" Br\xfcckner',
|
||||
u'Meinert "m2j" Jordan',
|
||||
u'Andreas "googol" Preikschat',
|
||||
u'Meinert "m2j" Jordan', u'Andreas "googol" Preikschat',
|
||||
u'Christian "crichter" Richter'],
|
||||
u'en_GB': [u'Tim "TRB143" Bentley', u'Jonathan "gushie" Corwin'],
|
||||
u'en_ZA': [u'Raoul "superfly" Snyman'],
|
||||
u'et': [u'Mattias "mahfiaz" P\xf5ldaru'],
|
||||
u'fr': [u'Stephan\xe9 "stbrunner" Brunner'],
|
||||
u'hu': [u'Gyuris Gellért'],
|
||||
u'hu': [u'Gyuris Gell\xe9rt'],
|
||||
u'ja': [u'Kunio "Kunio" Nakamaru'],
|
||||
u'nb': [u'Atle "pendlaren" Weibell', u'Frode "frodus" Woldsund'],
|
||||
u'nl': [u'Arjen "typovar" van Voorst'],
|
||||
u'pt_BR': [u'Rafael "rafaellerm" Lerm'],
|
||||
u'pt_BR': [u'Rafael "rafaellerm" Lerm', u'Gustavo Bim'],
|
||||
u'ru': [u'Sergey "ratz" Ratz']
|
||||
}
|
||||
documentors = [u'Wesley "wrst" Stout',
|
||||
@ -226,7 +226,7 @@ class Ui_AboutDialog(object):
|
||||
'Portions copyright \xa9 2004-2011 '
|
||||
'Tim Bentley, Jonathan Corwin, Michael Gorven, Scott Guerrieri,\n'
|
||||
'Meinert Jordan, Andreas Preikschat, Christian Richter, Philip\n'
|
||||
'Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, Carstenn'
|
||||
'Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, Carsten\n'
|
||||
'Tinggaard, Frode Woldsund')
|
||||
licence = translate('OpenLP.AboutForm',
|
||||
'This program is free software; you can redistribute it and/or '
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode Woldsund #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# This program is free software; you can redistribute it and/or modify it #
|
||||
# under the terms of the GNU General Public License as published by the Free #
|
||||
@ -28,25 +28,26 @@ from PyQt4 import QtCore, QtGui
|
||||
|
||||
from aboutdialog import Ui_AboutDialog
|
||||
from openlp.core.lib import translate
|
||||
from openlp.core.utils import get_application_version
|
||||
|
||||
class AboutForm(QtGui.QDialog, Ui_AboutDialog):
|
||||
"""
|
||||
The About dialog
|
||||
"""
|
||||
|
||||
def __init__(self, parent, applicationVersion):
|
||||
def __init__(self, parent):
|
||||
"""
|
||||
Do some initialisation stuff
|
||||
"""
|
||||
QtGui.QDialog.__init__(self, parent)
|
||||
self.applicationVersion = applicationVersion
|
||||
applicationVersion = get_application_version()
|
||||
self.setupUi(self)
|
||||
about_text = self.aboutTextEdit.toPlainText()
|
||||
about_text = about_text.replace(u'<version>',
|
||||
self.applicationVersion[u'version'])
|
||||
if self.applicationVersion[u'build']:
|
||||
applicationVersion[u'version'])
|
||||
if applicationVersion[u'build']:
|
||||
build_text = unicode(translate('OpenLP.AboutForm', ' build %s')) % \
|
||||
self.applicationVersion[u'build']
|
||||
applicationVersion[u'build']
|
||||
else:
|
||||
build_text = u''
|
||||
about_text = about_text.replace(u'<revision>', build_text)
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
@ -143,11 +143,11 @@ class Ui_DisplayTagDialog(object):
|
||||
self.tagTableWidget.horizontalHeaderItem(0).setText(
|
||||
translate('OpenLP.DisplayTagDialog', 'Description'))
|
||||
self.tagTableWidget.horizontalHeaderItem(1).setText(
|
||||
translate('OpenLP.DisplayTagDialog', 'Tag id'))
|
||||
translate('OpenLP.DisplayTagDialog', 'Tag Id'))
|
||||
self.tagTableWidget.horizontalHeaderItem(2).setText(
|
||||
translate('OpenLP.DisplayTagDialog', 'Start Html'))
|
||||
translate('OpenLP.DisplayTagDialog', 'Start HTML'))
|
||||
self.tagTableWidget.horizontalHeaderItem(3).setText(
|
||||
translate('OpenLP.DisplayTagDialog', 'End Html'))
|
||||
translate('OpenLP.DisplayTagDialog', 'End HTML'))
|
||||
self.tagTableWidget.setColumnWidth(0, 120)
|
||||
self.tagTableWidget.setColumnWidth(1, 40)
|
||||
self.tagTableWidget.setColumnWidth(2, 240)
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
@ -57,6 +57,7 @@ except ImportError:
|
||||
from openlp.core.lib import translate, SettingsManager
|
||||
from openlp.core.lib.mailto import mailto
|
||||
from openlp.core.lib.ui import UiStrings
|
||||
from openlp.core.utils import get_application_version
|
||||
|
||||
from exceptiondialog import Ui_ExceptionDialog
|
||||
|
||||
@ -78,7 +79,7 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog):
|
||||
return QtGui.QDialog.exec_(self)
|
||||
|
||||
def _createReport(self):
|
||||
openlp_version = self.parent().applicationVersion[u'full']
|
||||
openlp_version = get_application_version()
|
||||
description = unicode(self.descriptionTextEdit.toPlainText())
|
||||
traceback = unicode(self.exceptionTextEdit.toPlainText())
|
||||
system = unicode(translate('OpenLP.ExceptionForm',
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode Woldsund #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# This program is free software; you can redistribute it and/or modify it #
|
||||
# under the terms of the GNU General Public License as published by the Free #
|
||||
@ -24,19 +24,19 @@
|
||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||
###############################################################################
|
||||
|
||||
import ConfigParser
|
||||
import io
|
||||
import logging
|
||||
import os
|
||||
import urllib
|
||||
from tempfile import gettempdir
|
||||
from ConfigParser import SafeConfigParser
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from firsttimewizard import Ui_FirstTimeWizard
|
||||
|
||||
from openlp.core.lib import translate, PluginStatus, check_directory_exists, \
|
||||
Receiver
|
||||
from openlp.core.lib import translate, PluginStatus, Receiver, build_icon, \
|
||||
check_directory_exists
|
||||
from openlp.core.utils import get_web_page, AppLocation
|
||||
from firsttimewizard import Ui_FirstTimeWizard, FirstTimePage
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@ -48,24 +48,23 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
|
||||
log.info(u'ThemeWizardForm loaded')
|
||||
|
||||
def __init__(self, screens, parent=None):
|
||||
QtGui.QWizard.__init__(self, parent)
|
||||
self.setupUi(self)
|
||||
self.screens = screens
|
||||
# check to see if we have web access
|
||||
self.web = u'http://openlp.org/files/frw/'
|
||||
self.config = ConfigParser.ConfigParser()
|
||||
self.config = SafeConfigParser()
|
||||
self.webAccess = get_web_page(u'%s%s' % (self.web, u'download.cfg'))
|
||||
if self.webAccess:
|
||||
files = self.webAccess.read()
|
||||
self.config.readfp(io.BytesIO(files))
|
||||
QtGui.QWizard.__init__(self, parent)
|
||||
self.setupUi(self)
|
||||
for screen in screens.get_screen_list():
|
||||
self.displaySelectionComboBox.addItem(screen)
|
||||
self.songsText = translate('OpenLP.FirstTimeWizard', 'Songs')
|
||||
self.biblesText = translate('OpenLP.FirstTimeWizard', 'Bibles')
|
||||
self.themesText = translate('OpenLP.FirstTimeWizard', 'Themes')
|
||||
self.startUpdates = translate('OpenLP.FirstTimeWizard',
|
||||
'Starting Updates')
|
||||
self.updateScreenListCombo()
|
||||
self.downloading = unicode(translate('OpenLP.FirstTimeWizard',
|
||||
'Downloading %s'))
|
||||
'Downloading %s...'))
|
||||
QtCore.QObject.connect(self,
|
||||
QtCore.SIGNAL(u'currentIdChanged(int)'), self.onCurrentIdChanged)
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'config_screen_changed'), self.updateScreenListCombo)
|
||||
|
||||
def exec_(self, edit=False):
|
||||
"""
|
||||
@ -79,134 +78,235 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
|
||||
Set up display at start of theme edit.
|
||||
"""
|
||||
self.restart()
|
||||
check_directory_exists(os.path.join(gettempdir(), u'openlp'))
|
||||
# Sort out internet access for downloads
|
||||
if self.webAccess:
|
||||
self.internetGroupBox.setVisible(True)
|
||||
self.noInternetLabel.setVisible(False)
|
||||
# If songs database exists do not allow a copy
|
||||
songs = os.path.join(AppLocation.get_section_data_path(u'songs'),
|
||||
u'songs.sqlite')
|
||||
if not os.path.exists(songs):
|
||||
treewidgetitem = QtGui.QTreeWidgetItem(self.selectionTreeWidget)
|
||||
treewidgetitem.setText(0, self.songsText)
|
||||
self._loadChild(treewidgetitem, u'songs', u'languages', u'songs')
|
||||
treewidgetitem = QtGui.QTreeWidgetItem(self.selectionTreeWidget)
|
||||
treewidgetitem.setText(0, self.biblesText)
|
||||
self._loadChild(treewidgetitem, u'bibles', u'translations',
|
||||
u'bible')
|
||||
treewidgetitem = QtGui.QTreeWidgetItem(self.selectionTreeWidget)
|
||||
treewidgetitem.setText(0, self.themesText)
|
||||
self._loadChild(treewidgetitem, u'themes', u'files', 'theme')
|
||||
songs = self.config.get(u'songs', u'languages')
|
||||
songs = songs.split(u',')
|
||||
for song in songs:
|
||||
title = unicode(self.config.get(
|
||||
u'songs_%s' % song, u'title'), u'utf8')
|
||||
filename = unicode(self.config.get(
|
||||
u'songs_%s' % song, u'filename'), u'utf8')
|
||||
item = QtGui.QListWidgetItem(title, self.songsListWidget)
|
||||
item.setData(QtCore.Qt.UserRole, QtCore.QVariant(filename))
|
||||
item.setCheckState(QtCore.Qt.Unchecked)
|
||||
item.setFlags(item.flags() | QtCore.Qt.ItemIsUserCheckable)
|
||||
bible_languages = self.config.get(u'bibles', u'languages')
|
||||
bible_languages = bible_languages.split(u',')
|
||||
for lang in bible_languages:
|
||||
language = unicode(self.config.get(
|
||||
u'bibles_%s' % lang, u'title'), u'utf8')
|
||||
langItem = QtGui.QTreeWidgetItem(
|
||||
self.biblesTreeWidget, QtCore.QStringList(language))
|
||||
bibles = self.config.get(u'bibles_%s' % lang, u'translations')
|
||||
bibles = bibles.split(u',')
|
||||
for bible in bibles:
|
||||
title = unicode(self.config.get(
|
||||
u'bible_%s' % bible, u'title'), u'utf8')
|
||||
filename = unicode(self.config.get(
|
||||
u'bible_%s' % bible, u'filename'))
|
||||
item = QtGui.QTreeWidgetItem(
|
||||
langItem, QtCore.QStringList(title))
|
||||
item.setData(0, QtCore.Qt.UserRole,
|
||||
QtCore.QVariant(filename))
|
||||
item.setCheckState(0, QtCore.Qt.Unchecked)
|
||||
item.setFlags(item.flags() | QtCore.Qt.ItemIsUserCheckable)
|
||||
self.biblesTreeWidget.expandAll()
|
||||
themes = self.config.get(u'themes', u'files')
|
||||
themes = themes.split(u',')
|
||||
for theme in themes:
|
||||
title = self.config.get(u'theme_%s' % theme, u'title')
|
||||
filename = self.config.get(u'theme_%s' % theme, u'filename')
|
||||
screenshot = self.config.get(u'theme_%s' % theme, u'screenshot')
|
||||
urllib.urlretrieve(u'%s/%s' % (self.web, screenshot),
|
||||
os.path.join(gettempdir(), u'openlp', screenshot))
|
||||
item = QtGui.QListWidgetItem(title, self.themesListWidget)
|
||||
item.setData(QtCore.Qt.UserRole,
|
||||
QtCore.QVariant(filename))
|
||||
item.setIcon(build_icon(
|
||||
os.path.join(gettempdir(), u'openlp', screenshot)))
|
||||
item.setCheckState(QtCore.Qt.Unchecked)
|
||||
item.setFlags(item.flags() | QtCore.Qt.ItemIsUserCheckable)
|
||||
|
||||
def nextId(self):
|
||||
"""
|
||||
Determine the next page in the Wizard to go to.
|
||||
"""
|
||||
if self.currentId() == FirstTimePage.Plugins:
|
||||
if not self.webAccess:
|
||||
return FirstTimePage.NoInternet
|
||||
else:
|
||||
return FirstTimePage.Songs
|
||||
elif self.currentId() == FirstTimePage.Progress:
|
||||
return -1
|
||||
else:
|
||||
self.internetGroupBox.setVisible(False)
|
||||
self.noInternetLabel.setVisible(True)
|
||||
return self.currentId() + 1
|
||||
|
||||
def _loadChild(self, tree, list, tag, root):
|
||||
files = self.config.get(list, tag)
|
||||
files = files.split(u',')
|
||||
for file in files:
|
||||
if file:
|
||||
child = QtGui.QTreeWidgetItem(tree)
|
||||
child.setText(0, self.config.get(u'%s_%s'
|
||||
% (root, file), u'title'))
|
||||
child.setData(0, QtCore.Qt.UserRole,
|
||||
QtCore.QVariant(self.config.get(u'%s_%s'
|
||||
% (root, file), u'filename')))
|
||||
child.setCheckState(0, QtCore.Qt.Unchecked)
|
||||
child.setFlags(QtCore.Qt.ItemIsUserCheckable |
|
||||
QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled)
|
||||
|
||||
def initializePage(self, id):
|
||||
def onCurrentIdChanged(self, pageId):
|
||||
"""
|
||||
Set up the pages for Initial run through dialog
|
||||
Detects Page changes and updates as approprate.
|
||||
"""
|
||||
wizardPage = self.page(id)
|
||||
if wizardPage == self.DefaultsPage:
|
||||
listIterator = QtGui.QTreeWidgetItemIterator(
|
||||
self.selectionTreeWidget)
|
||||
while listIterator.value():
|
||||
parent = listIterator.value().parent()
|
||||
if parent and listIterator.value().checkState(0) \
|
||||
== QtCore.Qt.Checked:
|
||||
if unicode(parent.text(0)) == self.themesText:
|
||||
self.themeSelectionComboBox.addItem(
|
||||
listIterator.value().text(0))
|
||||
listIterator += 1
|
||||
if pageId == FirstTimePage.NoInternet:
|
||||
self.finishButton.setVisible(True)
|
||||
self.finishButton.setEnabled(True)
|
||||
self.nextButton.setVisible(False)
|
||||
elif pageId == FirstTimePage.Defaults:
|
||||
self.themeComboBox.clear()
|
||||
for iter in xrange(self.themesListWidget.count()):
|
||||
item = self.themesListWidget.item(iter)
|
||||
if item.checkState() == QtCore.Qt.Checked:
|
||||
self.themeComboBox.addItem(item.text())
|
||||
elif pageId == FirstTimePage.Progress:
|
||||
self._preWizard()
|
||||
self._performWizard()
|
||||
self._postWizard()
|
||||
|
||||
def accept(self):
|
||||
self._updateMessage(self.startUpdates)
|
||||
# Set up the Plugin status's
|
||||
self._pluginStatus(self.songsCheckBox, u'songs/status')
|
||||
self._pluginStatus(self.bibleCheckBox, u'bibles/status')
|
||||
self._pluginStatus(self.presentationCheckBox, u'presentations/status')
|
||||
self._pluginStatus(self.imageCheckBox, u'images/status')
|
||||
self._pluginStatus(self.mediaCheckBox, u'media/status')
|
||||
self._pluginStatus(self.remoteCheckBox, u'remotes/status')
|
||||
self._pluginStatus(self.customCheckBox, u'custom/status')
|
||||
self._pluginStatus(self.songUsageCheckBox, u'songusage/status')
|
||||
self._pluginStatus(self.alertCheckBox, u'alerts/status')
|
||||
def updateScreenListCombo(self):
|
||||
"""
|
||||
The user changed screen resolution or enabled/disabled more screens, so
|
||||
we need to update the combo box.
|
||||
"""
|
||||
self.displayComboBox.clear()
|
||||
self.displayComboBox.addItems(self.screens.get_screen_list())
|
||||
self.displayComboBox.setCurrentIndex(self.displayComboBox.count() - 1)
|
||||
|
||||
def _getFileSize(self, url):
|
||||
site = urllib.urlopen(url)
|
||||
meta = site.info()
|
||||
return int(meta.getheaders("Content-Length")[0])
|
||||
|
||||
def _downloadProgress(self, count, block_size, total_size):
|
||||
increment = (count * block_size) - self.previous_size
|
||||
self._incrementProgressBar(None, increment)
|
||||
self.previous_size = count * block_size
|
||||
|
||||
def _incrementProgressBar(self, status_text, increment=1):
|
||||
"""
|
||||
Update the wizard progress page.
|
||||
|
||||
``status_text``
|
||||
Current status information to display.
|
||||
|
||||
``increment``
|
||||
The value to increment the progress bar by.
|
||||
"""
|
||||
if status_text:
|
||||
self.progressLabel.setText(status_text)
|
||||
if increment > 0:
|
||||
self.progressBar.setValue(self.progressBar.value() + increment)
|
||||
Receiver.send_message(u'openlp_process_events')
|
||||
|
||||
def _preWizard(self):
|
||||
"""
|
||||
Prepare the UI for the process.
|
||||
"""
|
||||
# We start on 2 for plugins status setting plus a "finished" point.
|
||||
max_progress = 2
|
||||
# Loop through the songs list and increase for each selected item
|
||||
for i in xrange(self.songsListWidget.count()):
|
||||
item = self.songsListWidget.item(i)
|
||||
if item.checkState() == QtCore.Qt.Checked:
|
||||
filename = item.data(QtCore.Qt.UserRole).toString()
|
||||
size = self._getFileSize(u'%s%s' % (self.web, filename))
|
||||
max_progress += size
|
||||
# Loop through the Bibles list and increase for each selected item
|
||||
iterator = QtGui.QTreeWidgetItemIterator(self.biblesTreeWidget)
|
||||
while iterator.value():
|
||||
item = iterator.value()
|
||||
if item.parent() and item.checkState(0) == QtCore.Qt.Checked:
|
||||
filename = item.data(0, QtCore.Qt.UserRole).toString()
|
||||
size = self._getFileSize(u'%s%s' % (self.web, filename))
|
||||
max_progress += size
|
||||
iterator += 1
|
||||
# Loop through the themes list and increase for each selected item
|
||||
for i in xrange(self.themesListWidget.count()):
|
||||
item = self.themesListWidget.item(i)
|
||||
if item.checkState() == QtCore.Qt.Checked:
|
||||
filename = item.data(QtCore.Qt.UserRole).toString()
|
||||
size = self._getFileSize(u'%s%s' % (self.web, filename))
|
||||
max_progress += size
|
||||
self.finishButton.setVisible(False)
|
||||
self.progressBar.setValue(0)
|
||||
self.progressBar.setMinimum(0)
|
||||
self.progressBar.setMaximum(max_progress)
|
||||
|
||||
def _postWizard(self):
|
||||
"""
|
||||
Clean up the UI after the process has finished.
|
||||
"""
|
||||
self.progressBar.setValue(self.progressBar.maximum())
|
||||
self.finishButton.setVisible(True)
|
||||
self.finishButton.setEnabled(True)
|
||||
self.cancelButton.setVisible(False)
|
||||
self.nextButton.setVisible(False)
|
||||
self.progressLabel.setText(translate('OpenLP.FirstTimeWizard',
|
||||
'Download complete. Click the finish button to start OpenLP.'))
|
||||
Receiver.send_message(u'openlp_process_events')
|
||||
|
||||
def _performWizard(self):
|
||||
"""
|
||||
Run the tasks in the wizard.
|
||||
"""
|
||||
# Set plugin states
|
||||
self._incrementProgressBar(translate('OpenLP.FirstTimeWizard',
|
||||
'Enabling selected plugins...'))
|
||||
self._setPluginStatus(self.songsCheckBox, u'songs/status')
|
||||
self._setPluginStatus(self.bibleCheckBox, u'bibles/status')
|
||||
self._setPluginStatus(self.presentationCheckBox,
|
||||
u'presentations/status')
|
||||
self._setPluginStatus(self.imageCheckBox, u'images/status')
|
||||
self._setPluginStatus(self.mediaCheckBox, u'media/status')
|
||||
self._setPluginStatus(self.remoteCheckBox, u'remotes/status')
|
||||
self._setPluginStatus(self.customCheckBox, u'custom/status')
|
||||
self._setPluginStatus(self.songUsageCheckBox, u'songusage/status')
|
||||
self._setPluginStatus(self.alertCheckBox, u'alerts/status')
|
||||
# Build directories for downloads
|
||||
songsDestination = AppLocation.get_section_data_path(u'songs')
|
||||
check_directory_exists(songsDestination)
|
||||
bibleDestination = AppLocation.get_section_data_path(u'bibles')
|
||||
check_directory_exists(bibleDestination)
|
||||
themeDestination = AppLocation.get_section_data_path(u'themes')
|
||||
check_directory_exists(themeDestination)
|
||||
# Install Selected Items looping through them
|
||||
listIterator = QtGui.QTreeWidgetItemIterator(self.selectionTreeWidget)
|
||||
while listIterator.value():
|
||||
type = listIterator.value().parent()
|
||||
if listIterator.value().parent():
|
||||
if listIterator.value().checkState(0) == QtCore.Qt.Checked:
|
||||
# Install items as theu have been selected
|
||||
item = unicode(listIterator.value().text(0))
|
||||
# Download Song database if selected
|
||||
if unicode(type.text(0)) == self.songsText:
|
||||
songs = unicode(listIterator.value().data(0,
|
||||
QtCore.Qt.UserRole).toString())
|
||||
message = self.downloading % item
|
||||
self._updateMessage(message)
|
||||
# Song database is a fixed file name
|
||||
urllib.urlretrieve(u'%s%s' % (self.web, songs),
|
||||
os.path.join(songsDestination, u'songs.sqlite'))
|
||||
# Download and selected Bibles
|
||||
if unicode(type.text(0)) == self.biblesText:
|
||||
bible = unicode(listIterator.value().data(0,
|
||||
QtCore.Qt.UserRole).toString())
|
||||
message = self.downloading % item
|
||||
self._updateMessage(message)
|
||||
urllib.urlretrieve(u'%s%s' % (self.web, bible),
|
||||
os.path.join(bibleDestination, bible))
|
||||
# Download any themes
|
||||
if unicode(type.text(0)) == self.themesText:
|
||||
theme = unicode(listIterator.value().data(0,
|
||||
QtCore.Qt.UserRole).toString())
|
||||
message = self.downloading % item
|
||||
self._updateMessage(message)
|
||||
urllib.urlretrieve(u'%s%s' % (self.web, theme),
|
||||
os.path.join(themeDestination, theme))
|
||||
listIterator += 1
|
||||
songs_destination = os.path.join(unicode(gettempdir()), u'openlp')
|
||||
bibles_destination = AppLocation.get_section_data_path(u'bibles')
|
||||
themes_destination = AppLocation.get_section_data_path(u'themes')
|
||||
# Download songs
|
||||
for i in xrange(self.songsListWidget.count()):
|
||||
item = self.songsListWidget.item(i)
|
||||
if item.checkState() == QtCore.Qt.Checked:
|
||||
filename = item.data(QtCore.Qt.UserRole).toString()
|
||||
self._incrementProgressBar(self.downloading % filename, 0)
|
||||
self.previous_size = 0
|
||||
destination = os.path.join(songs_destination, unicode(filename))
|
||||
urllib.urlretrieve(u'%s%s' % (self.web, filename), destination,
|
||||
self._downloadProgress)
|
||||
# Download Bibles
|
||||
bibles_iterator = QtGui.QTreeWidgetItemIterator(self.biblesTreeWidget)
|
||||
while bibles_iterator.value():
|
||||
item = bibles_iterator.value()
|
||||
if item.parent() and item.checkState(0) == QtCore.Qt.Checked:
|
||||
bible = unicode(item.data(0, QtCore.Qt.UserRole).toString())
|
||||
self._incrementProgressBar(self.downloading % bible, 0)
|
||||
self.previous_size = 0
|
||||
urllib.urlretrieve(u'%s%s' % (self.web, bible),
|
||||
os.path.join(bibles_destination, bible),
|
||||
self._downloadProgress)
|
||||
bibles_iterator += 1
|
||||
# Download themes
|
||||
for i in xrange(self.themesListWidget.count()):
|
||||
item = self.themesListWidget.item(i)
|
||||
if item.checkState() == QtCore.Qt.Checked:
|
||||
theme = unicode(item.data(QtCore.Qt.UserRole).toString())
|
||||
self._incrementProgressBar(self.downloading % theme, 0)
|
||||
self.previous_size = 0
|
||||
urllib.urlretrieve(u'%s%s' % (self.web, theme),
|
||||
os.path.join(themes_destination, theme),
|
||||
self._downloadProgress)
|
||||
# Set Default Display
|
||||
if self.displaySelectionComboBox.currentIndex() != -1:
|
||||
if self.displayComboBox.currentIndex() != -1:
|
||||
QtCore.QSettings().setValue(u'General/monitor',
|
||||
QtCore.QVariant(self.displaySelectionComboBox.
|
||||
currentIndex()))
|
||||
QtCore.QVariant(self.displayComboBox.currentIndex()))
|
||||
# Set Global Theme
|
||||
if self.themeSelectionComboBox.currentIndex() != -1:
|
||||
if self.themeComboBox.currentIndex() != -1:
|
||||
QtCore.QSettings().setValue(u'themes/global theme',
|
||||
QtCore.QVariant(self.themeSelectionComboBox.currentText()))
|
||||
QtCore.QSettings().setValue(u'general/first time',
|
||||
QtCore.QVariant(False))
|
||||
return QtGui.QWizard.accept(self)
|
||||
QtCore.QVariant(self.themeComboBox.currentText()))
|
||||
|
||||
def _pluginStatus(self, field, tag):
|
||||
def _setPluginStatus(self, field, tag):
|
||||
status = PluginStatus.Active if field.checkState() \
|
||||
== QtCore.Qt.Checked else PluginStatus.Inactive
|
||||
QtCore.QSettings().setValue(tag, QtCore.QVariant(status))
|
||||
|
||||
def _updateMessage(self, text):
|
||||
"""
|
||||
Keep screen up to date
|
||||
"""
|
||||
self.updateLabel.setText(text)
|
||||
Receiver.send_message(u'openlp_process_events')
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
@ -30,26 +30,38 @@ from openlp.core.lib import translate
|
||||
from openlp.core.lib.ui import create_accept_reject_button_box
|
||||
|
||||
class Ui_FirstTimeLanguageDialog(object):
|
||||
def setupUi(self, firstTimeLanguageDialog):
|
||||
firstTimeLanguageDialog.setObjectName(u'firstTimeLanguageDialog')
|
||||
firstTimeLanguageDialog.resize(300, 10)
|
||||
self.dialogLayout = QtGui.QGridLayout(firstTimeLanguageDialog)
|
||||
def setupUi(self, languageDialog):
|
||||
languageDialog.setObjectName(u'languageDialog')
|
||||
languageDialog.resize(300, 50)
|
||||
self.dialogLayout = QtGui.QVBoxLayout(languageDialog)
|
||||
self.dialogLayout.setContentsMargins(8, 8, 8, 8)
|
||||
self.dialogLayout.setSpacing(8)
|
||||
self.dialogLayout.setObjectName(u'dialogLayout')
|
||||
self.fileNameLabel = QtGui.QLabel(firstTimeLanguageDialog)
|
||||
self.fileNameLabel.setObjectName(u'fileNameLabel')
|
||||
self.dialogLayout.addWidget(self.fileNameLabel, 0, 0)
|
||||
self.LanguageComboBox = QtGui.QComboBox(firstTimeLanguageDialog)
|
||||
self.LanguageComboBox.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToContents)
|
||||
self.LanguageComboBox.setObjectName("LanguageComboBox")
|
||||
self.dialogLayout.addWidget(self.LanguageComboBox, 0, 1)
|
||||
self.buttonBox = create_accept_reject_button_box(firstTimeLanguageDialog, True)
|
||||
self.dialogLayout.addWidget(self.buttonBox, 1, 0, 1, 2)
|
||||
self.retranslateUi(firstTimeLanguageDialog)
|
||||
self.setMaximumHeight(self.sizeHint().height())
|
||||
QtCore.QMetaObject.connectSlotsByName(firstTimeLanguageDialog)
|
||||
self.infoLabel = QtGui.QLabel(languageDialog)
|
||||
self.infoLabel.setObjectName(u'infoLabel')
|
||||
self.dialogLayout.addWidget(self.infoLabel)
|
||||
self.languageLayout = QtGui.QHBoxLayout()
|
||||
self.languageLayout.setObjectName(u'languageLayout')
|
||||
self.languageLabel = QtGui.QLabel(languageDialog)
|
||||
self.languageLabel.setObjectName(u'languageLabel')
|
||||
self.languageLayout.addWidget(self.languageLabel)
|
||||
self.languageComboBox = QtGui.QComboBox(languageDialog)
|
||||
self.languageComboBox.setSizeAdjustPolicy(
|
||||
QtGui.QComboBox.AdjustToContents)
|
||||
self.languageComboBox.setObjectName("languageComboBox")
|
||||
self.languageLayout.addWidget(self.languageComboBox)
|
||||
self.dialogLayout.addLayout(self.languageLayout)
|
||||
self.buttonBox = create_accept_reject_button_box(languageDialog, True)
|
||||
self.dialogLayout.addWidget(self.buttonBox)
|
||||
|
||||
def retranslateUi(self, firstTimeLanguageDialog):
|
||||
self.retranslateUi(languageDialog)
|
||||
self.setMaximumHeight(self.sizeHint().height())
|
||||
QtCore.QMetaObject.connectSlotsByName(languageDialog)
|
||||
|
||||
def retranslateUi(self, languageDialog):
|
||||
self.setWindowTitle(translate('OpenLP.FirstTimeLanguageForm',
|
||||
'Initial Set up Language'))
|
||||
self.fileNameLabel.setText(translate('OpenLP.FirstTimeLanguageForm',
|
||||
'Initial Language:'))
|
||||
'Select Translation'))
|
||||
self.infoLabel.setText(translate('OpenLP.FirstTimeLanguageForm',
|
||||
'Choose the translation you\'d like to use in OpenLP.'))
|
||||
self.languageLabel.setText(translate('OpenLP.FirstTimeLanguageForm',
|
||||
'Translation:'))
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode Woldsund #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# This program is free software; you can redistribute it and/or modify it #
|
||||
# under the terms of the GNU General Public License as published by the Free #
|
||||
@ -26,10 +26,8 @@
|
||||
|
||||
from PyQt4 import QtGui
|
||||
|
||||
from firsttimelanguagedialog import Ui_FirstTimeLanguageDialog
|
||||
|
||||
from openlp.core.lib import translate
|
||||
from openlp.core.utils import LanguageManager
|
||||
from firsttimelanguagedialog import Ui_FirstTimeLanguageDialog
|
||||
|
||||
class FirstTimeLanguageForm(QtGui.QDialog, Ui_FirstTimeLanguageDialog):
|
||||
"""
|
||||
@ -39,9 +37,9 @@ class FirstTimeLanguageForm(QtGui.QDialog, Ui_FirstTimeLanguageDialog):
|
||||
QtGui.QDialog.__init__(self, parent)
|
||||
self.setupUi(self)
|
||||
self.qmList = LanguageManager.get_qm_list()
|
||||
self.LanguageComboBox.addItem(u'Automatic')
|
||||
self.languageComboBox.addItem(u'Autodetect')
|
||||
for key in sorted(self.qmList.keys()):
|
||||
self.LanguageComboBox.addItem(key)
|
||||
self.languageComboBox.addItem(key)
|
||||
|
||||
def exec_(self):
|
||||
"""
|
||||
@ -51,13 +49,13 @@ class FirstTimeLanguageForm(QtGui.QDialog, Ui_FirstTimeLanguageDialog):
|
||||
|
||||
def accept(self):
|
||||
# It's the first row so must be Automatic
|
||||
if self.LanguageComboBox.currentIndex() == 0:
|
||||
if self.languageComboBox.currentIndex() == 0:
|
||||
LanguageManager.auto_language = True
|
||||
LanguageManager.set_language(False, False)
|
||||
else:
|
||||
LanguageManager.auto_language = False
|
||||
action = QtGui.QAction(None)
|
||||
action.setObjectName(unicode(self.LanguageComboBox.currentText()))
|
||||
action.setObjectName(unicode(self.languageComboBox.currentText()))
|
||||
LanguageManager.set_language(action, False)
|
||||
return QtGui.QDialog.accept(self)
|
||||
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode Woldsund #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# This program is free software; you can redistribute it and/or modify it #
|
||||
# under the terms of the GNU General Public License as published by the Free #
|
||||
@ -26,7 +26,20 @@
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
import sys
|
||||
|
||||
from openlp.core.lib import translate
|
||||
from openlp.core.lib.ui import add_welcome_page
|
||||
|
||||
class FirstTimePage(object):
|
||||
Welcome = 0
|
||||
Plugins = 1
|
||||
NoInternet = 2
|
||||
Songs = 3
|
||||
Bibles = 4
|
||||
Themes = 5
|
||||
Defaults = 6
|
||||
Progress = 7
|
||||
|
||||
|
||||
class Ui_FirstTimeWizard(object):
|
||||
@ -36,140 +49,145 @@ class Ui_FirstTimeWizard(object):
|
||||
FirstTimeWizard.setModal(True)
|
||||
FirstTimeWizard.setWizardStyle(QtGui.QWizard.ModernStyle)
|
||||
FirstTimeWizard.setOptions(QtGui.QWizard.IndependentPages|
|
||||
QtGui.QWizard.NoBackButtonOnStartPage)
|
||||
self.welcomePage = QtGui.QWizardPage()
|
||||
self.welcomePage.setTitle(u'')
|
||||
self.welcomePage.setSubTitle(u'')
|
||||
self.welcomePage.setObjectName(u'welcomePage')
|
||||
self.welcomeLayout = QtGui.QHBoxLayout(self.welcomePage)
|
||||
self.welcomeLayout.setSpacing(8)
|
||||
self.welcomeLayout.setMargin(0)
|
||||
self.welcomeLayout.setObjectName(u'welcomeLayout')
|
||||
self.importBibleImage = QtGui.QLabel(self.welcomePage)
|
||||
self.importBibleImage.setMinimumSize(QtCore.QSize(163, 0))
|
||||
self.importBibleImage.setMaximumSize(QtCore.QSize(163, 16777215))
|
||||
self.importBibleImage.setLineWidth(0)
|
||||
self.importBibleImage.setText(u'')
|
||||
self.importBibleImage.setPixmap(
|
||||
QtGui.QPixmap(u':/wizards/wizard_importbible.bmp'))
|
||||
self.importBibleImage.setIndent(0)
|
||||
self.importBibleImage.setObjectName(u'importBibleImage')
|
||||
self.welcomeLayout.addWidget(self.importBibleImage)
|
||||
self.welcomePageLayout = QtGui.QVBoxLayout()
|
||||
self.welcomePageLayout.setSpacing(8)
|
||||
self.welcomePageLayout.setObjectName(u'welcomePageLayout')
|
||||
self.titleLabel = QtGui.QLabel(self.welcomePage)
|
||||
self.titleLabel.setObjectName(u'titleLabel')
|
||||
self.welcomePageLayout.addWidget(self.titleLabel)
|
||||
spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum,
|
||||
QtGui.QSizePolicy.Fixed)
|
||||
self.welcomePageLayout.addItem(spacerItem)
|
||||
self.informationLabel = QtGui.QLabel(self.welcomePage)
|
||||
self.informationLabel.setWordWrap(True)
|
||||
self.informationLabel.setMargin(10)
|
||||
self.informationLabel.setObjectName(u'informationLabel')
|
||||
self.welcomePageLayout.addWidget(self.informationLabel)
|
||||
spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum,
|
||||
QtGui.QSizePolicy.Expanding)
|
||||
self.welcomePageLayout.addItem(spacerItem1)
|
||||
self.welcomeLayout.addLayout(self.welcomePageLayout)
|
||||
FirstTimeWizard.addPage(self.welcomePage)
|
||||
self.PluginPagePage = QtGui.QWizardPage()
|
||||
self.PluginPagePage.setObjectName(u'PluginPagePage')
|
||||
self.verticalLayout_2 = QtGui.QVBoxLayout(self.PluginPagePage)
|
||||
self.verticalLayout_2.setObjectName(u'verticalLayout_2')
|
||||
self.verticalLayout = QtGui.QVBoxLayout()
|
||||
self.verticalLayout.setObjectName(u'verticalLayout')
|
||||
self.songsCheckBox = QtGui.QCheckBox(self.PluginPagePage)
|
||||
QtGui.QWizard.NoBackButtonOnStartPage |
|
||||
QtGui.QWizard.NoBackButtonOnLastPage)
|
||||
self.finishButton = self.button(QtGui.QWizard.FinishButton)
|
||||
self.cancelButton = self.button(QtGui.QWizard.CancelButton)
|
||||
self.nextButton = self.button(QtGui.QWizard.NextButton)
|
||||
self.backButton = self.button(QtGui.QWizard.BackButton)
|
||||
add_welcome_page(FirstTimeWizard, u':/wizards/wizard_firsttime.bmp')
|
||||
# The plugins page
|
||||
self.pluginPage = QtGui.QWizardPage()
|
||||
self.pluginPage.setObjectName(u'pluginPage')
|
||||
self.pluginLayout = QtGui.QVBoxLayout(self.pluginPage)
|
||||
self.pluginLayout.setContentsMargins(40, 15, 40, 0)
|
||||
self.pluginLayout.setObjectName(u'pluginLayout')
|
||||
self.songsCheckBox = QtGui.QCheckBox(self.pluginPage)
|
||||
self.songsCheckBox.setChecked(True)
|
||||
self.songsCheckBox.setObjectName(u'songsCheckBox')
|
||||
self.verticalLayout.addWidget(self.songsCheckBox)
|
||||
self.customCheckBox = QtGui.QCheckBox(self.PluginPagePage)
|
||||
self.pluginLayout.addWidget(self.songsCheckBox)
|
||||
self.customCheckBox = QtGui.QCheckBox(self.pluginPage)
|
||||
self.customCheckBox.setChecked(True)
|
||||
self.customCheckBox.setObjectName(u'customCheckBox')
|
||||
self.verticalLayout.addWidget(self.customCheckBox)
|
||||
self.bibleCheckBox = QtGui.QCheckBox(self.PluginPagePage)
|
||||
self.pluginLayout.addWidget(self.customCheckBox)
|
||||
self.bibleCheckBox = QtGui.QCheckBox(self.pluginPage)
|
||||
self.bibleCheckBox.setChecked(True)
|
||||
self.bibleCheckBox.setObjectName(u'bibleCheckBox')
|
||||
self.verticalLayout.addWidget(self.bibleCheckBox)
|
||||
self.imageCheckBox = QtGui.QCheckBox(self.PluginPagePage)
|
||||
self.pluginLayout.addWidget(self.bibleCheckBox)
|
||||
self.imageCheckBox = QtGui.QCheckBox(self.pluginPage)
|
||||
self.imageCheckBox.setChecked(True)
|
||||
self.imageCheckBox.setObjectName(u'imageCheckBox')
|
||||
self.verticalLayout.addWidget(self.imageCheckBox)
|
||||
self.presentationCheckBox = QtGui.QCheckBox(self.PluginPagePage)
|
||||
self.presentationCheckBox.setChecked(True)
|
||||
self.pluginLayout.addWidget(self.imageCheckBox)
|
||||
self.presentationCheckBox = QtGui.QCheckBox(self.pluginPage)
|
||||
if sys.platform == "darwin":
|
||||
self.presentationCheckBox.setChecked(False)
|
||||
else:
|
||||
self.presentationCheckBox.setChecked(True)
|
||||
self.presentationCheckBox.setObjectName(u'presentationCheckBox')
|
||||
self.verticalLayout.addWidget(self.presentationCheckBox)
|
||||
self.mediaCheckBox = QtGui.QCheckBox(self.PluginPagePage)
|
||||
self.pluginLayout.addWidget(self.presentationCheckBox)
|
||||
self.mediaCheckBox = QtGui.QCheckBox(self.pluginPage)
|
||||
self.mediaCheckBox.setChecked(True)
|
||||
self.mediaCheckBox.setObjectName(u'mediaCheckBox')
|
||||
self.verticalLayout.addWidget(self.mediaCheckBox)
|
||||
self.remoteCheckBox = QtGui.QCheckBox(self.PluginPagePage)
|
||||
self.pluginLayout.addWidget(self.mediaCheckBox)
|
||||
self.remoteCheckBox = QtGui.QCheckBox(self.pluginPage)
|
||||
self.remoteCheckBox.setObjectName(u'remoteCheckBox')
|
||||
self.verticalLayout.addWidget(self.remoteCheckBox)
|
||||
self.songUsageCheckBox = QtGui.QCheckBox(self.PluginPagePage)
|
||||
self.pluginLayout.addWidget(self.remoteCheckBox)
|
||||
self.songUsageCheckBox = QtGui.QCheckBox(self.pluginPage)
|
||||
self.songUsageCheckBox.setChecked(True)
|
||||
self.songUsageCheckBox.setObjectName(u'songUsageCheckBox')
|
||||
self.verticalLayout.addWidget(self.songUsageCheckBox)
|
||||
self.alertCheckBox = QtGui.QCheckBox(self.PluginPagePage)
|
||||
self.pluginLayout.addWidget(self.songUsageCheckBox)
|
||||
self.alertCheckBox = QtGui.QCheckBox(self.pluginPage)
|
||||
self.alertCheckBox.setChecked(True)
|
||||
self.alertCheckBox.setObjectName(u'alertCheckBox')
|
||||
self.verticalLayout.addWidget(self.alertCheckBox)
|
||||
self.verticalLayout_2.addLayout(self.verticalLayout)
|
||||
FirstTimeWizard.addPage(self.PluginPagePage)
|
||||
self.downloadDefaultsPage = QtGui.QWizardPage()
|
||||
self.downloadDefaultsPage.setObjectName(u'downloadDefaultsPage')
|
||||
self.noInternetLabel = QtGui.QLabel(self.downloadDefaultsPage)
|
||||
self.noInternetLabel.setGeometry(QtCore.QRect(20, 20, 461, 17))
|
||||
self.pluginLayout.addWidget(self.alertCheckBox)
|
||||
FirstTimeWizard.setPage(FirstTimePage.Plugins, self.pluginPage)
|
||||
# The "you don't have an internet connection" page.
|
||||
self.noInternetPage = QtGui.QWizardPage()
|
||||
self.noInternetPage.setObjectName(u'noInternetPage')
|
||||
self.noInternetLayout = QtGui.QVBoxLayout(self.noInternetPage)
|
||||
self.noInternetLayout.setContentsMargins(50, 30, 50, 40)
|
||||
self.noInternetLayout.setObjectName(u'noInternetLayout')
|
||||
self.noInternetLabel = QtGui.QLabel(self.noInternetPage)
|
||||
self.noInternetLabel.setWordWrap(True)
|
||||
self.noInternetLabel.setObjectName(u'noInternetLabel')
|
||||
self.internetGroupBox = QtGui.QGroupBox(self.downloadDefaultsPage)
|
||||
self.internetGroupBox.setGeometry(QtCore.QRect(20, 10, 501, 271))
|
||||
self.internetGroupBox.setObjectName(u'internetGroupBox')
|
||||
self.verticalLayout_4 = QtGui.QVBoxLayout(self.internetGroupBox)
|
||||
self.verticalLayout_4.setObjectName(u'verticalLayout_4')
|
||||
self.selectionTreeWidget = QtGui.QTreeWidget(self.internetGroupBox)
|
||||
self.selectionTreeWidget.setHorizontalScrollBarPolicy(
|
||||
QtCore.Qt.ScrollBarAlwaysOff)
|
||||
self.selectionTreeWidget.setProperty(u'showDropIndicator', False)
|
||||
self.selectionTreeWidget.setAlternatingRowColors(True)
|
||||
self.selectionTreeWidget.setObjectName(u'selectionTreeWidget')
|
||||
self.selectionTreeWidget.headerItem().setText(0, u'1')
|
||||
self.selectionTreeWidget.header().setVisible(False)
|
||||
self.verticalLayout_4.addWidget(self.selectionTreeWidget)
|
||||
FirstTimeWizard.addPage(self.downloadDefaultsPage)
|
||||
self.DefaultsPage = QtGui.QWizardPage()
|
||||
self.DefaultsPage.setObjectName(u'DefaultsPage')
|
||||
self.layoutWidget = QtGui.QWidget(self.DefaultsPage)
|
||||
self.layoutWidget.setGeometry(QtCore.QRect(20, 20, 491, 113))
|
||||
self.layoutWidget.setObjectName(u'layoutWidget')
|
||||
self.gridLayout = QtGui.QGridLayout(self.layoutWidget)
|
||||
self.gridLayout.setMargin(0)
|
||||
self.gridLayout.setObjectName(u'gridLayout')
|
||||
self.displaySelectionLabel = QtGui.QLabel(self.layoutWidget)
|
||||
self.displaySelectionLabel.setObjectName(u'displaySelectionLabel')
|
||||
self.gridLayout.addWidget(self.displaySelectionLabel, 0, 0, 1, 1)
|
||||
self.displaySelectionComboBox = QtGui.QComboBox(self.layoutWidget)
|
||||
self.displaySelectionComboBox.setEditable(False)
|
||||
self.displaySelectionComboBox.setInsertPolicy(QtGui.QComboBox.NoInsert)
|
||||
self.displaySelectionComboBox.setSizeAdjustPolicy(
|
||||
self.noInternetLayout.addWidget(self.noInternetLabel)
|
||||
FirstTimeWizard.setPage(FirstTimePage.NoInternet, self.noInternetPage)
|
||||
# The song samples page
|
||||
self.songsPage = QtGui.QWizardPage()
|
||||
self.songsPage.setObjectName(u'songsPage')
|
||||
self.songsLayout = QtGui.QVBoxLayout(self.songsPage)
|
||||
self.songsLayout.setContentsMargins(50, 20, 50, 20)
|
||||
self.songsLayout.setObjectName(u'songsLayout')
|
||||
self.songsListWidget = QtGui.QListWidget(self.songsPage)
|
||||
self.songsListWidget.setAlternatingRowColors(True)
|
||||
self.songsListWidget.setObjectName(u'songsListWidget')
|
||||
self.songsLayout.addWidget(self.songsListWidget)
|
||||
FirstTimeWizard.setPage(FirstTimePage.Songs, self.songsPage)
|
||||
# The Bible samples page
|
||||
self.biblesPage = QtGui.QWizardPage()
|
||||
self.biblesPage.setObjectName(u'biblesPage')
|
||||
self.biblesLayout = QtGui.QVBoxLayout(self.biblesPage)
|
||||
self.biblesLayout.setContentsMargins(50, 20, 50, 20)
|
||||
self.biblesLayout.setObjectName(u'biblesLayout')
|
||||
self.biblesTreeWidget = QtGui.QTreeWidget(self.biblesPage)
|
||||
self.biblesTreeWidget.setAlternatingRowColors(True)
|
||||
self.biblesTreeWidget.header().setVisible(False)
|
||||
self.biblesTreeWidget.setObjectName(u'biblesTreeWidget')
|
||||
self.biblesLayout.addWidget(self.biblesTreeWidget)
|
||||
FirstTimeWizard.setPage(FirstTimePage.Bibles, self.biblesPage)
|
||||
# The theme samples page
|
||||
self.themesPage = QtGui.QWizardPage()
|
||||
self.themesPage.setObjectName(u'themesPage')
|
||||
self.themesLayout = QtGui.QVBoxLayout(self.themesPage)
|
||||
self.themesLayout.setContentsMargins(20, 50, 20, 60)
|
||||
self.themesLayout.setObjectName(u'themesLayout')
|
||||
self.themesListWidget = QtGui.QListWidget(self.themesPage)
|
||||
self.themesListWidget.setViewMode(QtGui.QListView.IconMode)
|
||||
self.themesListWidget.setMovement(QtGui.QListView.Static)
|
||||
self.themesListWidget.setFlow(QtGui.QListView.LeftToRight)
|
||||
self.themesListWidget.setSpacing(4)
|
||||
self.themesListWidget.setUniformItemSizes(True)
|
||||
self.themesListWidget.setIconSize(QtCore.QSize(133, 100))
|
||||
self.themesListWidget.setWrapping(False)
|
||||
self.themesListWidget.setObjectName(u'themesListWidget')
|
||||
self.themesLayout.addWidget(self.themesListWidget)
|
||||
FirstTimeWizard.setPage(FirstTimePage.Themes, self.themesPage)
|
||||
# the default settings page
|
||||
self.defaultsPage = QtGui.QWizardPage()
|
||||
self.defaultsPage.setObjectName(u'defaultsPage')
|
||||
self.defaultsLayout = QtGui.QFormLayout(self.defaultsPage)
|
||||
self.defaultsLayout.setContentsMargins(50, 20, 50, 20)
|
||||
self.defaultsLayout.setObjectName(u'defaultsLayout')
|
||||
self.displayLabel = QtGui.QLabel(self.defaultsPage)
|
||||
self.displayLabel.setObjectName(u'displayLabel')
|
||||
self.displayComboBox = QtGui.QComboBox(self.defaultsPage)
|
||||
self.displayComboBox.setEditable(False)
|
||||
self.displayComboBox.setInsertPolicy(QtGui.QComboBox.NoInsert)
|
||||
self.displayComboBox.setObjectName(u'displayComboBox')
|
||||
self.defaultsLayout.addRow(self.displayLabel, self.displayComboBox)
|
||||
self.themeLabel = QtGui.QLabel(self.defaultsPage)
|
||||
self.themeLabel.setObjectName(u'themeLabel')
|
||||
self.themeComboBox = QtGui.QComboBox(self.defaultsPage)
|
||||
self.themeComboBox.setEditable(False)
|
||||
self.themeComboBox.setInsertPolicy(QtGui.QComboBox.NoInsert)
|
||||
self.themeComboBox.setSizeAdjustPolicy(
|
||||
QtGui.QComboBox.AdjustToContents)
|
||||
self.displaySelectionComboBox.setObjectName(u'displaySelectionComboBox')
|
||||
self.gridLayout.addWidget(self.displaySelectionComboBox, 0, 1, 1, 1)
|
||||
self.themeSelectionLabel = QtGui.QLabel(self.layoutWidget)
|
||||
self.themeSelectionLabel.setObjectName(u'themeSelectionLabel')
|
||||
self.gridLayout.addWidget(self.themeSelectionLabel, 1, 0, 1, 1)
|
||||
self.themeSelectionComboBox = QtGui.QComboBox(self.layoutWidget)
|
||||
self.themeSelectionComboBox.setSizeAdjustPolicy(
|
||||
QtGui.QComboBox.AdjustToContents)
|
||||
self.themeSelectionComboBox.setObjectName(u'themeSelectionComboBox')
|
||||
self.gridLayout.addWidget(self.themeSelectionComboBox, 1, 1, 1, 1)
|
||||
self.messageLabel = QtGui.QLabel(self.DefaultsPage)
|
||||
self.messageLabel.setGeometry(QtCore.QRect(60, 160, 471, 17))
|
||||
self.messageLabel.setObjectName(u'messageLabel')
|
||||
self.updateLabel = QtGui.QLabel(self.DefaultsPage)
|
||||
self.updateLabel.setGeometry(QtCore.QRect(60, 220, 351, 17))
|
||||
self.updateLabel.setObjectName(u'updateLabel')
|
||||
FirstTimeWizard.addPage(self.DefaultsPage)
|
||||
self.themeComboBox.setObjectName(u'themeComboBox')
|
||||
self.defaultsLayout.addRow(self.themeLabel, self.themeComboBox)
|
||||
FirstTimeWizard.setPage(FirstTimePage.Defaults, self.defaultsPage)
|
||||
# Progress page
|
||||
self.progressPage = QtGui.QWizardPage()
|
||||
self.progressPage.setObjectName(u'progressPage')
|
||||
self.progressLayout = QtGui.QVBoxLayout(self.progressPage)
|
||||
self.progressLayout.setMargin(48)
|
||||
self.progressLayout.setObjectName(u'progressLayout')
|
||||
self.progressLabel = QtGui.QLabel(self.progressPage)
|
||||
self.progressLabel.setObjectName(u'progressLabel')
|
||||
self.progressLayout.addWidget(self.progressLabel)
|
||||
self.progressBar = QtGui.QProgressBar(self.progressPage)
|
||||
self.progressBar.setObjectName(u'progressBar')
|
||||
self.progressLayout.addWidget(self.progressBar)
|
||||
FirstTimeWizard.setPage(FirstTimePage.Progress, self.progressPage)
|
||||
|
||||
self.retranslateUi(FirstTimeWizard)
|
||||
QtCore.QMetaObject.connectSlotsByName(FirstTimeWizard)
|
||||
@ -182,12 +200,12 @@ class Ui_FirstTimeWizard(object):
|
||||
translate('OpenLP.FirstTimeWizard',
|
||||
'Welcome to the First Time Wizard'))
|
||||
self.informationLabel.setText(translate('OpenLP.FirstTimeWizard',
|
||||
'This wizard will help you to configure OpenLP for initial use .'
|
||||
'This wizard will help you to configure OpenLP for initial use.'
|
||||
' Click the next button below to start the process of selection '
|
||||
'your initial options. '))
|
||||
self.PluginPagePage.setTitle(translate('OpenLP.FirstTimeWizard',
|
||||
self.pluginPage.setTitle(translate('OpenLP.FirstTimeWizard',
|
||||
'Activate required Plugins'))
|
||||
self.PluginPagePage.setSubTitle(translate('OpenLP.FirstTimeWizard',
|
||||
self.pluginPage.setSubTitle(translate('OpenLP.FirstTimeWizard',
|
||||
'Select the Plugins you wish to use. '))
|
||||
self.songsCheckBox.setText(translate('OpenLP.FirstTimeWizard', 'Songs'))
|
||||
self.customCheckBox.setText(translate('OpenLP.FirstTimeWizard',
|
||||
@ -197,6 +215,8 @@ class Ui_FirstTimeWizard(object):
|
||||
'Images'))
|
||||
self.presentationCheckBox.setText(translate('OpenLP.FirstTimeWizard',
|
||||
'Presentations'))
|
||||
if sys.platform == "darwin":
|
||||
self.presentationCheckBox.setEnabled(False)
|
||||
self.mediaCheckBox.setText(translate('OpenLP.FirstTimeWizard',
|
||||
'Media (Audio and Video)'))
|
||||
self.remoteCheckBox.setText(translate('OpenLP.FirstTimeWizard',
|
||||
@ -205,23 +225,42 @@ class Ui_FirstTimeWizard(object):
|
||||
'Monitor Song Usage'))
|
||||
self.alertCheckBox.setText(translate('OpenLP.FirstTimeWizard',
|
||||
'Allow Alerts'))
|
||||
self.downloadDefaultsPage.setTitle(translate('OpenLP.FirstTimeWizard',
|
||||
'Download Samples from OpenLP.org'))
|
||||
self.downloadDefaultsPage.setSubTitle(translate(
|
||||
self.noInternetPage.setTitle(translate('OpenLP.FirstTimeWizard',
|
||||
'No Internet Connection'))
|
||||
self.noInternetPage.setSubTitle(translate(
|
||||
'OpenLP.FirstTimeWizard',
|
||||
'Select samples to downlaod and install for use.'))
|
||||
'Unable to detect an Internet connection.'))
|
||||
self.noInternetLabel.setText(translate('OpenLP.FirstTimeWizard',
|
||||
'No Internet connection found so unable to download any default'
|
||||
' files.'))
|
||||
self.internetGroupBox.setTitle(translate('OpenLP.FirstTimeWizard',
|
||||
'Download Example Files'))
|
||||
self.DefaultsPage.setTitle(translate('OpenLP.FirstTimeWizard',
|
||||
'No Internet connection was found. The First Time Wizard needs an '
|
||||
'Internet connection in order to be able to download sample '
|
||||
'songs, Bibles and themes.\n\nTo re-run the First Time Wizard and '
|
||||
'import this sample data at a later stage, press the cancel '
|
||||
'button now, check your Internet connection, and restart OpenLP.'
|
||||
'\n\nTo cancel the First Time Wizard completely, press the finish '
|
||||
'button now.'))
|
||||
self.songsPage.setTitle(translate('OpenLP.FirstTimeWizard',
|
||||
'Sample Songs'))
|
||||
self.songsPage.setSubTitle(translate('OpenLP.FirstTimeWizard',
|
||||
'Select and download public domain songs.'))
|
||||
self.biblesPage.setTitle(translate('OpenLP.FirstTimeWizard',
|
||||
'Sample Bibles'))
|
||||
self.biblesPage.setSubTitle(translate('OpenLP.FirstTimeWizard',
|
||||
'Select and download free Bibles.'))
|
||||
self.themesPage.setTitle(translate('OpenLP.FirstTimeWizard',
|
||||
'Sample Themes'))
|
||||
self.themesPage.setSubTitle(translate('OpenLP.FirstTimeWizard',
|
||||
'Select and download sample themes.'))
|
||||
self.defaultsPage.setTitle(translate('OpenLP.FirstTimeWizard',
|
||||
'Default Settings'))
|
||||
self.DefaultsPage.setSubTitle(translate('OpenLP.FirstTimeWizard',
|
||||
'Set up default values to be used by OpenLP'))
|
||||
self.displaySelectionLabel.setText(translate('OpenLP.FirstTimeWizard',
|
||||
'Default output display'))
|
||||
self.themeSelectionLabel.setText(translate('OpenLP.FirstTimeWizard',
|
||||
'Select the default Theme'))
|
||||
self.messageLabel.setText(translate('OpenLP.FirstTimeWizard',
|
||||
'Press Finish to apply all you changes and start OpenLP'))
|
||||
self.defaultsPage.setSubTitle(translate('OpenLP.FirstTimeWizard',
|
||||
'Set up default settings to be used by OpenLP.'))
|
||||
self.progressPage.setTitle(translate('OpenLP.FirstTimeWizard',
|
||||
'Setting Up And Importing'))
|
||||
self.progressPage.setSubTitle(translate('OpenLP.FirstTimeWizard',
|
||||
'Please wait while OpenLP is set up and your data is imported.'))
|
||||
self.displayLabel.setText(translate('OpenLP.FirstTimeWizard',
|
||||
'Default output display:'))
|
||||
self.themeLabel.setText(translate('OpenLP.FirstTimeWizard',
|
||||
'Select default theme:'))
|
||||
self.progressLabel.setText(translate('OpenLP.FirstTimeWizard',
|
||||
'Starting configuration process...'))
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
@ -32,27 +32,6 @@ from openlp.core.lib.ui import UiStrings
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
class ValidEdit(QtGui.QLineEdit):
|
||||
"""
|
||||
Only allow numeric characters to be edited
|
||||
"""
|
||||
def __init__(self, parent):
|
||||
"""
|
||||
Set up Override and Validator
|
||||
"""
|
||||
QtGui.QLineEdit.__init__(self, parent)
|
||||
self.setValidator(QtGui.QIntValidator(0, 9999, self))
|
||||
|
||||
def validText(self):
|
||||
"""
|
||||
Only return Integers. Space is 0
|
||||
"""
|
||||
if self.text().isEmpty():
|
||||
return QtCore.QString(u'0')
|
||||
else:
|
||||
return self.text()
|
||||
|
||||
|
||||
class GeneralTab(SettingsTab):
|
||||
"""
|
||||
GeneralTab is the general settings tab in the settings dialog.
|
||||
@ -126,6 +105,9 @@ class GeneralTab(SettingsTab):
|
||||
self.saveCheckServiceCheckBox = QtGui.QCheckBox(self.settingsGroupBox)
|
||||
self.saveCheckServiceCheckBox.setObjectName(u'saveCheckServiceCheckBox')
|
||||
self.settingsLayout.addRow(self.saveCheckServiceCheckBox)
|
||||
self.autoUnblankCheckBox = QtGui.QCheckBox(self.settingsGroupBox)
|
||||
self.autoUnblankCheckBox.setObjectName(u'autoUnblankCheckBox')
|
||||
self.settingsLayout.addRow(self.autoUnblankCheckBox)
|
||||
self.autoPreviewCheckBox = QtGui.QCheckBox(self.settingsGroupBox)
|
||||
self.autoPreviewCheckBox.setObjectName(u'autoPreviewCheckBox')
|
||||
self.settingsLayout.addRow(self.autoPreviewCheckBox)
|
||||
@ -164,30 +146,6 @@ class GeneralTab(SettingsTab):
|
||||
self.displayGroupBox.setObjectName(u'displayGroupBox')
|
||||
self.displayLayout = QtGui.QGridLayout(self.displayGroupBox)
|
||||
self.displayLayout.setObjectName(u'displayLayout')
|
||||
self.currentXLabel = QtGui.QLabel(self.displayGroupBox)
|
||||
self.currentXLabel.setObjectName(u'currentXLabel')
|
||||
self.displayLayout.addWidget(self.currentXLabel, 0, 0)
|
||||
self.currentXValueLabel = QtGui.QLabel(self.displayGroupBox)
|
||||
self.currentXValueLabel.setObjectName(u'currentXValueLabel')
|
||||
self.displayLayout.addWidget(self.currentXValueLabel, 1, 0)
|
||||
self.currentYLabel = QtGui.QLabel(self.displayGroupBox)
|
||||
self.currentYLabel.setObjectName(u'currentYLabel')
|
||||
self.displayLayout.addWidget(self.currentYLabel, 0, 1)
|
||||
self.currentYValueLabel = QtGui.QLabel(self.displayGroupBox)
|
||||
self.currentYValueLabel.setObjectName(u'currentYValueLabel')
|
||||
self.displayLayout.addWidget(self.currentYValueLabel, 1, 1)
|
||||
self.currentWidthLabel = QtGui.QLabel(self.displayGroupBox)
|
||||
self.currentWidthLabel.setObjectName(u'currentWidthLabel')
|
||||
self.displayLayout.addWidget(self.currentWidthLabel, 0, 2)
|
||||
self.currentWidthValueLabel = QtGui.QLabel(self.displayGroupBox)
|
||||
self.currentWidthValueLabel.setObjectName(u'currentWidthValueLabel')
|
||||
self.displayLayout.addWidget(self.currentWidthValueLabel, 1, 2)
|
||||
self.currentHeightLabel = QtGui.QLabel(self.displayGroupBox)
|
||||
self.currentHeightLabel.setObjectName(u'currentHeightLabel')
|
||||
self.displayLayout.addWidget(self.currentHeightLabel, 0, 3)
|
||||
self.currentHeightValueLabel = QtGui.QLabel(self.displayGroupBox)
|
||||
self.currentHeightValueLabel.setObjectName(u'Height')
|
||||
self.displayLayout.addWidget(self.currentHeightValueLabel, 1, 3)
|
||||
self.overrideCheckBox = QtGui.QCheckBox(self.displayGroupBox)
|
||||
self.overrideCheckBox.setObjectName(u'overrideCheckBox')
|
||||
self.displayLayout.addWidget(self.overrideCheckBox, 2, 0, 1, 4)
|
||||
@ -196,26 +154,30 @@ class GeneralTab(SettingsTab):
|
||||
self.customXLabel = QtGui.QLabel(self.displayGroupBox)
|
||||
self.customXLabel.setObjectName(u'customXLabel')
|
||||
self.displayLayout.addWidget(self.customXLabel, 3, 0)
|
||||
self.customXValueEdit = ValidEdit(self.displayGroupBox)
|
||||
self.customXValueEdit = QtGui.QSpinBox(self.displayGroupBox)
|
||||
self.customXValueEdit.setObjectName(u'customXValueEdit')
|
||||
self.customXValueEdit.setMaximum(9999)
|
||||
self.displayLayout.addWidget(self.customXValueEdit, 4, 0)
|
||||
self.customYLabel = QtGui.QLabel(self.displayGroupBox)
|
||||
self.customYLabel.setObjectName(u'customYLabel')
|
||||
self.displayLayout.addWidget(self.customYLabel, 3, 1)
|
||||
self.customYValueEdit = ValidEdit(self.displayGroupBox)
|
||||
self.customYValueEdit = QtGui.QSpinBox(self.displayGroupBox)
|
||||
self.customYValueEdit.setObjectName(u'customYValueEdit')
|
||||
self.customYValueEdit.setMaximum(9999)
|
||||
self.displayLayout.addWidget(self.customYValueEdit, 4, 1)
|
||||
self.customWidthLabel = QtGui.QLabel(self.displayGroupBox)
|
||||
self.customWidthLabel.setObjectName(u'customWidthLabel')
|
||||
self.displayLayout.addWidget(self.customWidthLabel, 3, 2)
|
||||
self.customWidthValueEdit = ValidEdit(self.displayGroupBox)
|
||||
self.customWidthValueEdit = QtGui.QSpinBox(self.displayGroupBox)
|
||||
self.customWidthValueEdit.setObjectName(u'customWidthValueEdit')
|
||||
self.customWidthValueEdit.setMaximum(9999)
|
||||
self.displayLayout.addWidget(self.customWidthValueEdit, 4, 2)
|
||||
self.customHeightLabel = QtGui.QLabel(self.displayGroupBox)
|
||||
self.customHeightLabel.setObjectName(u'customHeightLabel')
|
||||
self.displayLayout.addWidget(self.customHeightLabel, 3, 3)
|
||||
self.customHeightValueEdit = ValidEdit(self.displayGroupBox)
|
||||
self.customHeightValueEdit = QtGui.QSpinBox(self.displayGroupBox)
|
||||
self.customHeightValueEdit.setObjectName(u'customHeightValueEdit')
|
||||
self.customHeightValueEdit.setMaximum(9999)
|
||||
self.displayLayout.addWidget(self.customHeightValueEdit, 4, 3)
|
||||
self.rightLayout.addWidget(self.displayGroupBox)
|
||||
self.rightLayout.addStretch()
|
||||
@ -223,20 +185,22 @@ class GeneralTab(SettingsTab):
|
||||
QtCore.QObject.connect(self.overrideCheckBox,
|
||||
QtCore.SIGNAL(u'toggled(bool)'), self.onOverrideCheckBoxToggled)
|
||||
QtCore.QObject.connect(self.customHeightValueEdit,
|
||||
QtCore.SIGNAL(u'textEdited(const QString&)'),
|
||||
self.onDisplayPositionChanged)
|
||||
QtCore.SIGNAL(u'valueChanged(int)'), self.onDisplayPositionChanged)
|
||||
QtCore.QObject.connect(self.customWidthValueEdit,
|
||||
QtCore.SIGNAL(u'textEdited(const QString&)'),
|
||||
self.onDisplayPositionChanged)
|
||||
QtCore.SIGNAL(u'valueChanged(int)'), self.onDisplayPositionChanged)
|
||||
QtCore.QObject.connect(self.customYValueEdit,
|
||||
QtCore.SIGNAL(u'textEdited(const QString&)'),
|
||||
self.onDisplayPositionChanged)
|
||||
QtCore.SIGNAL(u'valueChanged(int)'), self.onDisplayPositionChanged)
|
||||
QtCore.QObject.connect(self.customXValueEdit,
|
||||
QtCore.SIGNAL(u'textEdited(const QString&)'),
|
||||
self.onDisplayPositionChanged)
|
||||
QtCore.SIGNAL(u'valueChanged(int)'), self.onDisplayPositionChanged)
|
||||
# Reload the tab, as the screen resolution/count may have changed.
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'config_screen_changed'), self.load)
|
||||
# Remove for now
|
||||
self.usernameLabel.setVisible(False)
|
||||
self.usernameEdit.setVisible(False)
|
||||
self.passwordLabel.setVisible(False)
|
||||
self.passwordEdit.setVisible(False)
|
||||
|
||||
|
||||
def retranslateUi(self):
|
||||
"""
|
||||
@ -263,12 +227,13 @@ class GeneralTab(SettingsTab):
|
||||
translate('OpenLP.GeneralTab', 'Application Settings'))
|
||||
self.saveCheckServiceCheckBox.setText(translate('OpenLP.GeneralTab',
|
||||
'Prompt to save before starting a new service'))
|
||||
self.autoUnblankCheckBox.setText(translate('OpenLP.GeneralTab',
|
||||
'Unblank display when adding new live item'))
|
||||
self.autoPreviewCheckBox.setText(translate('OpenLP.GeneralTab',
|
||||
'Automatically preview next item in service'))
|
||||
self.timeoutLabel.setText(translate('OpenLP.GeneralTab',
|
||||
'Slide loop delay:'))
|
||||
self.timeoutSpinBox.setSuffix(
|
||||
translate('OpenLP.GeneralTab', ' sec'))
|
||||
self.timeoutSpinBox.setSuffix(translate('OpenLP.GeneralTab', ' sec'))
|
||||
self.ccliGroupBox.setTitle(
|
||||
translate('OpenLP.GeneralTab', 'CCLI Details'))
|
||||
self.numberLabel.setText(UiStrings.CCLINumberLabel)
|
||||
@ -279,22 +244,11 @@ class GeneralTab(SettingsTab):
|
||||
# Moved from display tab
|
||||
self.displayGroupBox.setTitle(
|
||||
translate('OpenLP.GeneralTab', 'Display Position'))
|
||||
self.currentXLabel.setText(translate('OpenLP.GeneralTab', 'X'))
|
||||
self.currentXValueLabel.setText(u'0')
|
||||
self.currentYLabel.setText(translate('OpenLP.GeneralTab', 'Y'))
|
||||
self.currentYValueLabel.setText(u'0')
|
||||
self.currentHeightLabel.setText(
|
||||
translate('OpenLP.GeneralTab', 'Height'))
|
||||
self.currentHeightValueLabel.setText(u'0')
|
||||
self.currentWidthLabel.setText(
|
||||
translate('OpenLP.GeneralTab', 'Width'))
|
||||
self.currentWidthValueLabel.setText(u'0')
|
||||
self.overrideCheckBox.setText(translate('OpenLP.GeneralTab',
|
||||
'Override display position'))
|
||||
self.customXLabel.setText(translate('OpenLP.GeneralTab', 'X'))
|
||||
self.customYLabel.setText(translate('OpenLP.GeneralTab', 'Y'))
|
||||
self.customHeightLabel.setText(
|
||||
translate('OpenLP.GeneralTab', 'Height'))
|
||||
self.customHeightLabel.setText(translate('OpenLP.GeneralTab', 'Height'))
|
||||
self.customWidthLabel.setText(translate('OpenLP.GeneralTab', 'Width'))
|
||||
|
||||
def load(self):
|
||||
@ -304,8 +258,7 @@ class GeneralTab(SettingsTab):
|
||||
settings = QtCore.QSettings()
|
||||
settings.beginGroup(self.settingsSection)
|
||||
self.monitorComboBox.clear()
|
||||
for screen in self.screens.get_screen_list():
|
||||
self.monitorComboBox.addItem(screen)
|
||||
self.monitorComboBox.addItems(self.screens.get_screen_list())
|
||||
self.numberEdit.setText(unicode(settings.value(
|
||||
u'ccli number', QtCore.QVariant(u'')).toString()))
|
||||
self.usernameEdit.setText(unicode(settings.value(
|
||||
@ -314,6 +267,8 @@ class GeneralTab(SettingsTab):
|
||||
u'songselect password', QtCore.QVariant(u'')).toString()))
|
||||
self.saveCheckServiceCheckBox.setChecked(settings.value(u'save prompt',
|
||||
QtCore.QVariant(False)).toBool())
|
||||
self.autoUnblankCheckBox.setChecked(settings.value(u'auto unblank',
|
||||
QtCore.QVariant(False)).toBool())
|
||||
self.monitorComboBox.setCurrentIndex(self.monitorNumber)
|
||||
self.displayOnMonitorCheck.setChecked(self.screens.display)
|
||||
self.warningCheckBox.setChecked(settings.value(u'blank warning',
|
||||
@ -328,26 +283,16 @@ class GeneralTab(SettingsTab):
|
||||
QtCore.QVariant(False)).toBool())
|
||||
self.timeoutSpinBox.setValue(settings.value(u'loop delay',
|
||||
QtCore.QVariant(5)).toInt()[0])
|
||||
self.currentXValueLabel.setText(
|
||||
unicode(self.screens.current[u'size'].x()))
|
||||
self.currentYValueLabel.setText(
|
||||
unicode(self.screens.current[u'size'].y()))
|
||||
self.currentHeightValueLabel.setText(
|
||||
unicode(self.screens.current[u'size'].height()))
|
||||
self.currentWidthValueLabel.setText(
|
||||
unicode(self.screens.current[u'size'].width()))
|
||||
self.overrideCheckBox.setChecked(settings.value(u'override position',
|
||||
QtCore.QVariant(False)).toBool())
|
||||
self.customXValueEdit.setText(settings.value(u'x position',
|
||||
QtCore.QVariant(self.screens.current[u'size'].x())).toString())
|
||||
self.customYValueEdit.setText(settings.value(u'y position',
|
||||
QtCore.QVariant(self.screens.current[u'size'].y())).toString())
|
||||
self.customHeightValueEdit.setText(
|
||||
settings.value(u'height', QtCore.QVariant(
|
||||
self.screens.current[u'size'].height())).toString())
|
||||
self.customWidthValueEdit.setText(
|
||||
settings.value(u'width', QtCore.QVariant(
|
||||
self.screens.current[u'size'].width())).toString())
|
||||
self.customXValueEdit.setValue(settings.value(u'x position',
|
||||
QtCore.QVariant(self.screens.current[u'size'].x())).toInt()[0])
|
||||
self.customYValueEdit.setValue(settings.value(u'y position',
|
||||
QtCore.QVariant(self.screens.current[u'size'].y())).toInt()[0])
|
||||
self.customHeightValueEdit.setValue(settings.value(u'height',
|
||||
QtCore.QVariant(self.screens.current[u'size'].height())).toInt()[0])
|
||||
self.customWidthValueEdit.setValue(settings.value(u'width',
|
||||
QtCore.QVariant(self.screens.current[u'size'].width())).toInt()[0])
|
||||
settings.endGroup()
|
||||
self.customXValueEdit.setEnabled(self.overrideCheckBox.isChecked())
|
||||
self.customYValueEdit.setEnabled(self.overrideCheckBox.isChecked())
|
||||
@ -374,6 +319,8 @@ class GeneralTab(SettingsTab):
|
||||
QtCore.QVariant(self.checkForUpdatesCheckBox.isChecked()))
|
||||
settings.setValue(u'save prompt',
|
||||
QtCore.QVariant(self.saveCheckServiceCheckBox.isChecked()))
|
||||
settings.setValue(u'auto unblank',
|
||||
QtCore.QVariant(self.autoUnblankCheckBox.isChecked()))
|
||||
settings.setValue(u'auto preview',
|
||||
QtCore.QVariant(self.autoPreviewCheckBox.isChecked()))
|
||||
settings.setValue(u'loop delay',
|
||||
@ -385,13 +332,13 @@ class GeneralTab(SettingsTab):
|
||||
settings.setValue(u'songselect password',
|
||||
QtCore.QVariant(self.passwordEdit.displayText()))
|
||||
settings.setValue(u'x position',
|
||||
QtCore.QVariant(self.customXValueEdit.text()))
|
||||
QtCore.QVariant(self.customXValueEdit.value()))
|
||||
settings.setValue(u'y position',
|
||||
QtCore.QVariant(self.customYValueEdit.text()))
|
||||
QtCore.QVariant(self.customYValueEdit.value()))
|
||||
settings.setValue(u'height',
|
||||
QtCore.QVariant(self.customHeightValueEdit.text()))
|
||||
QtCore.QVariant(self.customHeightValueEdit.value()))
|
||||
settings.setValue(u'width',
|
||||
QtCore.QVariant(self.customWidthValueEdit.text()))
|
||||
QtCore.QVariant(self.customWidthValueEdit.value()))
|
||||
settings.setValue(u'override position',
|
||||
QtCore.QVariant(self.overrideCheckBox.isChecked()))
|
||||
settings.endGroup()
|
||||
@ -415,10 +362,10 @@ class GeneralTab(SettingsTab):
|
||||
# Reset screens after initial definition
|
||||
if self.overrideChanged:
|
||||
self.screens.override[u'size'] = QtCore.QRect(
|
||||
int(self.customXValueEdit.validText()),
|
||||
int(self.customYValueEdit.validText()),
|
||||
int(self.customWidthValueEdit.validText()),
|
||||
int(self.customHeightValueEdit.validText()))
|
||||
self.customXValueEdit.value(),
|
||||
self.customYValueEdit.value(),
|
||||
self.customWidthValueEdit.value(),
|
||||
self.customHeightValueEdit.value())
|
||||
if self.overrideCheckBox.isChecked():
|
||||
self.screens.set_override_display()
|
||||
else:
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
@ -67,6 +67,7 @@ class MainDisplay(DisplayWidget):
|
||||
self.isLive = live
|
||||
self.alertTab = None
|
||||
self.hideMode = None
|
||||
self.videoHide = False
|
||||
self.override = {}
|
||||
mainIcon = build_icon(u':/icon/openlp-logo-16x16.png')
|
||||
self.setWindowIcon(mainIcon)
|
||||
@ -90,8 +91,8 @@ class MainDisplay(DisplayWidget):
|
||||
"""
|
||||
Set up and build the output screen
|
||||
"""
|
||||
log.debug(u'Setup live = %s for monitor %s ' % (self.isLive,
|
||||
self.screens.monitor_number))
|
||||
log.debug(u'Start setup for monitor %s (live = %s)' %
|
||||
(self.screens.monitor_number, self.isLive))
|
||||
self.usePhonon = QtCore.QSettings().value(
|
||||
u'media/use phonon', QtCore.QVariant(True)).toBool()
|
||||
self.phononActive = False
|
||||
@ -102,13 +103,21 @@ class MainDisplay(DisplayWidget):
|
||||
self.videoWidget.setVisible(False)
|
||||
self.videoWidget.setGeometry(QtCore.QRect(0, 0,
|
||||
self.screen[u'size'].width(), self.screen[u'size'].height()))
|
||||
log.debug(u'Setup Phonon for monitor %s' % self.screens.monitor_number)
|
||||
self.mediaObject = Phonon.MediaObject(self)
|
||||
self.audio = Phonon.AudioOutput(Phonon.VideoCategory, self.mediaObject)
|
||||
Phonon.createPath(self.mediaObject, self.videoWidget)
|
||||
Phonon.createPath(self.mediaObject, self.audio)
|
||||
QtCore.QObject.connect(self.mediaObject,
|
||||
QtCore.SIGNAL(u'stateChanged(Phonon::State, Phonon::State)'),
|
||||
self.videoStart)
|
||||
self.videoState)
|
||||
QtCore.QObject.connect(self.mediaObject,
|
||||
QtCore.SIGNAL(u'finished()'),
|
||||
self.videoFinished)
|
||||
QtCore.QObject.connect(self.mediaObject,
|
||||
QtCore.SIGNAL(u'tick(qint64)'),
|
||||
self.videoTick)
|
||||
log.debug(u'Setup webView for monitor %s' % self.screens.monitor_number)
|
||||
self.webView = QtWebKit.QWebView(self)
|
||||
self.webView.setGeometry(0, 0,
|
||||
self.screen[u'size'].width(), self.screen[u'size'].height())
|
||||
@ -141,23 +150,22 @@ class MainDisplay(DisplayWidget):
|
||||
if not background_color.isValid():
|
||||
background_color = QtCore.Qt.white
|
||||
splash_image = QtGui.QImage(image_file)
|
||||
initialFrame = QtGui.QImage(
|
||||
self.initialFrame = QtGui.QImage(
|
||||
self.screens.current[u'size'].width(),
|
||||
self.screens.current[u'size'].height(),
|
||||
QtGui.QImage.Format_ARGB32_Premultiplied)
|
||||
painter_image = QtGui.QPainter()
|
||||
painter_image.begin(initialFrame)
|
||||
painter_image.fillRect(initialFrame.rect(), background_color)
|
||||
painter_image.begin(self.initialFrame)
|
||||
painter_image.fillRect(self.initialFrame.rect(), background_color)
|
||||
painter_image.drawImage(
|
||||
(self.screens.current[u'size'].width() -
|
||||
splash_image.width()) / 2,
|
||||
(self.screens.current[u'size'].height()
|
||||
- splash_image.height()) / 2, splash_image)
|
||||
serviceItem = ServiceItem()
|
||||
serviceItem.bg_image_bytes = image_to_byte(initialFrame)
|
||||
serviceItem.bg_image_bytes = image_to_byte(self.initialFrame)
|
||||
self.webView.setHtml(build_html(serviceItem, self.screen,
|
||||
self.alertTab, self.isLive, None))
|
||||
self.initialFrame = True
|
||||
self.__hideMouse()
|
||||
# To display or not to display?
|
||||
if not self.screen[u'primary']:
|
||||
@ -165,6 +173,8 @@ class MainDisplay(DisplayWidget):
|
||||
self.primary = False
|
||||
else:
|
||||
self.primary = True
|
||||
log.debug(
|
||||
u'Finished setup for monitor %s' % self.screens.monitor_number)
|
||||
|
||||
def text(self, slide):
|
||||
"""
|
||||
@ -177,6 +187,7 @@ class MainDisplay(DisplayWidget):
|
||||
# Wait for the webview to update before displaying text.
|
||||
while not self.webLoaded:
|
||||
Receiver.send_message(u'openlp_process_events')
|
||||
self.setGeometry(self.screen[u'size'])
|
||||
self.frame.evaluateJavaScript(u'show_text("%s")' % \
|
||||
slide.replace(u'\\', u'\\\\').replace(u'\"', u'\\\"'))
|
||||
return self.preview()
|
||||
@ -204,12 +215,18 @@ class MainDisplay(DisplayWidget):
|
||||
else:
|
||||
shrinkItem = self
|
||||
if text:
|
||||
shrinkItem.resize(self.width(), int(height.toString()))
|
||||
alert_height = int(height.toString())
|
||||
shrinkItem.resize(self.width(), alert_height)
|
||||
shrinkItem.setVisible(True)
|
||||
if self.alertTab.location == 1:
|
||||
shrinkItem.move(self.screen[u'size'].left(),
|
||||
(self.screen[u'size'].height() - alert_height) / 2)
|
||||
elif self.alertTab.location == 2:
|
||||
shrinkItem.move(self.screen[u'size'].left(),
|
||||
self.screen[u'size'].height() - alert_height)
|
||||
else:
|
||||
shrinkItem.setVisible(False)
|
||||
shrinkItem.resize(self.screen[u'size'].width(),
|
||||
self.screen[u'size'].height())
|
||||
self.setGeometry(self.screen[u'size'])
|
||||
|
||||
def directImage(self, name, path):
|
||||
"""
|
||||
@ -239,6 +256,7 @@ class MainDisplay(DisplayWidget):
|
||||
"""
|
||||
Display an image, as is.
|
||||
"""
|
||||
self.setGeometry(self.screen[u'size'])
|
||||
if image:
|
||||
js = u'show_image("data:image/png;base64,%s");' % image
|
||||
else:
|
||||
@ -258,6 +276,7 @@ class MainDisplay(DisplayWidget):
|
||||
self.displayImage(self.serviceItem.bg_image_bytes)
|
||||
else:
|
||||
self.displayImage(None)
|
||||
# clear the cache
|
||||
self.override = {}
|
||||
# Update the preview frame.
|
||||
if self.isLive:
|
||||
@ -332,6 +351,7 @@ class MainDisplay(DisplayWidget):
|
||||
"""
|
||||
log.debug(u'video')
|
||||
self.webLoaded = True
|
||||
self.setGeometry(self.screen[u'size'])
|
||||
# We are running a background theme
|
||||
self.override[u'theme'] = u''
|
||||
self.override[u'video'] = True
|
||||
@ -345,6 +365,10 @@ class MainDisplay(DisplayWidget):
|
||||
self.mediaObject.stop()
|
||||
self.mediaObject.clearQueue()
|
||||
self.mediaObject.setCurrentSource(Phonon.MediaSource(videoPath))
|
||||
# Need the timer to trigger set the trigger to 200ms
|
||||
# Value taken from web documentation.
|
||||
if self.serviceItem.end_time != 0:
|
||||
self.mediaObject.setTickInterval(200)
|
||||
self.mediaObject.play()
|
||||
self.webView.setVisible(False)
|
||||
self.videoWidget.setVisible(True)
|
||||
@ -354,13 +378,33 @@ class MainDisplay(DisplayWidget):
|
||||
Receiver.send_message(u'maindisplay_active')
|
||||
return self.preview()
|
||||
|
||||
def videoStart(self, newState, oldState):
|
||||
def videoState(self, newState, oldState):
|
||||
"""
|
||||
Start the video at a predetermined point.
|
||||
"""
|
||||
if newState == Phonon.PlayingState:
|
||||
if newState == Phonon.PlayingState \
|
||||
and oldState != Phonon.PausedState \
|
||||
and self.serviceItem.start_time > 0:
|
||||
# set start time in milliseconds
|
||||
self.mediaObject.seek(self.serviceItem.start_time * 1000)
|
||||
|
||||
def videoFinished(self):
|
||||
"""
|
||||
Blank the Video when it has finished so the final frame is not left
|
||||
hanging
|
||||
"""
|
||||
self.videoStop()
|
||||
self.hideDisplay(HideMode.Blank)
|
||||
self.phononActive = False
|
||||
self.videoHide = True
|
||||
|
||||
def videoTick(self, tick):
|
||||
"""
|
||||
Triggered on video tick every 200 milli seconds
|
||||
"""
|
||||
if tick > self.serviceItem.end_time * 1000:
|
||||
self.videoFinished()
|
||||
|
||||
def isWebLoaded(self):
|
||||
"""
|
||||
Called by webView event to show display is fully loaded
|
||||
@ -392,7 +436,14 @@ class MainDisplay(DisplayWidget):
|
||||
if self.hideMode:
|
||||
self.hideDisplay(self.hideMode)
|
||||
else:
|
||||
self.setVisible(True)
|
||||
# Single screen active
|
||||
if self.screens.monitor_number == 0:
|
||||
# Only make visible if setting enabled
|
||||
if QtCore.QSettings().value(u'general/display on monitor',
|
||||
QtCore.QVariant(True)).toBool():
|
||||
self.setVisible(True)
|
||||
else:
|
||||
self.setVisible(True)
|
||||
preview = QtGui.QImage(self.screen[u'size'].width(),
|
||||
self.screen[u'size'].height(),
|
||||
QtGui.QImage.Format_ARGB32_Premultiplied)
|
||||
@ -409,7 +460,7 @@ class MainDisplay(DisplayWidget):
|
||||
"""
|
||||
log.debug(u'buildHtml')
|
||||
self.webLoaded = False
|
||||
self.initialFrame = False
|
||||
self.initialFrame = None
|
||||
self.serviceItem = serviceItem
|
||||
background = None
|
||||
# We have an image override so keep the image till the theme changes
|
||||
@ -418,10 +469,12 @@ class MainDisplay(DisplayWidget):
|
||||
if u'video' in self.override:
|
||||
Receiver.send_message(u'video_background_replaced')
|
||||
self.override = {}
|
||||
# We have a different theme.
|
||||
elif self.override[u'theme'] != serviceItem.themedata.theme_name:
|
||||
Receiver.send_message(u'live_theme_changed')
|
||||
self.override = {}
|
||||
else:
|
||||
# replace the background
|
||||
background = self.imageManager. \
|
||||
get_image_bytes(self.override[u'image'])
|
||||
if self.serviceItem.themedata.background_filename:
|
||||
@ -436,7 +489,15 @@ class MainDisplay(DisplayWidget):
|
||||
self.footer(serviceItem.foot_text)
|
||||
# if was hidden keep it hidden
|
||||
if self.hideMode and self.isLive:
|
||||
self.hideDisplay(self.hideMode)
|
||||
if QtCore.QSettings().value(u'general/auto unblank',
|
||||
QtCore.QVariant(False)).toBool():
|
||||
Receiver.send_message(u'slidecontroller_live_unblank')
|
||||
else:
|
||||
self.hideDisplay(self.hideMode)
|
||||
# display hidden for video end we have a new item so must be shown
|
||||
if self.videoHide and self.isLive:
|
||||
self.videoHide = False
|
||||
self.showDisplay()
|
||||
self.__hideMouse()
|
||||
|
||||
def footer(self, text):
|
||||
@ -512,9 +573,6 @@ class AudioPlayer(QtCore.QObject):
|
||||
|
||||
``parent``
|
||||
The parent widget.
|
||||
|
||||
``screens``
|
||||
The list of screens.
|
||||
"""
|
||||
log.debug(u'AudioPlayer Initialisation started')
|
||||
QtCore.QObject.__init__(self, parent)
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode Woldsund #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# This program is free software; you can redistribute it and/or modify it #
|
||||
# under the terms of the GNU General Public License as published by the Free #
|
||||
@ -25,6 +25,8 @@
|
||||
###############################################################################
|
||||
|
||||
import logging
|
||||
import os
|
||||
from tempfile import gettempdir
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
@ -36,7 +38,7 @@ from openlp.core.ui import AboutForm, SettingsForm, ServiceManager, \
|
||||
ThemeManager, SlideController, PluginForm, MediaDockManager, \
|
||||
ShortcutListForm, DisplayTagForm
|
||||
from openlp.core.utils import AppLocation, add_actions, LanguageManager, \
|
||||
ActionList
|
||||
ActionList, get_application_version
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@ -215,8 +217,6 @@ class Ui_MainWindow(object):
|
||||
self.ModeDefaultItem.setChecked(True)
|
||||
self.ToolsAddToolItem = icon_action(mainWindow, u'ToolsAddToolItem',
|
||||
u':/tools/tools_add.png')
|
||||
# Hide the entry, as it does not have any functionality yet.
|
||||
self.ToolsAddToolItem.setVisible(False)
|
||||
mainWindow.actionList.add_action(self.ToolsAddToolItem, u'Tools')
|
||||
self.ToolsOpenDataFolder = icon_action(mainWindow,
|
||||
u'ToolsOpenDataFolder', u':/general/general_open.png')
|
||||
@ -232,7 +232,7 @@ class Ui_MainWindow(object):
|
||||
self.LanguageGroup = QtGui.QActionGroup(mainWindow)
|
||||
self.LanguageGroup.setExclusive(True)
|
||||
self.LanguageGroup.setObjectName(u'LanguageGroup')
|
||||
self.LanguageGroup.setDisabled(LanguageManager.auto_language)
|
||||
add_actions(self.LanguageGroup, [self.AutoLanguageItem])
|
||||
qmList = LanguageManager.get_qm_list()
|
||||
savedLanguage = LanguageManager.get_language()
|
||||
for key in sorted(qmList.keys()):
|
||||
@ -256,7 +256,6 @@ class Ui_MainWindow(object):
|
||||
u':/system/system_about.png')
|
||||
mainWindow.actionList.add_action(self.HelpAboutItem, u'Help')
|
||||
self.HelpOnlineHelpItem = base_action(mainWindow, u'HelpOnlineHelpItem')
|
||||
self.HelpOnlineHelpItem.setEnabled(False)
|
||||
mainWindow.actionList.add_action(self.HelpOnlineHelpItem, u'Help')
|
||||
self.helpWebSiteItem = base_action(mainWindow, u'helpWebSiteItem')
|
||||
mainWindow.actionList.add_action(self.helpWebSiteItem, u'Help')
|
||||
@ -298,6 +297,12 @@ class Ui_MainWindow(object):
|
||||
QtCore.QObject.connect(self.FileExitItem,
|
||||
QtCore.SIGNAL(u'triggered()'), mainWindow.close)
|
||||
QtCore.QMetaObject.connectSlotsByName(mainWindow)
|
||||
# Hide the entry, as it does not have any functionality yet.
|
||||
self.ToolsAddToolItem.setVisible(False)
|
||||
self.ImportLanguageItem.setVisible(False)
|
||||
self.ExportLanguageItem.setVisible(False)
|
||||
self.SettingsShortcutsItem.setVisible(False)
|
||||
self.HelpDocumentationItem.setVisible(False)
|
||||
|
||||
def retranslateUi(self, mainWindow):
|
||||
"""
|
||||
@ -423,16 +428,19 @@ class Ui_MainWindow(object):
|
||||
translate('OpenLP.MainWindow', 'Ctrl+F1'))
|
||||
self.HelpOnlineHelpItem.setText(
|
||||
translate('OpenLP.MainWindow', '&Online Help'))
|
||||
# Uncomment after 1.9.5 beta string freeze
|
||||
#self.HelpOnlineHelpItem.setShortcut(
|
||||
# translate('OpenLP.MainWindow', 'F1'))
|
||||
self.helpWebSiteItem.setText(
|
||||
translate('OpenLP.MainWindow', '&Web Site'))
|
||||
self.AutoLanguageItem.setText(
|
||||
translate('OpenLP.MainWindow', '&Auto Detect'))
|
||||
self.AutoLanguageItem.setStatusTip(translate('OpenLP.MainWindow',
|
||||
'Use the system language, if available.'))
|
||||
for item in self.LanguageGroup.actions():
|
||||
item.setText(item.objectName())
|
||||
item.setStatusTip(unicode(translate('OpenLP.MainWindow',
|
||||
'Set the interface language to %s')) % item.objectName())
|
||||
self.AutoLanguageItem.setText(
|
||||
translate('OpenLP.MainWindow', '&Autodetect'))
|
||||
self.AutoLanguageItem.setStatusTip(translate('OpenLP.MainWindow',
|
||||
'Use the system language, if available.'))
|
||||
self.ToolsAddToolItem.setText(
|
||||
translate('OpenLP.MainWindow', 'Add &Tool...'))
|
||||
self.ToolsAddToolItem.setStatusTip(translate('OpenLP.MainWindow',
|
||||
@ -461,16 +469,15 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||
|
||||
actionList = ActionList()
|
||||
|
||||
def __init__(self, screens, applicationVersion, clipboard, firstTime):
|
||||
def __init__(self, screens, clipboard, arguments):
|
||||
"""
|
||||
This constructor sets up the interface, the various managers, and the
|
||||
plugins.
|
||||
"""
|
||||
QtGui.QMainWindow.__init__(self)
|
||||
self.screens = screens
|
||||
self.actionList = ActionList()
|
||||
self.applicationVersion = applicationVersion
|
||||
self.clipboard = clipboard
|
||||
self.arguments = arguments
|
||||
# Set up settings sections for the main application
|
||||
# (not for use by plugins)
|
||||
self.uiSettingsSection = u'user interface'
|
||||
@ -478,8 +485,9 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||
self.serviceSettingsSection = u'servicemanager'
|
||||
self.songsSettingsSection = u'songs'
|
||||
self.serviceNotSaved = False
|
||||
self.actionList = ActionList()
|
||||
self.settingsmanager = SettingsManager(screens)
|
||||
self.aboutForm = AboutForm(self, applicationVersion)
|
||||
self.aboutForm = AboutForm(self)
|
||||
self.settingsForm = SettingsForm(self.screens, self, self)
|
||||
self.displayTagForm = DisplayTagForm(self)
|
||||
self.shortcutForm = ShortcutListForm(self)
|
||||
@ -523,6 +531,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||
self.ViewThemeManagerItem.setChecked)
|
||||
QtCore.QObject.connect(self.helpWebSiteItem,
|
||||
QtCore.SIGNAL(u'triggered()'), self.onHelpWebSiteClicked)
|
||||
QtCore.QObject.connect(self.HelpOnlineHelpItem,
|
||||
QtCore.SIGNAL(u'triggered()'), self.onHelpOnLineHelpClicked)
|
||||
QtCore.QObject.connect(self.HelpAboutItem,
|
||||
QtCore.SIGNAL(u'triggered()'), self.onHelpAboutItemClicked)
|
||||
QtCore.QObject.connect(self.ToolsOpenDataFolder,
|
||||
@ -550,8 +560,6 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||
QtCore.SIGNAL(u'triggered()'),
|
||||
self.ServiceManagerContents.printServiceOrder)
|
||||
# i18n set signals for languages
|
||||
QtCore.QObject.connect(self.AutoLanguageItem,
|
||||
QtCore.SIGNAL(u'toggled(bool)'), self.setAutoLanguage)
|
||||
self.LanguageGroup.triggered.connect(LanguageManager.set_language)
|
||||
QtCore.QObject.connect(self.ModeDefaultItem,
|
||||
QtCore.SIGNAL(u'triggered()'), self.onModeDefaultItemClicked)
|
||||
@ -614,9 +622,6 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||
# Call the initialise method to setup plugins.
|
||||
log.info(u'initialise plugins')
|
||||
self.pluginManager.initialise_plugins()
|
||||
# Once all components are initialised load the Themes
|
||||
log.info(u'Load Themes')
|
||||
self.themeManagerContents.loadThemes()
|
||||
log.info(u'Load data from Settings')
|
||||
if QtCore.QSettings().value(u'advanced/save current plugin',
|
||||
QtCore.QVariant(False)).toBool():
|
||||
@ -625,11 +630,10 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||
if savedPlugin != -1:
|
||||
self.MediaToolBox.setCurrentIndex(savedPlugin)
|
||||
self.settingsForm.postSetUp()
|
||||
# Once all components are initialised load the Themes
|
||||
log.info(u'Load Themes')
|
||||
self.themeManagerContents.loadThemes(True)
|
||||
Receiver.send_message(u'cursor_normal')
|
||||
# Import themes if first time
|
||||
if firstTime:
|
||||
self.themeManagerContents.firstTime()
|
||||
|
||||
|
||||
def setAutoLanguage(self, value):
|
||||
self.LanguageGroup.setDisabled(value)
|
||||
@ -647,7 +651,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||
'version from http://openlp.org/.'))
|
||||
QtGui.QMessageBox.question(self,
|
||||
translate('OpenLP.MainWindow', 'OpenLP Version Updated'),
|
||||
version_text % (version, self.applicationVersion[u'full']))
|
||||
version_text % (version, get_application_version()[u'full']))
|
||||
|
||||
def show(self):
|
||||
"""
|
||||
@ -657,7 +661,16 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||
if self.liveController.display.isVisible():
|
||||
self.liveController.display.setFocus()
|
||||
self.activateWindow()
|
||||
if QtCore.QSettings().value(
|
||||
# On Windows, arguments contains the entire commandline
|
||||
# So args[0]=='python' args[1]=='openlp.pyw'
|
||||
# Therefore this approach is not going to work
|
||||
# Bypass for now.
|
||||
if len(self.arguments) and os.name != u'nt':
|
||||
args = []
|
||||
for a in self.arguments:
|
||||
args.extend([a])
|
||||
self.ServiceManagerContents.loadFile(unicode(args[0]))
|
||||
elif QtCore.QSettings().value(
|
||||
self.generalSettingsSection + u'/auto open',
|
||||
QtCore.QVariant(False)).toBool():
|
||||
self.ServiceManagerContents.loadLastFile()
|
||||
@ -672,6 +685,19 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||
self.setViewMode(False, True, False, False, True)
|
||||
self.ModeLiveItem.setChecked(True)
|
||||
|
||||
def firstTime(self):
|
||||
# Import themes if first time
|
||||
Receiver.send_message(u'openlp_process_events')
|
||||
for plugin in self.pluginManager.plugins:
|
||||
if hasattr(plugin, u'firstTime'):
|
||||
Receiver.send_message(u'openlp_process_events')
|
||||
plugin.firstTime()
|
||||
Receiver.send_message(u'openlp_process_events')
|
||||
temp_dir = os.path.join(unicode(gettempdir()), u'openlp')
|
||||
for filename in os.listdir(temp_dir):
|
||||
os.remove(os.path.join(temp_dir, filename))
|
||||
os.removedirs(temp_dir)
|
||||
|
||||
def blankCheck(self):
|
||||
"""
|
||||
Check and display message if screen blank on setup.
|
||||
@ -705,11 +731,17 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||
import webbrowser
|
||||
webbrowser.open_new(u'http://openlp.org/')
|
||||
|
||||
def onHelpOnLineHelpClicked(self):
|
||||
"""
|
||||
Load the online OpenLP manual
|
||||
"""
|
||||
import webbrowser
|
||||
webbrowser.open_new(u'http://manual.openlp.org/')
|
||||
|
||||
def onHelpAboutItemClicked(self):
|
||||
"""
|
||||
Show the About form
|
||||
"""
|
||||
self.aboutForm.applicationVersion = self.applicationVersion
|
||||
self.aboutForm.exec_()
|
||||
|
||||
def onPluginItemClicked(self):
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
@ -64,8 +64,7 @@ class Ui_PrintServiceDialog(object):
|
||||
'Options'))
|
||||
self.optionsButton.setToolButtonStyle(
|
||||
QtCore.Qt.ToolButtonTextBesideIcon)
|
||||
self.optionsButton.setIcon(QtGui.QIcon(
|
||||
build_icon(u':/system/system_configure.png')))
|
||||
self.optionsButton.setIcon(build_icon(u':/system/system_configure.png'))
|
||||
self.optionsButton.setCheckable(True)
|
||||
self.toolbar.addWidget(self.optionsButton)
|
||||
self.closeButton = self.toolbar.addAction(
|
||||
@ -80,24 +79,23 @@ class Ui_PrintServiceDialog(object):
|
||||
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.setIcon(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.setIcon(
|
||||
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.setIcon(
|
||||
build_icon(u':/general/general_zoom_original.png'))
|
||||
self.zoomOriginalButton.setToolTip(translate('OpenLP.PrintServiceForm',
|
||||
'Zoom Original'))
|
||||
self.zoomOriginalButton.setObjectName(u'zoomOriginalButton')
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
@ -33,12 +33,12 @@ from openlp.core.ui.printservicedialog import Ui_PrintServiceDialog, ZoomSize
|
||||
|
||||
class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog):
|
||||
|
||||
def __init__(self, parent, serviceManager):
|
||||
def __init__(self, mainWindow, serviceManager):
|
||||
"""
|
||||
Constructor
|
||||
"""
|
||||
QtGui.QDialog.__init__(self, parent)
|
||||
self.parent = parent
|
||||
QtGui.QDialog.__init__(self, mainWindow)
|
||||
self.mainWindow = mainWindow
|
||||
self.serviceManager = serviceManager
|
||||
self.printer = QtGui.QPrinter()
|
||||
self.printDialog = QtGui.QPrintDialog(self.printer, self)
|
||||
@ -134,9 +134,12 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog):
|
||||
item.notes.replace(u'\n', u'<br />'))
|
||||
# Add play length of media files.
|
||||
if item.is_media() and self.metaDataCheckBox.isChecked():
|
||||
tme = item.media_length
|
||||
if item.end_time > 0:
|
||||
tme = item.end_time - item.start_time
|
||||
text += u'<p><strong>%s</strong> %s</p>' % (translate(
|
||||
'OpenLP.ServiceManager', u'Playing time:'),
|
||||
unicode(datetime.timedelta(seconds=item.media_length)))
|
||||
unicode(datetime.timedelta(seconds=tme)))
|
||||
if self.footerTextEdit.toPlainText():
|
||||
text += u'<h4>%s</h4>%s' % (translate('OpenLP.ServiceManager',
|
||||
u'Custom Service Notes:'), self.footerTextEdit.toPlainText())
|
||||
@ -181,13 +184,14 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog):
|
||||
"""
|
||||
Copies the display text to the clipboard as plain text
|
||||
"""
|
||||
self.parent.clipboard.setText(self.document.toPlainText())
|
||||
self.mainWindow.clipboard.setText(
|
||||
self.document.toPlainText())
|
||||
|
||||
def copyHtmlText(self):
|
||||
"""
|
||||
Copies the display text to the clipboard as Html
|
||||
"""
|
||||
self.parent.clipboard.setText(self.document.toHtml())
|
||||
self.mainWindow.clipboard.setText(self.document.toHtml())
|
||||
|
||||
def printServiceOrder(self):
|
||||
"""
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
@ -141,4 +141,3 @@ class ServiceItemEditForm(QtGui.QDialog, Ui_ServiceItemEditDialog):
|
||||
else:
|
||||
self.upButton.setEnabled(True)
|
||||
self.deleteButton.setEnabled(True)
|
||||
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
@ -49,6 +49,19 @@ class ServiceManagerList(QtGui.QTreeWidget):
|
||||
QtGui.QTreeWidget.__init__(self, parent)
|
||||
self.mainwindow = mainwindow
|
||||
|
||||
def keyPressEvent(self, event):
|
||||
if isinstance(event, QtGui.QKeyEvent):
|
||||
# here accept the event and do something
|
||||
if event.key() == QtCore.Qt.Key_Up:
|
||||
self.mainwindow.onMoveSelectionUp()
|
||||
event.accept()
|
||||
elif event.key() == QtCore.Qt.Key_Down:
|
||||
self.mainwindow.onMoveSelectionDown()
|
||||
event.accept()
|
||||
event.ignore()
|
||||
else:
|
||||
event.ignore()
|
||||
|
||||
def mouseMoveEvent(self, event):
|
||||
"""
|
||||
Drag and drop event does not care what data is selected
|
||||
@ -197,13 +210,13 @@ class ServiceManager(QtGui.QWidget):
|
||||
u':/services/service_expand_all.png',
|
||||
translate('OpenLP.ServiceManager',
|
||||
'Expand all the service items.'),
|
||||
self.onExpandAll)
|
||||
self.onExpandAll, shortcut=QtCore.Qt.Key_Plus)
|
||||
self.serviceManagerList.collapse = self.orderToolbar.addToolbarButton(
|
||||
translate('OpenLP.ServiceManager', '&Collapse all'),
|
||||
u':/services/service_collapse_all.png',
|
||||
translate('OpenLP.ServiceManager',
|
||||
'Collapse all the service items.'),
|
||||
self.onCollapseAll)
|
||||
self.onCollapseAll, shortcut=QtCore.Qt.Key_Minus)
|
||||
self.orderToolbar.addSeparator()
|
||||
self.serviceManagerList.makeLive = self.orderToolbar.addToolbarButton(
|
||||
translate('OpenLP.ServiceManager', 'Go Live'),
|
||||
@ -218,13 +231,15 @@ class ServiceManager(QtGui.QWidget):
|
||||
QtCore.QObject.connect(self.themeComboBox,
|
||||
QtCore.SIGNAL(u'activated(int)'), self.onThemeComboBoxSelected)
|
||||
QtCore.QObject.connect(self.serviceManagerList,
|
||||
QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), self.makeLive)
|
||||
QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), self.onMakeLive)
|
||||
QtCore.QObject.connect(self.serviceManagerList,
|
||||
QtCore.SIGNAL(u'itemCollapsed(QTreeWidgetItem*)'), self.collapsed)
|
||||
QtCore.QObject.connect(self.serviceManagerList,
|
||||
QtCore.SIGNAL(u'itemExpanded(QTreeWidgetItem*)'), self.expanded)
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'theme_update_list'), self.updateThemeList)
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'servicemanager_preview_live'), self.previewLive)
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'servicemanager_next_item'), self.nextItem)
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
@ -293,7 +308,9 @@ class ServiceManager(QtGui.QWidget):
|
||||
self.serviceManagerList.moveTop,
|
||||
self.serviceManagerList.moveBottom,
|
||||
self.serviceManagerList.up,
|
||||
self.serviceManagerList.down
|
||||
self.serviceManagerList.down,
|
||||
self.serviceManagerList.expand,
|
||||
self.serviceManagerList.collapse
|
||||
])
|
||||
self.configUpdated()
|
||||
|
||||
@ -306,6 +323,9 @@ class ServiceManager(QtGui.QWidget):
|
||||
actionList.add_action(self.serviceManagerList.makeLive, u'Service')
|
||||
actionList.add_action(self.serviceManagerList.up, u'Service')
|
||||
actionList.add_action(self.serviceManagerList.down, u'Service')
|
||||
actionList.add_action(self.serviceManagerList.expand, u'Service')
|
||||
actionList.add_action(self.serviceManagerList.collapse, u'Service')
|
||||
|
||||
|
||||
def setModified(self, modified=True):
|
||||
"""
|
||||
@ -415,48 +435,78 @@ class ServiceManager(QtGui.QWidget):
|
||||
"""
|
||||
if not self.fileName():
|
||||
return self.saveFileAs()
|
||||
else:
|
||||
fileName = self.fileName()
|
||||
log.debug(u'ServiceManager.saveFile - %s' % fileName)
|
||||
SettingsManager.set_last_dir(self.mainwindow.serviceSettingsSection,
|
||||
split_filename(fileName)[0])
|
||||
service = []
|
||||
serviceFileName = fileName.replace(u'.osz', u'.osd')
|
||||
zip = None
|
||||
file = None
|
||||
try:
|
||||
write_list = []
|
||||
zip = zipfile.ZipFile(unicode(fileName), 'w')
|
||||
for item in self.serviceItems:
|
||||
service.append({u'serviceitem': \
|
||||
item[u'service_item'].get_service_repr()})
|
||||
if item[u'service_item'].uses_file():
|
||||
for frame in item[u'service_item'].get_frames():
|
||||
if item[u'service_item'].is_image():
|
||||
path_from = frame[u'path']
|
||||
else:
|
||||
path_from = unicode(os.path.join(
|
||||
frame[u'path'],
|
||||
frame[u'title']))
|
||||
# On write a file once
|
||||
if not path_from in write_list:
|
||||
write_list.append(path_from)
|
||||
zip.write(path_from.encode(u'utf-8'))
|
||||
file = open(serviceFileName, u'wb')
|
||||
cPickle.dump(service, file)
|
||||
file.close()
|
||||
zip.write(serviceFileName.encode(u'utf-8'))
|
||||
except IOError:
|
||||
log.exception(u'Failed to save service to disk')
|
||||
finally:
|
||||
if file:
|
||||
file.close()
|
||||
if zip:
|
||||
zip.close()
|
||||
delete_file(serviceFileName)
|
||||
self.mainwindow.addRecentFile(fileName)
|
||||
path_file_name = unicode(self.fileName())
|
||||
(path, file_name) = os.path.split(path_file_name)
|
||||
(basename, extension) = os.path.splitext(file_name)
|
||||
service_file_name = basename + '.osd'
|
||||
log.debug(u'ServiceManager.saveFile - %s' % path_file_name)
|
||||
SettingsManager.set_last_dir(self.mainwindow.serviceSettingsSection,
|
||||
path)
|
||||
service = []
|
||||
write_list = []
|
||||
total_size = 0
|
||||
for item in self.serviceItems:
|
||||
service.append({u'serviceitem':
|
||||
item[u'service_item'].get_service_repr()})
|
||||
if not item[u'service_item'].uses_file():
|
||||
continue
|
||||
for frame in item[u'service_item'].get_frames():
|
||||
if item[u'service_item'].is_image():
|
||||
path_from = frame[u'path']
|
||||
else:
|
||||
path_from = os.path.join(frame[u'path'], frame[u'title'])
|
||||
# Only write a file once
|
||||
if path_from in write_list:
|
||||
continue
|
||||
file_size = os.path.getsize(path_from)
|
||||
size_limit = 52428800 # 50MiB
|
||||
#if file_size > size_limit:
|
||||
# # File exeeds size_limit bytes, ask user
|
||||
# message = unicode(translate('OpenLP.ServiceManager',
|
||||
# 'Do you want to include \n%.1f MB file "%s"\n'
|
||||
# 'into the service file?\nThis may take some time.\n\n'
|
||||
# 'Please note that you need to\ntake care of that file'
|
||||
# ' yourself,\nif you leave it out.')) % \
|
||||
# (file_size/1048576, os.path.split(path_from)[1])
|
||||
# ans = QtGui.QMessageBox.question(self.mainwindow,
|
||||
# translate('OpenLP.ServiceManager', 'Including Large '
|
||||
# 'File'), message, QtGui.QMessageBox.StandardButtons(
|
||||
# QtGui.QMessageBox.Ok|QtGui.QMessageBox.Cancel),
|
||||
# QtGui.QMessageBox.Ok)
|
||||
# if ans == QtGui.QMessageBox.Cancel:
|
||||
# continue
|
||||
write_list.append(path_from)
|
||||
total_size += file_size
|
||||
log.debug(u'ServiceManager.saveFile - ZIP contents size is %i bytes' %
|
||||
total_size)
|
||||
service_content = cPickle.dumps(service)
|
||||
# Usual Zip file cannot exceed 2GiB, file with Zip64 cannot be
|
||||
# extracted using unzip in UNIX.
|
||||
allow_zip_64 = (total_size > 2147483648 + len(service_content))
|
||||
log.debug(u'ServiceManager.saveFile - allowZip64 is %s' % allow_zip_64)
|
||||
zip = None
|
||||
success = True
|
||||
try:
|
||||
zip = zipfile.ZipFile(path_file_name, 'w', zipfile.ZIP_STORED,
|
||||
allow_zip_64)
|
||||
# First we add service contents.
|
||||
# We save ALL filenames into ZIP using UTF-8.
|
||||
zip.writestr(service_file_name.encode(u'utf-8'), service_content)
|
||||
# Finally add all the listed media files.
|
||||
for path_from in write_list:
|
||||
zip.write(path_from, path_from.encode(u'utf-8'))
|
||||
except IOError:
|
||||
log.exception(u'Failed to save service to disk')
|
||||
success = False
|
||||
finally:
|
||||
if zip:
|
||||
zip.close()
|
||||
if success:
|
||||
self.mainwindow.addRecentFile(path_file_name)
|
||||
self.setModified(False)
|
||||
return True
|
||||
else:
|
||||
delete_file(path_file_name)
|
||||
return success
|
||||
|
||||
def saveFileAs(self):
|
||||
"""
|
||||
@ -481,8 +531,9 @@ class ServiceManager(QtGui.QWidget):
|
||||
def loadFile(self, fileName):
|
||||
if not fileName:
|
||||
return False
|
||||
else:
|
||||
fileName = unicode(fileName)
|
||||
fileName = unicode(fileName)
|
||||
if not os.path.exists(fileName):
|
||||
return False
|
||||
zip = None
|
||||
fileTo = None
|
||||
try:
|
||||
@ -512,6 +563,7 @@ class ServiceManager(QtGui.QWidget):
|
||||
self.newFile()
|
||||
for item in items:
|
||||
serviceItem = ServiceItem()
|
||||
serviceItem.from_service = True
|
||||
serviceItem.render_manager = self.mainwindow.renderManager
|
||||
serviceItem.set_from_service(item, self.servicePath)
|
||||
self.validateItem(serviceItem)
|
||||
@ -520,24 +572,27 @@ class ServiceManager(QtGui.QWidget):
|
||||
Receiver.send_message(u'%s_service_load' %
|
||||
serviceItem.name.lower(), serviceItem)
|
||||
delete_file(p_file)
|
||||
self.setFileName(fileName)
|
||||
self.mainwindow.addRecentFile(fileName)
|
||||
self.setModified(False)
|
||||
QtCore.QSettings().setValue(
|
||||
'service/last file', QtCore.QVariant(fileName))
|
||||
Receiver.send_message(u'cursor_normal')
|
||||
else:
|
||||
critical_error_message_box(
|
||||
message=translate('OpenLP.ServiceManager',
|
||||
'File is not a valid service.'))
|
||||
log.exception(u'File contains no service data')
|
||||
except (IOError, NameError):
|
||||
except (IOError, NameError, zipfile.BadZipfile):
|
||||
critical_error_message_box(
|
||||
message=translate('OpenLP.ServiceManager',
|
||||
'File could not be opened because it is corrupt.'))
|
||||
log.exception(u'Problem loading service file %s' % fileName)
|
||||
finally:
|
||||
if fileTo:
|
||||
fileTo.close()
|
||||
if zip:
|
||||
zip.close()
|
||||
self.setFileName(fileName)
|
||||
self.mainwindow.addRecentFile(fileName)
|
||||
self.setModified(False)
|
||||
QtCore.QSettings(). \
|
||||
setValue(u'service/last file', QtCore.QVariant(fileName))
|
||||
|
||||
def loadLastFile(self):
|
||||
"""
|
||||
@ -572,7 +627,7 @@ class ServiceManager(QtGui.QWidget):
|
||||
if item.parent() is None:
|
||||
self.notesAction.setVisible(True)
|
||||
if serviceItem[u'service_item']\
|
||||
.is_capable(ItemCapabilities.AllowsVarableStartTime):
|
||||
.is_capable(ItemCapabilities.AllowsVariableStartTime):
|
||||
self.timeAction.setVisible(True)
|
||||
self.themeMenu.menuAction().setVisible(False)
|
||||
if serviceItem[u'service_item'].is_text():
|
||||
@ -606,10 +661,6 @@ class ServiceManager(QtGui.QWidget):
|
||||
item = self.findServiceItem()[0]
|
||||
self.startTimeForm.item = self.serviceItems[item]
|
||||
if self.startTimeForm.exec_():
|
||||
self.serviceItems[item][u'service_item'].start_time = \
|
||||
self.startTimeForm.hourSpinBox.value() * 3600 + \
|
||||
self.startTimeForm.minuteSpinBox.value() * 60 + \
|
||||
self.startTimeForm.secondSpinBox.value()
|
||||
self.repaintServiceList(item, -1)
|
||||
|
||||
def onServiceItemEditForm(self):
|
||||
@ -620,6 +671,19 @@ class ServiceManager(QtGui.QWidget):
|
||||
self.addServiceItem(self.serviceItemEditForm.getServiceItem(),
|
||||
replace=True, expand=self.serviceItems[item][u'expanded'])
|
||||
|
||||
def previewLive(self, message):
|
||||
"""
|
||||
Called by the SlideController to request a preview item be made live
|
||||
and allows the next preview to be updated if relevent.
|
||||
"""
|
||||
id, row = message.split(u':')
|
||||
for sitem in self.serviceItems:
|
||||
if sitem[u'service_item']._uuid == id:
|
||||
item = self.serviceManagerList.topLevelItem(sitem[u'order'] - 1)
|
||||
self.serviceManagerList.setCurrentItem(item)
|
||||
self.makeLive(int(row))
|
||||
return
|
||||
|
||||
def nextItem(self):
|
||||
"""
|
||||
Called by the SlideController to select the next service item.
|
||||
@ -859,7 +923,7 @@ class ServiceManager(QtGui.QWidget):
|
||||
child.setText(0, text[:40])
|
||||
child.setData(0, QtCore.Qt.UserRole, QtCore.QVariant(count))
|
||||
if item[u'service_item'] \
|
||||
.is_capable(ItemCapabilities.AllowsVarableStartTime):
|
||||
.is_capable(ItemCapabilities.AllowsVariableStartTime):
|
||||
tip = item[u'service_item'].get_media_time()
|
||||
if tip:
|
||||
child.setToolTip(0, tip)
|
||||
@ -975,6 +1039,7 @@ class ServiceManager(QtGui.QWidget):
|
||||
if expand is None:
|
||||
expand = self.expandTabs
|
||||
item.render()
|
||||
item.from_service = True
|
||||
if replace:
|
||||
sitem, child = self.findServiceItem()
|
||||
item.merge(self.serviceItems[sitem][u'service_item'])
|
||||
@ -1029,11 +1094,24 @@ class ServiceManager(QtGui.QWidget):
|
||||
else:
|
||||
return self.serviceItems[item][u'service_item']
|
||||
|
||||
def makeLive(self):
|
||||
def onMakeLive(self):
|
||||
"""
|
||||
Send the current item to the Live slide controller but triggered
|
||||
by a tablewidget click event.
|
||||
"""
|
||||
self.makeLive()
|
||||
|
||||
def makeLive(self, row=-1):
|
||||
"""
|
||||
Send the current item to the Live slide controller
|
||||
|
||||
``row``
|
||||
Row number to be displayed if from preview.
|
||||
-1 is passed if the value is not set
|
||||
"""
|
||||
item, child = self.findServiceItem()
|
||||
if row != -1:
|
||||
child = row
|
||||
if self.serviceItems[item][u'service_item'].is_valid:
|
||||
self.mainwindow.liveController.addServiceManagerItem(
|
||||
self.serviceItems[item][u'service_item'], child)
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
@ -117,7 +117,8 @@ class SlideController(QtGui.QWidget):
|
||||
self.previewListWidget.setColumnWidth(0, self.controller.width())
|
||||
self.previewListWidget.isLive = self.isLive
|
||||
self.previewListWidget.setObjectName(u'PreviewListWidget')
|
||||
self.previewListWidget.setSelectionBehavior(1)
|
||||
self.previewListWidget.setSelectionBehavior(
|
||||
QtGui.QAbstractItemView.SelectRows)
|
||||
self.previewListWidget.setSelectionMode(
|
||||
QtGui.QAbstractItemView.SingleSelection)
|
||||
self.previewListWidget.setEditTriggers(
|
||||
@ -184,7 +185,7 @@ class SlideController(QtGui.QWidget):
|
||||
self.delaySpinBox.setMinimum(1)
|
||||
self.delaySpinBox.setMaximum(180)
|
||||
self.toolbar.addToolbarWidget(u'Image SpinBox', self.delaySpinBox)
|
||||
self.delaySpinBox.setSuffix(UiStrings.S)
|
||||
self.delaySpinBox.setSuffix(UiStrings.Seconds)
|
||||
self.delaySpinBox.setToolTip(translate('OpenLP.SlideController',
|
||||
'Delay between slides in seconds'))
|
||||
else:
|
||||
@ -857,6 +858,7 @@ class SlideController(QtGui.QWidget):
|
||||
self.serviceItem.bg_image_bytes = None
|
||||
self.slidePreview.setPixmap(QtGui.QPixmap.fromImage(frame))
|
||||
self.selectedRow = row
|
||||
self.__checkUpdateSelectedSlide(row)
|
||||
Receiver.send_message(u'slidecontroller_%s_changed' % self.typePrefix,
|
||||
row)
|
||||
|
||||
@ -1012,8 +1014,12 @@ class SlideController(QtGui.QWidget):
|
||||
"""
|
||||
row = self.previewListWidget.currentRow()
|
||||
if row > -1 and row < self.previewListWidget.rowCount():
|
||||
self.parent.liveController.addServiceManagerItem(
|
||||
self.serviceItem, row)
|
||||
if self.serviceItem.from_service:
|
||||
Receiver.send_message('servicemanager_preview_live',
|
||||
u'%s:%s' % (self.serviceItem._uuid, row))
|
||||
else:
|
||||
self.parent.liveController.addServiceManagerItem(
|
||||
self.serviceItem, row)
|
||||
|
||||
def onMediaStart(self, item):
|
||||
"""
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
@ -32,39 +32,90 @@ 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)
|
||||
StartTimeDialog.resize(350, 10)
|
||||
self.dialogLayout = QtGui.QGridLayout(StartTimeDialog)
|
||||
self.dialogLayout.setObjectName(u'dialogLayout')
|
||||
self.startLabel = QtGui.QLabel(StartTimeDialog)
|
||||
self.startLabel.setObjectName(u'startLabel')
|
||||
self.startLabel.setAlignment(QtCore.Qt.AlignHCenter)
|
||||
self.dialogLayout.addWidget(self.startLabel, 0, 1, 1, 1)
|
||||
self.finishLabel = QtGui.QLabel(StartTimeDialog)
|
||||
self.finishLabel.setObjectName(u'finishLabel')
|
||||
self.finishLabel.setAlignment(QtCore.Qt.AlignHCenter)
|
||||
self.dialogLayout.addWidget(self.finishLabel, 0, 2, 1, 1)
|
||||
self.lengthLabel = QtGui.QLabel(StartTimeDialog)
|
||||
self.lengthLabel.setObjectName(u'startLabel')
|
||||
self.lengthLabel.setAlignment(QtCore.Qt.AlignHCenter)
|
||||
self.dialogLayout.addWidget(self.lengthLabel, 0, 3, 1, 1)
|
||||
self.hourLabel = QtGui.QLabel(StartTimeDialog)
|
||||
self.hourLabel.setObjectName("hourLabel")
|
||||
self.dialogLayout.addWidget(self.hourLabel, 0, 0, 1, 1)
|
||||
self.hourLabel.setObjectName(u'hourLabel')
|
||||
self.dialogLayout.addWidget(self.hourLabel, 1, 0, 1, 1)
|
||||
self.hourSpinBox = QtGui.QSpinBox(StartTimeDialog)
|
||||
self.hourSpinBox.setObjectName("hourSpinBox")
|
||||
self.dialogLayout.addWidget(self.hourSpinBox, 0, 1, 1, 1)
|
||||
self.hourSpinBox.setObjectName(u'hourSpinBox')
|
||||
self.hourSpinBox.setMinimum(0)
|
||||
self.hourSpinBox.setMaximum(4)
|
||||
self.dialogLayout.addWidget(self.hourSpinBox, 1, 1, 1, 1)
|
||||
self.hourFinishSpinBox = QtGui.QSpinBox(StartTimeDialog)
|
||||
self.hourFinishSpinBox.setObjectName(u'hourFinishSpinBox')
|
||||
self.hourFinishSpinBox.setMinimum(0)
|
||||
self.hourFinishSpinBox.setMaximum(4)
|
||||
self.dialogLayout.addWidget(self.hourFinishSpinBox, 1, 2, 1, 1)
|
||||
self.hourFinishLabel = QtGui.QLabel(StartTimeDialog)
|
||||
self.hourFinishLabel.setObjectName(u'hourLabel')
|
||||
self.hourFinishLabel.setAlignment(QtCore.Qt.AlignRight)
|
||||
self.dialogLayout.addWidget(self.hourFinishLabel, 1, 3, 1, 1)
|
||||
self.minuteLabel = QtGui.QLabel(StartTimeDialog)
|
||||
self.minuteLabel.setObjectName("minuteLabel")
|
||||
self.dialogLayout.addWidget(self.minuteLabel, 1, 0, 1, 1)
|
||||
self.minuteLabel.setObjectName(u'minuteLabel')
|
||||
self.dialogLayout.addWidget(self.minuteLabel, 2, 0, 1, 1)
|
||||
self.minuteSpinBox = QtGui.QSpinBox(StartTimeDialog)
|
||||
self.minuteSpinBox.setObjectName("minuteSpinBox")
|
||||
self.dialogLayout.addWidget(self.minuteSpinBox, 1, 1, 1, 1)
|
||||
self.minuteSpinBox.setObjectName(u'minuteSpinBox')
|
||||
self.minuteSpinBox.setMinimum(0)
|
||||
self.minuteSpinBox.setMaximum(59)
|
||||
self.dialogLayout.addWidget(self.minuteSpinBox, 2, 1, 1, 1)
|
||||
self.minuteFinishSpinBox = QtGui.QSpinBox(StartTimeDialog)
|
||||
self.minuteFinishSpinBox.setObjectName(u'minuteFinishSpinBox')
|
||||
self.minuteFinishSpinBox.setMinimum(0)
|
||||
self.minuteFinishSpinBox.setMaximum(59)
|
||||
self.dialogLayout.addWidget(self.minuteFinishSpinBox, 2, 2, 1, 1)
|
||||
self.minuteFinishLabel = QtGui.QLabel(StartTimeDialog)
|
||||
self.minuteFinishLabel.setObjectName(u'minuteLabel')
|
||||
self.minuteFinishLabel.setAlignment(QtCore.Qt.AlignRight)
|
||||
self.dialogLayout.addWidget(self.minuteFinishLabel, 2, 3, 1, 1)
|
||||
self.secondLabel = QtGui.QLabel(StartTimeDialog)
|
||||
self.secondLabel.setObjectName("secondLabel")
|
||||
self.dialogLayout.addWidget(self.secondLabel, 2, 0, 1, 1)
|
||||
self.secondLabel.setObjectName(u'secondLabel')
|
||||
self.dialogLayout.addWidget(self.secondLabel, 3, 0, 1, 1)
|
||||
self.secondSpinBox = QtGui.QSpinBox(StartTimeDialog)
|
||||
self.secondSpinBox.setObjectName("secondSpinBox")
|
||||
self.dialogLayout.addWidget(self.secondSpinBox, 2, 1, 1, 1)
|
||||
self.secondSpinBox.setObjectName(u'secondSpinBox')
|
||||
self.secondSpinBox.setMinimum(0)
|
||||
self.secondSpinBox.setMaximum(59)
|
||||
self.secondFinishSpinBox = QtGui.QSpinBox(StartTimeDialog)
|
||||
self.secondFinishSpinBox.setObjectName(u'secondFinishSpinBox')
|
||||
self.secondFinishSpinBox.setMinimum(0)
|
||||
self.secondFinishSpinBox.setMaximum(59)
|
||||
self.dialogLayout.addWidget(self.secondFinishSpinBox, 3, 2, 1, 1)
|
||||
self.secondFinishLabel = QtGui.QLabel(StartTimeDialog)
|
||||
self.secondFinishLabel.setObjectName(u'secondLabel')
|
||||
self.secondFinishLabel.setAlignment(QtCore.Qt.AlignRight)
|
||||
self.dialogLayout.addWidget(self.secondFinishLabel, 3, 3, 1, 1)
|
||||
self.dialogLayout.addWidget(self.secondSpinBox, 3, 1, 1, 1)
|
||||
self.buttonBox = create_accept_reject_button_box(StartTimeDialog, True)
|
||||
self.dialogLayout.addWidget(self.buttonBox, 4, 0, 1, 2)
|
||||
self.dialogLayout.addWidget(self.buttonBox, 5, 2, 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'))
|
||||
'Item Start and Finish Time'))
|
||||
self.hourSpinBox.setSuffix(UiStrings.Hours)
|
||||
self.minuteSpinBox.setSuffix(UiStrings.Minutes)
|
||||
self.secondSpinBox.setSuffix(UiStrings.Seconds)
|
||||
self.hourFinishSpinBox.setSuffix(UiStrings.Hours)
|
||||
self.minuteFinishSpinBox.setSuffix(UiStrings.Minutes)
|
||||
self.secondFinishSpinBox.setSuffix(UiStrings.Seconds)
|
||||
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:'))
|
||||
self.startLabel.setText(translate('OpenLP.StartTimeForm', 'Start'))
|
||||
self.finishLabel.setText(translate('OpenLP.StartTimeForm', 'Finish'))
|
||||
self.lengthLabel.setText(translate('OpenLP.StartTimeForm', 'Length'))
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode Woldsund #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# This program is free software; you can redistribute it and/or modify it #
|
||||
# under the terms of the GNU General Public License as published by the Free #
|
||||
@ -28,6 +28,9 @@ from PyQt4 import QtGui
|
||||
|
||||
from starttimedialog import Ui_StartTimeDialog
|
||||
|
||||
from openlp.core.lib import translate
|
||||
from openlp.core.lib.ui import UiStrings, critical_error_message_box
|
||||
|
||||
class StartTimeForm(QtGui.QDialog, Ui_StartTimeDialog):
|
||||
"""
|
||||
The exception dialog
|
||||
@ -40,13 +43,51 @@ class StartTimeForm(QtGui.QDialog, Ui_StartTimeDialog):
|
||||
"""
|
||||
Run the Dialog with correct heading.
|
||||
"""
|
||||
seconds = self.item[u'service_item'].start_time
|
||||
hour, minutes, seconds = self._time_split(
|
||||
self.item[u'service_item'].start_time)
|
||||
self.hourSpinBox.setValue(hour)
|
||||
self.minuteSpinBox.setValue(minutes)
|
||||
self.secondSpinBox.setValue(seconds)
|
||||
hours, minutes, seconds = self._time_split(
|
||||
self.item[u'service_item'].media_length)
|
||||
self.hourFinishSpinBox.setValue(hours)
|
||||
self.minuteFinishSpinBox.setValue(minutes)
|
||||
self.secondFinishSpinBox.setValue(seconds)
|
||||
self.hourFinishLabel.setText(u'%s%s' % (unicode(hour), UiStrings.Hours))
|
||||
self.minuteFinishLabel.setText(u'%s%s' %
|
||||
(unicode(minutes), UiStrings.Minutes))
|
||||
self.secondFinishLabel.setText(u'%s%s' %
|
||||
(unicode(seconds), UiStrings.Seconds))
|
||||
return QtGui.QDialog.exec_(self)
|
||||
|
||||
def accept(self):
|
||||
start = self.hourSpinBox.value() * 3600 + \
|
||||
self.minuteSpinBox.value() * 60 + \
|
||||
self.secondSpinBox.value()
|
||||
end = self.hourFinishSpinBox.value() * 3600 + \
|
||||
self.minuteFinishSpinBox.value() * 60 + \
|
||||
self.secondFinishSpinBox.value()
|
||||
if end > self.item[u'service_item'].media_length:
|
||||
critical_error_message_box(
|
||||
title=translate('OpenLP.StartTimeForm',
|
||||
'Time Validation Error'),
|
||||
message=translate('OpenLP.StartTimeForm',
|
||||
'End time is set after the end of the media item'))
|
||||
return
|
||||
elif start > end:
|
||||
critical_error_message_box(
|
||||
title=translate('OpenLP.StartTimeForm',
|
||||
'Time Validation Error'),
|
||||
message=translate('OpenLP.StartTimeForm',
|
||||
'Start time is after the End Time of the media item'))
|
||||
return
|
||||
self.item[u'service_item'].start_time = start
|
||||
self.item[u'service_item'].end_time = end
|
||||
return QtGui.QDialog.accept(self)
|
||||
|
||||
def _time_split(self, seconds):
|
||||
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)
|
||||
|
||||
return hours, minutes, seconds
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
@ -156,10 +156,9 @@ class ThemeManager(QtGui.QWidget):
|
||||
file = os.path.join(self.path, file).encode(encoding)
|
||||
self.unzipTheme(file, self.path)
|
||||
delete_file(file)
|
||||
self.loadThemes()
|
||||
Receiver.send_message(u'cursor_normal')
|
||||
|
||||
def configUpdated(self, firstTime=False):
|
||||
def configUpdated(self):
|
||||
"""
|
||||
Triggered when Config dialog is updated.
|
||||
"""
|
||||
@ -424,16 +423,16 @@ class ThemeManager(QtGui.QWidget):
|
||||
unicode(translate('OpenLP.ThemeManager',
|
||||
'OpenLP Themes (*.theme *.otz)')))
|
||||
log.info(u'New Themes %s', unicode(files))
|
||||
if not files:
|
||||
return
|
||||
Receiver.send_message(u'cursor_busy')
|
||||
if files:
|
||||
for file in files:
|
||||
SettingsManager.set_last_dir(
|
||||
self.settingsSection, unicode(file))
|
||||
self.unzipTheme(file, self.path)
|
||||
for file in files:
|
||||
SettingsManager.set_last_dir(self.settingsSection, unicode(file))
|
||||
self.unzipTheme(file, self.path)
|
||||
self.loadThemes()
|
||||
Receiver.send_message(u'cursor_normal')
|
||||
|
||||
def loadThemes(self):
|
||||
def loadThemes(self, firstTime=False):
|
||||
"""
|
||||
Loads the theme lists and triggers updates accross the whole system
|
||||
using direct calls or core functions and events for the plugins.
|
||||
@ -443,31 +442,44 @@ class ThemeManager(QtGui.QWidget):
|
||||
self.themelist = []
|
||||
self.themeListWidget.clear()
|
||||
dirList = os.listdir(self.path)
|
||||
dirList.sort()
|
||||
for name in dirList:
|
||||
if name.endswith(u'.png'):
|
||||
# check to see file is in theme root directory
|
||||
theme = os.path.join(self.path, name)
|
||||
if os.path.exists(theme):
|
||||
textName = os.path.splitext(name)[0]
|
||||
if textName == self.global_theme:
|
||||
name = unicode(translate('OpenLP.ThemeManager',
|
||||
'%s (default)')) % textName
|
||||
else:
|
||||
name = textName
|
||||
thumb = os.path.join(self.thumbPath, u'%s.png' % textName)
|
||||
item_name = QtGui.QListWidgetItem(name)
|
||||
if os.path.exists(thumb):
|
||||
icon = build_icon(thumb)
|
||||
else:
|
||||
icon = build_icon(theme)
|
||||
pixmap = icon.pixmap(QtCore.QSize(88, 50))
|
||||
pixmap.save(thumb, u'png')
|
||||
item_name.setIcon(icon)
|
||||
item_name.setData(QtCore.Qt.UserRole,
|
||||
QtCore.QVariant(textName))
|
||||
self.themeListWidget.addItem(item_name)
|
||||
self.themelist.append(textName)
|
||||
files = SettingsManager.get_files(self.settingsSection, u'.png')
|
||||
if firstTime:
|
||||
self.firstTime()
|
||||
# No themes have been found so create one
|
||||
if len(files) == 0:
|
||||
theme = ThemeXML()
|
||||
theme.theme_name = UiStrings.Default
|
||||
self._writeTheme(theme, None, None)
|
||||
QtCore.QSettings().setValue(
|
||||
self.settingsSection + u'/global theme',
|
||||
QtCore.QVariant(theme.theme_name))
|
||||
self.configUpdated()
|
||||
files = SettingsManager.get_files(self.settingsSection, u'.png')
|
||||
files.sort()
|
||||
# now process the file list of png files
|
||||
for name in files:
|
||||
# check to see file is in theme root directory
|
||||
theme = os.path.join(self.path, name)
|
||||
if os.path.exists(theme):
|
||||
textName = os.path.splitext(name)[0]
|
||||
if textName == self.global_theme:
|
||||
name = unicode(translate('OpenLP.ThemeManager',
|
||||
'%s (default)')) % textName
|
||||
else:
|
||||
name = textName
|
||||
thumb = os.path.join(self.thumbPath, u'%s.png' % textName)
|
||||
item_name = QtGui.QListWidgetItem(name)
|
||||
if os.path.exists(thumb):
|
||||
icon = build_icon(thumb)
|
||||
else:
|
||||
icon = build_icon(theme)
|
||||
pixmap = icon.pixmap(QtCore.QSize(88, 50))
|
||||
pixmap.save(thumb, u'png')
|
||||
item_name.setIcon(icon)
|
||||
item_name.setData(QtCore.Qt.UserRole,
|
||||
QtCore.QVariant(textName))
|
||||
self.themeListWidget.addItem(item_name)
|
||||
self.themelist.append(textName)
|
||||
self._pushThemes()
|
||||
|
||||
def _pushThemes(self):
|
||||
@ -502,16 +514,16 @@ class ThemeManager(QtGui.QWidget):
|
||||
def unzipTheme(self, filename, dir):
|
||||
"""
|
||||
Unzip the theme, remove the preview file if stored
|
||||
Generate a new preview fileCheck the XML theme version and upgrade if
|
||||
Generate a new preview file. Check the XML theme version and upgrade if
|
||||
necessary.
|
||||
"""
|
||||
log.debug(u'Unzipping theme %s', filename)
|
||||
filename = unicode(filename)
|
||||
zip = None
|
||||
outfile = None
|
||||
filexml = None
|
||||
try:
|
||||
zip = zipfile.ZipFile(filename)
|
||||
filexml = None
|
||||
themename = None
|
||||
for file in zip.namelist():
|
||||
ucsfile = file_is_unicode(file)
|
||||
@ -547,7 +559,7 @@ class ThemeManager(QtGui.QWidget):
|
||||
else:
|
||||
outfile = open(fullpath, u'wb')
|
||||
outfile.write(zip.read(file))
|
||||
except (IOError, NameError):
|
||||
except (IOError, NameError, zipfile.BadZipfile):
|
||||
critical_error_message_box(
|
||||
translate('OpenLP.ThemeManager', 'Validation Error'),
|
||||
translate('OpenLP.ThemeManager', 'File is not a valid theme.'))
|
||||
@ -562,7 +574,9 @@ class ThemeManager(QtGui.QWidget):
|
||||
if filexml:
|
||||
theme = self._createThemeFromXml(filexml, self.path)
|
||||
self.generateAndSaveImage(dir, themename, theme)
|
||||
else:
|
||||
# Only show the error message, when IOError was not raised (in this
|
||||
# case the error message has already been shown).
|
||||
elif zip is not None:
|
||||
critical_error_message_box(
|
||||
translate('OpenLP.ThemeManager', 'Validation Error'),
|
||||
translate('OpenLP.ThemeManager',
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
@ -33,8 +33,10 @@ import sys
|
||||
import time
|
||||
import urllib2
|
||||
from datetime import datetime
|
||||
from subprocess import Popen, PIPE
|
||||
|
||||
from PyQt4 import QtGui, QtCore
|
||||
|
||||
if sys.platform != u'win32' and sys.platform != u'darwin':
|
||||
try:
|
||||
from xdg import BaseDirectory
|
||||
@ -43,9 +45,10 @@ if sys.platform != u'win32' and sys.platform != u'darwin':
|
||||
XDG_BASE_AVAILABLE = False
|
||||
|
||||
import openlp
|
||||
from openlp.core.lib import Receiver, translate
|
||||
from openlp.core.lib import Receiver, translate, check_directory_exists
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
APPLICATION_VERSION = {}
|
||||
IMAGES_FILTER = None
|
||||
UNO_CONNECTION_TYPE = u'pipe'
|
||||
#UNO_CONNECTION_TYPE = u'socket'
|
||||
@ -55,9 +58,8 @@ class VersionThread(QtCore.QThread):
|
||||
A special Qt thread class to fetch the version of OpenLP from the website.
|
||||
This is threaded so that it doesn't affect the loading time of OpenLP.
|
||||
"""
|
||||
def __init__(self, parent, app_version):
|
||||
def __init__(self, parent):
|
||||
QtCore.QThread.__init__(self, parent)
|
||||
self.app_version = app_version
|
||||
self.version_splitter = re.compile(
|
||||
r'([0-9]+).([0-9]+).([0-9]+)(?:-bzr([0-9]+))?')
|
||||
|
||||
@ -67,7 +69,8 @@ class VersionThread(QtCore.QThread):
|
||||
"""
|
||||
time.sleep(1)
|
||||
Receiver.send_message(u'maindisplay_blank_check')
|
||||
version = check_latest_version(self.app_version)
|
||||
app_version = get_application_version()
|
||||
version = check_latest_version(app_version)
|
||||
remote_version = {}
|
||||
local_version = {}
|
||||
match = self.version_splitter.match(version)
|
||||
@ -79,7 +82,7 @@ class VersionThread(QtCore.QThread):
|
||||
remote_version[u'revision'] = int(match.group(4))
|
||||
else:
|
||||
return
|
||||
match = self.version_splitter.match(self.app_version[u'full'])
|
||||
match = self.version_splitter.match(app_version[u'full'])
|
||||
if match:
|
||||
local_version[u'major'] = int(match.group(1))
|
||||
local_version[u'minor'] = int(match.group(2))
|
||||
@ -134,7 +137,7 @@ class AppLocation(object):
|
||||
elif dir_type == AppLocation.LanguageDir:
|
||||
app_path = _get_frozen_path(
|
||||
os.path.abspath(os.path.split(sys.argv[0])[0]),
|
||||
os.path.split(openlp.__file__)[0])
|
||||
_get_os_dir_path(dir_type))
|
||||
return os.path.join(app_path, u'i18n')
|
||||
else:
|
||||
return _get_os_dir_path(dir_type)
|
||||
@ -145,8 +148,7 @@ class AppLocation(object):
|
||||
Return the path OpenLP stores all its data under.
|
||||
"""
|
||||
path = AppLocation.get_directory(AppLocation.DataDir)
|
||||
if not os.path.exists(path):
|
||||
os.makedirs(path)
|
||||
check_directory_exists(path)
|
||||
return path
|
||||
|
||||
@staticmethod
|
||||
@ -156,8 +158,7 @@ class AppLocation(object):
|
||||
"""
|
||||
data_path = AppLocation.get_data_path()
|
||||
path = os.path.join(data_path, section)
|
||||
if not os.path.exists(path):
|
||||
os.makedirs(path)
|
||||
check_directory_exists(path)
|
||||
return path
|
||||
|
||||
def _get_os_dir_path(dir_type):
|
||||
@ -169,15 +170,21 @@ def _get_os_dir_path(dir_type):
|
||||
if dir_type == AppLocation.DataDir:
|
||||
return os.path.join(unicode(os.getenv(u'APPDATA'), encoding),
|
||||
u'openlp', u'data')
|
||||
elif dir_type == AppLocation.LanguageDir:
|
||||
return os.path.split(openlp.__file__)[0]
|
||||
return os.path.join(unicode(os.getenv(u'APPDATA'), encoding),
|
||||
u'openlp')
|
||||
elif sys.platform == u'darwin':
|
||||
if dir_type == AppLocation.DataDir:
|
||||
return os.path.join(unicode(os.getenv(u'HOME'), encoding),
|
||||
u'Library', u'Application Support', u'openlp', u'Data')
|
||||
elif dir_type == AppLocation.LanguageDir:
|
||||
return os.path.split(openlp.__file__)[0]
|
||||
return os.path.join(unicode(os.getenv(u'HOME'), encoding),
|
||||
u'Library', u'Application Support', u'openlp')
|
||||
else:
|
||||
if dir_type == AppLocation.LanguageDir:
|
||||
return os.path.join(u'/usr', u'share', u'openlp')
|
||||
if XDG_BASE_AVAILABLE:
|
||||
if dir_type == AppLocation.ConfigDir:
|
||||
return os.path.join(unicode(BaseDirectory.xdg_config_home,
|
||||
@ -201,6 +208,85 @@ def _get_frozen_path(frozen_option, non_frozen_option):
|
||||
return frozen_option
|
||||
return non_frozen_option
|
||||
|
||||
def get_application_version():
|
||||
"""
|
||||
Returns the application version of the running instance of OpenLP::
|
||||
|
||||
{u'full': u'1.9.4-bzr1249', u'version': u'1.9.4', u'build': u'bzr1249'}
|
||||
"""
|
||||
global APPLICATION_VERSION
|
||||
if APPLICATION_VERSION:
|
||||
return APPLICATION_VERSION
|
||||
if u'--dev-version' in sys.argv or u'-d' in sys.argv:
|
||||
# If we're running the dev version, let's use bzr to get the version.
|
||||
try:
|
||||
# If bzrlib is available, use it.
|
||||
from bzrlib.branch import Branch
|
||||
b = Branch.open_containing('.')[0]
|
||||
b.lock_read()
|
||||
try:
|
||||
# Get the branch's latest revision number.
|
||||
revno = b.revno()
|
||||
# Convert said revision number into a bzr revision id.
|
||||
revision_id = b.dotted_revno_to_revision_id((revno,))
|
||||
# Get a dict of tags, with the revision id as the key.
|
||||
tags = b.tags.get_reverse_tag_dict()
|
||||
# Check if the latest
|
||||
if revision_id in tags:
|
||||
full_version = u'%s' % tags[revision_id][0]
|
||||
else:
|
||||
full_version = '%s-bzr%s' % \
|
||||
(sorted(b.tags.get_tag_dict().keys())[-1], revno)
|
||||
finally:
|
||||
b.unlock()
|
||||
except:
|
||||
# Otherwise run the command line bzr client.
|
||||
bzr = Popen((u'bzr', u'tags', u'--sort', u'time'), stdout=PIPE)
|
||||
output, error = bzr.communicate()
|
||||
code = bzr.wait()
|
||||
if code != 0:
|
||||
raise Exception(u'Error running bzr tags')
|
||||
lines = output.splitlines()
|
||||
if len(lines) == 0:
|
||||
tag = u'0.0.0'
|
||||
revision = u'0'
|
||||
else:
|
||||
tag, revision = lines[-1].split()
|
||||
bzr = Popen((u'bzr', u'log', u'--line', u'-r', u'-1'), stdout=PIPE)
|
||||
output, error = bzr.communicate()
|
||||
code = bzr.wait()
|
||||
if code != 0:
|
||||
raise Exception(u'Error running bzr log')
|
||||
latest = output.split(u':')[0]
|
||||
full_version = latest == revision and tag or \
|
||||
u'%s-bzr%s' % (tag, latest)
|
||||
else:
|
||||
# We're not running the development version, let's use the file.
|
||||
filepath = AppLocation.get_directory(AppLocation.VersionDir)
|
||||
filepath = os.path.join(filepath, u'.version')
|
||||
fversion = None
|
||||
try:
|
||||
fversion = open(filepath, u'r')
|
||||
full_version = unicode(fversion.read()).rstrip()
|
||||
except IOError:
|
||||
log.exception('Error in version file.')
|
||||
full_version = u'0.0.0-bzr000'
|
||||
finally:
|
||||
if fversion:
|
||||
fversion.close()
|
||||
bits = full_version.split(u'-')
|
||||
APPLICATION_VERSION = {
|
||||
u'full': full_version,
|
||||
u'version': bits[0],
|
||||
u'build': bits[1] if len(bits) > 1 else None
|
||||
}
|
||||
if APPLICATION_VERSION[u'build']:
|
||||
log.info(u'Openlp version %s build %s',
|
||||
APPLICATION_VERSION[u'version'], APPLICATION_VERSION[u'build'])
|
||||
else:
|
||||
log.info(u'Openlp version %s' % APPLICATION_VERSION[u'version'])
|
||||
return APPLICATION_VERSION
|
||||
|
||||
def check_latest_version(current_version):
|
||||
"""
|
||||
Check the latest version of OpenLP against the version file on the OpenLP
|
||||
@ -337,6 +423,7 @@ def get_web_page(url, header=None, update_openlp=False):
|
||||
return None
|
||||
if update_openlp:
|
||||
Receiver.send_message(u'openlp_process_events')
|
||||
log.debug(page)
|
||||
return page
|
||||
|
||||
def file_is_unicode(filename):
|
||||
@ -383,7 +470,7 @@ def get_uno_command():
|
||||
Returns the UNO command to launch an openoffice.org instance.
|
||||
"""
|
||||
COMMAND = u'soffice'
|
||||
OPTIONS = u'-nologo -norestore -minimized -invisible -nofirststartwizard'
|
||||
OPTIONS = u'-nologo -norestore -minimized -nodefault -nofirststartwizard'
|
||||
if UNO_CONNECTION_TYPE == u'pipe':
|
||||
CONNECTION = u'"-accept=pipe,name=openlp_pipe;urp;"'
|
||||
else:
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
@ -63,6 +63,8 @@ class LanguageManager(object):
|
||||
"""
|
||||
Find all available language files in this OpenLP install
|
||||
"""
|
||||
log.debug(u'Translation files: %s', AppLocation.get_directory(
|
||||
AppLocation.LanguageDir))
|
||||
trans_dir = QtCore.QDir(AppLocation.get_directory(
|
||||
AppLocation.LanguageDir))
|
||||
file_names = trans_dir.entryList(QtCore.QStringList(u'*.qm'),
|
||||
@ -89,7 +91,7 @@ class LanguageManager(object):
|
||||
"""
|
||||
Retrieve a saved language to use from settings
|
||||
"""
|
||||
settings = QtCore.QSettings(u'OpenLP', u'OpenLP')
|
||||
settings = QtCore.QSettings()
|
||||
language = unicode(settings.value(
|
||||
u'general/language', QtCore.QVariant(u'[en]')).toString())
|
||||
log.info(u'Language file: \'%s\' Loaded from conf file' % language)
|
||||
@ -112,14 +114,16 @@ class LanguageManager(object):
|
||||
"""
|
||||
language = u'en'
|
||||
if action:
|
||||
action_name = u'%s' % action.objectName()
|
||||
qm_list = LanguageManager.get_qm_list()
|
||||
language = u'%s' % qm_list[action_name]
|
||||
action_name = unicode(action.objectName())
|
||||
if action_name == u'AutoLanguageItem':
|
||||
LanguageManager.auto_language = True
|
||||
else:
|
||||
LanguageManager.auto_language = False
|
||||
qm_list = LanguageManager.get_qm_list()
|
||||
language = unicode(qm_list[action_name])
|
||||
if LanguageManager.auto_language:
|
||||
language = u'[%s]' % language
|
||||
# This needs to be here for the setValue to work
|
||||
settings = QtCore.QSettings(u'OpenLP', u'OpenLP')
|
||||
settings.setValue(
|
||||
QtCore.QSettings().setValue(
|
||||
u'general/language', QtCore.QVariant(language))
|
||||
log.info(u'Language file: \'%s\' written to conf file' % language)
|
||||
if message:
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
@ -40,7 +40,7 @@ class AlertsPlugin(Plugin):
|
||||
log.info(u'Alerts Plugin loaded')
|
||||
|
||||
def __init__(self, plugin_helpers):
|
||||
Plugin.__init__(self, u'Alerts', u'1.9.4', plugin_helpers,
|
||||
Plugin.__init__(self, u'Alerts', plugin_helpers,
|
||||
settingsTabClass=AlertsTab)
|
||||
self.weight = -3
|
||||
self.icon = build_icon(u':/plugins/plugin_alerts.png')
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
@ -112,7 +112,7 @@ class AlertsTab(SettingsTab):
|
||||
self.FontSizeSpinBox.setSuffix(UiStrings.FontSizePtUnit)
|
||||
self.TimeoutLabel.setText(
|
||||
translate('AlertsPlugin.AlertsTab', 'Alert timeout:'))
|
||||
self.TimeoutSpinBox.setSuffix(UiStrings.S)
|
||||
self.TimeoutSpinBox.setSuffix(UiStrings.Seconds)
|
||||
self.PreviewGroupBox.setTitle(UiStrings.Preview)
|
||||
self.FontPreview.setText(UiStrings.OLPV2)
|
||||
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
@ -37,7 +37,7 @@ class BiblePlugin(Plugin):
|
||||
log.info(u'Bible Plugin loaded')
|
||||
|
||||
def __init__(self, plugin_helpers):
|
||||
Plugin.__init__(self, u'Bibles', u'1.9.4', plugin_helpers,
|
||||
Plugin.__init__(self, u'Bibles', plugin_helpers,
|
||||
BibleMediaItem, BiblesTab)
|
||||
self.weight = -9
|
||||
self.icon_path = u':/plugins/plugin_bibles.png'
|
||||
@ -50,7 +50,8 @@ class BiblePlugin(Plugin):
|
||||
self.manager = BibleManager(self)
|
||||
Plugin.initialise(self)
|
||||
self.importBibleItem.setVisible(True)
|
||||
self.exportBibleItem.setVisible(True)
|
||||
# Set to invisible until we can export bibles
|
||||
self.exportBibleItem.setVisible(False)
|
||||
|
||||
def finalise(self):
|
||||
"""
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
@ -268,6 +268,7 @@ class SearchResults(object):
|
||||
return len(self.verselist) > 0
|
||||
|
||||
|
||||
from versereferencelist import VerseReferenceList
|
||||
from manager import BibleManager
|
||||
from biblestab import BiblesTab
|
||||
from mediaitem import BibleMediaItem
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
|
@ -6,9 +6,9 @@
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, 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 #
|
||||
@ -227,6 +227,10 @@ class BGExtract(object):
|
||||
cleanup = [(re.compile('\s+'), lambda match: ' ')]
|
||||
verses = BeautifulSoup(str(soup), markupMassage=cleanup)
|
||||
verse_list = {}
|
||||
# Cater for inconsistent mark up in the first verse of a chapter.
|
||||
first_verse = verses.find(u'versenum')
|
||||
if first_verse:
|
||||
verse_list[1] = unicode(first_verse.contents[0])
|
||||
for verse in verses(u'sup', u'versenum'):
|
||||
raw_verse_num = verse.next
|
||||
clean_verse_num = 0
|
||||
@ -251,7 +255,7 @@ class BGExtract(object):
|
||||
if isinstance(part.next, Tag) and part.next.name == u'div':
|
||||
# Run out of verses so stop.
|
||||
break
|
||||
part = part.next
|
||||
part = part.next
|
||||
verse_list[clean_verse_num] = unicode(verse_text)
|
||||
if not verse_list:
|
||||
log.debug(u'No content found in the BibleGateway response.')
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user