forked from openlp/openlp
Head
This commit is contained in:
commit
e0c122be84
14
LICENSE
14
LICENSE
|
@ -1,12 +1,12 @@
|
||||||
GNU GENERAL PUBLIC LICENSE
|
GNU GENERAL PUBLIC LICENSE
|
||||||
Version 2, June 1991
|
Version 2, June 1991
|
||||||
|
|
||||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
of this license document, but changing it is not allowed.
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
Preamble
|
Preamble
|
||||||
|
|
||||||
The licenses for most software are designed to take away your
|
The licenses for most software are designed to take away your
|
||||||
freedom to share and change it. By contrast, the GNU General Public
|
freedom to share and change it. By contrast, the GNU General Public
|
||||||
|
@ -56,7 +56,7 @@ patent must be licensed for everyone's free use or not licensed at all.
|
||||||
The precise terms and conditions for copying, distribution and
|
The precise terms and conditions for copying, distribution and
|
||||||
modification follow.
|
modification follow.
|
||||||
|
|
||||||
GNU GENERAL PUBLIC LICENSE
|
GNU GENERAL PUBLIC LICENSE
|
||||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||||
|
|
||||||
0. This License applies to any program or other work which contains
|
0. This License applies to any program or other work which contains
|
||||||
|
@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals
|
||||||
of preserving the free status of all derivatives of our free software and
|
of preserving the free status of all derivatives of our free software and
|
||||||
of promoting the sharing and reuse of software generally.
|
of promoting the sharing and reuse of software generally.
|
||||||
|
|
||||||
NO WARRANTY
|
NO WARRANTY
|
||||||
|
|
||||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||||
|
@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||||
POSSIBILITY OF SUCH DAMAGES.
|
POSSIBILITY OF SUCH DAMAGES.
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
How to Apply These Terms to Your New Programs
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
If you develop a new program, and you want it to be of the greatest
|
If you develop a new program, and you want it to be of the greatest
|
||||||
possible use to the public, the best way to achieve this is to make it
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
OpenLP 2.0
|
||||||
|
==========
|
||||||
|
|
||||||
|
You're probably reading this because you've just downloaded the source code for
|
||||||
|
OpenLP 2.0. If you are looking for the installer file, please go to the download
|
||||||
|
page on the web site::
|
||||||
|
|
||||||
|
http://openlp.org/en/download.html
|
||||||
|
|
||||||
|
If you're looking for how to contribute to OpenLP, then please look at the
|
||||||
|
contribution page on the web site::
|
||||||
|
|
||||||
|
http://openlp.org/en/documentation/introduction/contributing.html
|
||||||
|
|
||||||
|
If you've looked at that page, and are wanting to help develop, test or
|
||||||
|
translate OpenLP, have a look at the OpenLP wiki::
|
||||||
|
|
||||||
|
http://wiki.openlp.org/
|
||||||
|
|
||||||
|
Thanks for downloading OpenLP 2.0!
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
|
|
@ -13,7 +13,7 @@ Object Library
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
:mod:`ListWidgetWithDnD`
|
:mod:`ListWidgetWithDnD`
|
||||||
----------------------
|
------------------------
|
||||||
|
|
||||||
.. autoclass:: openlp.core.lib.listwidgetwithdnd.ListWidgetWithDnD
|
.. autoclass:: openlp.core.lib.listwidgetwithdnd.ListWidgetWithDnD
|
||||||
:members:
|
:members:
|
||||||
|
|
|
@ -54,9 +54,6 @@ Helper Classes & Functions
|
||||||
.. automodule:: openlp.plugins.songs.lib.mediaitem
|
.. automodule:: openlp.plugins.songs.lib.mediaitem
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
.. autoclass:: openlp.plugins.songs.lib.mediaitem.SongListView
|
|
||||||
:members:
|
|
||||||
|
|
||||||
.. automodule:: openlp.plugins.songs.lib.songimport
|
.. automodule:: openlp.plugins.songs.lib.songimport
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
|
|
46
openlp.pyw
46
openlp.pyw
|
@ -7,9 +7,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -24,7 +24,6 @@
|
||||||
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
|
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
|
||||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import logging
|
import logging
|
||||||
|
@ -37,6 +36,8 @@ from PyQt4 import QtCore, QtGui
|
||||||
from openlp.core.lib import Receiver, check_directory_exists
|
from openlp.core.lib import Receiver, check_directory_exists
|
||||||
from openlp.core.resources import qInitResources
|
from openlp.core.resources import qInitResources
|
||||||
from openlp.core.ui.mainwindow import MainWindow
|
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.exceptionform import ExceptionForm
|
||||||
from openlp.core.ui import SplashScreen, ScreenList
|
from openlp.core.ui import SplashScreen, ScreenList
|
||||||
from openlp.core.utils import AppLocation, LanguageManager, VersionThread
|
from openlp.core.utils import AppLocation, LanguageManager, VersionThread
|
||||||
|
@ -150,10 +151,6 @@ class OpenLP(QtGui.QApplication):
|
||||||
log.info(u'Openlp version %s' % app_version[u'version'])
|
log.info(u'Openlp version %s' % app_version[u'version'])
|
||||||
return app_version
|
return app_version
|
||||||
|
|
||||||
# def notify(self, obj, evt):
|
|
||||||
# #TODO needed for presentation exceptions
|
|
||||||
# return QtGui.QApplication.notify(self, obj, evt)
|
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
"""
|
"""
|
||||||
Run the OpenLP application.
|
Run the OpenLP application.
|
||||||
|
@ -170,6 +167,13 @@ class OpenLP(QtGui.QApplication):
|
||||||
self.setOrganizationDomain(u'openlp.org')
|
self.setOrganizationDomain(u'openlp.org')
|
||||||
self.setApplicationName(u'OpenLP')
|
self.setApplicationName(u'OpenLP')
|
||||||
self.setApplicationVersion(app_version[u'version'])
|
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_()
|
||||||
if os.name == u'nt':
|
if os.name == u'nt':
|
||||||
self.setStyleSheet(application_stylesheet)
|
self.setStyleSheet(application_stylesheet)
|
||||||
show_splash = QtCore.QSettings().value(
|
show_splash = QtCore.QSettings().value(
|
||||||
|
@ -179,16 +183,10 @@ class OpenLP(QtGui.QApplication):
|
||||||
self.splash.show()
|
self.splash.show()
|
||||||
# make sure Qt really display the splash screen
|
# make sure Qt really display the splash screen
|
||||||
self.processEvents()
|
self.processEvents()
|
||||||
screens = ScreenList()
|
|
||||||
# Decide how many screens we have and their size
|
|
||||||
for screen in xrange(0, self.desktop().numScreens()):
|
|
||||||
size = self.desktop().screenGeometry(screen)
|
|
||||||
screens.add_screen({u'number': screen,
|
|
||||||
u'size': size,
|
|
||||||
u'primary': (self.desktop().primaryScreen() == screen)})
|
|
||||||
log.info(u'Screen %d found with resolution %s', screen, size)
|
|
||||||
# start the main app window
|
# start the main app window
|
||||||
self.mainWindow = MainWindow(screens, app_version)
|
self.appClipboard = self.clipboard()
|
||||||
|
self.mainWindow = MainWindow(screens, app_version, self.appClipboard,
|
||||||
|
firstTime)
|
||||||
self.mainWindow.show()
|
self.mainWindow.show()
|
||||||
if show_splash:
|
if show_splash:
|
||||||
# now kill the splashscreen
|
# now kill the splashscreen
|
||||||
|
@ -272,7 +270,19 @@ def main():
|
||||||
qInitResources()
|
qInitResources()
|
||||||
# Now create and actually run the application.
|
# Now create and actually run the application.
|
||||||
app = OpenLP(qt_args)
|
app = OpenLP(qt_args)
|
||||||
#i18n Set Language
|
# Define the settings environment
|
||||||
|
QtCore.QSettings(u'OpenLP', u'OpenLP')
|
||||||
|
# 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 FirstTimeLanguageForm().exec_():
|
||||||
|
# if cancel then stop processing
|
||||||
|
sys.exit()
|
||||||
|
if sys.platform == u'darwin':
|
||||||
|
OpenLP.addLibraryPath(QtGui.QApplication.applicationDirPath()
|
||||||
|
+ "/qt4_plugins")
|
||||||
|
# i18n Set Language
|
||||||
language = LanguageManager.get_language()
|
language = LanguageManager.get_language()
|
||||||
appTranslator = LanguageManager.get_translator(language)
|
appTranslator = LanguageManager.get_translator(language)
|
||||||
app.installTranslator(appTranslator)
|
app.installTranslator(appTranslator)
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -25,4 +25,4 @@
|
||||||
###############################################################################
|
###############################################################################
|
||||||
"""
|
"""
|
||||||
The :mod:`openlp` module contains all the project produced OpenLP functionality
|
The :mod:`openlp` module contains all the project produced OpenLP functionality
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -28,4 +28,4 @@ The :mod:`core` module provides all core application functions
|
||||||
|
|
||||||
All the core functions of the OpenLP application including the GUI, settings,
|
All the core functions of the OpenLP application including the GUI, settings,
|
||||||
logging and a plugin framework are contained within the openlp.core module.
|
logging and a plugin framework are contained within the openlp.core module.
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -106,8 +106,8 @@ def translate(context, text, comment=None,
|
||||||
|
|
||||||
def get_text_file_string(text_file):
|
def get_text_file_string(text_file):
|
||||||
"""
|
"""
|
||||||
Open a file and return its content as unicode string. If the supplied file
|
Open a file and return its content as unicode string. If the supplied file
|
||||||
name is not a file then the function returns False. If there is an error
|
name is not a file then the function returns False. If there is an error
|
||||||
loading the file or the content can't be decoded then the function will
|
loading the file or the content can't be decoded then the function will
|
||||||
return None.
|
return None.
|
||||||
|
|
||||||
|
@ -239,7 +239,8 @@ def resize_image(image, width, height, background=QtCore.Qt.black):
|
||||||
Resize an image to fit on the current screen.
|
Resize an image to fit on the current screen.
|
||||||
|
|
||||||
``image``
|
``image``
|
||||||
The image to resize.
|
The image to resize. It has to be either a ``QImage`` instance or the
|
||||||
|
path to the image.
|
||||||
|
|
||||||
``width``
|
``width``
|
||||||
The new image width.
|
The new image width.
|
||||||
|
@ -320,8 +321,6 @@ def check_directory_exists(dir):
|
||||||
os.makedirs(dir)
|
os.makedirs(dir)
|
||||||
|
|
||||||
from listwidgetwithdnd import ListWidgetWithDnD
|
from listwidgetwithdnd import ListWidgetWithDnD
|
||||||
from theme import ThemeLevel, ThemeXML, BackgroundGradientType, \
|
|
||||||
BackgroundType, HorizontalType, VerticalType
|
|
||||||
from displaytags import DisplayTags
|
from displaytags import DisplayTags
|
||||||
from spelltextedit import SpellTextEdit
|
from spelltextedit import SpellTextEdit
|
||||||
from eventreceiver import Receiver
|
from eventreceiver import Receiver
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -65,7 +65,7 @@ def delete_database(plugin_name, db_file_name=None):
|
||||||
The name of the plugin to remove the database for
|
The name of the plugin to remove the database for
|
||||||
|
|
||||||
``db_file_name``
|
``db_file_name``
|
||||||
The database file name. Defaults to None resulting in the
|
The database file name. Defaults to None resulting in the
|
||||||
plugin_name being used.
|
plugin_name being used.
|
||||||
"""
|
"""
|
||||||
db_file_path = None
|
db_file_path = None
|
||||||
|
@ -91,6 +91,7 @@ class BaseModel(object):
|
||||||
instance.__setattr__(key, kwargs[key])
|
instance.__setattr__(key, kwargs[key])
|
||||||
return instance
|
return instance
|
||||||
|
|
||||||
|
|
||||||
class Manager(object):
|
class Manager(object):
|
||||||
"""
|
"""
|
||||||
Provide generic object persistence management
|
Provide generic object persistence management
|
||||||
|
@ -107,7 +108,7 @@ class Manager(object):
|
||||||
The init_schema function for this database
|
The init_schema function for this database
|
||||||
|
|
||||||
``db_file_name``
|
``db_file_name``
|
||||||
The file name to use for this database. Defaults to None resulting
|
The file name to use for this database. Defaults to None resulting
|
||||||
in the plugin_name being used.
|
in the plugin_name being used.
|
||||||
"""
|
"""
|
||||||
settings = QtCore.QSettings()
|
settings = QtCore.QSettings()
|
||||||
|
@ -211,11 +212,11 @@ class Manager(object):
|
||||||
The type of objects to return
|
The type of objects to return
|
||||||
|
|
||||||
``filter_clause``
|
``filter_clause``
|
||||||
The filter governing selection of objects to return. Defaults to
|
The filter governing selection of objects to return. Defaults to
|
||||||
None.
|
None.
|
||||||
|
|
||||||
``order_by_ref``
|
``order_by_ref``
|
||||||
Any parameters to order the returned objects by. Defaults to None.
|
Any parameters to order the returned objects by. Defaults to None.
|
||||||
"""
|
"""
|
||||||
query = self.session.query(object_class)
|
query = self.session.query(object_class)
|
||||||
if filter_clause is not None:
|
if filter_clause is not None:
|
||||||
|
@ -232,7 +233,7 @@ class Manager(object):
|
||||||
The type of objects to return.
|
The type of objects to return.
|
||||||
|
|
||||||
``filter_clause``
|
``filter_clause``
|
||||||
The filter governing selection of objects to return. Defaults to
|
The filter governing selection of objects to return. Defaults to
|
||||||
None.
|
None.
|
||||||
"""
|
"""
|
||||||
query = self.session.query(object_class)
|
query = self.session.query(object_class)
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -28,8 +28,8 @@ import logging
|
||||||
|
|
||||||
from PyQt4 import QtWebKit
|
from PyQt4 import QtWebKit
|
||||||
|
|
||||||
from openlp.core.lib import BackgroundType, BackgroundGradientType, \
|
from openlp.core.lib.theme import BackgroundType, BackgroundGradientType, \
|
||||||
VerticalType
|
VerticalType, HorizontalType
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -531,13 +531,8 @@ def build_lyrics_format_css(theme, width, height):
|
||||||
Height of the lyrics block
|
Height of the lyrics block
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if theme.display_horizontal_align == 2:
|
align = HorizontalType.Names[theme.display_horizontal_align]
|
||||||
align = u'center'
|
valign = VerticalType.Names[theme.display_vertical_align]
|
||||||
elif theme.display_horizontal_align == 1:
|
|
||||||
align = u'right'
|
|
||||||
else:
|
|
||||||
align = u'left'
|
|
||||||
valign = VerticalType.to_string(theme.display_vertical_align)
|
|
||||||
if theme.font_main_outline:
|
if theme.font_main_outline:
|
||||||
left_margin = int(theme.font_main_outline_size) * 2
|
left_margin = int(theme.font_main_outline_size) * 2
|
||||||
else:
|
else:
|
||||||
|
@ -630,7 +625,7 @@ def build_alert_css(alertTab, width):
|
||||||
"""
|
"""
|
||||||
if not alertTab:
|
if not alertTab:
|
||||||
return u''
|
return u''
|
||||||
align = VerticalType.to_string(alertTab.location)
|
align = VerticalType.Names[alertTab.location]
|
||||||
alert = style % (width, align, alertTab.font_face, alertTab.font_size,
|
alert = style % (width, align, alertTab.font_face, alertTab.font_size,
|
||||||
alertTab.font_color, alertTab.bg_color)
|
alertTab.font_color, alertTab.bg_color)
|
||||||
return alert
|
return alert
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -69,6 +69,7 @@ class ImageManager(QtCore.QObject):
|
||||||
log.info(u'Image Manager loaded')
|
log.info(u'Image Manager loaded')
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
QtCore.QObject.__init__(self)
|
||||||
self._cache = {}
|
self._cache = {}
|
||||||
self._thread_running = False
|
self._thread_running = False
|
||||||
self._cache_dirty = False
|
self._cache_dirty = False
|
||||||
|
@ -85,8 +86,7 @@ class ImageManager(QtCore.QObject):
|
||||||
for key in self._cache.keys():
|
for key in self._cache.keys():
|
||||||
image = self._cache[key]
|
image = self._cache[key]
|
||||||
image.dirty = True
|
image.dirty = True
|
||||||
image.image = resize_image(image.path,
|
image.image = resize_image(image.path, self.width, self.height)
|
||||||
self.width, self.height)
|
|
||||||
self._cache_dirty = True
|
self._cache_dirty = True
|
||||||
# only one thread please
|
# only one thread please
|
||||||
if not self._thread_running:
|
if not self._thread_running:
|
||||||
|
@ -128,8 +128,7 @@ class ImageManager(QtCore.QObject):
|
||||||
image = Image()
|
image = Image()
|
||||||
image.name = name
|
image.name = name
|
||||||
image.path = path
|
image.path = path
|
||||||
image.image = resize_image(path,
|
image.image = resize_image(path, self.width, self.height)
|
||||||
self.width, self.height)
|
|
||||||
self._cache[name] = image
|
self._cache[name] = image
|
||||||
else:
|
else:
|
||||||
log.debug(u'Image in cache %s:%s' % (name, path))
|
log.debug(u'Image in cache %s:%s' % (name, path))
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -34,6 +34,7 @@ from PyQt4 import QtCore, QtGui
|
||||||
from openlp.core.lib import context_menu_action, context_menu_separator, \
|
from openlp.core.lib import context_menu_action, context_menu_separator, \
|
||||||
SettingsManager, OpenLPToolbar, ServiceItem, StringContent, build_icon, \
|
SettingsManager, OpenLPToolbar, ServiceItem, StringContent, build_icon, \
|
||||||
translate, Receiver, ListWidgetWithDnD
|
translate, Receiver, ListWidgetWithDnD
|
||||||
|
from openlp.core.lib.ui import UiStrings
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -65,10 +66,11 @@ class MediaManagerItem(QtGui.QWidget):
|
||||||
When creating a descendant class from this class for your plugin,
|
When creating a descendant class from this class for your plugin,
|
||||||
the following member variables should be set.
|
the following member variables should be set.
|
||||||
|
|
||||||
``self.OnNewPrompt``
|
``self.onNewPrompt``
|
||||||
|
|
||||||
Defaults to *'Select Image(s)'*.
|
Defaults to *'Select Image(s)'*.
|
||||||
|
|
||||||
``self.OnNewFileMasks``
|
``self.onNewFileMasks``
|
||||||
Defaults to *'Images (*.jpg *jpeg *.gif *.png *.bmp)'*. This
|
Defaults to *'Images (*.jpg *jpeg *.gif *.png *.bmp)'*. This
|
||||||
assumes that the new action is to load a file. If not, you
|
assumes that the new action is to load a file. If not, you
|
||||||
need to override the ``OnNew`` method.
|
need to override the ``OnNew`` method.
|
||||||
|
@ -218,8 +220,6 @@ class MediaManagerItem(QtGui.QWidget):
|
||||||
if self.hasDeleteIcon:
|
if self.hasDeleteIcon:
|
||||||
toolbar_actions.append([StringContent.Delete,
|
toolbar_actions.append([StringContent.Delete,
|
||||||
u':/general/general_delete.png', self.onDeleteClick])
|
u':/general/general_delete.png', self.onDeleteClick])
|
||||||
## Separator Line ##
|
|
||||||
self.addToolbarSeparator()
|
|
||||||
## Preview ##
|
## Preview ##
|
||||||
toolbar_actions.append([StringContent.Preview,
|
toolbar_actions.append([StringContent.Preview,
|
||||||
u':/general/general_preview.png', self.onPreviewClick])
|
u':/general/general_preview.png', self.onPreviewClick])
|
||||||
|
@ -230,6 +230,8 @@ class MediaManagerItem(QtGui.QWidget):
|
||||||
toolbar_actions.append([StringContent.Service,
|
toolbar_actions.append([StringContent.Service,
|
||||||
u':/general/general_add.png', self.onAddClick])
|
u':/general/general_add.png', self.onAddClick])
|
||||||
for action in toolbar_actions:
|
for action in toolbar_actions:
|
||||||
|
if action[0] == StringContent.Preview:
|
||||||
|
self.addToolbarSeparator()
|
||||||
self.addToolbarButton(
|
self.addToolbarButton(
|
||||||
self.plugin.getString(action[0])[u'title'],
|
self.plugin.getString(action[0])[u'title'],
|
||||||
self.plugin.getString(action[0])[u'tooltip'],
|
self.plugin.getString(action[0])[u'tooltip'],
|
||||||
|
@ -240,7 +242,7 @@ class MediaManagerItem(QtGui.QWidget):
|
||||||
Creates the main widget for listing items the media item is tracking
|
Creates the main widget for listing items the media item is tracking
|
||||||
"""
|
"""
|
||||||
# Add the List widget
|
# Add the List widget
|
||||||
self.listView = ListWidgetWithDnD(self, self.title)
|
self.listView = ListWidgetWithDnD(self, self.plugin.name)
|
||||||
self.listView.uniformItemSizes = True
|
self.listView.uniformItemSizes = True
|
||||||
self.listView.setSpacing(1)
|
self.listView.setSpacing(1)
|
||||||
self.listView.setSelectionMode(
|
self.listView.setSelectionMode(
|
||||||
|
@ -316,9 +318,9 @@ class MediaManagerItem(QtGui.QWidget):
|
||||||
Add a file to the list widget to make it available for showing
|
Add a file to the list widget to make it available for showing
|
||||||
"""
|
"""
|
||||||
files = QtGui.QFileDialog.getOpenFileNames(
|
files = QtGui.QFileDialog.getOpenFileNames(
|
||||||
self, self.OnNewPrompt,
|
self, self.onNewPrompt,
|
||||||
SettingsManager.get_last_dir(self.settingsSection),
|
SettingsManager.get_last_dir(self.settingsSection),
|
||||||
self.OnNewFileMasks)
|
self.onNewFileMasks)
|
||||||
log.info(u'New files(s) %s', unicode(files))
|
log.info(u'New files(s) %s', unicode(files))
|
||||||
if files:
|
if files:
|
||||||
Receiver.send_message(u'cursor_busy')
|
Receiver.send_message(u'cursor_busy')
|
||||||
|
@ -415,8 +417,7 @@ class MediaManagerItem(QtGui.QWidget):
|
||||||
item to the preview slide controller.
|
item to the preview slide controller.
|
||||||
"""
|
"""
|
||||||
if not self.listView.selectedIndexes() and not self.remoteTriggered:
|
if not self.listView.selectedIndexes() and not self.remoteTriggered:
|
||||||
QtGui.QMessageBox.information(self,
|
QtGui.QMessageBox.information(self, UiStrings.NISp,
|
||||||
translate('OpenLP.MediaManagerItem', 'No Items Selected'),
|
|
||||||
translate('OpenLP.MediaManagerItem',
|
translate('OpenLP.MediaManagerItem',
|
||||||
'You must select one or more items to preview.'))
|
'You must select one or more items to preview.'))
|
||||||
else:
|
else:
|
||||||
|
@ -432,8 +433,7 @@ class MediaManagerItem(QtGui.QWidget):
|
||||||
item to the live slide controller.
|
item to the live slide controller.
|
||||||
"""
|
"""
|
||||||
if not self.listView.selectedIndexes():
|
if not self.listView.selectedIndexes():
|
||||||
QtGui.QMessageBox.information(self,
|
QtGui.QMessageBox.information(self, UiStrings.NISp,
|
||||||
translate('OpenLP.MediaManagerItem', 'No Items Selected'),
|
|
||||||
translate('OpenLP.MediaManagerItem',
|
translate('OpenLP.MediaManagerItem',
|
||||||
'You must select one or more items to send live.'))
|
'You must select one or more items to send live.'))
|
||||||
else:
|
else:
|
||||||
|
@ -448,8 +448,7 @@ class MediaManagerItem(QtGui.QWidget):
|
||||||
Add a selected item to the current service
|
Add a selected item to the current service
|
||||||
"""
|
"""
|
||||||
if not self.listView.selectedIndexes() and not self.remoteTriggered:
|
if not self.listView.selectedIndexes() and not self.remoteTriggered:
|
||||||
QtGui.QMessageBox.information(self,
|
QtGui.QMessageBox.information(self, UiStrings.NISp,
|
||||||
translate('OpenLP.MediaManagerItem', 'No Items Selected'),
|
|
||||||
translate('OpenLP.MediaManagerItem',
|
translate('OpenLP.MediaManagerItem',
|
||||||
'You must select one or more items.'))
|
'You must select one or more items.'))
|
||||||
else:
|
else:
|
||||||
|
@ -475,17 +474,14 @@ class MediaManagerItem(QtGui.QWidget):
|
||||||
Add a selected item to an existing item in the current service.
|
Add a selected item to an existing item in the current service.
|
||||||
"""
|
"""
|
||||||
if not self.listView.selectedIndexes() and not self.remoteTriggered:
|
if not self.listView.selectedIndexes() and not self.remoteTriggered:
|
||||||
QtGui.QMessageBox.information(self,
|
QtGui.QMessageBox.information(self, UiStrings.NISp,
|
||||||
translate('OpenLP.MediaManagerItem', 'No Items Selected'),
|
|
||||||
translate('OpenLP.MediaManagerItem',
|
translate('OpenLP.MediaManagerItem',
|
||||||
'You must select one or more items'))
|
'You must select one or more items.'))
|
||||||
else:
|
else:
|
||||||
log.debug(u'%s Add requested', self.plugin.name)
|
log.debug(u'%s Add requested', self.plugin.name)
|
||||||
serviceItem = self.parent.serviceManager.getServiceItem()
|
serviceItem = self.parent.serviceManager.getServiceItem()
|
||||||
if not serviceItem:
|
if not serviceItem:
|
||||||
QtGui.QMessageBox.information(self,
|
QtGui.QMessageBox.information(self, UiStrings.NISs,
|
||||||
translate('OpenLP.MediaManagerItem',
|
|
||||||
'No Service Item Selected'),
|
|
||||||
translate('OpenLP.MediaManagerItem',
|
translate('OpenLP.MediaManagerItem',
|
||||||
'You must select an existing service item to add to.'))
|
'You must select an existing service item to add to.'))
|
||||||
elif self.plugin.name.lower() == serviceItem.name.lower():
|
elif self.plugin.name.lower() == serviceItem.name.lower():
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -144,6 +144,7 @@ class Plugin(QtCore.QObject):
|
||||||
self.name = name
|
self.name = name
|
||||||
self.textStrings = {}
|
self.textStrings = {}
|
||||||
self.setPluginTextStrings()
|
self.setPluginTextStrings()
|
||||||
|
self.nameStrings = self.textStrings[StringContent.Name]
|
||||||
if version:
|
if version:
|
||||||
self.version = version
|
self.version = version
|
||||||
self.settingsSection = self.name.lower()
|
self.settingsSection = self.name.lower()
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -221,4 +221,4 @@ class PluginManager(object):
|
||||||
for plugin in self.plugins:
|
for plugin in self.plugins:
|
||||||
if plugin.isActive():
|
if plugin.isActive():
|
||||||
plugin.finalise()
|
plugin.finalise()
|
||||||
log.info(u'Finalisation Complete for %s ' % plugin.name)
|
log.info(u'Finalisation Complete for %s ' % plugin.name)
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -144,4 +144,4 @@ class Renderer(object):
|
||||||
html_text = html_text[:len(html_text)-4]
|
html_text = html_text[:len(html_text)-4]
|
||||||
formatted.append(html_text)
|
formatted.append(html_text)
|
||||||
log.debug(u'format_slide - End')
|
log.debug(u'format_slide - End')
|
||||||
return formatted
|
return formatted
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -28,11 +28,21 @@ import logging
|
||||||
|
|
||||||
from PyQt4 import QtCore
|
from PyQt4 import QtCore
|
||||||
|
|
||||||
from openlp.core.lib import Renderer, ThemeLevel, ServiceItem, ImageManager
|
from openlp.core.lib import Renderer, ServiceItem, ImageManager
|
||||||
|
from openlp.core.lib.theme import ThemeLevel
|
||||||
from openlp.core.ui import MainDisplay
|
from openlp.core.ui import MainDisplay
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
VERSE = u'The Lord said to {r}Noah{/r}: \n' \
|
||||||
|
'There\'s gonna be a {su}floody{/su}, {sb}floody{/sb}\n' \
|
||||||
|
'The Lord said to {g}Noah{/g}:\n' \
|
||||||
|
'There\'s gonna be a {st}floody{/st}, {it}floody{/it}\n' \
|
||||||
|
'Get those children out of the muddy, muddy \n' \
|
||||||
|
'{r}C{/r}{b}h{/b}{bl}i{/bl}{y}l{/y}{g}d{/g}{pk}' \
|
||||||
|
'r{/pk}{o}e{/o}{pp}n{/pp} of the Lord\n'
|
||||||
|
FOOTER = [u'Arky Arky (Unknown)', u'Public Domain', u'CCLI 123456']
|
||||||
|
|
||||||
class RenderManager(object):
|
class RenderManager(object):
|
||||||
"""
|
"""
|
||||||
Class to pull all Renderer interactions into one place. The plugins will
|
Class to pull all Renderer interactions into one place. The plugins will
|
||||||
|
@ -59,7 +69,6 @@ class RenderManager(object):
|
||||||
self.image_manager = ImageManager()
|
self.image_manager = ImageManager()
|
||||||
self.display = MainDisplay(self, screens, False)
|
self.display = MainDisplay(self, screens, False)
|
||||||
self.display.imageManager = self.image_manager
|
self.display.imageManager = self.image_manager
|
||||||
self.display.setup()
|
|
||||||
self.theme_manager = theme_manager
|
self.theme_manager = theme_manager
|
||||||
self.renderer = Renderer()
|
self.renderer = Renderer()
|
||||||
self.calculate_default(self.screens.current[u'size'])
|
self.calculate_default(self.screens.current[u'size'])
|
||||||
|
@ -173,14 +182,13 @@ class RenderManager(object):
|
||||||
main_rect = None
|
main_rect = None
|
||||||
footer_rect = None
|
footer_rect = None
|
||||||
if not theme.font_main_override:
|
if not theme.font_main_override:
|
||||||
main_rect = QtCore.QRect(10, 0,
|
main_rect = QtCore.QRect(10, 0, self.width - 20, self.footer_start)
|
||||||
self.width - 20, self.footer_start)
|
|
||||||
else:
|
else:
|
||||||
main_rect = QtCore.QRect(theme.font_main_x, theme.font_main_y,
|
main_rect = QtCore.QRect(theme.font_main_x, theme.font_main_y,
|
||||||
theme.font_main_width - 1, theme.font_main_height - 1)
|
theme.font_main_width - 1, theme.font_main_height - 1)
|
||||||
if not theme.font_footer_override:
|
if not theme.font_footer_override:
|
||||||
footer_rect = QtCore.QRect(10, self.footer_start,
|
footer_rect = QtCore.QRect(10, self.footer_start, self.width - 20,
|
||||||
self.width - 20, self.height - self.footer_start)
|
self.height - self.footer_start)
|
||||||
else:
|
else:
|
||||||
footer_rect = QtCore.QRect(theme.font_footer_x,
|
footer_rect = QtCore.QRect(theme.font_footer_x,
|
||||||
theme.font_footer_y, theme.font_footer_width - 1,
|
theme.font_footer_y, theme.font_footer_width - 1,
|
||||||
|
@ -202,28 +210,17 @@ class RenderManager(object):
|
||||||
self.force_page = force_page
|
self.force_page = force_page
|
||||||
# set the default image size for previews
|
# set the default image size for previews
|
||||||
self.calculate_default(self.screens.preview[u'size'])
|
self.calculate_default(self.screens.preview[u'size'])
|
||||||
verse = u'The Lord said to {r}Noah{/r}: \n' \
|
|
||||||
'There\'s gonna be a {su}floody{/su}, {sb}floody{/sb}\n' \
|
|
||||||
'The Lord said to {g}Noah{/g}:\n' \
|
|
||||||
'There\'s gonna be a {st}floody{/st}, {it}floody{/it}\n' \
|
|
||||||
'Get those children out of the muddy, muddy \n' \
|
|
||||||
'{r}C{/r}{b}h{/b}{bl}i{/bl}{y}l{/y}{g}d{/g}{pk}' \
|
|
||||||
'r{/pk}{o}e{/o}{pp}n{/pp} of the Lord\n'
|
|
||||||
# make big page for theme edit dialog to get line count
|
|
||||||
if self.force_page:
|
|
||||||
verse = verse + verse + verse
|
|
||||||
else:
|
|
||||||
self.image_manager.del_image(theme_data.theme_name)
|
|
||||||
footer = []
|
|
||||||
footer.append(u'Arky Arky (Unknown)' )
|
|
||||||
footer.append(u'Public Domain')
|
|
||||||
footer.append(u'CCLI 123456')
|
|
||||||
# build a service item to generate preview
|
# build a service item to generate preview
|
||||||
serviceItem = ServiceItem()
|
serviceItem = ServiceItem()
|
||||||
serviceItem.theme = theme_data
|
serviceItem.theme = theme_data
|
||||||
serviceItem.add_from_text(u'', verse, footer)
|
if self.force_page:
|
||||||
|
# make big page for theme edit dialog to get line count
|
||||||
|
serviceItem.add_from_text(u'', VERSE + VERSE + VERSE, FOOTER)
|
||||||
|
else:
|
||||||
|
self.image_manager.del_image(theme_data.theme_name)
|
||||||
|
serviceItem.add_from_text(u'', VERSE, FOOTER)
|
||||||
serviceItem.render_manager = self
|
serviceItem.render_manager = self
|
||||||
serviceItem.raw_footer = footer
|
serviceItem.raw_footer = FOOTER
|
||||||
serviceItem.render(True)
|
serviceItem.render(True)
|
||||||
if not self.force_page:
|
if not self.force_page:
|
||||||
self.display.buildHtml(serviceItem)
|
self.display.buildHtml(serviceItem)
|
||||||
|
@ -258,6 +255,6 @@ class RenderManager(object):
|
||||||
self.height = screen.height()
|
self.height = screen.height()
|
||||||
self.screen_ratio = float(self.height) / float(self.width)
|
self.screen_ratio = float(self.height) / float(self.width)
|
||||||
log.debug(u'calculate default %d, %d, %f',
|
log.debug(u'calculate default %d, %d, %f',
|
||||||
self.width, self.height, self.screen_ratio )
|
self.width, self.height, self.screen_ratio)
|
||||||
# 90% is start of footer
|
# 90% is start of footer
|
||||||
self.footer_start = int(self.height * 0.90)
|
self.footer_start = int(self.height * 0.90)
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -88,8 +88,8 @@ class ServiceItem(object):
|
||||||
self.audit = u''
|
self.audit = u''
|
||||||
self.items = []
|
self.items = []
|
||||||
self.iconic_representation = None
|
self.iconic_representation = None
|
||||||
self.raw_footer = None
|
self.raw_footer = []
|
||||||
self.foot_text = None
|
self.foot_text = u''
|
||||||
self.theme = None
|
self.theme = None
|
||||||
self.service_item_type = None
|
self.service_item_type = None
|
||||||
self._raw_frames = []
|
self._raw_frames = []
|
||||||
|
@ -162,9 +162,7 @@ class ServiceItem(object):
|
||||||
line_break = True
|
line_break = True
|
||||||
if self.is_capable(ItemCapabilities.NoLineBreaks):
|
if self.is_capable(ItemCapabilities.NoLineBreaks):
|
||||||
line_break = False
|
line_break = False
|
||||||
theme = None
|
theme = self.theme if self.theme else None
|
||||||
if self.theme:
|
|
||||||
theme = self.theme
|
|
||||||
self.main, self.footer = \
|
self.main, self.footer = \
|
||||||
self.render_manager.set_override_theme(theme, useOverride)
|
self.render_manager.set_override_theme(theme, useOverride)
|
||||||
self.themedata = self.render_manager.renderer._theme
|
self.themedata = self.render_manager.renderer._theme
|
||||||
|
@ -185,13 +183,8 @@ class ServiceItem(object):
|
||||||
else:
|
else:
|
||||||
log.error(u'Invalid value renderer :%s' % self.service_item_type)
|
log.error(u'Invalid value renderer :%s' % self.service_item_type)
|
||||||
self.title = clean_tags(self.title)
|
self.title = clean_tags(self.title)
|
||||||
self.foot_text = None
|
self.foot_text = \
|
||||||
if self.raw_footer:
|
u'<br>'.join([footer for footer in self.raw_footer if footer])
|
||||||
for foot in self.raw_footer:
|
|
||||||
if not self.foot_text:
|
|
||||||
self.foot_text = foot
|
|
||||||
else:
|
|
||||||
self.foot_text = u'%s<br>%s' % (self.foot_text, foot)
|
|
||||||
|
|
||||||
def add_from_image(self, path, title):
|
def add_from_image(self, path, title):
|
||||||
"""
|
"""
|
||||||
|
@ -204,8 +197,7 @@ class ServiceItem(object):
|
||||||
A title for the slide in the service item.
|
A title for the slide in the service item.
|
||||||
"""
|
"""
|
||||||
self.service_item_type = ServiceItemType.Image
|
self.service_item_type = ServiceItemType.Image
|
||||||
self._raw_frames.append(
|
self._raw_frames.append({u'title': title, u'path': path})
|
||||||
{u'title': title, u'path': path})
|
|
||||||
self.render_manager.image_manager.add_image(title, path)
|
self.render_manager.image_manager.add_image(title, path)
|
||||||
self._new_item()
|
self._new_item()
|
||||||
|
|
||||||
|
@ -323,7 +315,7 @@ class ServiceItem(object):
|
||||||
for text_image in serviceitem[u'serviceitem'][u'data']:
|
for text_image in serviceitem[u'serviceitem'][u'data']:
|
||||||
filename = os.path.join(path, text_image[u'title'])
|
filename = os.path.join(path, text_image[u'title'])
|
||||||
self.add_from_command(
|
self.add_from_command(
|
||||||
path, text_image[u'title'], text_image[u'image'] )
|
path, text_image[u'title'], text_image[u'image'])
|
||||||
self._new_item()
|
self._new_item()
|
||||||
|
|
||||||
def get_display_title(self):
|
def get_display_title(self):
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -64,7 +64,7 @@ class SettingsManager(object):
|
||||||
Read the last directory used for plugin.
|
Read the last directory used for plugin.
|
||||||
|
|
||||||
``section``
|
``section``
|
||||||
The section of code calling the method. This is used in the
|
The section of code calling the method. This is used in the
|
||||||
settings key.
|
settings key.
|
||||||
|
|
||||||
``num``
|
``num``
|
||||||
|
@ -84,7 +84,7 @@ class SettingsManager(object):
|
||||||
Save the last directory used for plugin.
|
Save the last directory used for plugin.
|
||||||
|
|
||||||
``section``
|
``section``
|
||||||
The section of code calling the method. This is used in the
|
The section of code calling the method. This is used in the
|
||||||
settings key.
|
settings key.
|
||||||
|
|
||||||
``directory``
|
``directory``
|
||||||
|
@ -160,11 +160,11 @@ class SettingsManager(object):
|
||||||
Get a list of files from the data files path.
|
Get a list of files from the data files path.
|
||||||
|
|
||||||
``section``
|
``section``
|
||||||
Defaults to *None*. The section of code getting the files - used
|
Defaults to *None*. The section of code getting the files - used
|
||||||
to load from a section's data subdirectory.
|
to load from a section's data subdirectory.
|
||||||
|
|
||||||
``extension``
|
``extension``
|
||||||
Defaults to *None*. The extension to search for.
|
Defaults to *None*. The extension to search for.
|
||||||
"""
|
"""
|
||||||
path = AppLocation.get_data_path()
|
path = AppLocation.get_data_path()
|
||||||
if section:
|
if section:
|
||||||
|
@ -178,4 +178,4 @@ class SettingsManager(object):
|
||||||
if extension == os.path.splitext(filename)[1]]
|
if extension == os.path.splitext(filename)[1]]
|
||||||
else:
|
else:
|
||||||
# no filtering required
|
# no filtering required
|
||||||
return files
|
return files
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -33,7 +33,8 @@ import logging
|
||||||
from xml.dom.minidom import Document
|
from xml.dom.minidom import Document
|
||||||
from lxml import etree, objectify
|
from lxml import etree, objectify
|
||||||
|
|
||||||
from openlp.core.lib import str_to_bool
|
from openlp.core.lib import str_to_bool, translate
|
||||||
|
from openlp.core.lib.ui import UiStrings
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -90,6 +91,7 @@ class ThemeLevel(object):
|
||||||
Service = 2
|
Service = 2
|
||||||
Song = 3
|
Song = 3
|
||||||
|
|
||||||
|
|
||||||
class BackgroundType(object):
|
class BackgroundType(object):
|
||||||
"""
|
"""
|
||||||
Type enumeration for backgrounds.
|
Type enumeration for backgrounds.
|
||||||
|
@ -122,6 +124,7 @@ class BackgroundType(object):
|
||||||
elif type_string == u'image':
|
elif type_string == u'image':
|
||||||
return BackgroundType.Image
|
return BackgroundType.Image
|
||||||
|
|
||||||
|
|
||||||
class BackgroundGradientType(object):
|
class BackgroundGradientType(object):
|
||||||
"""
|
"""
|
||||||
Type enumeration for background gradients.
|
Type enumeration for background gradients.
|
||||||
|
@ -170,20 +173,14 @@ class HorizontalType(object):
|
||||||
Type enumeration for horizontal alignment.
|
Type enumeration for horizontal alignment.
|
||||||
"""
|
"""
|
||||||
Left = 0
|
Left = 0
|
||||||
Center = 2
|
|
||||||
Right = 1
|
Right = 1
|
||||||
|
Center = 2
|
||||||
|
|
||||||
@staticmethod
|
Names = [u'left', u'right', u'center']
|
||||||
def to_string(horizontal_type):
|
TranslatedNames = [
|
||||||
"""
|
translate('OpenLP.ThemeWizard', 'Left'),
|
||||||
Return a string representation of a horizontal type.
|
translate('OpenLP.ThemeWizard', 'Right'),
|
||||||
"""
|
translate('OpenLP.ThemeWizard', 'Center')]
|
||||||
if horizontal_type == HorizontalType.Right:
|
|
||||||
return u'right'
|
|
||||||
elif horizontal_type == HorizontalType.Center:
|
|
||||||
return u'center'
|
|
||||||
else:
|
|
||||||
return u'left'
|
|
||||||
|
|
||||||
|
|
||||||
class VerticalType(object):
|
class VerticalType(object):
|
||||||
|
@ -194,17 +191,8 @@ class VerticalType(object):
|
||||||
Middle = 1
|
Middle = 1
|
||||||
Bottom = 2
|
Bottom = 2
|
||||||
|
|
||||||
@staticmethod
|
Names = [u'top', u'middle', u'bottom']
|
||||||
def to_string(vertical_type):
|
TranslatedNames = [UiStrings.Top, UiStrings.Middle, UiStrings.Bottom]
|
||||||
"""
|
|
||||||
Return a string representation of a vertical type.
|
|
||||||
"""
|
|
||||||
if vertical_type == VerticalType.Bottom:
|
|
||||||
return u'bottom'
|
|
||||||
elif vertical_type == VerticalType.Middle:
|
|
||||||
return u'middle'
|
|
||||||
else:
|
|
||||||
return u'top'
|
|
||||||
|
|
||||||
|
|
||||||
BOOLEAN_LIST = [u'bold', u'italics', u'override', u'outline', u'shadow',
|
BOOLEAN_LIST = [u'bold', u'italics', u'override', u'outline', u'shadow',
|
||||||
|
@ -214,6 +202,7 @@ INTEGER_LIST = [u'size', u'line_adjustment', u'x', u'height', u'y',
|
||||||
u'width', u'shadow_size', u'outline_size', u'horizontal_align',
|
u'width', u'shadow_size', u'outline_size', u'horizontal_align',
|
||||||
u'vertical_align', u'wrap_style']
|
u'vertical_align', u'wrap_style']
|
||||||
|
|
||||||
|
|
||||||
class ThemeXML(object):
|
class ThemeXML(object):
|
||||||
"""
|
"""
|
||||||
A class to encapsulate the Theme XML.
|
A class to encapsulate the Theme XML.
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -40,32 +40,59 @@ class UiStrings(object):
|
||||||
"""
|
"""
|
||||||
# These strings should need a good reason to be retranslated elsewhere.
|
# These strings should need a good reason to be retranslated elsewhere.
|
||||||
# Should some/more/less of these have an & attached?
|
# Should some/more/less of these have an & attached?
|
||||||
|
About = translate('OpenLP.Ui', 'About')
|
||||||
Add = translate('OpenLP.Ui', '&Add')
|
Add = translate('OpenLP.Ui', '&Add')
|
||||||
Advanced = translate('OpenLP.Ui', 'Advanced')
|
Advanced = translate('OpenLP.Ui', 'Advanced')
|
||||||
AllFiles = translate('OpenLP.Ui', 'All Files')
|
AllFiles = translate('OpenLP.Ui', 'All Files')
|
||||||
Authors = translate('OpenLP.Ui', 'Authors')
|
Bottom = translate('OpenLP.Ui', 'Bottom')
|
||||||
|
Browse = translate('OpenLP.Ui', 'Browse...')
|
||||||
|
Cancel = translate('OpenLP.Ui', 'Cancel')
|
||||||
|
CCLINumberLabel = translate('OpenLP.Ui', 'CCLI number:')
|
||||||
CreateService = translate('OpenLP.Ui', 'Create a new service.')
|
CreateService = translate('OpenLP.Ui', 'Create a new service.')
|
||||||
Delete = translate('OpenLP.Ui', '&Delete')
|
Delete = translate('OpenLP.Ui', '&Delete')
|
||||||
Edit = translate('OpenLP.Ui', '&Edit')
|
Edit = translate('OpenLP.Ui', '&Edit')
|
||||||
|
EmptyField = translate('OpenLP.Ui', 'Empty Field')
|
||||||
Error = translate('OpenLP.Ui', 'Error')
|
Error = translate('OpenLP.Ui', 'Error')
|
||||||
|
Export = translate('OpenLP.Ui', 'Export')
|
||||||
|
FontSizePtUnit = translate('OpenLP.Ui', 'pt',
|
||||||
|
'Abbreviated font pointsize unit')
|
||||||
|
Image = translate('OpenLP.Ui', 'Image')
|
||||||
Import = translate('OpenLP.Ui', 'Import')
|
Import = translate('OpenLP.Ui', 'Import')
|
||||||
LengthTime = unicode(translate('OpenLP.Ui', 'Length %s'))
|
LengthTime = unicode(translate('OpenLP.Ui', 'Length %s'))
|
||||||
Live = translate('OpenLP.Ui', 'Live')
|
Live = translate('OpenLP.Ui', 'Live')
|
||||||
|
LiveBGError = translate('OpenLP.Ui', 'Live Background Error')
|
||||||
|
LivePanel = translate('OpenLP.Ui', 'Live Panel')
|
||||||
Load = translate('OpenLP.Ui', 'Load')
|
Load = translate('OpenLP.Ui', 'Load')
|
||||||
|
Middle = translate('OpenLP.Ui', 'Middle')
|
||||||
New = translate('OpenLP.Ui', 'New')
|
New = translate('OpenLP.Ui', 'New')
|
||||||
NewService = translate('OpenLP.Ui', 'New Service')
|
NewService = translate('OpenLP.Ui', 'New Service')
|
||||||
|
NewTheme = translate('OpenLP.Ui', 'New Theme')
|
||||||
|
NFSs = translate('OpenLP.Ui', 'No File Selected', 'Singular')
|
||||||
|
NFSp = translate('OpenLP.Ui', 'No Files Selected', 'Plural')
|
||||||
|
NISs = translate('OpenLP.Ui', 'No Item Selected', 'Singular')
|
||||||
|
NISp = translate('OpenLP.Ui', 'No Items Selected', 'Plural')
|
||||||
|
OLPV1 = translate('OpenLP.Ui', 'openlp.org 1.x')
|
||||||
OLPV2 = translate('OpenLP.Ui', 'OpenLP 2.0')
|
OLPV2 = translate('OpenLP.Ui', 'OpenLP 2.0')
|
||||||
OpenService = translate('OpenLP.Ui', 'Open Service')
|
OpenService = translate('OpenLP.Ui', 'Open Service')
|
||||||
Preview = translate('OpenLP.Ui', 'Preview')
|
Preview = translate('OpenLP.Ui', 'Preview')
|
||||||
|
PreviewPanel = translate('OpenLP.Ui', 'Preview Panel')
|
||||||
|
PrintServiceOrder = translate('OpenLP.Ui', 'Print Service Order')
|
||||||
ReplaceBG = translate('OpenLP.Ui', 'Replace Background')
|
ReplaceBG = translate('OpenLP.Ui', 'Replace Background')
|
||||||
ReplaceLiveBG = translate('OpenLP.Ui', 'Replace Live Background')
|
ReplaceLiveBG = translate('OpenLP.Ui', 'Replace Live Background')
|
||||||
ResetBG = translate('OpenLP.Ui', 'Reset Background')
|
ResetBG = translate('OpenLP.Ui', 'Reset Background')
|
||||||
ResetLiveBG = translate('OpenLP.Ui', 'Reset Live Background')
|
ResetLiveBG = translate('OpenLP.Ui', 'Reset Live Background')
|
||||||
|
S = translate('OpenLP.Ui', 's', 'The abbreviated unit for seconds')
|
||||||
|
SaveAndPreview = translate('OpenLP.Ui', 'Save && Preview')
|
||||||
|
Search = translate('OpenLP.Ui', 'Search')
|
||||||
|
SelectDelete = translate('OpenLP.Ui', 'You must select an item to delete.')
|
||||||
|
SelectEdit = translate('OpenLP.Ui', 'You must select an item to edit.')
|
||||||
SaveService = translate('OpenLP.Ui', 'Save Service')
|
SaveService = translate('OpenLP.Ui', 'Save Service')
|
||||||
Service = translate('OpenLP.Ui', 'Service')
|
Service = translate('OpenLP.Ui', 'Service')
|
||||||
StartTimeCode = unicode(translate('OpenLP.Ui', 'Start %s'))
|
StartTimeCode = unicode(translate('OpenLP.Ui', 'Start %s'))
|
||||||
Theme = translate('OpenLP.Ui', 'Theme')
|
Theme = translate('OpenLP.Ui', 'Theme', 'Singular')
|
||||||
Themes = translate('OpenLP.Ui', 'Themes')
|
Themes = translate('OpenLP.Ui', 'Themes', 'Plural')
|
||||||
|
Top = translate('OpenLP.Ui', 'Top')
|
||||||
|
Version = translate('OpenLP.Ui', 'Version')
|
||||||
|
|
||||||
def add_welcome_page(parent, image):
|
def add_welcome_page(parent, image):
|
||||||
"""
|
"""
|
||||||
|
@ -103,7 +130,7 @@ def create_accept_reject_button_box(parent, okay=False):
|
||||||
methods to handle the default ``accepted()`` and ``rejected()`` signals.
|
methods to handle the default ``accepted()`` and ``rejected()`` signals.
|
||||||
|
|
||||||
``parent``
|
``parent``
|
||||||
The parent object. This should be a ``QWidget`` descendant.
|
The parent object. This should be a ``QWidget`` descendant.
|
||||||
|
|
||||||
``okay``
|
``okay``
|
||||||
If true creates an okay/cancel combination instead of save/cancel.
|
If true creates an okay/cancel combination instead of save/cancel.
|
||||||
|
@ -158,15 +185,15 @@ def media_item_combo_box(parent, name):
|
||||||
|
|
||||||
def create_delete_push_button(parent, icon=None):
|
def create_delete_push_button(parent, icon=None):
|
||||||
"""
|
"""
|
||||||
Creates a standard push button with a delete label and optional icon. The
|
Creates a standard push button with a delete label and optional icon. The
|
||||||
button is connected to the parent's ``onDeleteButtonClicked()`` method to
|
button is connected to the parent's ``onDeleteButtonClicked()`` method to
|
||||||
handle the ``clicked()`` signal.
|
handle the ``clicked()`` signal.
|
||||||
|
|
||||||
``parent``
|
``parent``
|
||||||
The parent object. This should be a ``QWidget`` descendant.
|
The parent object. This should be a ``QWidget`` descendant.
|
||||||
|
|
||||||
``icon``
|
``icon``
|
||||||
An icon to display on the button. This can be either a ``QIcon``, a
|
An icon to display on the button. This can be either a ``QIcon``, a
|
||||||
resource path or a file name.
|
resource path or a file name.
|
||||||
"""
|
"""
|
||||||
delete_button = QtGui.QPushButton(parent)
|
delete_button = QtGui.QPushButton(parent)
|
||||||
|
@ -183,12 +210,12 @@ def create_delete_push_button(parent, icon=None):
|
||||||
def create_up_down_push_button_set(parent):
|
def create_up_down_push_button_set(parent):
|
||||||
"""
|
"""
|
||||||
Creates a standard set of two push buttons, one for up and the other for
|
Creates a standard set of two push buttons, one for up and the other for
|
||||||
down, for use with lists. The buttons use arrow icons and no text and are
|
down, for use with lists. The buttons use arrow icons and no text and are
|
||||||
connected to the parent's ``onUpButtonClicked()`` and
|
connected to the parent's ``onUpButtonClicked()`` and
|
||||||
``onDownButtonClicked()`` to handle their respective ``clicked()`` signals.
|
``onDownButtonClicked()`` to handle their respective ``clicked()`` signals.
|
||||||
|
|
||||||
``parent``
|
``parent``
|
||||||
The parent object. This should be a ``QWidget`` descendant.
|
The parent object. This should be a ``QWidget`` descendant.
|
||||||
"""
|
"""
|
||||||
up_button = QtGui.QPushButton(parent)
|
up_button = QtGui.QPushButton(parent)
|
||||||
up_button.setIcon(build_icon(u':/services/service_up.png'))
|
up_button.setIcon(build_icon(u':/services/service_up.png'))
|
||||||
|
@ -268,7 +295,7 @@ def create_valign_combo(form, parent, layout):
|
||||||
The UI screen that the label and combo will appear on.
|
The UI screen that the label and combo will appear on.
|
||||||
|
|
||||||
``parent``
|
``parent``
|
||||||
The parent object. This should be a ``QWidget`` descendant.
|
The parent object. This should be a ``QWidget`` descendant.
|
||||||
|
|
||||||
``layout``
|
``layout``
|
||||||
A layout object to add the label and combo widgets to.
|
A layout object to add the label and combo widgets to.
|
||||||
|
@ -278,8 +305,8 @@ def create_valign_combo(form, parent, layout):
|
||||||
verticalLabel.setText(translate('OpenLP.Ui', '&Vertical Align:'))
|
verticalLabel.setText(translate('OpenLP.Ui', '&Vertical Align:'))
|
||||||
form.verticalComboBox = QtGui.QComboBox(parent)
|
form.verticalComboBox = QtGui.QComboBox(parent)
|
||||||
form.verticalComboBox.setObjectName(u'VerticalComboBox')
|
form.verticalComboBox.setObjectName(u'VerticalComboBox')
|
||||||
form.verticalComboBox.addItem(translate('OpenLP.Ui', 'Top'))
|
form.verticalComboBox.addItem(UiStrings.Top)
|
||||||
form.verticalComboBox.addItem(translate('OpenLP.Ui', 'Middle'))
|
form.verticalComboBox.addItem(UiStrings.Middle)
|
||||||
form.verticalComboBox.addItem(translate('OpenLP.Ui', 'Bottom'))
|
form.verticalComboBox.addItem(UiStrings.Bottom)
|
||||||
verticalLabel.setBuddy(form.verticalComboBox)
|
verticalLabel.setBuddy(form.verticalComboBox)
|
||||||
layout.addRow(verticalLabel, form.verticalComboBox)
|
layout.addRow(verticalLabel, form.verticalComboBox)
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -24,4 +24,4 @@
|
||||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
from openlp.core.theme.theme import Theme
|
from openlp.core.theme.theme import Theme
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -92,7 +92,7 @@ class Theme(object):
|
||||||
* ``solid`` - color
|
* ``solid`` - color
|
||||||
|
|
||||||
``BackgroundParameter2``
|
``BackgroundParameter2``
|
||||||
Extra information about the background. The contents of this attribute
|
Extra information about the background. The contents of this attribute
|
||||||
depend on the BackgroundType:
|
depend on the BackgroundType:
|
||||||
|
|
||||||
* ``image`` - border color
|
* ``image`` - border color
|
||||||
|
@ -100,7 +100,7 @@ class Theme(object):
|
||||||
* ``solid`` - N/A
|
* ``solid`` - N/A
|
||||||
|
|
||||||
``BackgroundParameter3``
|
``BackgroundParameter3``
|
||||||
Extra information about the background. The contents of this attribute
|
Extra information about the background. The contents of this attribute
|
||||||
depend on the BackgroundType:
|
depend on the BackgroundType:
|
||||||
|
|
||||||
* ``image`` - N/A
|
* ``image`` - N/A
|
||||||
|
@ -142,7 +142,7 @@ class Theme(object):
|
||||||
Color for the outline (or None if Outline is 0)
|
Color for the outline (or None if Outline is 0)
|
||||||
|
|
||||||
``HorizontalAlign``
|
``HorizontalAlign``
|
||||||
The horizontal alignment to apply to text. Valid alignments are:
|
The horizontal alignment to apply to text. Valid alignments are:
|
||||||
|
|
||||||
* ``0`` - left align
|
* ``0`` - left align
|
||||||
* ``1`` - right align
|
* ``1`` - right align
|
||||||
|
@ -156,7 +156,7 @@ class Theme(object):
|
||||||
* ``2`` - centre align
|
* ``2`` - centre align
|
||||||
|
|
||||||
``WrapStyle``
|
``WrapStyle``
|
||||||
The wrap style to apply to the text. Valid styles are:
|
The wrap style to apply to the text. Valid styles are:
|
||||||
|
|
||||||
* ``0`` - normal
|
* ``0`` - normal
|
||||||
* ``1`` - lyrics
|
* ``1`` - lyrics
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -51,6 +51,8 @@ class HideMode(object):
|
||||||
Theme = 2
|
Theme = 2
|
||||||
Screen = 3
|
Screen = 3
|
||||||
|
|
||||||
|
from firsttimeform import FirstTimeForm
|
||||||
|
from firsttimelanguageform import FirstTimeLanguageForm
|
||||||
from themeform import ThemeForm
|
from themeform import ThemeForm
|
||||||
from filerenameform import FileRenameForm
|
from filerenameform import FileRenameForm
|
||||||
from starttimeform import StartTimeForm
|
from starttimeform import StartTimeForm
|
||||||
|
@ -63,10 +65,10 @@ from splashscreen import SplashScreen
|
||||||
from generaltab import GeneralTab
|
from generaltab import GeneralTab
|
||||||
from themestab import ThemesTab
|
from themestab import ThemesTab
|
||||||
from advancedtab import AdvancedTab
|
from advancedtab import AdvancedTab
|
||||||
from displaytagtab import DisplayTagTab
|
|
||||||
from aboutform import AboutForm
|
from aboutform import AboutForm
|
||||||
from pluginform import PluginForm
|
from pluginform import PluginForm
|
||||||
from settingsform import SettingsForm
|
from settingsform import SettingsForm
|
||||||
|
from displaytagform import DisplayTagForm
|
||||||
from shortcutlistform import ShortcutListForm
|
from shortcutlistform import ShortcutListForm
|
||||||
from mediadockmanager import MediaDockManager
|
from mediadockmanager import MediaDockManager
|
||||||
from servicemanager import ServiceManager
|
from servicemanager import ServiceManager
|
||||||
|
@ -74,4 +76,4 @@ from thememanager import ThemeManager
|
||||||
|
|
||||||
__all__ = ['SplashScreen', 'AboutForm', 'SettingsForm', 'MainDisplay',
|
__all__ = ['SplashScreen', 'AboutForm', 'SettingsForm', 'MainDisplay',
|
||||||
'SlideController', 'ServiceManager', 'ThemeManager', 'MediaDockManager',
|
'SlideController', 'ServiceManager', 'ThemeManager', 'MediaDockManager',
|
||||||
'ServiceItemEditForm']
|
'ServiceItemEditForm', u'FirstTimeForm']
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -27,6 +27,7 @@
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import build_icon, translate
|
from openlp.core.lib import build_icon, translate
|
||||||
|
from openlp.core.lib.ui import UiStrings
|
||||||
|
|
||||||
class Ui_AboutDialog(object):
|
class Ui_AboutDialog(object):
|
||||||
def setupUi(self, aboutDialog):
|
def setupUi(self, aboutDialog):
|
||||||
|
@ -86,8 +87,7 @@ class Ui_AboutDialog(object):
|
||||||
QtCore.QMetaObject.connectSlotsByName(aboutDialog)
|
QtCore.QMetaObject.connectSlotsByName(aboutDialog)
|
||||||
|
|
||||||
def retranslateUi(self, aboutDialog):
|
def retranslateUi(self, aboutDialog):
|
||||||
aboutDialog.setWindowTitle(translate('OpenLP.AboutForm',
|
aboutDialog.setWindowTitle(u'%s OpenLP' % UiStrings.About)
|
||||||
'About OpenLP'))
|
|
||||||
self.aboutTextEdit.setPlainText(translate('OpenLP.AboutForm',
|
self.aboutTextEdit.setPlainText(translate('OpenLP.AboutForm',
|
||||||
'OpenLP <version><revision> - Open Source Lyrics '
|
'OpenLP <version><revision> - Open Source Lyrics '
|
||||||
'Projection\n'
|
'Projection\n'
|
||||||
|
@ -105,40 +105,87 @@ class Ui_AboutDialog(object):
|
||||||
'consider contributing by using the button below.'
|
'consider contributing by using the button below.'
|
||||||
))
|
))
|
||||||
self.aboutNotebook.setTabText(
|
self.aboutNotebook.setTabText(
|
||||||
self.aboutNotebook.indexOf(self.aboutTab),
|
self.aboutNotebook.indexOf(self.aboutTab), UiStrings.About)
|
||||||
translate('OpenLP.AboutForm', 'About'))
|
lead = u'Raoul "superfly" Snyman'
|
||||||
self.creditsTextEdit.setPlainText(translate('OpenLP.AboutForm',
|
developers = [u'Tim "TRB143" Bentley', u'Jonathan "gushie" Corwin',
|
||||||
|
u'Michael "cocooncrash" Gorven',
|
||||||
|
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'Christian "crichter" Richter', u'Philip "Phill" Ridout',
|
||||||
|
u'Jeffrey "whydoubt" Smith', u'Maikel Stuivenberg',
|
||||||
|
u'Carsten "catini" Tingaard', 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)']
|
||||||
|
translators = {
|
||||||
|
u'af': [u'Johan "nuvolari" Mynhardt'],
|
||||||
|
u'de': [u'Patrick "madmuffin" Br\xfcckner',
|
||||||
|
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'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'ru': [u'Sergey "ratz" Ratz']
|
||||||
|
}
|
||||||
|
documentors = [u'Wesley "wrst" Stout',
|
||||||
|
u'John "jseagull1" Cegalis (lead)']
|
||||||
|
self.creditsTextEdit.setPlainText(unicode(translate('OpenLP.AboutForm',
|
||||||
'Project Lead\n'
|
'Project Lead\n'
|
||||||
' Raoul "superfly" Snyman\n'
|
' %s\n'
|
||||||
'\n'
|
'\n'
|
||||||
'Developers\n'
|
'Developers\n'
|
||||||
' Tim "TRB143" Bentley\n'
|
' %s\n'
|
||||||
' Jonathan "gushie" Corwin\n'
|
|
||||||
' Michael "cocooncrash" Gorven\n'
|
|
||||||
' Scott "sguerrieri" Guerrieri\n'
|
|
||||||
' Raoul "superfly" Snyman\n'
|
|
||||||
' Martin "mijiti" Thompson\n'
|
|
||||||
' Jon "Meths" Tibble\n'
|
|
||||||
'\n'
|
'\n'
|
||||||
'Contributors\n'
|
'Contributors\n'
|
||||||
' Meinert "m2j" Jordan\n'
|
' %s\n'
|
||||||
' Andreas "googol" Preikschat\n'
|
|
||||||
' Christian "crichter" Richter\n'
|
|
||||||
' Philip "Phill" Ridout\n'
|
|
||||||
' Maikel Stuivenberg\n'
|
|
||||||
' Carsten "catini" Tingaard\n'
|
|
||||||
' Frode "frodus" Woldsund\n'
|
|
||||||
'\n'
|
'\n'
|
||||||
'Testers\n'
|
'Testers\n'
|
||||||
' Philip "Phill" Ridout\n'
|
' %s\n'
|
||||||
' Wesley "wrst" Stout (lead)\n'
|
|
||||||
'\n'
|
'\n'
|
||||||
'Packagers\n'
|
'Packagers\n'
|
||||||
' Thomas "tabthorpe" Abthorpe (FreeBSD)\n'
|
' %s\n'
|
||||||
' Tim "TRB143" Bentley (Fedora)\n'
|
'\n'
|
||||||
' Michael "cocooncrash" Gorven (Ubuntu)\n'
|
'Translators\n'
|
||||||
' Matthias "matthub" Hub (Mac OS X)\n'
|
' Afrikaans (af)\n'
|
||||||
' Raoul "superfly" Snyman (Windows, Ubuntu)\n'
|
' %s\n'
|
||||||
|
' German (de)\n'
|
||||||
|
' %s\n'
|
||||||
|
' English, United Kingdom (en_GB)\n'
|
||||||
|
' %s\n'
|
||||||
|
' English, South Africa (en_ZA)\n'
|
||||||
|
' %s\n'
|
||||||
|
' Estonian (et)\n'
|
||||||
|
' %s\n'
|
||||||
|
' French (fr)\n'
|
||||||
|
' %s\n'
|
||||||
|
' Hungarian (hu)\n'
|
||||||
|
' %s\n'
|
||||||
|
' Japanese (ja)\n'
|
||||||
|
' %s\n'
|
||||||
|
' Norwegian Bokm\xe5l (nb)\n'
|
||||||
|
' %s\n'
|
||||||
|
' Dutch (nl)\n'
|
||||||
|
' %s\n'
|
||||||
|
' Portuguese, Brazil (pt_BR)\n'
|
||||||
|
' %s\n'
|
||||||
|
' Russian (ru)\n'
|
||||||
|
' %s\n'
|
||||||
|
'\n'
|
||||||
|
'Documentation\n'
|
||||||
|
' %s\n'
|
||||||
'\n'
|
'\n'
|
||||||
'Built With\n'
|
'Built With\n'
|
||||||
' Python: http://www.python.org/\n'
|
' Python: http://www.python.org/\n'
|
||||||
|
@ -156,31 +203,42 @@ class Ui_AboutDialog(object):
|
||||||
' God our Father, for sending His Son to die\n'
|
' God our Father, for sending His Son to die\n'
|
||||||
' on the cross, setting us free from sin. We\n'
|
' on the cross, setting us free from sin. We\n'
|
||||||
' bring this software to you for free because\n'
|
' bring this software to you for free because\n'
|
||||||
' He has set us free.'
|
' He has set us free.')) % (lead, u'\n '.join(developers),
|
||||||
))
|
u'\n '.join(contributors), u'\n '.join(testers),
|
||||||
|
u'\n '.join(packagers), u'\n '.join(translators[u'af']),
|
||||||
|
u'\n '.join(translators[u'de']),
|
||||||
|
u'\n '.join(translators[u'en_GB']),
|
||||||
|
u'\n '.join(translators[u'en_ZA']),
|
||||||
|
u'\n '.join(translators[u'et']),
|
||||||
|
u'\n '.join(translators[u'fr']),
|
||||||
|
u'\n '.join(translators[u'hu']),
|
||||||
|
u'\n '.join(translators[u'ja']),
|
||||||
|
u'\n '.join(translators[u'nb']),
|
||||||
|
u'\n '.join(translators[u'nl']),
|
||||||
|
u'\n '.join(translators[u'pt_BR']),
|
||||||
|
u'\n '.join(translators[u'ru']),
|
||||||
|
u'\n '.join(documentors)))
|
||||||
self.aboutNotebook.setTabText(
|
self.aboutNotebook.setTabText(
|
||||||
self.aboutNotebook.indexOf(self.creditsTab),
|
self.aboutNotebook.indexOf(self.creditsTab),
|
||||||
translate('OpenLP.AboutForm', 'Credits'))
|
translate('OpenLP.AboutForm', 'Credits'))
|
||||||
self.licenseTextEdit.setPlainText(translate('OpenLP.AboutForm',
|
copyright = translate('OpenLP.AboutForm',
|
||||||
'Copyright \xa9 2004-2011 Raoul Snyman\n'
|
'Copyright \xa9 2004-2011 Raoul Snyman\n'
|
||||||
'Portions copyright \xa9 2004-2011 '
|
'Portions copyright \xa9 2004-2011 '
|
||||||
'Tim Bentley, Jonathan Corwin, Michael Gorven, Scott Guerrieri,\n'
|
'Tim Bentley, Jonathan Corwin, Michael Gorven, Scott Guerrieri,\n'
|
||||||
'Meinert Jordan, Andreas Preikschat, Christian Richter, Philip\n'
|
'Meinert Jordan, Andreas Preikschat, Christian Richter, Philip\n'
|
||||||
'Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, Carstenn'
|
'Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, Carstenn'
|
||||||
'Tinggaard, Frode Woldsund\n'
|
'Tinggaard, Frode Woldsund')
|
||||||
'\n'
|
licence = translate('OpenLP.AboutForm',
|
||||||
'This program is free software; you can redistribute it and/or '
|
'This program is free software; you can redistribute it and/or '
|
||||||
'modify it under the terms of the GNU General Public License as '
|
'modify it under the terms of the GNU General Public License as '
|
||||||
'published by the Free Software Foundation; version 2 of the '
|
'published by the Free Software Foundation; version 2 of the '
|
||||||
'License.\n'
|
'License.')
|
||||||
'\n'
|
disclaimer = translate('OpenLP.AboutForm',
|
||||||
'This program is distributed in the hope that it will be useful, '
|
'This program is distributed in the hope that it will be useful, '
|
||||||
'but WITHOUT ANY WARRANTY; without even the implied warranty of '
|
'but WITHOUT ANY WARRANTY; without even the implied warranty of '
|
||||||
'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See below '
|
'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See below '
|
||||||
'for more details.\n'
|
'for more details.')
|
||||||
'\n'
|
gpltext = ('GNU GENERAL PUBLIC LICENSE\n'
|
||||||
'\n'
|
|
||||||
'GNU GENERAL PUBLIC LICENSE\n'
|
|
||||||
'Version 2, June 1991\n'
|
'Version 2, June 1991\n'
|
||||||
'\n'
|
'\n'
|
||||||
'Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 '
|
'Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 '
|
||||||
|
@ -550,7 +608,9 @@ class Ui_AboutDialog(object):
|
||||||
'subroutine library, you may consider it more useful to permit '
|
'subroutine library, you may consider it more useful to permit '
|
||||||
'linking proprietary applications with the library. If this is '
|
'linking proprietary applications with the library. If this is '
|
||||||
'what you want to do, use the GNU Lesser General Public License '
|
'what you want to do, use the GNU Lesser General Public License '
|
||||||
'instead of this License.'))
|
'instead of this License.')
|
||||||
|
self.licenseTextEdit.setPlainText(u'%s\n\n%s\n\n%s\n\n\n%s' %
|
||||||
|
(copyright, licence, disclaimer, gpltext))
|
||||||
self.aboutNotebook.setTabText(
|
self.aboutNotebook.setTabText(
|
||||||
self.aboutNotebook.indexOf(self.licenseTab),
|
self.aboutNotebook.indexOf(self.licenseTab),
|
||||||
translate('OpenLP.AboutForm', 'License'))
|
translate('OpenLP.AboutForm', 'License'))
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -61,4 +61,4 @@ class AboutForm(QtGui.QDialog, Ui_AboutDialog):
|
||||||
import webbrowser
|
import webbrowser
|
||||||
url = u'http://www.openlp.org/en/documentation/introduction/' \
|
url = u'http://www.openlp.org/en/documentation/introduction/' \
|
||||||
+ u'contributing.html'
|
+ u'contributing.html'
|
||||||
webbrowser.open_new(url)
|
webbrowser.open_new(url)
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -28,8 +28,9 @@ The :mod:`advancedtab` provides an advanced settings facility.
|
||||||
"""
|
"""
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import SettingsTab, translate
|
from openlp.core.lib import SettingsTab, translate, build_icon
|
||||||
from openlp.core.lib.ui import UiStrings
|
from openlp.core.lib.ui import UiStrings
|
||||||
|
from openlp.core.utils import get_images_filter
|
||||||
|
|
||||||
class AdvancedTab(SettingsTab):
|
class AdvancedTab(SettingsTab):
|
||||||
"""
|
"""
|
||||||
|
@ -41,6 +42,8 @@ class AdvancedTab(SettingsTab):
|
||||||
Initialise the settings tab
|
Initialise the settings tab
|
||||||
"""
|
"""
|
||||||
SettingsTab.__init__(self, u'Advanced')
|
SettingsTab.__init__(self, u'Advanced')
|
||||||
|
self.default_image = u':/graphics/openlp-splash-screen.png'
|
||||||
|
self.default_color = u'#ffffff'
|
||||||
|
|
||||||
def setupUi(self):
|
def setupUi(self):
|
||||||
"""
|
"""
|
||||||
|
@ -81,33 +84,38 @@ class AdvancedTab(SettingsTab):
|
||||||
self.hideMouseCheckBox.setObjectName(u'hideMouseCheckBox')
|
self.hideMouseCheckBox.setObjectName(u'hideMouseCheckBox')
|
||||||
self.hideMouseLayout.addWidget(self.hideMouseCheckBox)
|
self.hideMouseLayout.addWidget(self.hideMouseCheckBox)
|
||||||
self.leftLayout.addWidget(self.hideMouseGroupBox)
|
self.leftLayout.addWidget(self.hideMouseGroupBox)
|
||||||
# self.sharedDirGroupBox = QtGui.QGroupBox(self.leftColumn)
|
|
||||||
# self.sharedDirGroupBox.setObjectName(u'sharedDirGroupBox')
|
|
||||||
# self.sharedDirLayout = QtGui.QFormLayout(self.sharedDirGroupBox)
|
|
||||||
# self.sharedCheckBox = QtGui.QCheckBox(self.sharedDirGroupBox)
|
|
||||||
# self.sharedCheckBox.setObjectName(u'sharedCheckBox')
|
|
||||||
# self.sharedDirLayout.addRow(self.sharedCheckBox)
|
|
||||||
# self.sharedLabel = QtGui.QLabel(self.sharedDirGroupBox)
|
|
||||||
# self.sharedLabel.setObjectName(u'sharedLabel')
|
|
||||||
# self.sharedSubLayout = QtGui.QHBoxLayout()
|
|
||||||
# self.sharedSubLayout.setObjectName(u'sharedSubLayout')
|
|
||||||
# self.sharedLineEdit = QtGui.QLineEdit(self.sharedDirGroupBox)
|
|
||||||
# self.sharedLineEdit.setObjectName(u'sharedLineEdit')
|
|
||||||
# self.sharedSubLayout.addWidget(self.sharedLineEdit)
|
|
||||||
# self.sharedPushButton = QtGui.QPushButton(self.sharedDirGroupBox)
|
|
||||||
# self.sharedPushButton.setObjectName(u'sharedPushButton')
|
|
||||||
# self.sharedSubLayout.addWidget(self.sharedPushButton)
|
|
||||||
# self.sharedDirLayout.addRow(self.sharedLabel, self.sharedSubLayout)
|
|
||||||
# self.leftLayout.addWidget(self.sharedDirGroupBox)
|
|
||||||
self.leftLayout.addStretch()
|
self.leftLayout.addStretch()
|
||||||
# self.databaseGroupBox = QtGui.QGroupBox(self.rightColumn)
|
self.defaultImageGroupBox = QtGui.QGroupBox(self.rightColumn)
|
||||||
# self.databaseGroupBox.setObjectName(u'databaseGroupBox')
|
self.defaultImageGroupBox.setObjectName(u'defaultImageGroupBox')
|
||||||
# self.databaseGroupBox.setEnabled(False)
|
self.defaultImageLayout = QtGui.QFormLayout(self.defaultImageGroupBox)
|
||||||
# self.databaseLayout = QtGui.QVBoxLayout(self.databaseGroupBox)
|
self.defaultImageLayout.setObjectName(u'defaultImageLayout')
|
||||||
# self.rightLayout.addWidget(self.databaseGroupBox)
|
self.defaultColorLabel = QtGui.QLabel(self.defaultImageGroupBox)
|
||||||
|
self.defaultColorLabel.setObjectName(u'defaultColorLabel')
|
||||||
|
self.defaultColorButton = QtGui.QPushButton(self.defaultImageGroupBox)
|
||||||
|
self.defaultColorButton.setObjectName(u'defaultColorButton')
|
||||||
|
self.defaultImageLayout.addRow(self.defaultColorLabel,
|
||||||
|
self.defaultColorButton)
|
||||||
|
self.defaultFileLabel = QtGui.QLabel(self.defaultImageGroupBox)
|
||||||
|
self.defaultFileLabel.setObjectName(u'defaultFileLabel')
|
||||||
|
self.defaultFileEdit = QtGui.QLineEdit(self.defaultImageGroupBox)
|
||||||
|
self.defaultFileEdit.setObjectName(u'defaultFileEdit')
|
||||||
|
self.defaultBrowseButton = QtGui.QToolButton(self.defaultImageGroupBox)
|
||||||
|
self.defaultBrowseButton.setObjectName(u'defaultBrowseButton')
|
||||||
|
self.defaultBrowseButton.setIcon(
|
||||||
|
build_icon(u':/general/general_open.png'))
|
||||||
|
self.defaultFileLayout = QtGui.QHBoxLayout()
|
||||||
|
self.defaultFileLayout.setObjectName(u'defaultFileLayout')
|
||||||
|
self.defaultFileLayout.addWidget(self.defaultFileEdit)
|
||||||
|
self.defaultFileLayout.addWidget(self.defaultBrowseButton)
|
||||||
|
self.defaultImageLayout.addRow(self.defaultFileLabel,
|
||||||
|
self.defaultFileLayout)
|
||||||
|
self.rightLayout.addWidget(self.defaultImageGroupBox)
|
||||||
self.rightLayout.addStretch()
|
self.rightLayout.addStretch()
|
||||||
# QtCore.QObject.connect(self.sharedCheckBox,
|
|
||||||
# QtCore.SIGNAL(u'stateChanged(int)'), self.onSharedCheckBoxChanged)
|
QtCore.QObject.connect(self.defaultColorButton,
|
||||||
|
QtCore.SIGNAL(u'pressed()'), self.onDefaultColorButtonPressed)
|
||||||
|
QtCore.QObject.connect(self.defaultBrowseButton,
|
||||||
|
QtCore.SIGNAL(u'pressed()'), self.onDefaultBrowseButtonPressed)
|
||||||
|
|
||||||
def retranslateUi(self):
|
def retranslateUi(self):
|
||||||
"""
|
"""
|
||||||
|
@ -129,14 +137,13 @@ class AdvancedTab(SettingsTab):
|
||||||
self.hideMouseGroupBox.setTitle(translate('OpenLP.AdvancedTab',
|
self.hideMouseGroupBox.setTitle(translate('OpenLP.AdvancedTab',
|
||||||
'Mouse Cursor'))
|
'Mouse Cursor'))
|
||||||
self.hideMouseCheckBox.setText(translate('OpenLP.AdvancedTab',
|
self.hideMouseCheckBox.setText(translate('OpenLP.AdvancedTab',
|
||||||
'Hide the mouse cursor when moved over the display window'))
|
'Hide mouse cursor when over display window'))
|
||||||
# self.sharedDirGroupBox.setTitle(
|
self.defaultImageGroupBox.setTitle(translate('OpenLP.AdvancedTab',
|
||||||
# translate('AdvancedTab', 'Central Data Store'))
|
'Default Image'))
|
||||||
# self.sharedCheckBox.setText(
|
self.defaultColorLabel.setText(translate('OpenLP.AdvancedTab',
|
||||||
# translate('AdvancedTab', 'Enable a shared data location'))
|
'Background color:'))
|
||||||
# self.sharedLabel.setText(translate('AdvancedTab', 'Store location:'))
|
self.defaultFileLabel.setText(translate('OpenLP.AdvancedTab',
|
||||||
# self.sharedPushButton.setText(translate('AdvancedTab', 'Browse...'))
|
'Image file:'))
|
||||||
# self.databaseGroupBox.setTitle(translate('AdvancedTab', 'Databases'))
|
|
||||||
|
|
||||||
def load(self):
|
def load(self):
|
||||||
"""
|
"""
|
||||||
|
@ -165,7 +172,14 @@ class AdvancedTab(SettingsTab):
|
||||||
QtCore.QVariant(True)).toBool())
|
QtCore.QVariant(True)).toBool())
|
||||||
self.hideMouseCheckBox.setChecked(
|
self.hideMouseCheckBox.setChecked(
|
||||||
settings.value(u'hide mouse', QtCore.QVariant(False)).toBool())
|
settings.value(u'hide mouse', QtCore.QVariant(False)).toBool())
|
||||||
|
self.default_color = settings.value(u'default color',
|
||||||
|
QtCore.QVariant(u'#ffffff')).toString()
|
||||||
|
self.defaultFileEdit.setText(settings.value(u'default image',
|
||||||
|
QtCore.QVariant(u':/graphics/openlp-splash-screen.png'))\
|
||||||
|
.toString())
|
||||||
settings.endGroup()
|
settings.endGroup()
|
||||||
|
self.defaultColorButton.setStyleSheet(
|
||||||
|
u'background-color: %s' % self.default_color)
|
||||||
|
|
||||||
def save(self):
|
def save(self):
|
||||||
"""
|
"""
|
||||||
|
@ -185,12 +199,24 @@ class AdvancedTab(SettingsTab):
|
||||||
QtCore.QVariant(self.enableAutoCloseCheckBox.isChecked()))
|
QtCore.QVariant(self.enableAutoCloseCheckBox.isChecked()))
|
||||||
settings.setValue(u'hide mouse',
|
settings.setValue(u'hide mouse',
|
||||||
QtCore.QVariant(self.hideMouseCheckBox.isChecked()))
|
QtCore.QVariant(self.hideMouseCheckBox.isChecked()))
|
||||||
|
settings.setValue(u'default color', self.default_color)
|
||||||
|
settings.setValue(u'default image', self.defaultFileEdit.text())
|
||||||
settings.endGroup()
|
settings.endGroup()
|
||||||
|
|
||||||
# def onSharedCheckBoxChanged(self, checked):
|
def onDefaultColorButtonPressed(self):
|
||||||
# """
|
new_color = QtGui.QColorDialog.getColor(
|
||||||
# Enables the widgets to allow a shared data location
|
QtGui.QColor(self.default_color), self)
|
||||||
# """
|
if new_color.isValid():
|
||||||
# self.sharedLabel.setEnabled(checked)
|
self.default_color = new_color.name()
|
||||||
# self.sharedTextEdit.setEnabled(checked)
|
self.defaultColorButton.setStyleSheet(
|
||||||
# self.sharedPushButton.setEnabled(checked)
|
u'background-color: %s' % self.default_color)
|
||||||
|
|
||||||
|
def onDefaultBrowseButtonPressed(self):
|
||||||
|
file_filters = u'%s;;%s (*.*) (*)' % (get_images_filter(),
|
||||||
|
UiStrings.AllFiles)
|
||||||
|
filename = QtGui.QFileDialog.getOpenFileName(self,
|
||||||
|
translate('OpenLP.AdvancedTab', 'Open File'), '',
|
||||||
|
file_filters)
|
||||||
|
if filename:
|
||||||
|
self.defaultFileEdit.setText(filename)
|
||||||
|
self.defaultFileEdit.setFocus()
|
||||||
|
|
|
@ -0,0 +1,154 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# OpenLP - Open Source Lyrics Projection #
|
||||||
|
# --------------------------------------------------------------------------- #
|
||||||
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
|
# --------------------------------------------------------------------------- #
|
||||||
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
# Software Foundation; version 2 of the License. #
|
||||||
|
# #
|
||||||
|
# This program is distributed in the hope that it will be useful, but WITHOUT #
|
||||||
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
|
||||||
|
# more details. #
|
||||||
|
# #
|
||||||
|
# You should have received a copy of the GNU General Public License along #
|
||||||
|
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
|
||||||
|
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
|
from openlp.core.lib import translate
|
||||||
|
from openlp.core.lib.ui import UiStrings, create_accept_reject_button_box
|
||||||
|
|
||||||
|
class Ui_DisplayTagDialog(object):
|
||||||
|
|
||||||
|
def setupUi(self, displayTagDialog):
|
||||||
|
displayTagDialog.setObjectName(u'displayTagDialog')
|
||||||
|
displayTagDialog.resize(725, 548)
|
||||||
|
self.widget = QtGui.QWidget(displayTagDialog)
|
||||||
|
self.widget.setGeometry(QtCore.QRect(10, 10, 701, 521))
|
||||||
|
self.widget.setObjectName(u'widget')
|
||||||
|
self.listdataGridLayout = QtGui.QGridLayout(self.widget)
|
||||||
|
self.listdataGridLayout.setMargin(0)
|
||||||
|
self.listdataGridLayout.setObjectName(u'listdataGridLayout')
|
||||||
|
self.tagTableWidget = QtGui.QTableWidget(self.widget)
|
||||||
|
self.tagTableWidget.setHorizontalScrollBarPolicy(
|
||||||
|
QtCore.Qt.ScrollBarAlwaysOff)
|
||||||
|
self.tagTableWidget.setEditTriggers(
|
||||||
|
QtGui.QAbstractItemView.NoEditTriggers)
|
||||||
|
self.tagTableWidget.setAlternatingRowColors(True)
|
||||||
|
self.tagTableWidget.setSelectionMode(
|
||||||
|
QtGui.QAbstractItemView.SingleSelection)
|
||||||
|
self.tagTableWidget.setSelectionBehavior(
|
||||||
|
QtGui.QAbstractItemView.SelectRows)
|
||||||
|
self.tagTableWidget.setCornerButtonEnabled(False)
|
||||||
|
self.tagTableWidget.setObjectName(u'tagTableWidget')
|
||||||
|
self.tagTableWidget.setColumnCount(4)
|
||||||
|
self.tagTableWidget.setRowCount(0)
|
||||||
|
item = QtGui.QTableWidgetItem()
|
||||||
|
self.tagTableWidget.setHorizontalHeaderItem(0, item)
|
||||||
|
item = QtGui.QTableWidgetItem()
|
||||||
|
self.tagTableWidget.setHorizontalHeaderItem(1, item)
|
||||||
|
item = QtGui.QTableWidgetItem()
|
||||||
|
self.tagTableWidget.setHorizontalHeaderItem(2, item)
|
||||||
|
item = QtGui.QTableWidgetItem()
|
||||||
|
self.tagTableWidget.setHorizontalHeaderItem(3, item)
|
||||||
|
self.listdataGridLayout.addWidget(self.tagTableWidget, 0, 0, 1, 1)
|
||||||
|
self.horizontalLayout = QtGui.QHBoxLayout()
|
||||||
|
self.horizontalLayout.setObjectName(u'horizontalLayout')
|
||||||
|
spacerItem = QtGui.QSpacerItem(40, 20,
|
||||||
|
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
|
||||||
|
self.horizontalLayout.addItem(spacerItem)
|
||||||
|
self.defaultPushButton = QtGui.QPushButton(self.widget)
|
||||||
|
self.defaultPushButton.setObjectName(u'defaultPushButton')
|
||||||
|
self.horizontalLayout.addWidget(self.defaultPushButton)
|
||||||
|
self.deletePushButton = QtGui.QPushButton(self.widget)
|
||||||
|
self.deletePushButton.setObjectName(u'deletePushButton')
|
||||||
|
self.horizontalLayout.addWidget(self.deletePushButton)
|
||||||
|
self.listdataGridLayout.addLayout(self.horizontalLayout, 1, 0, 1, 1)
|
||||||
|
self.editGroupBox = QtGui.QGroupBox(self.widget)
|
||||||
|
self.editGroupBox.setObjectName(u'editGroupBox')
|
||||||
|
self.dataGridLayout = QtGui.QGridLayout(self.editGroupBox)
|
||||||
|
self.dataGridLayout.setObjectName(u'dataGridLayout')
|
||||||
|
self.descriptionLabel = QtGui.QLabel(self.editGroupBox)
|
||||||
|
self.descriptionLabel.setAlignment(QtCore.Qt.AlignCenter)
|
||||||
|
self.descriptionLabel.setObjectName(u'descriptionLabel')
|
||||||
|
self.dataGridLayout.addWidget(self.descriptionLabel, 0, 0, 1, 1)
|
||||||
|
self.descriptionLineEdit = QtGui.QLineEdit(self.editGroupBox)
|
||||||
|
self.descriptionLineEdit.setObjectName(u'descriptionLineEdit')
|
||||||
|
self.dataGridLayout.addWidget(self.descriptionLineEdit, 0, 1, 2, 1)
|
||||||
|
self.newPushButton = QtGui.QPushButton(self.editGroupBox)
|
||||||
|
self.newPushButton.setObjectName(u'newPushButton')
|
||||||
|
self.dataGridLayout.addWidget(self.newPushButton, 0, 2, 2, 1)
|
||||||
|
self.tagLabel = QtGui.QLabel(self.editGroupBox)
|
||||||
|
self.tagLabel.setAlignment(QtCore.Qt.AlignCenter)
|
||||||
|
self.tagLabel.setObjectName(u'tagLabel')
|
||||||
|
self.dataGridLayout.addWidget(self.tagLabel, 2, 0, 1, 1)
|
||||||
|
self.tagLineEdit = QtGui.QLineEdit(self.editGroupBox)
|
||||||
|
self.tagLineEdit.setMaximumSize(QtCore.QSize(50, 16777215))
|
||||||
|
self.tagLineEdit.setMaxLength(5)
|
||||||
|
self.tagLineEdit.setObjectName(u'tagLineEdit')
|
||||||
|
self.dataGridLayout.addWidget(self.tagLineEdit, 2, 1, 1, 1)
|
||||||
|
self.startTagLabel = QtGui.QLabel(self.editGroupBox)
|
||||||
|
self.startTagLabel.setAlignment(QtCore.Qt.AlignCenter)
|
||||||
|
self.startTagLabel.setObjectName(u'startTagLabel')
|
||||||
|
self.dataGridLayout.addWidget(self.startTagLabel, 3, 0, 1, 1)
|
||||||
|
self.startTagLineEdit = QtGui.QLineEdit(self.editGroupBox)
|
||||||
|
self.startTagLineEdit.setObjectName(u'startTagLineEdit')
|
||||||
|
self.dataGridLayout.addWidget(self.startTagLineEdit, 3, 1, 1, 1)
|
||||||
|
self.endTagLabel = QtGui.QLabel(self.editGroupBox)
|
||||||
|
self.endTagLabel.setAlignment(QtCore.Qt.AlignCenter)
|
||||||
|
self.endTagLabel.setObjectName(u'endTagLabel')
|
||||||
|
self.dataGridLayout.addWidget(self.endTagLabel, 4, 0, 1, 1)
|
||||||
|
self.endTagLineEdit = QtGui.QLineEdit(self.editGroupBox)
|
||||||
|
self.endTagLineEdit.setObjectName(u'endTagLineEdit')
|
||||||
|
self.dataGridLayout.addWidget(self.endTagLineEdit, 4, 1, 1, 1)
|
||||||
|
self.updatePushButton = QtGui.QPushButton(self.editGroupBox)
|
||||||
|
self.updatePushButton.setObjectName(u'updatePushButton')
|
||||||
|
self.dataGridLayout.addWidget(self.updatePushButton, 4, 2, 1, 1)
|
||||||
|
self.listdataGridLayout.addWidget(self.editGroupBox, 2, 0, 1, 1)
|
||||||
|
self.buttonBox = create_accept_reject_button_box(displayTagDialog)
|
||||||
|
self.listdataGridLayout.addWidget(self.buttonBox, 3, 0, 1, 1)
|
||||||
|
|
||||||
|
self.retranslateUi(displayTagDialog)
|
||||||
|
QtCore.QMetaObject.connectSlotsByName(displayTagDialog)
|
||||||
|
|
||||||
|
def retranslateUi(self, displayTagDialog):
|
||||||
|
displayTagDialog.setWindowTitle(translate('OpenLP.displayTagDialog',
|
||||||
|
'Configure Display Tags'))
|
||||||
|
self.editGroupBox.setTitle(
|
||||||
|
translate('OpenLP.DisplayTagDialog', 'Edit Selection'))
|
||||||
|
self.updatePushButton.setText(
|
||||||
|
translate('OpenLP.DisplayTagDialog', 'Update'))
|
||||||
|
self.descriptionLabel.setText(
|
||||||
|
translate('OpenLP.DisplayTagDialog', 'Description'))
|
||||||
|
self.tagLabel.setText(translate('OpenLP.DisplayTagDialog', 'Tag'))
|
||||||
|
self.startTagLabel.setText(
|
||||||
|
translate('OpenLP.DisplayTagDialog', 'Start tag'))
|
||||||
|
self.endTagLabel.setText(
|
||||||
|
translate('OpenLP.DisplayTagDialog', 'End tag'))
|
||||||
|
self.deletePushButton.setText(UiStrings.Delete)
|
||||||
|
self.defaultPushButton.setText(
|
||||||
|
translate('OpenLP.DisplayTagDialog', 'Default'))
|
||||||
|
self.newPushButton.setText(UiStrings.New)
|
||||||
|
self.tagTableWidget.horizontalHeaderItem(0).setText(
|
||||||
|
translate('OpenLP.DisplayTagDialog', 'Description'))
|
||||||
|
self.tagTableWidget.horizontalHeaderItem(1).setText(
|
||||||
|
translate('OpenLP.DisplayTagDialog', 'Tag id'))
|
||||||
|
self.tagTableWidget.horizontalHeaderItem(2).setText(
|
||||||
|
translate('OpenLP.DisplayTagDialog', 'Start Html'))
|
||||||
|
self.tagTableWidget.horizontalHeaderItem(3).setText(
|
||||||
|
translate('OpenLP.DisplayTagDialog', 'End Html'))
|
||||||
|
self.tagTableWidget.setColumnWidth(0, 120)
|
||||||
|
self.tagTableWidget.setColumnWidth(1, 40)
|
||||||
|
self.tagTableWidget.setColumnWidth(2, 240)
|
||||||
|
self.tagTableWidget.setColumnWidth(3, 240)
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -33,154 +33,21 @@ import cPickle
|
||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import SettingsTab, translate, DisplayTags
|
from openlp.core.lib import translate, DisplayTags
|
||||||
from openlp.core.lib.ui import UiStrings, critical_error_message_box
|
from openlp.core.lib.ui import critical_error_message_box
|
||||||
|
from openlp.core.ui.displaytagdialog import Ui_DisplayTagDialog
|
||||||
|
|
||||||
class DisplayTagTab(SettingsTab):
|
class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog):
|
||||||
"""
|
"""
|
||||||
The :class:`DisplayTagTab` manages the settings tab .
|
The :class:`DisplayTagTab` manages the settings tab .
|
||||||
"""
|
"""
|
||||||
def __init__(self):
|
def __init__(self, parent):
|
||||||
"""
|
"""
|
||||||
Initialise the settings tab
|
Constructor
|
||||||
"""
|
"""
|
||||||
SettingsTab.__init__(self, u'Display Tags')
|
QtGui.QDialog.__init__(self, parent)
|
||||||
|
self.setupUi(self)
|
||||||
def resizeEvent(self, event=None):
|
self.preLoad()
|
||||||
pass
|
|
||||||
|
|
||||||
def preLoad(self):
|
|
||||||
"""
|
|
||||||
Initialise values before the Load takes place
|
|
||||||
"""
|
|
||||||
# Create initial copy from master
|
|
||||||
DisplayTags.reset_html_tags()
|
|
||||||
user_expands = QtCore.QSettings().value(u'displayTags/html_tags',
|
|
||||||
QtCore.QVariant(u'')).toString()
|
|
||||||
# cPickle only accepts str not unicode strings
|
|
||||||
user_expands_string = str(unicode(user_expands).encode(u'utf8'))
|
|
||||||
if user_expands_string:
|
|
||||||
user_tags = cPickle.loads(user_expands_string)
|
|
||||||
# If we have some user ones added them as well
|
|
||||||
for t in user_tags:
|
|
||||||
DisplayTags.add_html_tag(t)
|
|
||||||
self.selected = -1
|
|
||||||
|
|
||||||
def setupUi(self):
|
|
||||||
"""
|
|
||||||
Configure the UI elements for the tab.
|
|
||||||
"""
|
|
||||||
self.setObjectName(u'DisplayTagTab')
|
|
||||||
self.tabTitleVisible = \
|
|
||||||
translate(u'OpenLP.DisplayTagTab', 'Display Tags')
|
|
||||||
self.displayTagEdit = QtGui.QWidget(self)
|
|
||||||
self.editGroupBox = QtGui.QGroupBox(self.displayTagEdit)
|
|
||||||
self.editGroupBox.setGeometry(QtCore.QRect(10, 220, 650, 181))
|
|
||||||
self.editGroupBox.setObjectName(u'editGroupBox')
|
|
||||||
self.updatePushButton = QtGui.QPushButton(self.editGroupBox)
|
|
||||||
self.updatePushButton.setGeometry(QtCore.QRect(550, 140, 71, 26))
|
|
||||||
self.updatePushButton.setObjectName(u'updatePushButton')
|
|
||||||
self.layoutWidget = QtGui.QWidget(self.editGroupBox)
|
|
||||||
self.layoutWidget.setGeometry(QtCore.QRect(5, 20, 571, 114))
|
|
||||||
self.layoutWidget.setObjectName(u'layoutWidget')
|
|
||||||
self.formLayout = QtGui.QFormLayout(self.layoutWidget)
|
|
||||||
self.formLayout.setObjectName(u'formLayout')
|
|
||||||
self.descriptionLabel = QtGui.QLabel(self.layoutWidget)
|
|
||||||
self.descriptionLabel.setAlignment(QtCore.Qt.AlignCenter)
|
|
||||||
self.descriptionLabel.setObjectName(u'descriptionLabel')
|
|
||||||
self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole,
|
|
||||||
self.descriptionLabel)
|
|
||||||
self.descriptionLineEdit = QtGui.QLineEdit(self.layoutWidget)
|
|
||||||
self.descriptionLineEdit.setObjectName(u'descriptionLineEdit')
|
|
||||||
self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole,
|
|
||||||
self.descriptionLineEdit)
|
|
||||||
self.tagLabel = QtGui.QLabel(self.layoutWidget)
|
|
||||||
self.tagLabel.setAlignment(QtCore.Qt.AlignCenter)
|
|
||||||
self.tagLabel.setObjectName(u'tagLabel')
|
|
||||||
self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.tagLabel)
|
|
||||||
self.tagLineEdit = QtGui.QLineEdit(self.layoutWidget)
|
|
||||||
self.tagLineEdit.setMaximumSize(QtCore.QSize(50, 16777215))
|
|
||||||
self.tagLineEdit.setMaxLength(5)
|
|
||||||
self.tagLineEdit.setObjectName(u'tagLineEdit')
|
|
||||||
self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole,
|
|
||||||
self.tagLineEdit)
|
|
||||||
self.startTagLabel = QtGui.QLabel(self.layoutWidget)
|
|
||||||
self.startTagLabel.setAlignment(QtCore.Qt.AlignCenter)
|
|
||||||
self.startTagLabel.setObjectName(u'startTagLabel')
|
|
||||||
self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole,
|
|
||||||
self.startTagLabel)
|
|
||||||
self.startTagLineEdit = QtGui.QLineEdit(self.layoutWidget)
|
|
||||||
self.startTagLineEdit.setObjectName(u'startTagLineEdit')
|
|
||||||
self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole,
|
|
||||||
self.startTagLineEdit)
|
|
||||||
self.endTagLabel = QtGui.QLabel(self.layoutWidget)
|
|
||||||
self.endTagLabel.setAlignment(QtCore.Qt.AlignCenter)
|
|
||||||
self.endTagLabel.setObjectName(u'endTagLabel')
|
|
||||||
self.formLayout.setWidget(3, QtGui.QFormLayout.LabelRole,
|
|
||||||
self.endTagLabel)
|
|
||||||
self.endTagLineEdit = QtGui.QLineEdit(self.layoutWidget)
|
|
||||||
self.endTagLineEdit.setObjectName(u'endTagLineEdit')
|
|
||||||
self.formLayout.setWidget(3, QtGui.QFormLayout.FieldRole,
|
|
||||||
self.endTagLineEdit)
|
|
||||||
self.defaultPushButton = QtGui.QPushButton(self.displayTagEdit)
|
|
||||||
self.defaultPushButton.setGeometry(QtCore.QRect(430, 188, 71, 26))
|
|
||||||
self.defaultPushButton.setObjectName(u'updatePushButton')
|
|
||||||
self.deletePushButton = QtGui.QPushButton(self.displayTagEdit)
|
|
||||||
self.deletePushButton.setGeometry(QtCore.QRect(510, 188, 71, 26))
|
|
||||||
self.deletePushButton.setObjectName(u'deletePushButton')
|
|
||||||
self.newPushButton = QtGui.QPushButton(self.displayTagEdit)
|
|
||||||
self.newPushButton.setGeometry(QtCore.QRect(600, 188, 71, 26))
|
|
||||||
self.newPushButton.setObjectName(u'newPushButton')
|
|
||||||
self.tagTableWidget = QtGui.QTableWidget(self.displayTagEdit)
|
|
||||||
self.tagTableWidget.setGeometry(QtCore.QRect(10, 10, 650, 171))
|
|
||||||
self.tagTableWidget.setHorizontalScrollBarPolicy(
|
|
||||||
QtCore.Qt.ScrollBarAlwaysOff)
|
|
||||||
self.tagTableWidget.setEditTriggers(
|
|
||||||
QtGui.QAbstractItemView.NoEditTriggers)
|
|
||||||
self.tagTableWidget.setAlternatingRowColors(True)
|
|
||||||
self.tagTableWidget.setSelectionMode(
|
|
||||||
QtGui.QAbstractItemView.SingleSelection)
|
|
||||||
self.tagTableWidget.setSelectionBehavior(
|
|
||||||
QtGui.QAbstractItemView.SelectRows)
|
|
||||||
self.tagTableWidget.setCornerButtonEnabled(False)
|
|
||||||
self.tagTableWidget.setObjectName(u'tagTableWidget')
|
|
||||||
self.tagTableWidget.setColumnCount(4)
|
|
||||||
self.tagTableWidget.setRowCount(0)
|
|
||||||
item = QtGui.QTableWidgetItem()
|
|
||||||
self.tagTableWidget.setHorizontalHeaderItem(0, item)
|
|
||||||
item = QtGui.QTableWidgetItem()
|
|
||||||
self.tagTableWidget.setHorizontalHeaderItem(1, item)
|
|
||||||
item = QtGui.QTableWidgetItem()
|
|
||||||
self.tagTableWidget.setHorizontalHeaderItem(2, item)
|
|
||||||
item = QtGui.QTableWidgetItem()
|
|
||||||
self.tagTableWidget.setHorizontalHeaderItem(3, item)
|
|
||||||
self.editGroupBox.setTitle(
|
|
||||||
translate('OpenLP.DisplayTagTab', 'Edit Selection'))
|
|
||||||
self.updatePushButton.setText(
|
|
||||||
translate('OpenLP.DisplayTagTab', 'Update'))
|
|
||||||
self.descriptionLabel.setText(
|
|
||||||
translate('OpenLP.DisplayTagTab', 'Description'))
|
|
||||||
self.tagLabel.setText(translate('OpenLP.DisplayTagTab', 'Tag'))
|
|
||||||
self.startTagLabel.setText(
|
|
||||||
translate('OpenLP.DisplayTagTab', 'Start tag'))
|
|
||||||
self.endTagLabel.setText(translate('OpenLP.DisplayTagTab', 'End tag'))
|
|
||||||
self.deletePushButton.setText(UiStrings.Delete)
|
|
||||||
self.defaultPushButton.setText(
|
|
||||||
translate('OpenLP.DisplayTagTab', 'Default'))
|
|
||||||
self.newPushButton.setText(translate('OpenLP.DisplayTagTab', 'New'))
|
|
||||||
self.tagTableWidget.horizontalHeaderItem(0)\
|
|
||||||
.setText(translate('OpenLP.DisplayTagTab', 'Description'))
|
|
||||||
self.tagTableWidget.horizontalHeaderItem(1)\
|
|
||||||
.setText(translate('OpenLP.DisplayTagTab', 'Tag id'))
|
|
||||||
self.tagTableWidget.horizontalHeaderItem(2)\
|
|
||||||
.setText(translate('OpenLP.DisplayTagTab', 'Start Html'))
|
|
||||||
self.tagTableWidget.horizontalHeaderItem(3)\
|
|
||||||
.setText(translate('OpenLP.DisplayTagTab', 'End Html'))
|
|
||||||
QtCore.QMetaObject.connectSlotsByName(self.displayTagEdit)
|
|
||||||
self.tagTableWidget.setColumnWidth(0, 120)
|
|
||||||
self.tagTableWidget.setColumnWidth(1, 40)
|
|
||||||
self.tagTableWidget.setColumnWidth(2, 240)
|
|
||||||
self.tagTableWidget.setColumnWidth(3, 200)
|
|
||||||
QtCore.QObject.connect(self.tagTableWidget,
|
QtCore.QObject.connect(self.tagTableWidget,
|
||||||
QtCore.SIGNAL(u'clicked(QModelIndex)'), self.onRowSelected)
|
QtCore.SIGNAL(u'clicked(QModelIndex)'), self.onRowSelected)
|
||||||
QtCore.QObject.connect(self.defaultPushButton,
|
QtCore.QObject.connect(self.defaultPushButton,
|
||||||
|
@ -192,35 +59,35 @@ class DisplayTagTab(SettingsTab):
|
||||||
QtCore.QObject.connect(self.deletePushButton,
|
QtCore.QObject.connect(self.deletePushButton,
|
||||||
QtCore.SIGNAL(u'pressed()'), self.onDeletePushed)
|
QtCore.SIGNAL(u'pressed()'), self.onDeletePushed)
|
||||||
|
|
||||||
def load(self):
|
def exec_(self):
|
||||||
"""
|
"""
|
||||||
Load Display and set field state.
|
Load Display and set field state.
|
||||||
"""
|
"""
|
||||||
self.newPushButton.setEnabled(True)
|
# Create initial copy from master
|
||||||
self.updatePushButton.setEnabled(False)
|
self.preLoad()
|
||||||
self.deletePushButton.setEnabled(False)
|
self._resetTable()
|
||||||
for linenumber, html in enumerate(DisplayTags.get_html_tags()):
|
self.selected = -1
|
||||||
self.tagTableWidget.setRowCount(
|
return QtGui.QDialog.exec_(self)
|
||||||
self.tagTableWidget.rowCount() + 1)
|
|
||||||
self.tagTableWidget.setItem(linenumber, 0,
|
|
||||||
QtGui.QTableWidgetItem(html[u'desc']))
|
|
||||||
self.tagTableWidget.setItem(linenumber, 1,
|
|
||||||
QtGui.QTableWidgetItem(self._strip(html[u'start tag'])))
|
|
||||||
self.tagTableWidget.setItem(linenumber, 2,
|
|
||||||
QtGui.QTableWidgetItem(html[u'start html']))
|
|
||||||
self.tagTableWidget.setItem(linenumber, 3,
|
|
||||||
QtGui.QTableWidgetItem(html[u'end html']))
|
|
||||||
self.tagTableWidget.resizeRowsToContents()
|
|
||||||
self.descriptionLineEdit.setText(u'')
|
|
||||||
self.tagLineEdit.setText(u'')
|
|
||||||
self.startTagLineEdit.setText(u'')
|
|
||||||
self.endTagLineEdit.setText(u'')
|
|
||||||
self.descriptionLineEdit.setEnabled(False)
|
|
||||||
self.tagLineEdit.setEnabled(False)
|
|
||||||
self.startTagLineEdit.setEnabled(False)
|
|
||||||
self.endTagLineEdit.setEnabled(False)
|
|
||||||
|
|
||||||
def save(self):
|
def preLoad(self):
|
||||||
|
"""
|
||||||
|
Load the Tags from store so can be used in the system or used to
|
||||||
|
update the display. If Cancel was selected this is needed to reset the
|
||||||
|
dsiplay to the correct version.
|
||||||
|
"""
|
||||||
|
# Initial Load of the Tags
|
||||||
|
DisplayTags.reset_html_tags()
|
||||||
|
user_expands = QtCore.QSettings().value(u'displayTags/html_tags',
|
||||||
|
QtCore.QVariant(u'')).toString()
|
||||||
|
# cPickle only accepts str not unicode strings
|
||||||
|
user_expands_string = str(unicode(user_expands).encode(u'utf8'))
|
||||||
|
if user_expands_string:
|
||||||
|
user_tags = cPickle.loads(user_expands_string)
|
||||||
|
# If we have some user ones added them as well
|
||||||
|
for t in user_tags:
|
||||||
|
DisplayTags.add_html_tag(t)
|
||||||
|
|
||||||
|
def accept(self):
|
||||||
"""
|
"""
|
||||||
Save Custom tags in a pickle .
|
Save Custom tags in a pickle .
|
||||||
"""
|
"""
|
||||||
|
@ -235,13 +102,14 @@ class DisplayTagTab(SettingsTab):
|
||||||
else:
|
else:
|
||||||
QtCore.QSettings().setValue(u'displayTags/html_tags',
|
QtCore.QSettings().setValue(u'displayTags/html_tags',
|
||||||
QtCore.QVariant(u''))
|
QtCore.QVariant(u''))
|
||||||
|
return QtGui.QDialog.accept(self)
|
||||||
|
|
||||||
def cancel(self):
|
def reject(self):
|
||||||
"""
|
"""
|
||||||
Reset Custom tags from Settings.
|
Reset Custom tags from Settings.
|
||||||
"""
|
"""
|
||||||
self.preLoad()
|
|
||||||
self._resetTable()
|
self._resetTable()
|
||||||
|
return QtGui.QDialog.reject(self)
|
||||||
|
|
||||||
def onRowSelected(self):
|
def onRowSelected(self):
|
||||||
"""
|
"""
|
||||||
|
@ -288,6 +156,7 @@ class DisplayTagTab(SettingsTab):
|
||||||
self._resetTable()
|
self._resetTable()
|
||||||
# Highlight new row
|
# Highlight new row
|
||||||
self.tagTableWidget.selectRow(self.tagTableWidget.rowCount() - 1)
|
self.tagTableWidget.selectRow(self.tagTableWidget.rowCount() - 1)
|
||||||
|
self.onRowSelected()
|
||||||
|
|
||||||
def onDefaultPushed(self):
|
def onDefaultPushed(self):
|
||||||
"""
|
"""
|
||||||
|
@ -335,7 +204,29 @@ class DisplayTagTab(SettingsTab):
|
||||||
"""
|
"""
|
||||||
self.tagTableWidget.clearContents()
|
self.tagTableWidget.clearContents()
|
||||||
self.tagTableWidget.setRowCount(0)
|
self.tagTableWidget.setRowCount(0)
|
||||||
self.load()
|
self.newPushButton.setEnabled(True)
|
||||||
|
self.updatePushButton.setEnabled(False)
|
||||||
|
self.deletePushButton.setEnabled(False)
|
||||||
|
for linenumber, html in enumerate(DisplayTags.get_html_tags()):
|
||||||
|
self.tagTableWidget.setRowCount(
|
||||||
|
self.tagTableWidget.rowCount() + 1)
|
||||||
|
self.tagTableWidget.setItem(linenumber, 0,
|
||||||
|
QtGui.QTableWidgetItem(html[u'desc']))
|
||||||
|
self.tagTableWidget.setItem(linenumber, 1,
|
||||||
|
QtGui.QTableWidgetItem(self._strip(html[u'start tag'])))
|
||||||
|
self.tagTableWidget.setItem(linenumber, 2,
|
||||||
|
QtGui.QTableWidgetItem(html[u'start html']))
|
||||||
|
self.tagTableWidget.setItem(linenumber, 3,
|
||||||
|
QtGui.QTableWidgetItem(html[u'end html']))
|
||||||
|
self.tagTableWidget.resizeRowsToContents()
|
||||||
|
self.descriptionLineEdit.setText(u'')
|
||||||
|
self.tagLineEdit.setText(u'')
|
||||||
|
self.startTagLineEdit.setText(u'')
|
||||||
|
self.endTagLineEdit.setText(u'')
|
||||||
|
self.descriptionLineEdit.setEnabled(False)
|
||||||
|
self.tagLineEdit.setEnabled(False)
|
||||||
|
self.startTagLineEdit.setEnabled(False)
|
||||||
|
self.endTagLineEdit.setEnabled(False)
|
||||||
|
|
||||||
def _strip(self, tag):
|
def _strip(self, tag):
|
||||||
"""
|
"""
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -35,24 +35,24 @@ from PyQt4 import Qt, QtCore, QtGui
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from PyQt4.phonon import Phonon
|
from PyQt4.phonon import Phonon
|
||||||
phonon_version = Phonon.phononVersion()
|
PHONON_VERSION = Phonon.phononVersion()
|
||||||
except ImportError:
|
except ImportError:
|
||||||
phonon_version = u'-'
|
PHONON_VERSION = u'-'
|
||||||
try:
|
try:
|
||||||
import chardet
|
import chardet
|
||||||
chardet_version = chardet.__version__
|
CHARDET_VERSION = chardet.__version__
|
||||||
except ImportError:
|
except ImportError:
|
||||||
chardet_version = u'-'
|
CHARDET_VERSION = u'-'
|
||||||
try:
|
try:
|
||||||
import enchant
|
import enchant
|
||||||
enchant_version = enchant.__version__
|
ENCHANT_VERSION = enchant.__version__
|
||||||
except ImportError:
|
except ImportError:
|
||||||
enchant_version = u'-'
|
ENCHANT_VERSION = u'-'
|
||||||
try:
|
try:
|
||||||
import sqlite
|
import sqlite
|
||||||
sqlite_version = sqlite.version
|
SQLITE_VERSION = sqlite.version
|
||||||
except ImportError:
|
except ImportError:
|
||||||
sqlite_version = u'-'
|
SQLITE_VERSION = u'-'
|
||||||
|
|
||||||
from openlp.core.lib import translate, SettingsManager
|
from openlp.core.lib import translate, SettingsManager
|
||||||
from openlp.core.lib.mailto import mailto
|
from openlp.core.lib.mailto import mailto
|
||||||
|
@ -85,14 +85,14 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog):
|
||||||
'Platform: %s\n')) % platform.platform()
|
'Platform: %s\n')) % platform.platform()
|
||||||
libraries = u'Python: %s\n' % platform.python_version() + \
|
libraries = u'Python: %s\n' % platform.python_version() + \
|
||||||
u'Qt4: %s\n' % Qt.qVersion() + \
|
u'Qt4: %s\n' % Qt.qVersion() + \
|
||||||
u'Phonon: %s\n' % phonon_version + \
|
u'Phonon: %s\n' % PHONON_VERSION + \
|
||||||
u'PyQt4: %s\n' % Qt.PYQT_VERSION_STR + \
|
u'PyQt4: %s\n' % Qt.PYQT_VERSION_STR + \
|
||||||
u'SQLAlchemy: %s\n' % sqlalchemy.__version__ + \
|
u'SQLAlchemy: %s\n' % sqlalchemy.__version__ + \
|
||||||
u'BeautifulSoup: %s\n' % BeautifulSoup.__version__ + \
|
u'BeautifulSoup: %s\n' % BeautifulSoup.__version__ + \
|
||||||
u'lxml: %s\n' % etree.__version__ + \
|
u'lxml: %s\n' % etree.__version__ + \
|
||||||
u'Chardet: %s\n' % chardet_version + \
|
u'Chardet: %s\n' % CHARDET_VERSION + \
|
||||||
u'PyEnchant: %s\n' % enchant_version + \
|
u'PyEnchant: %s\n' % ENCHANT_VERSION + \
|
||||||
u'PySQLite: %s\n' % sqlite_version
|
u'PySQLite: %s\n' % SQLITE_VERSION
|
||||||
if platform.system() == u'Linux':
|
if platform.system() == u'Linux':
|
||||||
if os.environ.get(u'KDE_FULL_SESSION') == u'true':
|
if os.environ.get(u'KDE_FULL_SESSION') == u'true':
|
||||||
system = system + u'Desktop: KDE SC\n'
|
system = system + u'Desktop: KDE SC\n'
|
||||||
|
@ -170,7 +170,7 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog):
|
||||||
self.__buttonState(False)
|
self.__buttonState(False)
|
||||||
self.descriptionWordCount.setText(
|
self.descriptionWordCount.setText(
|
||||||
unicode(translate('OpenLP.ExceptionDialog',
|
unicode(translate('OpenLP.ExceptionDialog',
|
||||||
'Description characters to enter : %s')) % count )
|
'Description characters to enter : %s')) % count)
|
||||||
|
|
||||||
def onAttachFileButtonPressed(self):
|
def onAttachFileButtonPressed(self):
|
||||||
files = QtGui.QFileDialog.getOpenFileName(
|
files = QtGui.QFileDialog.getOpenFileName(
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
|
|
@ -0,0 +1,217 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# OpenLP - Open Source Lyrics Projection #
|
||||||
|
# --------------------------------------------------------------------------- #
|
||||||
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
|
# --------------------------------------------------------------------------- #
|
||||||
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
# Software Foundation; version 2 of the License. #
|
||||||
|
# #
|
||||||
|
# This program is distributed in the hope that it will be useful, but WITHOUT #
|
||||||
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
|
||||||
|
# more details. #
|
||||||
|
# #
|
||||||
|
# You should have received a copy of the GNU General Public License along #
|
||||||
|
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
|
||||||
|
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
import ConfigParser
|
||||||
|
import io
|
||||||
|
import logging
|
||||||
|
import os
|
||||||
|
import urllib
|
||||||
|
|
||||||
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
|
from firsttimewizard import Ui_FirstTimeWizard
|
||||||
|
|
||||||
|
from openlp.core.lib import translate, PluginStatus, check_directory_exists, \
|
||||||
|
Receiver
|
||||||
|
from openlp.core.utils import get_web_page, AppLocation
|
||||||
|
|
||||||
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
|
||||||
|
"""
|
||||||
|
This is the Theme Import Wizard, which allows easy creation and editing of
|
||||||
|
OpenLP themes.
|
||||||
|
"""
|
||||||
|
log.info(u'ThemeWizardForm loaded')
|
||||||
|
|
||||||
|
def __init__(self, screens, parent=None):
|
||||||
|
# check to see if we have web access
|
||||||
|
self.web = u'http://openlp.org/files/frw/'
|
||||||
|
self.config = ConfigParser.ConfigParser()
|
||||||
|
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.downloading = unicode(translate('OpenLP.FirstTimeWizard',
|
||||||
|
'Downloading %s'))
|
||||||
|
QtCore.QObject.connect(self,
|
||||||
|
QtCore.SIGNAL(u'currentIdChanged(int)'),
|
||||||
|
self.onCurrentIdChanged)
|
||||||
|
|
||||||
|
def exec_(self, edit=False):
|
||||||
|
"""
|
||||||
|
Run the wizard.
|
||||||
|
"""
|
||||||
|
self.setDefaults()
|
||||||
|
return QtGui.QWizard.exec_(self)
|
||||||
|
|
||||||
|
def setDefaults(self):
|
||||||
|
"""
|
||||||
|
Set up display at start of theme edit.
|
||||||
|
"""
|
||||||
|
self.restart()
|
||||||
|
# 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')
|
||||||
|
else:
|
||||||
|
self.internetGroupBox.setVisible(False)
|
||||||
|
self.noInternetLabel.setVisible(True)
|
||||||
|
|
||||||
|
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 onCurrentIdChanged(self, pageId):
|
||||||
|
"""
|
||||||
|
Detects Page changes and updates as approprate.
|
||||||
|
"""
|
||||||
|
if self.page(pageId) == self.DefaultsPage:
|
||||||
|
self.themeSelectionComboBox.clear()
|
||||||
|
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
|
||||||
|
|
||||||
|
def accept(self):
|
||||||
|
Receiver.send_message(u'cursor_busy')
|
||||||
|
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')
|
||||||
|
# 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
|
||||||
|
# Set Default Display
|
||||||
|
if self.displaySelectionComboBox.currentIndex() != -1:
|
||||||
|
QtCore.QSettings().setValue(u'General/monitor',
|
||||||
|
QtCore.QVariant(self.displaySelectionComboBox.
|
||||||
|
currentIndex()))
|
||||||
|
# Set Global Theme
|
||||||
|
if self.themeSelectionComboBox.currentIndex() != -1:
|
||||||
|
QtCore.QSettings().setValue(u'themes/global theme',
|
||||||
|
QtCore.QVariant(self.themeSelectionComboBox.currentText()))
|
||||||
|
QtCore.QSettings().setValue(u'general/first time',
|
||||||
|
QtCore.QVariant(False))
|
||||||
|
Receiver.send_message(u'cursor_normal')
|
||||||
|
return QtGui.QWizard.accept(self)
|
||||||
|
|
||||||
|
def _pluginStatus(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')
|
|
@ -0,0 +1,55 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# OpenLP - Open Source Lyrics Projection #
|
||||||
|
# --------------------------------------------------------------------------- #
|
||||||
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
|
# --------------------------------------------------------------------------- #
|
||||||
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
# Software Foundation; version 2 of the License. #
|
||||||
|
# #
|
||||||
|
# This program is distributed in the hope that it will be useful, but WITHOUT #
|
||||||
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
|
||||||
|
# more details. #
|
||||||
|
# #
|
||||||
|
# You should have received a copy of the GNU General Public License along #
|
||||||
|
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
|
||||||
|
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
|
from openlp.core.lib import translate
|
||||||
|
from openlp.core.lib.ui import 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)
|
||||||
|
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)
|
||||||
|
|
||||||
|
def retranslateUi(self, firstTimeLanguageDialog):
|
||||||
|
self.setWindowTitle(translate('OpenLP.FirstTimeLanguageForm',
|
||||||
|
'Initial Set up Language'))
|
||||||
|
self.fileNameLabel.setText(translate('OpenLP.FirstTimeLanguageForm',
|
||||||
|
'Initial Language:'))
|
|
@ -0,0 +1,67 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# OpenLP - Open Source Lyrics Projection #
|
||||||
|
# --------------------------------------------------------------------------- #
|
||||||
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
|
# --------------------------------------------------------------------------- #
|
||||||
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
# Software Foundation; version 2 of the License. #
|
||||||
|
# #
|
||||||
|
# This program is distributed in the hope that it will be useful, but WITHOUT #
|
||||||
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
|
||||||
|
# more details. #
|
||||||
|
# #
|
||||||
|
# You should have received a copy of the GNU General Public License along #
|
||||||
|
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
|
||||||
|
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
from PyQt4 import QtGui
|
||||||
|
|
||||||
|
from firsttimelanguagedialog import Ui_FirstTimeLanguageDialog
|
||||||
|
|
||||||
|
from openlp.core.lib import translate
|
||||||
|
from openlp.core.utils import LanguageManager
|
||||||
|
|
||||||
|
class FirstTimeLanguageForm(QtGui.QDialog, Ui_FirstTimeLanguageDialog):
|
||||||
|
"""
|
||||||
|
The exception dialog
|
||||||
|
"""
|
||||||
|
def __init__(self, parent=None):
|
||||||
|
QtGui.QDialog.__init__(self, parent)
|
||||||
|
self.setupUi(self)
|
||||||
|
self.qmList = LanguageManager.get_qm_list()
|
||||||
|
self.LanguageComboBox.addItem(u'Automatic')
|
||||||
|
for key in sorted(self.qmList.keys()):
|
||||||
|
self.LanguageComboBox.addItem(key)
|
||||||
|
|
||||||
|
def exec_(self):
|
||||||
|
"""
|
||||||
|
Run the Dialog with correct heading.
|
||||||
|
"""
|
||||||
|
return QtGui.QDialog.exec_(self)
|
||||||
|
|
||||||
|
def accept(self):
|
||||||
|
# It's the first row so must be Automatic
|
||||||
|
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()))
|
||||||
|
LanguageManager.set_language(action, False)
|
||||||
|
return QtGui.QDialog.accept(self)
|
||||||
|
|
||||||
|
def reject(self):
|
||||||
|
LanguageManager.auto_language = True
|
||||||
|
LanguageManager.set_language(False, False)
|
||||||
|
return QtGui.QDialog.reject(self)
|
|
@ -0,0 +1,227 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# OpenLP - Open Source Lyrics Projection #
|
||||||
|
# --------------------------------------------------------------------------- #
|
||||||
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
|
# --------------------------------------------------------------------------- #
|
||||||
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
# Software Foundation; version 2 of the License. #
|
||||||
|
# #
|
||||||
|
# This program is distributed in the hope that it will be useful, but WITHOUT #
|
||||||
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
|
||||||
|
# more details. #
|
||||||
|
# #
|
||||||
|
# You should have received a copy of the GNU General Public License along #
|
||||||
|
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
|
||||||
|
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
|
from openlp.core.lib import translate
|
||||||
|
|
||||||
|
|
||||||
|
class Ui_FirstTimeWizard(object):
|
||||||
|
def setupUi(self, FirstTimeWizard):
|
||||||
|
FirstTimeWizard.setObjectName(u'FirstTimeWizard')
|
||||||
|
FirstTimeWizard.resize(550, 386)
|
||||||
|
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)
|
||||||
|
self.songsCheckBox.setChecked(True)
|
||||||
|
self.songsCheckBox.setObjectName(u'songsCheckBox')
|
||||||
|
self.verticalLayout.addWidget(self.songsCheckBox)
|
||||||
|
self.customCheckBox = QtGui.QCheckBox(self.PluginPagePage)
|
||||||
|
self.customCheckBox.setChecked(True)
|
||||||
|
self.customCheckBox.setObjectName(u'customCheckBox')
|
||||||
|
self.verticalLayout.addWidget(self.customCheckBox)
|
||||||
|
self.bibleCheckBox = QtGui.QCheckBox(self.PluginPagePage)
|
||||||
|
self.bibleCheckBox.setChecked(True)
|
||||||
|
self.bibleCheckBox.setObjectName(u'bibleCheckBox')
|
||||||
|
self.verticalLayout.addWidget(self.bibleCheckBox)
|
||||||
|
self.imageCheckBox = QtGui.QCheckBox(self.PluginPagePage)
|
||||||
|
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.presentationCheckBox.setObjectName(u'presentationCheckBox')
|
||||||
|
self.verticalLayout.addWidget(self.presentationCheckBox)
|
||||||
|
self.mediaCheckBox = QtGui.QCheckBox(self.PluginPagePage)
|
||||||
|
self.mediaCheckBox.setChecked(True)
|
||||||
|
self.mediaCheckBox.setObjectName(u'mediaCheckBox')
|
||||||
|
self.verticalLayout.addWidget(self.mediaCheckBox)
|
||||||
|
self.remoteCheckBox = QtGui.QCheckBox(self.PluginPagePage)
|
||||||
|
self.remoteCheckBox.setObjectName(u'remoteCheckBox')
|
||||||
|
self.verticalLayout.addWidget(self.remoteCheckBox)
|
||||||
|
self.songUsageCheckBox = QtGui.QCheckBox(self.PluginPagePage)
|
||||||
|
self.songUsageCheckBox.setChecked(True)
|
||||||
|
self.songUsageCheckBox.setObjectName(u'songUsageCheckBox')
|
||||||
|
self.verticalLayout.addWidget(self.songUsageCheckBox)
|
||||||
|
self.alertCheckBox = QtGui.QCheckBox(self.PluginPagePage)
|
||||||
|
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.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(
|
||||||
|
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.retranslateUi(FirstTimeWizard)
|
||||||
|
QtCore.QMetaObject.connectSlotsByName(FirstTimeWizard)
|
||||||
|
|
||||||
|
def retranslateUi(self, FirstTimeWizard):
|
||||||
|
FirstTimeWizard.setWindowTitle(translate(
|
||||||
|
'OpenLP.FirstTimeWizard', 'First Time Wizard'))
|
||||||
|
self.titleLabel.setText(
|
||||||
|
u'<span style="font-size:14pt; font-weight:600;">%s</span>' % \
|
||||||
|
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 .'
|
||||||
|
' Click the next button below to start the process of selection '
|
||||||
|
'your initial options. '))
|
||||||
|
self.PluginPagePage.setTitle(translate('OpenLP.FirstTimeWizard',
|
||||||
|
'Activate required Plugins'))
|
||||||
|
self.PluginPagePage.setSubTitle(translate('OpenLP.FirstTimeWizard',
|
||||||
|
'Select the Plugins you wish to use. '))
|
||||||
|
self.songsCheckBox.setText(translate('OpenLP.FirstTimeWizard', 'Songs'))
|
||||||
|
self.customCheckBox.setText(translate('OpenLP.FirstTimeWizard',
|
||||||
|
'Custom Text'))
|
||||||
|
self.bibleCheckBox.setText(translate('OpenLP.FirstTimeWizard', 'Bible'))
|
||||||
|
self.imageCheckBox.setText(translate('OpenLP.FirstTimeWizard',
|
||||||
|
'Images'))
|
||||||
|
self.presentationCheckBox.setText(translate('OpenLP.FirstTimeWizard',
|
||||||
|
'Presentations'))
|
||||||
|
self.mediaCheckBox.setText(translate('OpenLP.FirstTimeWizard',
|
||||||
|
'Media (Audio and Video)'))
|
||||||
|
self.remoteCheckBox.setText(translate('OpenLP.FirstTimeWizard',
|
||||||
|
'Allow remote access'))
|
||||||
|
self.songUsageCheckBox.setText(translate('OpenLP.FirstTimeWizard',
|
||||||
|
'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(
|
||||||
|
'OpenLP.FirstTimeWizard',
|
||||||
|
'Select samples to downlaod and install for use.'))
|
||||||
|
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',
|
||||||
|
'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 your changes and start OpenLP'))
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -28,6 +28,7 @@ import logging
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import SettingsTab, Receiver, translate
|
from openlp.core.lib import SettingsTab, Receiver, translate
|
||||||
|
from openlp.core.lib.ui import UiStrings
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -44,7 +45,7 @@ class ValidEdit(QtGui.QLineEdit):
|
||||||
|
|
||||||
def validText(self):
|
def validText(self):
|
||||||
"""
|
"""
|
||||||
Only return Integers. Space is 0
|
Only return Integers. Space is 0
|
||||||
"""
|
"""
|
||||||
if self.text().isEmpty():
|
if self.text().isEmpty():
|
||||||
return QtCore.QString(u'0')
|
return QtCore.QString(u'0')
|
||||||
|
@ -233,6 +234,9 @@ class GeneralTab(SettingsTab):
|
||||||
QtCore.QObject.connect(self.customXValueEdit,
|
QtCore.QObject.connect(self.customXValueEdit,
|
||||||
QtCore.SIGNAL(u'textEdited(const QString&)'),
|
QtCore.SIGNAL(u'textEdited(const QString&)'),
|
||||||
self.onDisplayPositionChanged)
|
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)
|
||||||
|
|
||||||
def retranslateUi(self):
|
def retranslateUi(self):
|
||||||
"""
|
"""
|
||||||
|
@ -267,8 +271,7 @@ class GeneralTab(SettingsTab):
|
||||||
translate('OpenLP.GeneralTab', ' sec'))
|
translate('OpenLP.GeneralTab', ' sec'))
|
||||||
self.ccliGroupBox.setTitle(
|
self.ccliGroupBox.setTitle(
|
||||||
translate('OpenLP.GeneralTab', 'CCLI Details'))
|
translate('OpenLP.GeneralTab', 'CCLI Details'))
|
||||||
self.numberLabel.setText(
|
self.numberLabel.setText(UiStrings.CCLINumberLabel)
|
||||||
translate('OpenLP.GeneralTab', 'CCLI number:'))
|
|
||||||
self.usernameLabel.setText(
|
self.usernameLabel.setText(
|
||||||
translate('OpenLP.GeneralTab', 'SongSelect username:'))
|
translate('OpenLP.GeneralTab', 'SongSelect username:'))
|
||||||
self.passwordLabel.setText(
|
self.passwordLabel.setText(
|
||||||
|
@ -300,13 +303,9 @@ class GeneralTab(SettingsTab):
|
||||||
"""
|
"""
|
||||||
settings = QtCore.QSettings()
|
settings = QtCore.QSettings()
|
||||||
settings.beginGroup(self.settingsSection)
|
settings.beginGroup(self.settingsSection)
|
||||||
for screen in self.screens.screen_list:
|
self.monitorComboBox.clear()
|
||||||
screen_name = u'%s %d' % (translate('OpenLP.GeneralTab', 'Screen'),
|
for screen in self.screens.get_screen_list():
|
||||||
screen[u'number'] + 1)
|
self.monitorComboBox.addItem(screen)
|
||||||
if screen[u'primary']:
|
|
||||||
screen_name = u'%s (%s)' % (screen_name,
|
|
||||||
translate('OpenLP.GeneralTab', 'primary'))
|
|
||||||
self.monitorComboBox.addItem(screen_name)
|
|
||||||
self.numberEdit.setText(unicode(settings.value(
|
self.numberEdit.setText(unicode(settings.value(
|
||||||
u'ccli number', QtCore.QVariant(u'')).toString()))
|
u'ccli number', QtCore.QVariant(u'')).toString()))
|
||||||
self.usernameEdit.setText(unicode(settings.value(
|
self.usernameEdit.setText(unicode(settings.value(
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -90,8 +90,8 @@ class MainDisplay(DisplayWidget):
|
||||||
"""
|
"""
|
||||||
Set up and build the output screen
|
Set up and build the output screen
|
||||||
"""
|
"""
|
||||||
log.debug(u'Setup live = %s for monitor %s ' % (self.isLive,
|
log.debug(u'Start setup for monitor %s (live = %s)' %
|
||||||
self.screens.monitor_number))
|
(self.screens.monitor_number, self.isLive))
|
||||||
self.usePhonon = QtCore.QSettings().value(
|
self.usePhonon = QtCore.QSettings().value(
|
||||||
u'media/use phonon', QtCore.QVariant(True)).toBool()
|
u'media/use phonon', QtCore.QVariant(True)).toBool()
|
||||||
self.phononActive = False
|
self.phononActive = False
|
||||||
|
@ -102,6 +102,7 @@ class MainDisplay(DisplayWidget):
|
||||||
self.videoWidget.setVisible(False)
|
self.videoWidget.setVisible(False)
|
||||||
self.videoWidget.setGeometry(QtCore.QRect(0, 0,
|
self.videoWidget.setGeometry(QtCore.QRect(0, 0,
|
||||||
self.screen[u'size'].width(), self.screen[u'size'].height()))
|
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.mediaObject = Phonon.MediaObject(self)
|
||||||
self.audio = Phonon.AudioOutput(Phonon.VideoCategory, self.mediaObject)
|
self.audio = Phonon.AudioOutput(Phonon.VideoCategory, self.mediaObject)
|
||||||
Phonon.createPath(self.mediaObject, self.videoWidget)
|
Phonon.createPath(self.mediaObject, self.videoWidget)
|
||||||
|
@ -109,6 +110,7 @@ class MainDisplay(DisplayWidget):
|
||||||
QtCore.QObject.connect(self.mediaObject,
|
QtCore.QObject.connect(self.mediaObject,
|
||||||
QtCore.SIGNAL(u'stateChanged(Phonon::State, Phonon::State)'),
|
QtCore.SIGNAL(u'stateChanged(Phonon::State, Phonon::State)'),
|
||||||
self.videoStart)
|
self.videoStart)
|
||||||
|
log.debug(u'Setup webView for monitor %s' % self.screens.monitor_number)
|
||||||
self.webView = QtWebKit.QWebView(self)
|
self.webView = QtWebKit.QWebView(self)
|
||||||
self.webView.setGeometry(0, 0,
|
self.webView.setGeometry(0, 0,
|
||||||
self.screen[u'size'].width(), self.screen[u'size'].height())
|
self.screen[u'size'].width(), self.screen[u'size'].height())
|
||||||
|
@ -132,14 +134,22 @@ class MainDisplay(DisplayWidget):
|
||||||
painter_image.begin(self.black)
|
painter_image.begin(self.black)
|
||||||
painter_image.fillRect(self.black.rect(), QtCore.Qt.black)
|
painter_image.fillRect(self.black.rect(), QtCore.Qt.black)
|
||||||
# Build the initial frame.
|
# Build the initial frame.
|
||||||
|
image_file = QtCore.QSettings().value(u'advanced/default image',
|
||||||
|
QtCore.QVariant(u':/graphics/openlp-splash-screen.png'))\
|
||||||
|
.toString()
|
||||||
|
background_color = QtGui.QColor(QtCore.QSettings().value(
|
||||||
|
u'advanced/default color',
|
||||||
|
QtCore.QVariant(u'#ffffff')).toString())
|
||||||
|
if not background_color.isValid():
|
||||||
|
background_color = QtCore.Qt.white
|
||||||
|
splash_image = QtGui.QImage(image_file)
|
||||||
initialFrame = QtGui.QImage(
|
initialFrame = QtGui.QImage(
|
||||||
self.screens.current[u'size'].width(),
|
self.screens.current[u'size'].width(),
|
||||||
self.screens.current[u'size'].height(),
|
self.screens.current[u'size'].height(),
|
||||||
QtGui.QImage.Format_ARGB32_Premultiplied)
|
QtGui.QImage.Format_ARGB32_Premultiplied)
|
||||||
splash_image = QtGui.QImage(u':/graphics/openlp-splash-screen.png')
|
|
||||||
painter_image = QtGui.QPainter()
|
painter_image = QtGui.QPainter()
|
||||||
painter_image.begin(initialFrame)
|
painter_image.begin(initialFrame)
|
||||||
painter_image.fillRect(initialFrame.rect(), QtCore.Qt.white)
|
painter_image.fillRect(initialFrame.rect(), background_color)
|
||||||
painter_image.drawImage(
|
painter_image.drawImage(
|
||||||
(self.screens.current[u'size'].width() -
|
(self.screens.current[u'size'].width() -
|
||||||
splash_image.width()) / 2,
|
splash_image.width()) / 2,
|
||||||
|
@ -150,12 +160,15 @@ class MainDisplay(DisplayWidget):
|
||||||
self.webView.setHtml(build_html(serviceItem, self.screen,
|
self.webView.setHtml(build_html(serviceItem, self.screen,
|
||||||
self.alertTab, self.isLive, None))
|
self.alertTab, self.isLive, None))
|
||||||
self.initialFrame = True
|
self.initialFrame = True
|
||||||
|
self.__hideMouse()
|
||||||
# To display or not to display?
|
# To display or not to display?
|
||||||
if not self.screen[u'primary']:
|
if not self.screen[u'primary']:
|
||||||
self.show()
|
self.show()
|
||||||
self.primary = False
|
self.primary = False
|
||||||
else:
|
else:
|
||||||
self.primary = True
|
self.primary = True
|
||||||
|
log.debug(
|
||||||
|
u'Finished setup for monitor %s' % self.screens.monitor_number)
|
||||||
|
|
||||||
def text(self, slide):
|
def text(self, slide):
|
||||||
"""
|
"""
|
||||||
|
@ -224,9 +237,6 @@ class MainDisplay(DisplayWidget):
|
||||||
image = self.imageManager.get_image_bytes(name)
|
image = self.imageManager.get_image_bytes(name)
|
||||||
self.resetVideo()
|
self.resetVideo()
|
||||||
self.displayImage(image)
|
self.displayImage(image)
|
||||||
# show screen
|
|
||||||
if self.isLive:
|
|
||||||
self.setVisible(True)
|
|
||||||
return self.preview()
|
return self.preview()
|
||||||
|
|
||||||
def displayImage(self, image):
|
def displayImage(self, image):
|
||||||
|
@ -239,7 +249,8 @@ class MainDisplay(DisplayWidget):
|
||||||
js = u'show_image("");'
|
js = u'show_image("");'
|
||||||
self.frame.evaluateJavaScript(js)
|
self.frame.evaluateJavaScript(js)
|
||||||
# Update the preview frame.
|
# Update the preview frame.
|
||||||
Receiver.send_message(u'maindisplay_active')
|
if self.isLive:
|
||||||
|
Receiver.send_message(u'maindisplay_active')
|
||||||
|
|
||||||
def resetImage(self):
|
def resetImage(self):
|
||||||
"""
|
"""
|
||||||
|
@ -253,7 +264,8 @@ class MainDisplay(DisplayWidget):
|
||||||
self.displayImage(None)
|
self.displayImage(None)
|
||||||
self.override = {}
|
self.override = {}
|
||||||
# Update the preview frame.
|
# Update the preview frame.
|
||||||
Receiver.send_message(u'maindisplay_active')
|
if self.isLive:
|
||||||
|
Receiver.send_message(u'maindisplay_active')
|
||||||
|
|
||||||
def resetVideo(self):
|
def resetVideo(self):
|
||||||
"""
|
"""
|
||||||
|
@ -270,7 +282,8 @@ class MainDisplay(DisplayWidget):
|
||||||
self.frame.evaluateJavaScript(u'show_video("close");')
|
self.frame.evaluateJavaScript(u'show_video("close");')
|
||||||
self.override = {}
|
self.override = {}
|
||||||
# Update the preview frame.
|
# Update the preview frame.
|
||||||
Receiver.send_message(u'maindisplay_active')
|
if self.isLive:
|
||||||
|
Receiver.send_message(u'maindisplay_active')
|
||||||
|
|
||||||
def videoPlay(self):
|
def videoPlay(self):
|
||||||
"""
|
"""
|
||||||
|
@ -310,7 +323,7 @@ class MainDisplay(DisplayWidget):
|
||||||
Changes the volume of a running video
|
Changes the volume of a running video
|
||||||
"""
|
"""
|
||||||
log.debug(u'videoVolume %d' % volume)
|
log.debug(u'videoVolume %d' % volume)
|
||||||
vol = float(volume)/float(10)
|
vol = float(volume) / float(10)
|
||||||
if self.phononActive:
|
if self.phononActive:
|
||||||
self.audio.setVolume(vol)
|
self.audio.setVolume(vol)
|
||||||
else:
|
else:
|
||||||
|
@ -326,7 +339,7 @@ class MainDisplay(DisplayWidget):
|
||||||
# We are running a background theme
|
# We are running a background theme
|
||||||
self.override[u'theme'] = u''
|
self.override[u'theme'] = u''
|
||||||
self.override[u'video'] = True
|
self.override[u'video'] = True
|
||||||
vol = float(volume)/float(10)
|
vol = float(volume) / float(10)
|
||||||
if isBackground or not self.usePhonon:
|
if isBackground or not self.usePhonon:
|
||||||
js = u'show_video("init", "%s", %s, true); show_video("play");' % \
|
js = u'show_video("init", "%s", %s, true); show_video("play");' % \
|
||||||
(videoPath.replace(u'\\', u'\\\\'), str(vol))
|
(videoPath.replace(u'\\', u'\\\\'), str(vol))
|
||||||
|
@ -341,7 +354,8 @@ class MainDisplay(DisplayWidget):
|
||||||
self.videoWidget.setVisible(True)
|
self.videoWidget.setVisible(True)
|
||||||
self.audio.setVolume(vol)
|
self.audio.setVolume(vol)
|
||||||
# Update the preview frame.
|
# Update the preview frame.
|
||||||
Receiver.send_message(u'maindisplay_active')
|
if self.isLive:
|
||||||
|
Receiver.send_message(u'maindisplay_active')
|
||||||
return self.preview()
|
return self.preview()
|
||||||
|
|
||||||
def videoStart(self, newState, oldState):
|
def videoStart(self, newState, oldState):
|
||||||
|
@ -379,9 +393,10 @@ class MainDisplay(DisplayWidget):
|
||||||
Receiver.send_message(u'openlp_process_events')
|
Receiver.send_message(u'openlp_process_events')
|
||||||
# if was hidden keep it hidden
|
# if was hidden keep it hidden
|
||||||
if self.isLive:
|
if self.isLive:
|
||||||
self.setVisible(True)
|
|
||||||
if self.hideMode:
|
if self.hideMode:
|
||||||
self.hideDisplay(self.hideMode)
|
self.hideDisplay(self.hideMode)
|
||||||
|
else:
|
||||||
|
self.setVisible(True)
|
||||||
preview = QtGui.QImage(self.screen[u'size'].width(),
|
preview = QtGui.QImage(self.screen[u'size'].width(),
|
||||||
self.screen[u'size'].height(),
|
self.screen[u'size'].height(),
|
||||||
QtGui.QImage.Format_ARGB32_Premultiplied)
|
QtGui.QImage.Format_ARGB32_Premultiplied)
|
||||||
|
@ -426,15 +441,7 @@ class MainDisplay(DisplayWidget):
|
||||||
# if was hidden keep it hidden
|
# if was hidden keep it hidden
|
||||||
if self.hideMode and self.isLive:
|
if self.hideMode and self.isLive:
|
||||||
self.hideDisplay(self.hideMode)
|
self.hideDisplay(self.hideMode)
|
||||||
# Hide mouse cursor when moved over display if enabled in settings
|
self.__hideMouse()
|
||||||
settings = QtCore.QSettings()
|
|
||||||
if settings.value(u'advanced/hide mouse',
|
|
||||||
QtCore.QVariant(False)).toBool():
|
|
||||||
self.setCursor(QtCore.Qt.BlankCursor)
|
|
||||||
self.frame.evaluateJavaScript('document.body.style.cursor = "none"')
|
|
||||||
else:
|
|
||||||
self.setCursor(QtCore.Qt.ArrowCursor)
|
|
||||||
self.frame.evaluateJavaScript('document.body.style.cursor = "auto"')
|
|
||||||
|
|
||||||
def footer(self, text):
|
def footer(self, text):
|
||||||
"""
|
"""
|
||||||
|
@ -482,7 +489,18 @@ class MainDisplay(DisplayWidget):
|
||||||
self.videoPlay()
|
self.videoPlay()
|
||||||
self.hideMode = None
|
self.hideMode = None
|
||||||
# Trigger actions when display is active again
|
# Trigger actions when display is active again
|
||||||
Receiver.send_message(u'maindisplay_active')
|
if self.isLive:
|
||||||
|
Receiver.send_message(u'maindisplay_active')
|
||||||
|
|
||||||
|
def __hideMouse(self):
|
||||||
|
# Hide mouse cursor when moved over display if enabled in settings
|
||||||
|
if QtCore.QSettings().value(u'advanced/hide mouse',
|
||||||
|
QtCore.QVariant(False)).toBool():
|
||||||
|
self.setCursor(QtCore.Qt.BlankCursor)
|
||||||
|
self.frame.evaluateJavaScript('document.body.style.cursor = "none"')
|
||||||
|
else:
|
||||||
|
self.setCursor(QtCore.Qt.ArrowCursor)
|
||||||
|
self.frame.evaluateJavaScript('document.body.style.cursor = "auto"')
|
||||||
|
|
||||||
|
|
||||||
class AudioPlayer(QtCore.QObject):
|
class AudioPlayer(QtCore.QObject):
|
||||||
|
@ -498,9 +516,6 @@ class AudioPlayer(QtCore.QObject):
|
||||||
|
|
||||||
``parent``
|
``parent``
|
||||||
The parent widget.
|
The parent widget.
|
||||||
|
|
||||||
``screens``
|
|
||||||
The list of screens.
|
|
||||||
"""
|
"""
|
||||||
log.debug(u'AudioPlayer Initialisation started')
|
log.debug(u'AudioPlayer Initialisation started')
|
||||||
QtCore.QObject.__init__(self, parent)
|
QtCore.QObject.__init__(self, parent)
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -34,7 +34,7 @@ from openlp.core.lib.ui import UiStrings, base_action, checkable_action, \
|
||||||
icon_action
|
icon_action
|
||||||
from openlp.core.ui import AboutForm, SettingsForm, ServiceManager, \
|
from openlp.core.ui import AboutForm, SettingsForm, ServiceManager, \
|
||||||
ThemeManager, SlideController, PluginForm, MediaDockManager, \
|
ThemeManager, SlideController, PluginForm, MediaDockManager, \
|
||||||
ShortcutListForm
|
ShortcutListForm, DisplayTagForm
|
||||||
from openlp.core.utils import AppLocation, add_actions, LanguageManager, \
|
from openlp.core.utils import AppLocation, add_actions, LanguageManager, \
|
||||||
ActionList
|
ActionList
|
||||||
|
|
||||||
|
@ -73,15 +73,15 @@ class Ui_MainWindow(object):
|
||||||
# Set up the main container, which contains all the other form widgets.
|
# Set up the main container, which contains all the other form widgets.
|
||||||
self.MainContent = QtGui.QWidget(mainWindow)
|
self.MainContent = QtGui.QWidget(mainWindow)
|
||||||
self.MainContent.setObjectName(u'MainContent')
|
self.MainContent.setObjectName(u'MainContent')
|
||||||
self.MainContentLayout = QtGui.QHBoxLayout(self.MainContent)
|
self.mainContentLayout = QtGui.QHBoxLayout(self.MainContent)
|
||||||
self.MainContentLayout.setSpacing(0)
|
self.mainContentLayout.setSpacing(0)
|
||||||
self.MainContentLayout.setMargin(0)
|
self.mainContentLayout.setMargin(0)
|
||||||
self.MainContentLayout.setObjectName(u'MainContentLayout')
|
self.mainContentLayout.setObjectName(u'mainContentLayout')
|
||||||
mainWindow.setCentralWidget(self.MainContent)
|
mainWindow.setCentralWidget(self.MainContent)
|
||||||
self.controlSplitter = QtGui.QSplitter(self.MainContent)
|
self.controlSplitter = QtGui.QSplitter(self.MainContent)
|
||||||
self.controlSplitter.setOrientation(QtCore.Qt.Horizontal)
|
self.controlSplitter.setOrientation(QtCore.Qt.Horizontal)
|
||||||
self.controlSplitter.setObjectName(u'controlSplitter')
|
self.controlSplitter.setObjectName(u'controlSplitter')
|
||||||
self.MainContentLayout.addWidget(self.controlSplitter)
|
self.mainContentLayout.addWidget(self.controlSplitter)
|
||||||
# Create slide controllers
|
# Create slide controllers
|
||||||
self.previewController = SlideController(self, self.settingsmanager,
|
self.previewController = SlideController(self, self.settingsmanager,
|
||||||
self.screens)
|
self.screens)
|
||||||
|
@ -152,10 +152,10 @@ class Ui_MainWindow(object):
|
||||||
u'themeManagerDock', u':/system/system_thememanager.png')
|
u'themeManagerDock', u':/system/system_thememanager.png')
|
||||||
self.themeManagerDock.setMinimumWidth(
|
self.themeManagerDock.setMinimumWidth(
|
||||||
self.settingsmanager.mainwindow_right)
|
self.settingsmanager.mainwindow_right)
|
||||||
self.ThemeManagerContents = ThemeManager(mainWindow,
|
self.themeManagerContents = ThemeManager(mainWindow,
|
||||||
self.themeManagerDock)
|
self.themeManagerDock)
|
||||||
self.ThemeManagerContents.setObjectName(u'ThemeManagerContents')
|
self.themeManagerContents.setObjectName(u'themeManagerContents')
|
||||||
self.themeManagerDock.setWidget(self.ThemeManagerContents)
|
self.themeManagerDock.setWidget(self.themeManagerContents)
|
||||||
mainWindow.addDockWidget(QtCore.Qt.RightDockWidgetArea,
|
mainWindow.addDockWidget(QtCore.Qt.RightDockWidgetArea,
|
||||||
self.themeManagerDock)
|
self.themeManagerDock)
|
||||||
# Create the menu items
|
# Create the menu items
|
||||||
|
@ -206,7 +206,7 @@ class Ui_MainWindow(object):
|
||||||
mainWindow.actionList.add_action(self.ModeDefaultItem, u'View Mode')
|
mainWindow.actionList.add_action(self.ModeDefaultItem, u'View Mode')
|
||||||
self.ModeSetupItem = checkable_action(mainWindow, u'ModeLiveItem')
|
self.ModeSetupItem = checkable_action(mainWindow, u'ModeLiveItem')
|
||||||
mainWindow.actionList.add_action(self.ModeSetupItem, u'View Mode')
|
mainWindow.actionList.add_action(self.ModeSetupItem, u'View Mode')
|
||||||
self.ModeLiveItem = checkable_action(mainWindow, u'ModeLiveItem')
|
self.ModeLiveItem = checkable_action(mainWindow, u'ModeLiveItem', True)
|
||||||
mainWindow.actionList.add_action(self.ModeLiveItem, u'View Mode')
|
mainWindow.actionList.add_action(self.ModeLiveItem, u'View Mode')
|
||||||
self.ModeGroup = QtGui.QActionGroup(mainWindow)
|
self.ModeGroup = QtGui.QActionGroup(mainWindow)
|
||||||
self.ModeGroup.addAction(self.ModeDefaultItem)
|
self.ModeGroup.addAction(self.ModeDefaultItem)
|
||||||
|
@ -215,6 +215,8 @@ class Ui_MainWindow(object):
|
||||||
self.ModeDefaultItem.setChecked(True)
|
self.ModeDefaultItem.setChecked(True)
|
||||||
self.ToolsAddToolItem = icon_action(mainWindow, u'ToolsAddToolItem',
|
self.ToolsAddToolItem = icon_action(mainWindow, u'ToolsAddToolItem',
|
||||||
u':/tools/tools_add.png')
|
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')
|
mainWindow.actionList.add_action(self.ToolsAddToolItem, u'Tools')
|
||||||
self.ToolsOpenDataFolder = icon_action(mainWindow,
|
self.ToolsOpenDataFolder = icon_action(mainWindow,
|
||||||
u'ToolsOpenDataFolder', u':/general/general_open.png')
|
u'ToolsOpenDataFolder', u':/general/general_open.png')
|
||||||
|
@ -225,23 +227,23 @@ class Ui_MainWindow(object):
|
||||||
u'Settings')
|
u'Settings')
|
||||||
# i18n Language Items
|
# i18n Language Items
|
||||||
self.AutoLanguageItem = checkable_action(mainWindow,
|
self.AutoLanguageItem = checkable_action(mainWindow,
|
||||||
u'AutoLanguageItem')
|
u'AutoLanguageItem', LanguageManager.auto_language)
|
||||||
mainWindow.actionList.add_action(self.AutoLanguageItem, u'Settings')
|
mainWindow.actionList.add_action(self.AutoLanguageItem, u'Settings')
|
||||||
self.LanguageGroup = QtGui.QActionGroup(mainWindow)
|
self.LanguageGroup = QtGui.QActionGroup(mainWindow)
|
||||||
self.LanguageGroup.setExclusive(True)
|
self.LanguageGroup.setExclusive(True)
|
||||||
self.LanguageGroup.setObjectName(u'LanguageGroup')
|
self.LanguageGroup.setObjectName(u'LanguageGroup')
|
||||||
self.AutoLanguageItem.setChecked(LanguageManager.auto_language)
|
|
||||||
self.LanguageGroup.setDisabled(LanguageManager.auto_language)
|
self.LanguageGroup.setDisabled(LanguageManager.auto_language)
|
||||||
qmList = LanguageManager.get_qm_list()
|
qmList = LanguageManager.get_qm_list()
|
||||||
savedLanguage = LanguageManager.get_language()
|
savedLanguage = LanguageManager.get_language()
|
||||||
for key in sorted(qmList.keys()):
|
for key in sorted(qmList.keys()):
|
||||||
languageItem = checkable_action(mainWindow, key)
|
languageItem = checkable_action(
|
||||||
if qmList[key] == savedLanguage:
|
mainWindow, key, qmList[key] == savedLanguage)
|
||||||
languageItem.setChecked(True)
|
|
||||||
add_actions(self.LanguageGroup, [languageItem])
|
add_actions(self.LanguageGroup, [languageItem])
|
||||||
self.SettingsShortcutsItem = icon_action(mainWindow,
|
self.SettingsShortcutsItem = icon_action(mainWindow,
|
||||||
u'SettingsShortcutsItem',
|
u'SettingsShortcutsItem',
|
||||||
u':/system/system_configure_shortcuts.png')
|
u':/system/system_configure_shortcuts.png')
|
||||||
|
self.DisplayTagItem = icon_action(mainWindow,
|
||||||
|
u'DisplayTagItem', u':/system/tag_editor.png')
|
||||||
self.SettingsConfigureItem = icon_action(mainWindow,
|
self.SettingsConfigureItem = icon_action(mainWindow,
|
||||||
u'SettingsConfigureItem', u':/system/system_settings.png')
|
u'SettingsConfigureItem', u':/system/system_settings.png')
|
||||||
mainWindow.actionList.add_action(self.SettingsShortcutsItem,
|
mainWindow.actionList.add_action(self.SettingsShortcutsItem,
|
||||||
|
@ -256,8 +258,8 @@ class Ui_MainWindow(object):
|
||||||
self.HelpOnlineHelpItem = base_action(mainWindow, u'HelpOnlineHelpItem')
|
self.HelpOnlineHelpItem = base_action(mainWindow, u'HelpOnlineHelpItem')
|
||||||
self.HelpOnlineHelpItem.setEnabled(False)
|
self.HelpOnlineHelpItem.setEnabled(False)
|
||||||
mainWindow.actionList.add_action(self.HelpOnlineHelpItem, u'Help')
|
mainWindow.actionList.add_action(self.HelpOnlineHelpItem, u'Help')
|
||||||
self.HelpWebSiteItem = base_action(mainWindow, u'HelpWebSiteItem')
|
self.helpWebSiteItem = base_action(mainWindow, u'helpWebSiteItem')
|
||||||
mainWindow.actionList.add_action(self.HelpWebSiteItem, u'Help')
|
mainWindow.actionList.add_action(self.helpWebSiteItem, u'Help')
|
||||||
add_actions(self.FileImportMenu,
|
add_actions(self.FileImportMenu,
|
||||||
(self.ImportThemeItem, self.ImportLanguageItem))
|
(self.ImportThemeItem, self.ImportLanguageItem))
|
||||||
add_actions(self.FileExportMenu,
|
add_actions(self.FileExportMenu,
|
||||||
|
@ -277,11 +279,12 @@ class Ui_MainWindow(object):
|
||||||
add_actions(self.SettingsLanguageMenu, self.LanguageGroup.actions())
|
add_actions(self.SettingsLanguageMenu, self.LanguageGroup.actions())
|
||||||
add_actions(self.SettingsMenu, (self.settingsPluginListItem,
|
add_actions(self.SettingsMenu, (self.settingsPluginListItem,
|
||||||
self.SettingsLanguageMenu.menuAction(), None,
|
self.SettingsLanguageMenu.menuAction(), None,
|
||||||
self.SettingsShortcutsItem, self.SettingsConfigureItem))
|
self.DisplayTagItem, self.SettingsShortcutsItem,
|
||||||
|
self.SettingsConfigureItem))
|
||||||
add_actions(self.ToolsMenu, (self.ToolsAddToolItem, None))
|
add_actions(self.ToolsMenu, (self.ToolsAddToolItem, None))
|
||||||
add_actions(self.ToolsMenu, (self.ToolsOpenDataFolder, None))
|
add_actions(self.ToolsMenu, (self.ToolsOpenDataFolder, None))
|
||||||
add_actions(self.HelpMenu, (self.HelpDocumentationItem,
|
add_actions(self.HelpMenu, (self.HelpDocumentationItem,
|
||||||
self.HelpOnlineHelpItem, None, self.HelpWebSiteItem,
|
self.HelpOnlineHelpItem, None, self.helpWebSiteItem,
|
||||||
self.HelpAboutItem))
|
self.HelpAboutItem))
|
||||||
add_actions(self.MenuBar, (self.FileMenu.menuAction(),
|
add_actions(self.MenuBar, (self.FileMenu.menuAction(),
|
||||||
self.viewMenu.menuAction(), self.ToolsMenu.menuAction(),
|
self.viewMenu.menuAction(), self.ToolsMenu.menuAction(),
|
||||||
|
@ -340,8 +343,7 @@ class Ui_MainWindow(object):
|
||||||
'Save the current service under a new name.'))
|
'Save the current service under a new name.'))
|
||||||
self.FileSaveAsItem.setShortcut(
|
self.FileSaveAsItem.setShortcut(
|
||||||
translate('OpenLP.MainWindow', 'Ctrl+Shift+S'))
|
translate('OpenLP.MainWindow', 'Ctrl+Shift+S'))
|
||||||
self.printServiceOrderItem.setText(
|
self.printServiceOrderItem.setText(UiStrings.PrintServiceOrder)
|
||||||
translate('OpenLP.MainWindow', 'Print Service Order'))
|
|
||||||
self.printServiceOrderItem.setStatusTip(translate('OpenLP.MainWindow',
|
self.printServiceOrderItem.setStatusTip(translate('OpenLP.MainWindow',
|
||||||
'Print the current Service Order.'))
|
'Print the current Service Order.'))
|
||||||
self.printServiceOrderItem.setShortcut(
|
self.printServiceOrderItem.setShortcut(
|
||||||
|
@ -362,6 +364,8 @@ class Ui_MainWindow(object):
|
||||||
translate('OpenLP.MainWindow', '&Language'))
|
translate('OpenLP.MainWindow', '&Language'))
|
||||||
self.SettingsShortcutsItem.setText(
|
self.SettingsShortcutsItem.setText(
|
||||||
translate('OpenLP.MainWindow', 'Configure &Shortcuts...'))
|
translate('OpenLP.MainWindow', 'Configure &Shortcuts...'))
|
||||||
|
self.DisplayTagItem.setText(
|
||||||
|
translate('OpenLP.MainWindow', '&Configure Display Tags'))
|
||||||
self.SettingsConfigureItem.setText(
|
self.SettingsConfigureItem.setText(
|
||||||
translate('OpenLP.MainWindow', '&Configure OpenLP...'))
|
translate('OpenLP.MainWindow', '&Configure OpenLP...'))
|
||||||
self.ViewMediaManagerItem.setText(
|
self.ViewMediaManagerItem.setText(
|
||||||
|
@ -419,7 +423,7 @@ class Ui_MainWindow(object):
|
||||||
translate('OpenLP.MainWindow', 'Ctrl+F1'))
|
translate('OpenLP.MainWindow', 'Ctrl+F1'))
|
||||||
self.HelpOnlineHelpItem.setText(
|
self.HelpOnlineHelpItem.setText(
|
||||||
translate('OpenLP.MainWindow', '&Online Help'))
|
translate('OpenLP.MainWindow', '&Online Help'))
|
||||||
self.HelpWebSiteItem.setText(
|
self.helpWebSiteItem.setText(
|
||||||
translate('OpenLP.MainWindow', '&Web Site'))
|
translate('OpenLP.MainWindow', '&Web Site'))
|
||||||
self.AutoLanguageItem.setText(
|
self.AutoLanguageItem.setText(
|
||||||
translate('OpenLP.MainWindow', '&Auto Detect'))
|
translate('OpenLP.MainWindow', '&Auto Detect'))
|
||||||
|
@ -457,7 +461,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||||
|
|
||||||
actionList = ActionList()
|
actionList = ActionList()
|
||||||
|
|
||||||
def __init__(self, screens, applicationVersion):
|
def __init__(self, screens, applicationVersion, clipboard, firstTime):
|
||||||
"""
|
"""
|
||||||
This constructor sets up the interface, the various managers, and the
|
This constructor sets up the interface, the various managers, and the
|
||||||
plugins.
|
plugins.
|
||||||
|
@ -466,6 +470,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||||
self.screens = screens
|
self.screens = screens
|
||||||
self.actionList = ActionList()
|
self.actionList = ActionList()
|
||||||
self.applicationVersion = applicationVersion
|
self.applicationVersion = applicationVersion
|
||||||
|
self.clipboard = clipboard
|
||||||
# Set up settings sections for the main application
|
# Set up settings sections for the main application
|
||||||
# (not for use by plugins)
|
# (not for use by plugins)
|
||||||
self.uiSettingsSection = u'user interface'
|
self.uiSettingsSection = u'user interface'
|
||||||
|
@ -476,6 +481,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||||
self.settingsmanager = SettingsManager(screens)
|
self.settingsmanager = SettingsManager(screens)
|
||||||
self.aboutForm = AboutForm(self, applicationVersion)
|
self.aboutForm = AboutForm(self, applicationVersion)
|
||||||
self.settingsForm = SettingsForm(self.screens, self, self)
|
self.settingsForm = SettingsForm(self.screens, self, self)
|
||||||
|
self.displayTagForm = DisplayTagForm(self)
|
||||||
self.shortcutForm = ShortcutListForm(self)
|
self.shortcutForm = ShortcutListForm(self)
|
||||||
self.recentFiles = QtCore.QStringList()
|
self.recentFiles = QtCore.QStringList()
|
||||||
# Set up the path with plugins
|
# Set up the path with plugins
|
||||||
|
@ -492,10 +498,10 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||||
# Set up signals and slots
|
# Set up signals and slots
|
||||||
QtCore.QObject.connect(self.ImportThemeItem,
|
QtCore.QObject.connect(self.ImportThemeItem,
|
||||||
QtCore.SIGNAL(u'triggered()'),
|
QtCore.SIGNAL(u'triggered()'),
|
||||||
self.ThemeManagerContents.onImportTheme)
|
self.themeManagerContents.onImportTheme)
|
||||||
QtCore.QObject.connect(self.ExportThemeItem,
|
QtCore.QObject.connect(self.ExportThemeItem,
|
||||||
QtCore.SIGNAL(u'triggered()'),
|
QtCore.SIGNAL(u'triggered()'),
|
||||||
self.ThemeManagerContents.onExportTheme)
|
self.themeManagerContents.onExportTheme)
|
||||||
QtCore.QObject.connect(self.ViewMediaManagerItem,
|
QtCore.QObject.connect(self.ViewMediaManagerItem,
|
||||||
QtCore.SIGNAL(u'triggered(bool)'), self.toggleMediaManager)
|
QtCore.SIGNAL(u'triggered(bool)'), self.toggleMediaManager)
|
||||||
QtCore.QObject.connect(self.ViewServiceManagerItem,
|
QtCore.QObject.connect(self.ViewServiceManagerItem,
|
||||||
|
@ -515,7 +521,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||||
QtCore.QObject.connect(self.themeManagerDock,
|
QtCore.QObject.connect(self.themeManagerDock,
|
||||||
QtCore.SIGNAL(u'visibilityChanged(bool)'),
|
QtCore.SIGNAL(u'visibilityChanged(bool)'),
|
||||||
self.ViewThemeManagerItem.setChecked)
|
self.ViewThemeManagerItem.setChecked)
|
||||||
QtCore.QObject.connect(self.HelpWebSiteItem,
|
QtCore.QObject.connect(self.helpWebSiteItem,
|
||||||
QtCore.SIGNAL(u'triggered()'), self.onHelpWebSiteClicked)
|
QtCore.SIGNAL(u'triggered()'), self.onHelpWebSiteClicked)
|
||||||
QtCore.QObject.connect(self.HelpAboutItem,
|
QtCore.QObject.connect(self.HelpAboutItem,
|
||||||
QtCore.SIGNAL(u'triggered()'), self.onHelpAboutItemClicked)
|
QtCore.SIGNAL(u'triggered()'), self.onHelpAboutItemClicked)
|
||||||
|
@ -523,6 +529,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||||
QtCore.SIGNAL(u'triggered()'), self.onToolsOpenDataFolderClicked)
|
QtCore.SIGNAL(u'triggered()'), self.onToolsOpenDataFolderClicked)
|
||||||
QtCore.QObject.connect(self.settingsPluginListItem,
|
QtCore.QObject.connect(self.settingsPluginListItem,
|
||||||
QtCore.SIGNAL(u'triggered()'), self.onPluginItemClicked)
|
QtCore.SIGNAL(u'triggered()'), self.onPluginItemClicked)
|
||||||
|
QtCore.QObject.connect(self.DisplayTagItem,
|
||||||
|
QtCore.SIGNAL(u'triggered()'), self.onDisplayTagItemClicked)
|
||||||
QtCore.QObject.connect(self.SettingsConfigureItem,
|
QtCore.QObject.connect(self.SettingsConfigureItem,
|
||||||
QtCore.SIGNAL(u'triggered()'), self.onSettingsConfigureItemClicked)
|
QtCore.SIGNAL(u'triggered()'), self.onSettingsConfigureItemClicked)
|
||||||
QtCore.QObject.connect(self.SettingsShortcutsItem,
|
QtCore.QObject.connect(self.SettingsShortcutsItem,
|
||||||
|
@ -574,7 +582,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||||
# RenderManager needs to call ThemeManager and
|
# RenderManager needs to call ThemeManager and
|
||||||
# ThemeManager needs to call RenderManager
|
# ThemeManager needs to call RenderManager
|
||||||
self.renderManager = RenderManager(
|
self.renderManager = RenderManager(
|
||||||
self.ThemeManagerContents, self.screens)
|
self.themeManagerContents, self.screens)
|
||||||
# Define the media Dock Manager
|
# Define the media Dock Manager
|
||||||
self.mediaDockManager = MediaDockManager(self.MediaToolBox)
|
self.mediaDockManager = MediaDockManager(self.MediaToolBox)
|
||||||
log.info(u'Load Plugins')
|
log.info(u'Load Plugins')
|
||||||
|
@ -608,7 +616,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||||
self.pluginManager.initialise_plugins()
|
self.pluginManager.initialise_plugins()
|
||||||
# Once all components are initialised load the Themes
|
# Once all components are initialised load the Themes
|
||||||
log.info(u'Load Themes')
|
log.info(u'Load Themes')
|
||||||
self.ThemeManagerContents.loadThemes()
|
self.themeManagerContents.loadThemes()
|
||||||
log.info(u'Load data from Settings')
|
log.info(u'Load data from Settings')
|
||||||
if QtCore.QSettings().value(u'advanced/save current plugin',
|
if QtCore.QSettings().value(u'advanced/save current plugin',
|
||||||
QtCore.QVariant(False)).toBool():
|
QtCore.QVariant(False)).toBool():
|
||||||
|
@ -618,6 +626,10 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||||
self.MediaToolBox.setCurrentIndex(savedPlugin)
|
self.MediaToolBox.setCurrentIndex(savedPlugin)
|
||||||
self.settingsForm.postSetUp()
|
self.settingsForm.postSetUp()
|
||||||
Receiver.send_message(u'cursor_normal')
|
Receiver.send_message(u'cursor_normal')
|
||||||
|
# Import themes if first time
|
||||||
|
if firstTime:
|
||||||
|
self.themeManagerContents.firstTime()
|
||||||
|
|
||||||
|
|
||||||
def setAutoLanguage(self, value):
|
def setAutoLanguage(self, value):
|
||||||
self.LanguageGroup.setDisabled(value)
|
self.LanguageGroup.setDisabled(value)
|
||||||
|
@ -642,8 +654,6 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||||
Show the main form, as well as the display form
|
Show the main form, as well as the display form
|
||||||
"""
|
"""
|
||||||
QtGui.QWidget.show(self)
|
QtGui.QWidget.show(self)
|
||||||
self.liveController.display.setup()
|
|
||||||
self.previewController.display.setup()
|
|
||||||
if self.liveController.display.isVisible():
|
if self.liveController.display.isVisible():
|
||||||
self.liveController.display.setFocus()
|
self.liveController.display.setFocus()
|
||||||
self.activateWindow()
|
self.activateWindow()
|
||||||
|
@ -716,6 +726,12 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||||
path = AppLocation.get_data_path()
|
path = AppLocation.get_data_path()
|
||||||
QtGui.QDesktopServices.openUrl(QtCore.QUrl("file:///" + path))
|
QtGui.QDesktopServices.openUrl(QtCore.QUrl("file:///" + path))
|
||||||
|
|
||||||
|
def onDisplayTagItemClicked(self):
|
||||||
|
"""
|
||||||
|
Show the Settings dialog
|
||||||
|
"""
|
||||||
|
self.displayTagForm.exec_()
|
||||||
|
|
||||||
def onSettingsConfigureItemClicked(self):
|
def onSettingsConfigureItemClicked(self):
|
||||||
"""
|
"""
|
||||||
Show the Settings dialog
|
Show the Settings dialog
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -85,4 +85,4 @@ class MediaDockManager(object):
|
||||||
if self.media_dock.widget(dock_index).settingsSection == \
|
if self.media_dock.widget(dock_index).settingsSection == \
|
||||||
media_item.plugin.name.lower():
|
media_item.plugin.name.lower():
|
||||||
self.media_dock.widget(dock_index).hide()
|
self.media_dock.widget(dock_index).hide()
|
||||||
self.media_dock.removeItem(dock_index)
|
self.media_dock.removeItem(dock_index)
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -25,7 +25,9 @@
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import translate
|
from openlp.core.lib import translate
|
||||||
|
from openlp.core.lib.ui import UiStrings
|
||||||
|
|
||||||
class Ui_PluginViewDialog(object):
|
class Ui_PluginViewDialog(object):
|
||||||
def setupUi(self, pluginViewDialog):
|
def setupUi(self, pluginViewDialog):
|
||||||
|
@ -76,10 +78,8 @@ class Ui_PluginViewDialog(object):
|
||||||
translate('OpenLP.PluginForm', 'Plugin List'))
|
translate('OpenLP.PluginForm', 'Plugin List'))
|
||||||
self.pluginInfoGroupBox.setTitle(
|
self.pluginInfoGroupBox.setTitle(
|
||||||
translate('OpenLP.PluginForm', 'Plugin Details'))
|
translate('OpenLP.PluginForm', 'Plugin Details'))
|
||||||
self.versionLabel.setText(
|
self.versionLabel.setText(u'%s:' % UiStrings.Version)
|
||||||
translate('OpenLP.PluginForm', 'Version:'))
|
self.aboutLabel.setText(u'%s:' % UiStrings.About)
|
||||||
self.aboutLabel.setText(
|
|
||||||
translate('OpenLP.PluginForm', 'About:'))
|
|
||||||
self.statusLabel.setText(
|
self.statusLabel.setText(
|
||||||
translate('OpenLP.PluginForm', 'Status:'))
|
translate('OpenLP.PluginForm', 'Status:'))
|
||||||
self.statusComboBox.setItemText(0,
|
self.statusComboBox.setItemText(0,
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -28,7 +28,7 @@ import logging
|
||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import PluginStatus, Receiver, StringContent, translate
|
from openlp.core.lib import PluginStatus, Receiver, translate
|
||||||
from plugindialog import Ui_PluginViewDialog
|
from plugindialog import Ui_PluginViewDialog
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
@ -80,15 +80,14 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
|
||||||
# PluginStatus.Inactive
|
# PluginStatus.Inactive
|
||||||
status_text = unicode(
|
status_text = unicode(
|
||||||
translate('OpenLP.PluginForm', '%s (Inactive)'))
|
translate('OpenLP.PluginForm', '%s (Inactive)'))
|
||||||
name_string = plugin.getString(StringContent.Name)
|
item.setText(status_text % plugin.nameStrings[u'singular'])
|
||||||
item.setText(status_text % name_string[u'singular'])
|
|
||||||
# If the plugin has an icon, set it!
|
# If the plugin has an icon, set it!
|
||||||
if plugin.icon:
|
if plugin.icon:
|
||||||
item.setIcon(plugin.icon)
|
item.setIcon(plugin.icon)
|
||||||
self.pluginListWidget.addItem(item)
|
self.pluginListWidget.addItem(item)
|
||||||
pluginListWidth = max(pluginListWidth, self.fontMetrics().width(
|
pluginListWidth = max(pluginListWidth, self.fontMetrics().width(
|
||||||
unicode(translate('OpenLP.PluginForm', '%s (Inactive)')) %
|
unicode(translate('OpenLP.PluginForm', '%s (Inactive)')) %
|
||||||
name_string[u'singular']))
|
plugin.nameStrings[u'singular']))
|
||||||
self.pluginListWidget.setFixedWidth(pluginListWidth +
|
self.pluginListWidget.setFixedWidth(pluginListWidth +
|
||||||
self.pluginListWidget.iconSize().width() + 48)
|
self.pluginListWidget.iconSize().width() + 48)
|
||||||
|
|
||||||
|
@ -118,8 +117,7 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
|
||||||
self.pluginListWidget.currentItem().text().split(u' ')[0]
|
self.pluginListWidget.currentItem().text().split(u' ')[0]
|
||||||
self.activePlugin = None
|
self.activePlugin = None
|
||||||
for plugin in self.parent.pluginManager.plugins:
|
for plugin in self.parent.pluginManager.plugins:
|
||||||
name_string = plugin.getString(StringContent.Name)
|
if plugin.nameStrings[u'singular'] == plugin_name_singular:
|
||||||
if name_string[u'singular'] == plugin_name_singular:
|
|
||||||
self.activePlugin = plugin
|
self.activePlugin = plugin
|
||||||
break
|
break
|
||||||
if self.activePlugin:
|
if self.activePlugin:
|
||||||
|
@ -147,6 +145,5 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
|
||||||
elif self.activePlugin.status == PluginStatus.Disabled:
|
elif self.activePlugin.status == PluginStatus.Disabled:
|
||||||
status_text = unicode(
|
status_text = unicode(
|
||||||
translate('OpenLP.PluginForm', '%s (Disabled)'))
|
translate('OpenLP.PluginForm', '%s (Disabled)'))
|
||||||
name_string = self.activePlugin.getString(StringContent.Name)
|
|
||||||
self.pluginListWidget.currentItem().setText(
|
self.pluginListWidget.currentItem().setText(
|
||||||
status_text % name_string[u'singular'])
|
status_text % self.activePlugin.nameStrings[u'singular'])
|
||||||
|
|
|
@ -0,0 +1,165 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# OpenLP - Open Source Lyrics Projection #
|
||||||
|
# --------------------------------------------------------------------------- #
|
||||||
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
|
# --------------------------------------------------------------------------- #
|
||||||
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
# Software Foundation; version 2 of the License. #
|
||||||
|
# #
|
||||||
|
# This program is distributed in the hope that it will be useful, but WITHOUT #
|
||||||
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
|
||||||
|
# more details. #
|
||||||
|
# #
|
||||||
|
# You should have received a copy of the GNU General Public License along #
|
||||||
|
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
|
||||||
|
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
|
from openlp.core.lib import build_icon, translate, SpellTextEdit
|
||||||
|
from openlp.core.lib.ui import UiStrings
|
||||||
|
|
||||||
|
class ZoomSize(object):
|
||||||
|
"""
|
||||||
|
Type enumeration for Combo Box sizes
|
||||||
|
"""
|
||||||
|
Page = 0
|
||||||
|
Width = 1
|
||||||
|
OneHundred = 2
|
||||||
|
SeventyFive = 3
|
||||||
|
Fifty = 4
|
||||||
|
TwentyFive = 5
|
||||||
|
|
||||||
|
Sizes = [
|
||||||
|
translate('OpenLP.PrintServiceDialog', 'Fit Page'),
|
||||||
|
translate('OpenLP.PrintServiceDialog', 'Fit Width'),
|
||||||
|
u'100%', u'75%', u'50%', u'25%']
|
||||||
|
|
||||||
|
|
||||||
|
class Ui_PrintServiceDialog(object):
|
||||||
|
def setupUi(self, printServiceDialog):
|
||||||
|
printServiceDialog.setObjectName(u'printServiceDialog')
|
||||||
|
printServiceDialog.resize(664, 594)
|
||||||
|
self.mainLayout = QtGui.QVBoxLayout(printServiceDialog)
|
||||||
|
self.mainLayout.setSpacing(0)
|
||||||
|
self.mainLayout.setMargin(0)
|
||||||
|
self.mainLayout.setObjectName(u'mainLayout')
|
||||||
|
self.toolbar = QtGui.QToolBar(printServiceDialog)
|
||||||
|
self.toolbar.setIconSize(QtCore.QSize(22, 22))
|
||||||
|
self.toolbar.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
|
||||||
|
self.printButton = self.toolbar.addAction(
|
||||||
|
build_icon(u':/general/general_print.png'), 'Print')
|
||||||
|
self.optionsButton = QtGui.QToolButton(self.toolbar)
|
||||||
|
self.optionsButton.setText(translate('OpenLP.PrintServiceForm',
|
||||||
|
'Options'))
|
||||||
|
self.optionsButton.setToolButtonStyle(
|
||||||
|
QtCore.Qt.ToolButtonTextBesideIcon)
|
||||||
|
self.optionsButton.setIcon(QtGui.QIcon(
|
||||||
|
build_icon(u':/system/system_configure.png')))
|
||||||
|
self.optionsButton.setCheckable(True)
|
||||||
|
self.toolbar.addWidget(self.optionsButton)
|
||||||
|
self.closeButton = self.toolbar.addAction(
|
||||||
|
build_icon(u':/system/system_close.png'),
|
||||||
|
translate('OpenLP.PrintServiceForm', 'Close'))
|
||||||
|
self.toolbar.addSeparator()
|
||||||
|
self.plainCopy = self.toolbar.addAction(
|
||||||
|
build_icon(u':/system/system_edit_copy.png'),
|
||||||
|
translate('OpenLP.PrintServiceForm', 'Copy'))
|
||||||
|
self.htmlCopy = self.toolbar.addAction(
|
||||||
|
build_icon(u':/system/system_edit_copy.png'),
|
||||||
|
translate('OpenLP.PrintServiceForm', 'Copy as HTML'))
|
||||||
|
self.toolbar.addSeparator()
|
||||||
|
self.zoomInButton = QtGui.QToolButton(self.toolbar)
|
||||||
|
self.zoomInButton.setIcon(QtGui.QIcon(
|
||||||
|
build_icon(u':/general/general_zoom_in.png')))
|
||||||
|
self.zoomInButton.setToolTip(translate('OpenLP.PrintServiceForm',
|
||||||
|
'Zoom In'))
|
||||||
|
self.zoomInButton.setObjectName(u'zoomInButton')
|
||||||
|
self.zoomInButton.setIconSize(QtCore.QSize(22, 22))
|
||||||
|
self.toolbar.addWidget(self.zoomInButton)
|
||||||
|
self.zoomOutButton = QtGui.QToolButton(self.toolbar)
|
||||||
|
self.zoomOutButton.setIcon(QtGui.QIcon(
|
||||||
|
build_icon(u':/general/general_zoom_out.png')))
|
||||||
|
self.zoomOutButton.setToolTip(translate('OpenLP.PrintServiceForm',
|
||||||
|
'Zoom Out'))
|
||||||
|
self.zoomOutButton.setObjectName(u'zoomOutButton')
|
||||||
|
self.zoomOutButton.setIconSize(QtCore.QSize(22, 22))
|
||||||
|
self.toolbar.addWidget(self.zoomOutButton)
|
||||||
|
self.zoomOriginalButton = QtGui.QToolButton(self.toolbar)
|
||||||
|
self.zoomOriginalButton.setIcon(QtGui.QIcon(
|
||||||
|
build_icon(u':/general/general_zoom_original.png')))
|
||||||
|
self.zoomOriginalButton.setToolTip(translate('OpenLP.PrintServiceForm',
|
||||||
|
'Zoom Original'))
|
||||||
|
self.zoomOriginalButton.setObjectName(u'zoomOriginalButton')
|
||||||
|
self.zoomOriginalButton.setIconSize(QtCore.QSize(22, 22))
|
||||||
|
self.toolbar.addWidget(self.zoomOriginalButton)
|
||||||
|
self.zoomComboBox = QtGui.QComboBox(printServiceDialog)
|
||||||
|
self.zoomComboBox.setObjectName(u'zoomComboBox')
|
||||||
|
self.toolbar.addWidget(self.zoomComboBox)
|
||||||
|
self.mainLayout.addWidget(self.toolbar)
|
||||||
|
self.previewWidget = QtGui.QPrintPreviewWidget(printServiceDialog)
|
||||||
|
self.mainLayout.addWidget(self.previewWidget)
|
||||||
|
self.optionsWidget = QtGui.QWidget(printServiceDialog)
|
||||||
|
self.optionsWidget.hide()
|
||||||
|
self.optionsWidget.resize(400, 300)
|
||||||
|
self.optionsWidget.setAutoFillBackground(True)
|
||||||
|
self.optionsLayout = QtGui.QVBoxLayout(self.optionsWidget)
|
||||||
|
self.optionsLayout.setContentsMargins(8, 8, 8, 8)
|
||||||
|
self.titleLabel = QtGui.QLabel(self.optionsWidget)
|
||||||
|
self.titleLabel.setObjectName(u'titleLabel')
|
||||||
|
self.titleLabel.setText(u'Title:')
|
||||||
|
self.optionsLayout.addWidget(self.titleLabel)
|
||||||
|
self.titleLineEdit = QtGui.QLineEdit(self.optionsWidget)
|
||||||
|
self.titleLineEdit.setObjectName(u'titleLineEdit')
|
||||||
|
self.optionsLayout.addWidget(self.titleLineEdit)
|
||||||
|
self.footerLabel = QtGui.QLabel(self.optionsWidget)
|
||||||
|
self.footerLabel.setObjectName(u'footerLabel')
|
||||||
|
self.footerLabel.setText(u'Custom Footer Text:')
|
||||||
|
self.optionsLayout.addWidget(self.footerLabel)
|
||||||
|
self.footerTextEdit = SpellTextEdit(self.optionsWidget)
|
||||||
|
self.footerTextEdit.setObjectName(u'footerTextEdit')
|
||||||
|
self.optionsLayout.addWidget(self.footerTextEdit)
|
||||||
|
self.optionsGroupBox = QtGui.QGroupBox(
|
||||||
|
translate('OpenLP.PrintServiceForm','Other Options'))
|
||||||
|
self.groupLayout = QtGui.QVBoxLayout()
|
||||||
|
self.slideTextCheckBox = QtGui.QCheckBox()
|
||||||
|
self.groupLayout.addWidget(self.slideTextCheckBox)
|
||||||
|
self.notesCheckBox = QtGui.QCheckBox()
|
||||||
|
self.groupLayout.addWidget(self.notesCheckBox)
|
||||||
|
self.metaDataCheckBox = QtGui.QCheckBox()
|
||||||
|
self.groupLayout.addWidget(self.metaDataCheckBox)
|
||||||
|
self.groupLayout.addStretch(1)
|
||||||
|
self.optionsGroupBox.setLayout(self.groupLayout)
|
||||||
|
self.optionsLayout.addWidget(self.optionsGroupBox)
|
||||||
|
|
||||||
|
self.retranslateUi(printServiceDialog)
|
||||||
|
QtCore.QMetaObject.connectSlotsByName(printServiceDialog)
|
||||||
|
QtCore.QObject.connect(self.optionsButton,
|
||||||
|
QtCore.SIGNAL(u'toggled(bool)'), self.toggleOptions)
|
||||||
|
|
||||||
|
def retranslateUi(self, printServiceDialog):
|
||||||
|
printServiceDialog.setWindowTitle(UiStrings.PrintServiceOrder)
|
||||||
|
self.slideTextCheckBox.setText(translate('OpenLP.PrintServiceForm',
|
||||||
|
'Include slide text if available'))
|
||||||
|
self.notesCheckBox.setText(translate('OpenLP.PrintServiceForm',
|
||||||
|
'Include service item notes'))
|
||||||
|
self.metaDataCheckBox.setText(translate('OpenLP.PrintServiceForm',
|
||||||
|
'Include play length of media items'))
|
||||||
|
self.titleLineEdit.setText(translate('OpenLP.PrintServiceForm',
|
||||||
|
'Service Order Sheet'))
|
||||||
|
self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.Page])
|
||||||
|
self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.Width])
|
||||||
|
self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.OneHundred])
|
||||||
|
self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.SeventyFive])
|
||||||
|
self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.Fifty])
|
||||||
|
self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.TwentyFive])
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -28,51 +28,65 @@ import datetime
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import translate
|
from openlp.core.lib import translate
|
||||||
from openlp.core.ui.printserviceorderdialog import Ui_PrintServiceOrderDialog
|
from openlp.core.lib.ui import UiStrings
|
||||||
|
from openlp.core.ui.printservicedialog import Ui_PrintServiceDialog, ZoomSize
|
||||||
|
|
||||||
|
class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog):
|
||||||
|
|
||||||
class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog):
|
|
||||||
def __init__(self, parent, serviceManager):
|
def __init__(self, parent, serviceManager):
|
||||||
"""
|
"""
|
||||||
Constructor
|
Constructor
|
||||||
"""
|
"""
|
||||||
QtGui.QDialog.__init__(self, parent)
|
QtGui.QDialog.__init__(self, parent)
|
||||||
|
self.parent = parent
|
||||||
self.serviceManager = serviceManager
|
self.serviceManager = serviceManager
|
||||||
self.printer = QtGui.QPrinter()
|
self.printer = QtGui.QPrinter()
|
||||||
self.printDialog = QtGui.QPrintDialog(self.printer, self)
|
self.printDialog = QtGui.QPrintDialog(self.printer, self)
|
||||||
self.document = QtGui.QTextDocument()
|
self.document = QtGui.QTextDocument()
|
||||||
|
self.zoom = 0
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
# Load the settings for the dialog.
|
# Load the settings for the dialog.
|
||||||
settings = QtCore.QSettings()
|
settings = QtCore.QSettings()
|
||||||
settings.beginGroup(u'advanced')
|
settings.beginGroup(u'advanced')
|
||||||
self.printSlideTextCheckBox.setChecked(settings.value(
|
self.slideTextCheckBox.setChecked(settings.value(
|
||||||
u'print slide text', QtCore.QVariant(False)).toBool())
|
u'print slide text', QtCore.QVariant(False)).toBool())
|
||||||
self.printMetaDataCheckBox.setChecked(settings.value(
|
self.metaDataCheckBox.setChecked(settings.value(
|
||||||
u'print file meta data', QtCore.QVariant(False)).toBool())
|
u'print file meta data', QtCore.QVariant(False)).toBool())
|
||||||
self.printNotesCheckBox.setChecked(settings.value(
|
self.notesCheckBox.setChecked(settings.value(
|
||||||
u'print notes', QtCore.QVariant(False)).toBool())
|
u'print notes', QtCore.QVariant(False)).toBool())
|
||||||
|
self.zoomComboBox.setCurrentIndex(settings.value(
|
||||||
|
u'display size', QtCore.QVariant(0)).toInt()[0])
|
||||||
settings.endGroup()
|
settings.endGroup()
|
||||||
# Signals
|
# Signals
|
||||||
QtCore.QObject.connect(self.printButton,
|
QtCore.QObject.connect(self.printButton,
|
||||||
QtCore.SIGNAL(u'clicked()'), self.printServiceOrder)
|
QtCore.SIGNAL(u'triggered()'), self.printServiceOrder)
|
||||||
|
QtCore.QObject.connect(self.closeButton,
|
||||||
|
QtCore.SIGNAL(u'triggered()'), self.accept)
|
||||||
QtCore.QObject.connect(self.zoomOutButton,
|
QtCore.QObject.connect(self.zoomOutButton,
|
||||||
QtCore.SIGNAL(u'clicked()'), self.zoomOut)
|
QtCore.SIGNAL(u'clicked()'), self.zoomOut)
|
||||||
QtCore.QObject.connect(self.zoomInButton,
|
QtCore.QObject.connect(self.zoomInButton,
|
||||||
QtCore.SIGNAL(u'clicked()'), self.zoomIn)
|
QtCore.SIGNAL(u'clicked()'), self.zoomIn)
|
||||||
|
QtCore.QObject.connect(self.zoomOriginalButton,
|
||||||
|
QtCore.SIGNAL(u'clicked()'), self.zoomOriginal)
|
||||||
QtCore.QObject.connect(self.previewWidget,
|
QtCore.QObject.connect(self.previewWidget,
|
||||||
QtCore.SIGNAL(u'paintRequested(QPrinter *)'), self.paintRequested)
|
QtCore.SIGNAL(u'paintRequested(QPrinter *)'), self.paintRequested)
|
||||||
QtCore.QObject.connect(self.serviceTitleLineEdit,
|
QtCore.QObject.connect(self.zoomComboBox,
|
||||||
QtCore.SIGNAL(u'textChanged(const QString)'),
|
QtCore.SIGNAL(u'currentIndexChanged(int)'), self.displaySizeChanged)
|
||||||
self.updatePreviewText)
|
QtCore.QObject.connect(self.plainCopy,
|
||||||
QtCore.QObject.connect(self.printSlideTextCheckBox,
|
QtCore.SIGNAL(u'triggered()'), self.copyText)
|
||||||
QtCore.SIGNAL(u'stateChanged(int)'), self.updatePreviewText)
|
QtCore.QObject.connect(self.htmlCopy,
|
||||||
QtCore.QObject.connect(self.printNotesCheckBox,
|
QtCore.SIGNAL(u'triggered()'), self.copyHtmlText)
|
||||||
QtCore.SIGNAL(u'stateChanged(int)'), self.updatePreviewText)
|
self.updatePreviewText()
|
||||||
QtCore.QObject.connect(self.printMetaDataCheckBox,
|
|
||||||
QtCore.SIGNAL(u'stateChanged(int)'), self.updatePreviewText)
|
def toggleOptions(self, checked):
|
||||||
QtCore.QObject.connect(self.customNoteEdit,
|
self.optionsWidget.setVisible(checked)
|
||||||
QtCore.SIGNAL(u'textChanged()'), self.updatePreviewText)
|
if checked:
|
||||||
QtCore.QObject.connect(self.cancelButton,
|
left = self.optionsButton.pos().x()
|
||||||
QtCore.SIGNAL(u'clicked()'), self.reject)
|
top = self.toolbar.height()
|
||||||
|
self.optionsWidget.move(left, top)
|
||||||
|
self.titleLineEdit.setFocus()
|
||||||
|
else:
|
||||||
|
self.saveOptions()
|
||||||
self.updatePreviewText()
|
self.updatePreviewText()
|
||||||
|
|
||||||
def updatePreviewText(self):
|
def updatePreviewText(self):
|
||||||
|
@ -80,19 +94,28 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog):
|
||||||
Creates the html text and updates the html of *self.document*.
|
Creates the html text and updates the html of *self.document*.
|
||||||
"""
|
"""
|
||||||
text = u''
|
text = u''
|
||||||
if self.serviceTitleLineEdit.text():
|
if self.titleLineEdit.text():
|
||||||
text += u'<h2>%s</h2>' % unicode(self.serviceTitleLineEdit.text())
|
text += u'<h2>%s</h2>' % unicode(self.titleLineEdit.text())
|
||||||
for item in self.serviceManager.serviceItems:
|
for item in self.serviceManager.serviceItems:
|
||||||
item = item[u'service_item']
|
item = item[u'service_item']
|
||||||
# Add the title of the service item.
|
# Add the title of the service item.
|
||||||
text += u'<h4><img src="%s" /> %s</h4>' % (item.icon,
|
text += u'<h3><img src="%s" /> %s</h3>' % (item.icon,
|
||||||
item.get_display_title())
|
item.get_display_title())
|
||||||
# Add slide text of the service item.
|
# Add slide text of the service item.
|
||||||
if self.printSlideTextCheckBox.isChecked():
|
if self.slideTextCheckBox.isChecked():
|
||||||
if item.is_text():
|
if item.is_text():
|
||||||
# Add the text of the service item.
|
# Add the text of the service item.
|
||||||
|
verse = None
|
||||||
for slide in item.get_frames():
|
for slide in item.get_frames():
|
||||||
text += u'<p>' + slide[u'text'] + u'</p>'
|
if not verse:
|
||||||
|
text += u'<p>' + slide[u'html']
|
||||||
|
verse = slide[u'verseTag']
|
||||||
|
elif verse != slide[u'verseTag']:
|
||||||
|
text += u'<\p><p>' + slide[u'html']
|
||||||
|
verse = slide[u'verseTag']
|
||||||
|
else:
|
||||||
|
text += u'<br/>' + slide[u'html']
|
||||||
|
text += u'</p>'
|
||||||
elif item.is_image():
|
elif item.is_image():
|
||||||
# Add the image names of the service item.
|
# Add the image names of the service item.
|
||||||
text += u'<ol>'
|
text += u'<ol>'
|
||||||
|
@ -104,19 +127,19 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog):
|
||||||
# add footer
|
# add footer
|
||||||
text += u'<p>%s</p>' % item.foot_text
|
text += u'<p>%s</p>' % item.foot_text
|
||||||
# Add service items' notes.
|
# Add service items' notes.
|
||||||
if self.printNotesCheckBox.isChecked():
|
if self.notesCheckBox.isChecked():
|
||||||
if item.notes:
|
if item.notes:
|
||||||
text += u'<p><b>%s</b></p>%s' % (translate(
|
text += u'<p><strong>%s</strong></p>%s' % (translate(
|
||||||
'OpenLP.ServiceManager', 'Notes:'),
|
'OpenLP.ServiceManager', 'Notes:'),
|
||||||
item.notes.replace(u'\n', u'<br />'))
|
item.notes.replace(u'\n', u'<br />'))
|
||||||
# Add play length of media files.
|
# Add play length of media files.
|
||||||
if item.is_media() and self.printMetaDataCheckBox.isChecked():
|
if item.is_media() and self.metaDataCheckBox.isChecked():
|
||||||
text += u'<p><b>%s</b> %s</p>' % (translate(
|
text += u'<p><strong>%s</strong> %s</p>' % (translate(
|
||||||
'OpenLP.ServiceManager', u'Playing time:'),
|
'OpenLP.ServiceManager', u'Playing time:'),
|
||||||
unicode(datetime.timedelta(seconds=item.media_length)))
|
unicode(datetime.timedelta(seconds=item.media_length)))
|
||||||
if self.customNoteEdit.toPlainText():
|
if self.footerTextEdit.toPlainText():
|
||||||
text += u'<h4>%s</h4>%s' % (translate('OpenLP.ServiceManager',
|
text += u'<h4>%s</h4>%s' % (translate('OpenLP.ServiceManager',
|
||||||
u'Custom Service Notes:'), self.customNoteEdit.toPlainText())
|
u'Custom Service Notes:'), self.footerTextEdit.toPlainText())
|
||||||
self.document.setHtml(text)
|
self.document.setHtml(text)
|
||||||
self.previewWidget.updatePreview()
|
self.previewWidget.updatePreview()
|
||||||
|
|
||||||
|
@ -129,6 +152,43 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog):
|
||||||
"""
|
"""
|
||||||
self.document.print_(printer)
|
self.document.print_(printer)
|
||||||
|
|
||||||
|
def displaySizeChanged(self, display):
|
||||||
|
"""
|
||||||
|
The Zoom Combo box has changed so set up the size.
|
||||||
|
"""
|
||||||
|
if display == ZoomSize.Page:
|
||||||
|
self.previewWidget.fitInView()
|
||||||
|
elif display == ZoomSize.Width:
|
||||||
|
self.previewWidget.fitToWidth()
|
||||||
|
elif display == ZoomSize.OneHundred:
|
||||||
|
self.previewWidget.fitToWidth()
|
||||||
|
self.previewWidget.zoomIn(1)
|
||||||
|
elif display == ZoomSize.SeventyFive:
|
||||||
|
self.previewWidget.fitToWidth()
|
||||||
|
self.previewWidget.zoomIn(0.75)
|
||||||
|
elif display == ZoomSize.Fifty:
|
||||||
|
self.previewWidget.fitToWidth()
|
||||||
|
self.previewWidget.zoomIn(0.5)
|
||||||
|
elif display == ZoomSize.TwentyFive:
|
||||||
|
self.previewWidget.fitToWidth()
|
||||||
|
self.previewWidget.zoomIn(0.25)
|
||||||
|
settings = QtCore.QSettings()
|
||||||
|
settings.beginGroup(u'advanced')
|
||||||
|
settings.setValue(u'display size', QtCore.QVariant(display))
|
||||||
|
settings.endGroup()
|
||||||
|
|
||||||
|
def copyText(self):
|
||||||
|
"""
|
||||||
|
Copies the display text to the clipboard as plain text
|
||||||
|
"""
|
||||||
|
self.parent.clipboard.setText(self.document.toPlainText())
|
||||||
|
|
||||||
|
def copyHtmlText(self):
|
||||||
|
"""
|
||||||
|
Copies the display text to the clipboard as Html
|
||||||
|
"""
|
||||||
|
self.parent.clipboard.setText(self.document.toHtml())
|
||||||
|
|
||||||
def printServiceOrder(self):
|
def printServiceOrder(self):
|
||||||
"""
|
"""
|
||||||
Called, when the *printButton* is clicked. Opens the *printDialog*.
|
Called, when the *printButton* is clicked. Opens the *printDialog*.
|
||||||
|
@ -137,21 +197,38 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog):
|
||||||
return
|
return
|
||||||
# Print the document.
|
# Print the document.
|
||||||
self.document.print_(self.printer)
|
self.document.print_(self.printer)
|
||||||
self.accept()
|
|
||||||
|
|
||||||
def zoomIn(self):
|
def zoomIn(self):
|
||||||
"""
|
"""
|
||||||
Called when *zoomInButton* is clicked.
|
Called when *zoomInButton* is clicked.
|
||||||
"""
|
"""
|
||||||
self.previewWidget.zoomIn()
|
self.previewWidget.zoomIn()
|
||||||
|
self.zoom -= 0.1
|
||||||
|
|
||||||
def zoomOut(self):
|
def zoomOut(self):
|
||||||
"""
|
"""
|
||||||
Called when *zoomOutButton* is clicked.
|
Called when *zoomOutButton* is clicked.
|
||||||
"""
|
"""
|
||||||
self.previewWidget.zoomOut()
|
self.previewWidget.zoomOut()
|
||||||
|
self.zoom += 0.1
|
||||||
|
|
||||||
def accept(self):
|
def zoomOriginal(self):
|
||||||
|
"""
|
||||||
|
Called when *zoomOutButton* is clicked.
|
||||||
|
"""
|
||||||
|
self.previewWidget.zoomIn(1 + self.zoom)
|
||||||
|
self.zoom = 0
|
||||||
|
|
||||||
|
def updateTextFormat(self, value):
|
||||||
|
"""
|
||||||
|
Called when html copy check box is selected.
|
||||||
|
"""
|
||||||
|
if value == QtCore.Qt.Checked:
|
||||||
|
self.copyTextButton.setText(UiStrings.CopyToHtml)
|
||||||
|
else:
|
||||||
|
self.copyTextButton.setText(UiStrings.CopyToText)
|
||||||
|
|
||||||
|
def saveOptions(self):
|
||||||
"""
|
"""
|
||||||
Save the settings and close the dialog.
|
Save the settings and close the dialog.
|
||||||
"""
|
"""
|
||||||
|
@ -159,17 +236,9 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog):
|
||||||
settings = QtCore.QSettings()
|
settings = QtCore.QSettings()
|
||||||
settings.beginGroup(u'advanced')
|
settings.beginGroup(u'advanced')
|
||||||
settings.setValue(u'print slide text',
|
settings.setValue(u'print slide text',
|
||||||
QtCore.QVariant(self.printSlideTextCheckBox.isChecked()))
|
QtCore.QVariant(self.slideTextCheckBox.isChecked()))
|
||||||
settings.setValue(u'print file meta data',
|
settings.setValue(u'print file meta data',
|
||||||
QtCore.QVariant(self.printMetaDataCheckBox.isChecked()))
|
QtCore.QVariant(self.metaDataCheckBox.isChecked()))
|
||||||
settings.setValue(u'print notes',
|
settings.setValue(u'print notes',
|
||||||
QtCore.QVariant(self.printNotesCheckBox.isChecked()))
|
QtCore.QVariant(self.notesCheckBox.isChecked()))
|
||||||
settings.endGroup()
|
settings.endGroup()
|
||||||
# Close the dialog.
|
|
||||||
return QtGui.QDialog.accept(self)
|
|
||||||
|
|
||||||
def reject(self):
|
|
||||||
"""
|
|
||||||
Close the dialog, do not print the service and do not save the settings.
|
|
||||||
"""
|
|
||||||
return QtGui.QDialog.reject(self)
|
|
|
@ -1,137 +0,0 @@
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
# OpenLP - Open Source Lyrics Projection #
|
|
||||||
# --------------------------------------------------------------------------- #
|
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
|
||||||
# --------------------------------------------------------------------------- #
|
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
|
||||||
# Software Foundation; version 2 of the License. #
|
|
||||||
# #
|
|
||||||
# This program is distributed in the hope that it will be useful, but WITHOUT #
|
|
||||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
|
|
||||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
|
|
||||||
# more details. #
|
|
||||||
# #
|
|
||||||
# You should have received a copy of the GNU General Public License along #
|
|
||||||
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
|
|
||||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
|
||||||
|
|
||||||
from openlp.core.lib import build_icon, translate, SpellTextEdit
|
|
||||||
|
|
||||||
class Ui_PrintServiceOrderDialog(object):
|
|
||||||
def setupUi(self, printServiceOrderDialog):
|
|
||||||
printServiceOrderDialog.setObjectName(u'printServiceOrderDialog')
|
|
||||||
self.dialogLayout = QtGui.QGridLayout(printServiceOrderDialog)
|
|
||||||
self.dialogLayout.setObjectName(u'dialogLayout')
|
|
||||||
self.perviewLayout = QtGui.QVBoxLayout()
|
|
||||||
self.perviewLayout.setObjectName(u'perviewLayout')
|
|
||||||
self.previewLabel = QtGui.QLabel(printServiceOrderDialog)
|
|
||||||
self.previewLabel.setSizePolicy(
|
|
||||||
QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
|
|
||||||
self.previewLabel.setObjectName(u'previewLabel')
|
|
||||||
self.perviewLayout.addWidget(self.previewLabel)
|
|
||||||
self.previewWidget = QtGui.QPrintPreviewWidget(
|
|
||||||
self.printer, self, QtCore.Qt.Widget)
|
|
||||||
self.previewWidget.setEnabled(True)
|
|
||||||
self.previewWidget.setSizePolicy(
|
|
||||||
QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Expanding)
|
|
||||||
self.previewWidget.setObjectName(u'previewWidget')
|
|
||||||
# Give the previewWidget a fixed size, to prevent resizing when clicking
|
|
||||||
# the zoom buttons.
|
|
||||||
self.previewWidget.setFixedWidth(350)
|
|
||||||
self.perviewLayout.addWidget(self.previewWidget)
|
|
||||||
self.dialogLayout.addLayout(self.perviewLayout, 0, 0, 1, 1)
|
|
||||||
self.settingsLayout = QtGui.QVBoxLayout()
|
|
||||||
self.settingsLayout.setObjectName(u'settingsLayout')
|
|
||||||
self.serviceTitleLayout = QtGui.QGridLayout()
|
|
||||||
self.serviceTitleLayout.setObjectName(u'serviceTitleLayout')
|
|
||||||
self.serviceTitleLineEdit = QtGui.QLineEdit(printServiceOrderDialog)
|
|
||||||
self.serviceTitleLineEdit.setSizePolicy(
|
|
||||||
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Preferred)
|
|
||||||
self.serviceTitleLineEdit.setObjectName(u'serviceTitleLineEdit')
|
|
||||||
self.serviceTitleLayout.addWidget(self.serviceTitleLineEdit, 1, 1, 1, 1)
|
|
||||||
self.serviceTitleLabel = QtGui.QLabel(printServiceOrderDialog)
|
|
||||||
self.serviceTitleLabel.setSizePolicy(
|
|
||||||
QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
|
|
||||||
self.serviceTitleLabel.setObjectName(u'serviceTitleLabel')
|
|
||||||
self.serviceTitleLayout.addWidget(self.serviceTitleLabel, 1, 0, 1, 1)
|
|
||||||
self.settingsLayout.addLayout(self.serviceTitleLayout)
|
|
||||||
self.printSlideTextCheckBox = QtGui.QCheckBox(printServiceOrderDialog)
|
|
||||||
self.printSlideTextCheckBox.setObjectName(u'printSlideTextCheckBox')
|
|
||||||
self.settingsLayout.addWidget(self.printSlideTextCheckBox)
|
|
||||||
self.printNotesCheckBox = QtGui.QCheckBox(printServiceOrderDialog)
|
|
||||||
self.printNotesCheckBox.setObjectName(u'printNotesCheckBox')
|
|
||||||
self.settingsLayout.addWidget(self.printNotesCheckBox)
|
|
||||||
self.printMetaDataCheckBox = QtGui.QCheckBox(printServiceOrderDialog)
|
|
||||||
self.printMetaDataCheckBox.setObjectName(u'printMetaDataCheckBox')
|
|
||||||
self.settingsLayout.addWidget(self.printMetaDataCheckBox)
|
|
||||||
spacerItem = QtGui.QSpacerItem(20, 40,
|
|
||||||
QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
|
|
||||||
self.settingsLayout.addItem(spacerItem)
|
|
||||||
self.customNotesLabel = QtGui.QLabel(self)
|
|
||||||
self.customNotesLabel.setObjectName(u'customNotesLabel')
|
|
||||||
self.settingsLayout.addWidget(self.customNotesLabel)
|
|
||||||
self.customNoteEdit = SpellTextEdit(self)
|
|
||||||
self.customNoteEdit.setObjectName(u'customNoteEdit')
|
|
||||||
self.settingsLayout.addWidget(self.customNoteEdit)
|
|
||||||
self.dialogLayout.addLayout(self.settingsLayout, 0, 3, 1, 1)
|
|
||||||
self.buttonLayout = QtGui.QHBoxLayout()
|
|
||||||
self.buttonLayout.setObjectName(u'buttonLayout')
|
|
||||||
spacerItem = QtGui.QSpacerItem(40, 20,
|
|
||||||
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
|
|
||||||
self.buttonLayout.addItem(spacerItem)
|
|
||||||
self.cancelButton = QtGui.QPushButton(printServiceOrderDialog)
|
|
||||||
self.cancelButton.setObjectName(u'cancelButton')
|
|
||||||
self.buttonLayout.addWidget(self.cancelButton)
|
|
||||||
self.printButton = QtGui.QPushButton(printServiceOrderDialog)
|
|
||||||
self.printButton.setObjectName(u'printButton')
|
|
||||||
self.buttonLayout.addWidget(self.printButton)
|
|
||||||
self.dialogLayout.addLayout(self.buttonLayout, 1, 3, 1, 1)
|
|
||||||
self.zoomButtonLayout = QtGui.QHBoxLayout()
|
|
||||||
self.zoomButtonLayout.setObjectName(u'zoomButtonLayout')
|
|
||||||
spacerItem = QtGui.QSpacerItem(40, 20,
|
|
||||||
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
|
|
||||||
self.zoomButtonLayout.addItem(spacerItem)
|
|
||||||
self.zoomOutButton = QtGui.QToolButton(printServiceOrderDialog)
|
|
||||||
self.zoomOutButton.setIcon(
|
|
||||||
build_icon(u':/general/general_zoom_out.png'))
|
|
||||||
self.zoomOutButton.setObjectName(u'zoomOutButton')
|
|
||||||
self.zoomButtonLayout.addWidget(self.zoomOutButton)
|
|
||||||
self.zoomInButton = QtGui.QToolButton(printServiceOrderDialog)
|
|
||||||
self.zoomInButton.setIcon(build_icon(u':/general/general_zoom_in.png'))
|
|
||||||
self.zoomInButton.setObjectName(u'zoomInButton')
|
|
||||||
self.zoomButtonLayout.addWidget(self.zoomInButton)
|
|
||||||
self.dialogLayout.addLayout(self.zoomButtonLayout, 1, 0, 1, 1)
|
|
||||||
self.retranslateUi(printServiceOrderDialog)
|
|
||||||
QtCore.QMetaObject.connectSlotsByName(printServiceOrderDialog)
|
|
||||||
|
|
||||||
def retranslateUi(self, printServiceOrderDialog):
|
|
||||||
printServiceOrderDialog.setWindowTitle(
|
|
||||||
translate('OpenLP.PrintServiceOrderForm', 'Print Service Order'))
|
|
||||||
self.previewLabel.setText(
|
|
||||||
translate('OpenLP.ServiceManager', '<b>Preview:</b>'))
|
|
||||||
self.printSlideTextCheckBox.setText(translate(
|
|
||||||
'OpenLP.PrintServiceOrderForm', 'Include slide text if available'))
|
|
||||||
self.printNotesCheckBox.setText(translate(
|
|
||||||
'OpenLP.PrintServiceOrderForm', 'Include service item notes'))
|
|
||||||
self.printMetaDataCheckBox.setText(
|
|
||||||
translate('OpenLP.PrintServiceOrderForm',
|
|
||||||
'Include play length of media items'))
|
|
||||||
self.serviceTitleLabel.setText(translate(
|
|
||||||
'OpenLP.PrintServiceOrderForm', 'Title:'))
|
|
||||||
self.serviceTitleLineEdit.setText(translate('OpenLP.ServiceManager',
|
|
||||||
'Service Order Sheet'))
|
|
||||||
self.printButton.setText(translate('OpenLP.ServiceManager', 'Print'))
|
|
||||||
self.cancelButton.setText(translate('OpenLP.ServiceManager', 'Cancel'))
|
|
||||||
self.customNotesLabel.setText(
|
|
||||||
translate('OpenLP.ServiceManager', '<b>Custom Service Notes:</b>'))
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -25,11 +25,15 @@
|
||||||
###############################################################################
|
###############################################################################
|
||||||
"""
|
"""
|
||||||
The :mod:`screen` module provides management functionality for a machines'
|
The :mod:`screen` module provides management functionality for a machines'
|
||||||
displays
|
displays.
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
import copy
|
import copy
|
||||||
|
|
||||||
|
from PyQt4 import QtCore
|
||||||
|
|
||||||
|
from openlp.core.lib import Receiver, translate
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
class ScreenList(object):
|
class ScreenList(object):
|
||||||
|
@ -38,7 +42,14 @@ class ScreenList(object):
|
||||||
"""
|
"""
|
||||||
log.info(u'Screen loaded')
|
log.info(u'Screen loaded')
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self, desktop):
|
||||||
|
"""
|
||||||
|
Initialise the screen list.
|
||||||
|
|
||||||
|
``desktop``
|
||||||
|
A ``QDesktopWidget`` object.
|
||||||
|
"""
|
||||||
|
self.desktop = desktop
|
||||||
self.preview = None
|
self.preview = None
|
||||||
self.current = None
|
self.current = None
|
||||||
self.override = None
|
self.override = None
|
||||||
|
@ -48,19 +59,120 @@ class ScreenList(object):
|
||||||
self.current_display = 0
|
self.current_display = 0
|
||||||
# save config display number
|
# save config display number
|
||||||
self.monitor_number = 0
|
self.monitor_number = 0
|
||||||
|
self.screen_count_changed()
|
||||||
|
QtCore.QObject.connect(desktop,
|
||||||
|
QtCore.SIGNAL(u'resized(int)'), self.screen_resolution_changed)
|
||||||
|
QtCore.QObject.connect(desktop,
|
||||||
|
QtCore.SIGNAL(u'screenCountChanged(int)'),
|
||||||
|
self.screen_count_changed)
|
||||||
|
|
||||||
|
def screen_resolution_changed(self, number):
|
||||||
|
"""
|
||||||
|
Called when the resolution of a screen has changed.
|
||||||
|
|
||||||
|
``number``
|
||||||
|
The number of the screen, which size has changed.
|
||||||
|
"""
|
||||||
|
log.info(u'screenResolutionChanged %d' % number)
|
||||||
|
for screen in self.screen_list:
|
||||||
|
if number == screen[u'number']:
|
||||||
|
newScreen = {
|
||||||
|
u'number': number,
|
||||||
|
u'size': self.desktop.screenGeometry(number),
|
||||||
|
u'primary': self.desktop.primaryScreen() == number
|
||||||
|
}
|
||||||
|
self.remove_screen(number)
|
||||||
|
self.add_screen(newScreen)
|
||||||
|
# The screen's default size is used, that is why we have to
|
||||||
|
# update the override screen.
|
||||||
|
if screen == self.override:
|
||||||
|
self.override = copy.deepcopy(newScreen)
|
||||||
|
self.set_override_display()
|
||||||
|
Receiver.send_message(u'config_screen_changed')
|
||||||
|
break
|
||||||
|
|
||||||
|
def screen_count_changed(self, changed_screen=-1):
|
||||||
|
"""
|
||||||
|
Called when a screen has been added or removed.
|
||||||
|
|
||||||
|
``changed_screen``
|
||||||
|
The screen's number which has been (un)plugged.
|
||||||
|
"""
|
||||||
|
# Remove unplugged screens.
|
||||||
|
for screen in copy.deepcopy(self.screen_list):
|
||||||
|
if screen[u'number'] == self.desktop.numScreens():
|
||||||
|
self.remove_screen(screen[u'number'])
|
||||||
|
# Add new screens.
|
||||||
|
for number in xrange(0, self.desktop.numScreens()):
|
||||||
|
if not self.screen_exists(number):
|
||||||
|
self.add_screen({
|
||||||
|
u'number': number,
|
||||||
|
u'size': self.desktop.screenGeometry(number),
|
||||||
|
u'primary': (self.desktop.primaryScreen() == number)
|
||||||
|
})
|
||||||
|
# We do not want to send this message, when the method is called the
|
||||||
|
# first time.
|
||||||
|
if changed_screen != -1:
|
||||||
|
# Reload setting tabs to apply possible changes.
|
||||||
|
Receiver.send_message(u'config_screen_changed')
|
||||||
|
|
||||||
|
def get_screen_list(self):
|
||||||
|
"""
|
||||||
|
Returns a list with the screens. This should only be used to display
|
||||||
|
available screens to the user::
|
||||||
|
|
||||||
|
[u'Screen 1 (primary)', u'Screen 2']
|
||||||
|
"""
|
||||||
|
screen_list = []
|
||||||
|
for screen in self.screen_list:
|
||||||
|
screen_name = u'%s %d' % (translate('OpenLP.ScreenList', 'Screen'),
|
||||||
|
screen[u'number'] + 1)
|
||||||
|
if screen[u'primary']:
|
||||||
|
screen_name = u'%s (%s)' % (screen_name,
|
||||||
|
translate('OpenLP.ScreenList', 'primary'))
|
||||||
|
screen_list.append(screen_name)
|
||||||
|
return screen_list
|
||||||
|
|
||||||
def add_screen(self, screen):
|
def add_screen(self, screen):
|
||||||
"""
|
"""
|
||||||
Add a screen to the list of known screens
|
Add a screen to the list of known screens.
|
||||||
|
|
||||||
|
``screen``
|
||||||
|
A dict with the screen properties::
|
||||||
|
|
||||||
|
{
|
||||||
|
u'primary': True,
|
||||||
|
u'number': 0,
|
||||||
|
u'size': PyQt4.QtCore.QRect(0, 0, 1024, 768)
|
||||||
|
}
|
||||||
"""
|
"""
|
||||||
|
log.info(u'Screen %d found with resolution %s',
|
||||||
|
screen[u'number'], screen[u'size'])
|
||||||
if screen[u'primary']:
|
if screen[u'primary']:
|
||||||
self.current = screen
|
self.current = screen
|
||||||
self.screen_list.append(screen)
|
self.screen_list.append(screen)
|
||||||
self.display_count += 1
|
self.display_count += 1
|
||||||
|
|
||||||
|
def remove_screen(self, number):
|
||||||
|
"""
|
||||||
|
Remove a screen from the list of known screens.
|
||||||
|
|
||||||
|
``number``
|
||||||
|
The screen number (int).
|
||||||
|
"""
|
||||||
|
log.info(u'remove_screen %d' % number)
|
||||||
|
for screen in self.screen_list:
|
||||||
|
if screen[u'number'] == number:
|
||||||
|
self.screen_list.remove(screen)
|
||||||
|
self.display_count -= 1
|
||||||
|
break
|
||||||
|
|
||||||
def screen_exists(self, number):
|
def screen_exists(self, number):
|
||||||
"""
|
"""
|
||||||
Confirms a screen is known
|
Confirms a screen is known.
|
||||||
|
|
||||||
|
``number``
|
||||||
|
The screen number (int).
|
||||||
"""
|
"""
|
||||||
for screen in self.screen_list:
|
for screen in self.screen_list:
|
||||||
if screen[u'number'] == number:
|
if screen[u'number'] == number:
|
||||||
|
@ -69,9 +181,12 @@ class ScreenList(object):
|
||||||
|
|
||||||
def set_current_display(self, number):
|
def set_current_display(self, number):
|
||||||
"""
|
"""
|
||||||
Set up the current screen dimensions
|
Set up the current screen dimensions.
|
||||||
|
|
||||||
|
``number``
|
||||||
|
The screen number (int).
|
||||||
"""
|
"""
|
||||||
log.debug(u'set_current_display %s', number, )
|
log.debug(u'set_current_display %s', number)
|
||||||
if number + 1 > self.display_count:
|
if number + 1 > self.display_count:
|
||||||
self.current = self.screen_list[0]
|
self.current = self.screen_list[0]
|
||||||
self.override = copy.deepcopy(self.current)
|
self.override = copy.deepcopy(self.current)
|
||||||
|
@ -86,8 +201,8 @@ class ScreenList(object):
|
||||||
|
|
||||||
def set_override_display(self):
|
def set_override_display(self):
|
||||||
"""
|
"""
|
||||||
replace the current size with the override values
|
Replace the current size with the override values, as the user wants to
|
||||||
user wants to have their own screen attributes
|
have their own screen attributes.
|
||||||
"""
|
"""
|
||||||
log.debug(u'set_override_display')
|
log.debug(u'set_override_display')
|
||||||
self.current = copy.deepcopy(self.override)
|
self.current = copy.deepcopy(self.override)
|
||||||
|
@ -95,8 +210,8 @@ class ScreenList(object):
|
||||||
|
|
||||||
def reset_current_display(self):
|
def reset_current_display(self):
|
||||||
"""
|
"""
|
||||||
replace the current values with the correct values
|
Replace the current values with the correct values, as the user wants to
|
||||||
user wants to use the correct screen attributes
|
use the correct screen attributes.
|
||||||
"""
|
"""
|
||||||
log.debug(u'reset_current_display')
|
log.debug(u'reset_current_display')
|
||||||
self.set_current_display(self.current_display)
|
self.set_current_display(self.current_display)
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -33,11 +33,11 @@ log = logging.getLogger(__name__)
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import OpenLPToolbar, ServiceItem, context_menu_action, \
|
from openlp.core.lib import OpenLPToolbar, ServiceItem, context_menu_action, \
|
||||||
Receiver, build_icon, ItemCapabilities, SettingsManager, translate, \
|
Receiver, build_icon, ItemCapabilities, SettingsManager, translate
|
||||||
ThemeLevel
|
from openlp.core.lib.theme import ThemeLevel
|
||||||
from openlp.core.lib.ui import UiStrings, critical_error_message_box
|
from openlp.core.lib.ui import UiStrings, critical_error_message_box
|
||||||
from openlp.core.ui import ServiceNoteForm, ServiceItemEditForm, StartTimeForm
|
from openlp.core.ui import ServiceNoteForm, ServiceItemEditForm, StartTimeForm
|
||||||
from openlp.core.ui.printserviceorderform import PrintServiceOrderForm
|
from openlp.core.ui.printserviceform import PrintServiceForm
|
||||||
from openlp.core.utils import AppLocation, delete_file, file_is_unicode, \
|
from openlp.core.utils import AppLocation, delete_file, file_is_unicode, \
|
||||||
split_filename
|
split_filename
|
||||||
|
|
||||||
|
@ -120,8 +120,7 @@ class ServiceManager(QtGui.QWidget):
|
||||||
translate('OpenLP.ServiceManager', 'Save this service'),
|
translate('OpenLP.ServiceManager', 'Save this service'),
|
||||||
self.saveFile)
|
self.saveFile)
|
||||||
self.toolbar.addSeparator()
|
self.toolbar.addSeparator()
|
||||||
self.themeLabel = QtGui.QLabel(translate('OpenLP.ServiceManager',
|
self.themeLabel = QtGui.QLabel(u'%s:' % UiStrings.Theme, self)
|
||||||
'Theme:'), self)
|
|
||||||
self.themeLabel.setMargin(3)
|
self.themeLabel.setMargin(3)
|
||||||
self.themeLabel.setObjectName(u'themeLabel')
|
self.themeLabel.setObjectName(u'themeLabel')
|
||||||
self.toolbar.addToolbarWidget(u'ThemeLabel', self.themeLabel)
|
self.toolbar.addToolbarWidget(u'ThemeLabel', self.themeLabel)
|
||||||
|
@ -939,6 +938,7 @@ class ServiceManager(QtGui.QWidget):
|
||||||
for item in self.serviceItems:
|
for item in self.serviceItems:
|
||||||
if item[u'service_item']._uuid == uuid:
|
if item[u'service_item']._uuid == uuid:
|
||||||
item[u'service_item'].edit_id = editId
|
item[u'service_item'].edit_id = editId
|
||||||
|
self.setModified(True)
|
||||||
|
|
||||||
def replaceServiceItem(self, newItem):
|
def replaceServiceItem(self, newItem):
|
||||||
"""
|
"""
|
||||||
|
@ -1057,8 +1057,8 @@ class ServiceManager(QtGui.QWidget):
|
||||||
if self.serviceItems[item][u'service_item']\
|
if self.serviceItems[item][u'service_item']\
|
||||||
.is_capable(ItemCapabilities.AllowsEdit):
|
.is_capable(ItemCapabilities.AllowsEdit):
|
||||||
Receiver.send_message(u'%s_edit' %
|
Receiver.send_message(u'%s_edit' %
|
||||||
self.serviceItems[item][u'service_item'].name.lower(), u'L:%s' %
|
self.serviceItems[item][u'service_item'].name.lower(),
|
||||||
self.serviceItems[item][u'service_item'].edit_id )
|
u'L:%s' % self.serviceItems[item][u'service_item'].edit_id)
|
||||||
|
|
||||||
def findServiceItem(self):
|
def findServiceItem(self):
|
||||||
"""
|
"""
|
||||||
|
@ -1119,13 +1119,14 @@ class ServiceManager(QtGui.QWidget):
|
||||||
self.serviceItems.remove(serviceItem)
|
self.serviceItems.remove(serviceItem)
|
||||||
self.serviceItems.insert(endpos, serviceItem)
|
self.serviceItems.insert(endpos, serviceItem)
|
||||||
self.repaintServiceList(endpos, child)
|
self.repaintServiceList(endpos, child)
|
||||||
|
self.setModified(True)
|
||||||
else:
|
else:
|
||||||
# we are not over anything so drop
|
# we are not over anything so drop
|
||||||
replace = False
|
replace = False
|
||||||
if item is None:
|
if item is None:
|
||||||
self.dropPosition = len(self.serviceItems)
|
self.dropPosition = len(self.serviceItems)
|
||||||
else:
|
else:
|
||||||
# we are over somthing so lets investigate
|
# we are over something so lets investigate
|
||||||
pos = self._getParentItemData(item) - 1
|
pos = self._getParentItemData(item) - 1
|
||||||
serviceItem = self.serviceItems[pos]
|
serviceItem = self.serviceItems[pos]
|
||||||
if (plugin == serviceItem[u'service_item'].name and
|
if (plugin == serviceItem[u'service_item'].name and
|
||||||
|
@ -1203,5 +1204,5 @@ class ServiceManager(QtGui.QWidget):
|
||||||
"""
|
"""
|
||||||
Print a Service Order Sheet.
|
Print a Service Order Sheet.
|
||||||
"""
|
"""
|
||||||
settingDialog = PrintServiceOrderForm(self.mainwindow, self)
|
settingDialog = PrintServiceForm(self.mainwindow, self)
|
||||||
settingDialog.exec_()
|
settingDialog.exec_()
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -53,4 +53,4 @@ class ServiceNoteForm(QtGui.QDialog):
|
||||||
|
|
||||||
def retranslateUi(self):
|
def retranslateUi(self):
|
||||||
self.setWindowTitle(
|
self.setWindowTitle(
|
||||||
translate('OpenLP.ServiceNoteForm', 'Service Item Notes'))
|
translate('OpenLP.ServiceNoteForm', 'Service Item Notes'))
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -31,7 +31,7 @@ import logging
|
||||||
from PyQt4 import QtGui
|
from PyQt4 import QtGui
|
||||||
|
|
||||||
from openlp.core.lib import Receiver
|
from openlp.core.lib import Receiver
|
||||||
from openlp.core.ui import AdvancedTab, GeneralTab, ThemesTab, DisplayTagTab
|
from openlp.core.ui import AdvancedTab, GeneralTab, ThemesTab
|
||||||
from settingsdialog import Ui_SettingsDialog
|
from settingsdialog import Ui_SettingsDialog
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
@ -47,17 +47,14 @@ class SettingsForm(QtGui.QDialog, Ui_SettingsDialog):
|
||||||
QtGui.QDialog.__init__(self, parent)
|
QtGui.QDialog.__init__(self, parent)
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
# General tab
|
# General tab
|
||||||
self.generalTab = GeneralTab(screens)
|
generalTab = GeneralTab(screens)
|
||||||
self.addTab(u'General', self.generalTab)
|
self.addTab(u'General', generalTab)
|
||||||
# Themes tab
|
# Themes tab
|
||||||
self.themesTab = ThemesTab(mainWindow)
|
themesTab = ThemesTab(mainWindow)
|
||||||
self.addTab(u'Themes', self.themesTab)
|
self.addTab(u'Themes', themesTab)
|
||||||
# Advanced tab
|
# Advanced tab
|
||||||
self.advancedTab = AdvancedTab()
|
advancedTab = AdvancedTab()
|
||||||
self.addTab(u'Advanced', self.advancedTab)
|
self.addTab(u'Advanced', advancedTab)
|
||||||
# Edit Display Tags tab
|
|
||||||
self.displayTagTab = DisplayTagTab()
|
|
||||||
self.addTab(u'Display Tags', self.displayTagTab)
|
|
||||||
|
|
||||||
def addTab(self, name, tab):
|
def addTab(self, name, tab):
|
||||||
"""
|
"""
|
||||||
|
@ -71,9 +68,9 @@ class SettingsForm(QtGui.QDialog, Ui_SettingsDialog):
|
||||||
Add a tab to the form at a specific location
|
Add a tab to the form at a specific location
|
||||||
"""
|
"""
|
||||||
log.debug(u'Inserting %s tab' % tab.tabTitle)
|
log.debug(u'Inserting %s tab' % tab.tabTitle)
|
||||||
# 15 : There are 4 tables currently and locations starts at -10
|
# 14 : There are 3 tables currently and locations starts at -10
|
||||||
self.settingsTabWidget.insertTab(
|
self.settingsTabWidget.insertTab(
|
||||||
location + 15, tab, tab.tabTitleVisible)
|
location + 14, tab, tab.tabTitleVisible)
|
||||||
|
|
||||||
def removeTab(self, tab):
|
def removeTab(self, tab):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -78,7 +78,7 @@ class Ui_ShortcutListDialog(object):
|
||||||
translate('OpenLP.ShortcutListDialog', 'Customize Shortcuts'))
|
translate('OpenLP.ShortcutListDialog', 'Customize Shortcuts'))
|
||||||
self.treeWidget.setHeaderLabels([
|
self.treeWidget.setHeaderLabels([
|
||||||
translate('OpenLP.ShortcutListDialog', 'Action'),
|
translate('OpenLP.ShortcutListDialog', 'Action'),
|
||||||
translate('OpenLP.ShortcutListDialog', 'Shortcut'),
|
translate('OpenLP.ShortcutListDialog', 'Shortcut'),
|
||||||
translate('OpenLP.ShortcutListDialog', 'Alternate')])
|
translate('OpenLP.ShortcutListDialog', 'Alternate')])
|
||||||
self.defaultButton.setText(
|
self.defaultButton.setText(
|
||||||
translate('OpenLP.ShortcutListDialog', 'Default: %s'))
|
translate('OpenLP.ShortcutListDialog', 'Default: %s'))
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -101,7 +101,8 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog):
|
||||||
else:
|
else:
|
||||||
shortcutText = action.shortcut().toString()
|
shortcutText = action.shortcut().toString()
|
||||||
alternateText = u''
|
alternateText = u''
|
||||||
actionItem = QtGui.QTreeWidgetItem([actionText, shortcutText, alternateText])
|
actionItem = QtGui.QTreeWidgetItem(
|
||||||
|
[actionText, shortcutText, alternateText])
|
||||||
actionItem.setIcon(0, action.icon())
|
actionItem.setIcon(0, action.icon())
|
||||||
item.addChild(actionItem)
|
item.addChild(actionItem)
|
||||||
item.setExpanded(True)
|
item.setExpanded(True)
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -32,7 +32,7 @@ from PyQt4.phonon import Phonon
|
||||||
|
|
||||||
from openlp.core.lib import OpenLPToolbar, Receiver, resize_image, \
|
from openlp.core.lib import OpenLPToolbar, Receiver, resize_image, \
|
||||||
ItemCapabilities, translate
|
ItemCapabilities, translate
|
||||||
from openlp.core.lib.ui import UiStrings, shortcut_action
|
from openlp.core.lib.ui import icon_action, UiStrings, shortcut_action
|
||||||
from openlp.core.ui import HideMode, MainDisplay
|
from openlp.core.ui import HideMode, MainDisplay
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
@ -114,8 +114,7 @@ class SlideController(QtGui.QWidget):
|
||||||
self.previewListWidget = SlideList(self)
|
self.previewListWidget = SlideList(self)
|
||||||
self.previewListWidget.setColumnCount(1)
|
self.previewListWidget.setColumnCount(1)
|
||||||
self.previewListWidget.horizontalHeader().setVisible(False)
|
self.previewListWidget.horizontalHeader().setVisible(False)
|
||||||
self.previewListWidget.setColumnWidth(
|
self.previewListWidget.setColumnWidth(0, self.controller.width())
|
||||||
0, self.controller.width())
|
|
||||||
self.previewListWidget.isLive = self.isLive
|
self.previewListWidget.isLive = self.isLive
|
||||||
self.previewListWidget.setObjectName(u'PreviewListWidget')
|
self.previewListWidget.setObjectName(u'PreviewListWidget')
|
||||||
self.previewListWidget.setSelectionBehavior(1)
|
self.previewListWidget.setSelectionBehavior(1)
|
||||||
|
@ -146,36 +145,30 @@ class SlideController(QtGui.QWidget):
|
||||||
u':/slides/slide_next.png',
|
u':/slides/slide_next.png',
|
||||||
translate('OpenLP.SlideController', 'Move to next'),
|
translate('OpenLP.SlideController', 'Move to next'),
|
||||||
self.onSlideSelectedNext)
|
self.onSlideSelectedNext)
|
||||||
|
self.toolbar.addToolbarSeparator(u'Close Separator')
|
||||||
if self.isLive:
|
if self.isLive:
|
||||||
self.toolbar.addToolbarSeparator(u'Close Separator')
|
|
||||||
self.hideMenu = QtGui.QToolButton(self.toolbar)
|
self.hideMenu = QtGui.QToolButton(self.toolbar)
|
||||||
self.hideMenu.setText(translate('OpenLP.SlideController', 'Hide'))
|
self.hideMenu.setText(translate('OpenLP.SlideController', 'Hide'))
|
||||||
self.hideMenu.setPopupMode(QtGui.QToolButton.MenuButtonPopup)
|
self.hideMenu.setPopupMode(QtGui.QToolButton.MenuButtonPopup)
|
||||||
self.toolbar.addToolbarWidget(u'Hide Menu', self.hideMenu)
|
self.toolbar.addToolbarWidget(u'Hide Menu', self.hideMenu)
|
||||||
self.hideMenu.setMenu(QtGui.QMenu(
|
self.hideMenu.setMenu(QtGui.QMenu(
|
||||||
translate('OpenLP.SlideController', 'Hide'), self.toolbar))
|
translate('OpenLP.SlideController', 'Hide'), self.toolbar))
|
||||||
self.blankScreen = QtGui.QAction(QtGui.QIcon(
|
self.blankScreen = icon_action(self.hideMenu, u'Blank Screen',
|
||||||
u':/slides/slide_blank.png'),
|
u':/slides/slide_blank.png', False)
|
||||||
translate('OpenLP.SlideController',
|
self.blankScreen.setText(
|
||||||
'Blank Screen'), self.hideMenu)
|
translate('OpenLP.SlideController', 'Blank Screen'))
|
||||||
self.blankScreen.setCheckable(True)
|
self.themeScreen = icon_action(self.hideMenu, u'Blank Theme',
|
||||||
self.themeScreen = QtGui.QAction(QtGui.QIcon(
|
u':/slides/slide_theme.png', False)
|
||||||
u':/slides/slide_theme.png'),
|
self.themeScreen.setText(
|
||||||
translate('OpenLP.SlideController',
|
translate('OpenLP.SlideController', 'Blank to Theme'))
|
||||||
'Blank to Theme'), self.hideMenu)
|
self.desktopScreen = icon_action(self.hideMenu, u'Desktop Screen',
|
||||||
self.themeScreen.setCheckable(True)
|
u':/slides/slide_desktop.png', False)
|
||||||
|
self.desktopScreen.setText(
|
||||||
|
translate('OpenLP.SlideController', 'Show Desktop'))
|
||||||
self.hideMenu.setDefaultAction(self.blankScreen)
|
self.hideMenu.setDefaultAction(self.blankScreen)
|
||||||
self.hideMenu.menu().addAction(self.blankScreen)
|
self.hideMenu.menu().addAction(self.blankScreen)
|
||||||
self.hideMenu.menu().addAction(self.themeScreen)
|
self.hideMenu.menu().addAction(self.themeScreen)
|
||||||
if self.screens.display_count > 1:
|
self.hideMenu.menu().addAction(self.desktopScreen)
|
||||||
self.desktopScreen = QtGui.QAction(QtGui.QIcon(
|
|
||||||
u':/slides/slide_desktop.png'),
|
|
||||||
translate('OpenLP.SlideController',
|
|
||||||
'Show Desktop'), self.hideMenu)
|
|
||||||
self.hideMenu.menu().addAction(self.desktopScreen)
|
|
||||||
self.desktopScreen.setCheckable(True)
|
|
||||||
QtCore.QObject.connect(self.desktopScreen,
|
|
||||||
QtCore.SIGNAL(u'triggered(bool)'), self.onHideDisplay)
|
|
||||||
self.toolbar.addToolbarSeparator(u'Loop Separator')
|
self.toolbar.addToolbarSeparator(u'Loop Separator')
|
||||||
self.toolbar.addToolbarButton(
|
self.toolbar.addToolbarButton(
|
||||||
# Does not need translating - control string.
|
# Does not need translating - control string.
|
||||||
|
@ -191,12 +184,10 @@ class SlideController(QtGui.QWidget):
|
||||||
self.delaySpinBox.setMinimum(1)
|
self.delaySpinBox.setMinimum(1)
|
||||||
self.delaySpinBox.setMaximum(180)
|
self.delaySpinBox.setMaximum(180)
|
||||||
self.toolbar.addToolbarWidget(u'Image SpinBox', self.delaySpinBox)
|
self.toolbar.addToolbarWidget(u'Image SpinBox', self.delaySpinBox)
|
||||||
self.delaySpinBox.setSuffix(translate('OpenLP.SlideController',
|
self.delaySpinBox.setSuffix(UiStrings.S)
|
||||||
's'))
|
|
||||||
self.delaySpinBox.setToolTip(translate('OpenLP.SlideController',
|
self.delaySpinBox.setToolTip(translate('OpenLP.SlideController',
|
||||||
'Delay between slides in seconds'))
|
'Delay between slides in seconds'))
|
||||||
else:
|
else:
|
||||||
self.toolbar.addToolbarSeparator(u'Close Separator')
|
|
||||||
self.toolbar.addToolbarButton(
|
self.toolbar.addToolbarButton(
|
||||||
# Does not need translating - control string.
|
# Does not need translating - control string.
|
||||||
u'Go Live', u':/general/general_live.png',
|
u'Go Live', u':/general/general_live.png',
|
||||||
|
@ -227,8 +218,7 @@ class SlideController(QtGui.QWidget):
|
||||||
if self.isLive:
|
if self.isLive:
|
||||||
# Build the Song Toolbar
|
# Build the Song Toolbar
|
||||||
self.songMenu = QtGui.QToolButton(self.toolbar)
|
self.songMenu = QtGui.QToolButton(self.toolbar)
|
||||||
self.songMenu.setText(translate('OpenLP.SlideController',
|
self.songMenu.setText(translate('OpenLP.SlideController', 'Go To'))
|
||||||
'Go To'))
|
|
||||||
self.songMenu.setPopupMode(QtGui.QToolButton.InstantPopup)
|
self.songMenu.setPopupMode(QtGui.QToolButton.InstantPopup)
|
||||||
self.toolbar.addToolbarWidget(u'Song Menu', self.songMenu)
|
self.toolbar.addToolbarWidget(u'Song Menu', self.songMenu)
|
||||||
self.songMenu.setMenu(QtGui.QMenu(
|
self.songMenu.setMenu(QtGui.QMenu(
|
||||||
|
@ -304,6 +294,8 @@ class SlideController(QtGui.QWidget):
|
||||||
QtCore.SIGNAL(u'triggered(bool)'), self.onBlankDisplay)
|
QtCore.SIGNAL(u'triggered(bool)'), self.onBlankDisplay)
|
||||||
QtCore.QObject.connect(self.themeScreen,
|
QtCore.QObject.connect(self.themeScreen,
|
||||||
QtCore.SIGNAL(u'triggered(bool)'), self.onThemeDisplay)
|
QtCore.SIGNAL(u'triggered(bool)'), self.onThemeDisplay)
|
||||||
|
QtCore.QObject.connect(self.desktopScreen,
|
||||||
|
QtCore.SIGNAL(u'triggered(bool)'), self.onHideDisplay)
|
||||||
QtCore.QObject.connect(self.volumeSlider,
|
QtCore.QObject.connect(self.volumeSlider,
|
||||||
QtCore.SIGNAL(u'sliderReleased()'), self.mediaVolume)
|
QtCore.SIGNAL(u'sliderReleased()'), self.mediaVolume)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
|
@ -470,6 +462,9 @@ class SlideController(QtGui.QWidget):
|
||||||
self.onSlideSelected()
|
self.onSlideSelected()
|
||||||
|
|
||||||
def receiveSpinDelay(self, value):
|
def receiveSpinDelay(self, value):
|
||||||
|
"""
|
||||||
|
Adjusts the value of the ``delaySpinBox`` to the given one.
|
||||||
|
"""
|
||||||
self.delaySpinBox.setValue(int(value))
|
self.delaySpinBox.setValue(int(value))
|
||||||
|
|
||||||
def enableToolBar(self, item):
|
def enableToolBar(self, item):
|
||||||
|
@ -603,14 +598,15 @@ class SlideController(QtGui.QWidget):
|
||||||
slideHeight = 0
|
slideHeight = 0
|
||||||
if self.serviceItem.is_text():
|
if self.serviceItem.is_text():
|
||||||
if frame[u'verseTag']:
|
if frame[u'verseTag']:
|
||||||
bits = frame[u'verseTag'].split(u':')
|
# These tags are already translated.
|
||||||
tag = u'%s\n%s' % (bits[0][0], bits[1][0:] )
|
verse_def = frame[u'verseTag']
|
||||||
tag1 = u'%s%s' % (bits[0][0], bits[1][0:] )
|
verse_def = u'%s%s' % (verse_def[0].upper(), verse_def[1:])
|
||||||
row = tag
|
two_line_def = u'%s\n%s' % (verse_def[0], verse_def[1:])
|
||||||
|
row = two_line_def
|
||||||
if self.isLive:
|
if self.isLive:
|
||||||
if tag1 not in self.slideList:
|
if verse_def not in self.slideList:
|
||||||
self.slideList[tag1] = framenumber
|
self.slideList[verse_def] = framenumber
|
||||||
self.songMenu.menu().addAction(tag1,
|
self.songMenu.menu().addAction(verse_def,
|
||||||
self.onSongBarHandler)
|
self.onSongBarHandler)
|
||||||
else:
|
else:
|
||||||
row += 1
|
row += 1
|
||||||
|
@ -624,6 +620,11 @@ class SlideController(QtGui.QWidget):
|
||||||
self.parent.renderManager.width,
|
self.parent.renderManager.width,
|
||||||
self.parent.renderManager.height)
|
self.parent.renderManager.height)
|
||||||
else:
|
else:
|
||||||
|
# If current slide set background to image
|
||||||
|
if framenumber == slideno:
|
||||||
|
self.serviceItem.bg_image_bytes = \
|
||||||
|
self.parent.renderManager.image_manager. \
|
||||||
|
get_image_bytes(frame[u'title'])
|
||||||
image = self.parent.renderManager.image_manager. \
|
image = self.parent.renderManager.image_manager. \
|
||||||
get_image(frame[u'title'])
|
get_image(frame[u'title'])
|
||||||
label.setPixmap(QtGui.QPixmap.fromImage(image))
|
label.setPixmap(QtGui.QPixmap.fromImage(image))
|
||||||
|
@ -747,8 +748,7 @@ class SlideController(QtGui.QWidget):
|
||||||
self.hideMenu.setDefaultAction(self.blankScreen)
|
self.hideMenu.setDefaultAction(self.blankScreen)
|
||||||
self.blankScreen.setChecked(checked)
|
self.blankScreen.setChecked(checked)
|
||||||
self.themeScreen.setChecked(False)
|
self.themeScreen.setChecked(False)
|
||||||
if self.screens.display_count > 1:
|
self.desktopScreen.setChecked(False)
|
||||||
self.desktopScreen.setChecked(False)
|
|
||||||
if checked:
|
if checked:
|
||||||
Receiver.send_message(u'maindisplay_hide', HideMode.Blank)
|
Receiver.send_message(u'maindisplay_hide', HideMode.Blank)
|
||||||
QtCore.QSettings().setValue(
|
QtCore.QSettings().setValue(
|
||||||
|
@ -769,8 +769,7 @@ class SlideController(QtGui.QWidget):
|
||||||
self.hideMenu.setDefaultAction(self.themeScreen)
|
self.hideMenu.setDefaultAction(self.themeScreen)
|
||||||
self.blankScreen.setChecked(False)
|
self.blankScreen.setChecked(False)
|
||||||
self.themeScreen.setChecked(checked)
|
self.themeScreen.setChecked(checked)
|
||||||
if self.screens.display_count > 1:
|
self.desktopScreen.setChecked(False)
|
||||||
self.desktopScreen.setChecked(False)
|
|
||||||
if checked:
|
if checked:
|
||||||
Receiver.send_message(u'maindisplay_hide', HideMode.Theme)
|
Receiver.send_message(u'maindisplay_hide', HideMode.Theme)
|
||||||
QtCore.QSettings().setValue(
|
QtCore.QSettings().setValue(
|
||||||
|
@ -791,9 +790,6 @@ class SlideController(QtGui.QWidget):
|
||||||
self.hideMenu.setDefaultAction(self.desktopScreen)
|
self.hideMenu.setDefaultAction(self.desktopScreen)
|
||||||
self.blankScreen.setChecked(False)
|
self.blankScreen.setChecked(False)
|
||||||
self.themeScreen.setChecked(False)
|
self.themeScreen.setChecked(False)
|
||||||
# On valid if more than 1 display
|
|
||||||
if self.screens.display_count <= 1:
|
|
||||||
return
|
|
||||||
self.desktopScreen.setChecked(checked)
|
self.desktopScreen.setChecked(checked)
|
||||||
if checked:
|
if checked:
|
||||||
Receiver.send_message(u'maindisplay_hide', HideMode.Screen)
|
Receiver.send_message(u'maindisplay_hide', HideMode.Screen)
|
||||||
|
@ -857,6 +853,8 @@ class SlideController(QtGui.QWidget):
|
||||||
frame = self.display.text(toDisplay)
|
frame = self.display.text(toDisplay)
|
||||||
else:
|
else:
|
||||||
frame = self.display.image(toDisplay)
|
frame = self.display.image(toDisplay)
|
||||||
|
# reset the store used to display first image
|
||||||
|
self.serviceItem.bg_image_bytes = None
|
||||||
self.slidePreview.setPixmap(QtGui.QPixmap.fromImage(frame))
|
self.slidePreview.setPixmap(QtGui.QPixmap.fromImage(frame))
|
||||||
self.selectedRow = row
|
self.selectedRow = row
|
||||||
Receiver.send_message(u'slidecontroller_%s_changed' % self.typePrefix,
|
Receiver.send_message(u'slidecontroller_%s_changed' % self.typePrefix,
|
||||||
|
@ -1096,15 +1094,15 @@ class SlideController(QtGui.QWidget):
|
||||||
Used by command items which provide their own displays to reset the
|
Used by command items which provide their own displays to reset the
|
||||||
screen hide attributes
|
screen hide attributes
|
||||||
"""
|
"""
|
||||||
|
blank = None
|
||||||
if self.blankScreen.isChecked:
|
if self.blankScreen.isChecked:
|
||||||
self.blankScreen.setChecked(False)
|
blank = self.blankScreen
|
||||||
self.hideMenu.setDefaultAction(self.blankScreen)
|
if self.themeScreen.isChecked:
|
||||||
|
blank = self.themeScreen
|
||||||
|
if self.desktopScreen.isChecked:
|
||||||
|
blank = self.desktopScreen
|
||||||
|
if blank:
|
||||||
|
blank.setChecked(False)
|
||||||
|
self.hideMenu.setDefaultAction(blank)
|
||||||
QtCore.QSettings().remove(
|
QtCore.QSettings().remove(
|
||||||
self.parent.generalSettingsSection + u'/screen blank')
|
self.parent.generalSettingsSection + u'/screen blank')
|
||||||
if self.themeScreen.isChecked:
|
|
||||||
self.themeScreen.setChecked(False)
|
|
||||||
self.hideMenu.setDefaultAction(self.themeScreen)
|
|
||||||
if self.screens.display_count > 1:
|
|
||||||
if self.desktopScreen.isChecked:
|
|
||||||
self.desktopScreen.setChecked(False)
|
|
||||||
self.hideMenu.setDefaultAction(self.desktopScreen)
|
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import translate
|
from openlp.core.lib import translate
|
||||||
from openlp.core.lib.ui import create_accept_reject_button_box
|
from openlp.core.lib.ui import UiStrings, create_accept_reject_button_box
|
||||||
|
|
||||||
class Ui_StartTimeDialog(object):
|
class Ui_StartTimeDialog(object):
|
||||||
def setupUi(self, StartTimeDialog):
|
def setupUi(self, StartTimeDialog):
|
||||||
|
@ -65,6 +65,6 @@ class Ui_StartTimeDialog(object):
|
||||||
self.hourLabel.setText(translate('OpenLP.StartTimeForm', 'Hours:'))
|
self.hourLabel.setText(translate('OpenLP.StartTimeForm', 'Hours:'))
|
||||||
self.hourSpinBox.setSuffix(translate('OpenLP.StartTimeForm', 'h'))
|
self.hourSpinBox.setSuffix(translate('OpenLP.StartTimeForm', 'h'))
|
||||||
self.minuteSpinBox.setSuffix(translate('OpenLP.StartTimeForm', 'm'))
|
self.minuteSpinBox.setSuffix(translate('OpenLP.StartTimeForm', 'm'))
|
||||||
self.secondSpinBox.setSuffix(translate('OpenLP.StartTimeForm', 's'))
|
self.secondSpinBox.setSuffix(UiStrings.S)
|
||||||
self.minuteLabel.setText(translate('OpenLP.StartTimeForm', 'Minutes:'))
|
self.minuteLabel.setText(translate('OpenLP.StartTimeForm', 'Minutes:'))
|
||||||
self.secondLabel.setText(translate('OpenLP.StartTimeForm', 'Seconds:'))
|
self.secondLabel.setText(translate('OpenLP.StartTimeForm', 'Seconds:'))
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -29,8 +29,8 @@ import os
|
||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import translate, BackgroundType, BackgroundGradientType, \
|
from openlp.core.lib import Receiver, translate
|
||||||
Receiver
|
from openlp.core.lib.theme import BackgroundType, BackgroundGradientType
|
||||||
from openlp.core.lib.ui import UiStrings, critical_error_message_box
|
from openlp.core.lib.ui import UiStrings, critical_error_message_box
|
||||||
from openlp.core.utils import get_images_filter
|
from openlp.core.utils import get_images_filter
|
||||||
from themewizard import Ui_ThemeWizard
|
from themewizard import Ui_ThemeWizard
|
||||||
|
@ -204,7 +204,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
|
||||||
# Do not trigger on start up
|
# Do not trigger on start up
|
||||||
if self.currentPage != self.welcomePage:
|
if self.currentPage != self.welcomePage:
|
||||||
self.updateTheme()
|
self.updateTheme()
|
||||||
frame = self.thememanager.generateImage(self.theme, True)
|
self.thememanager.generateImage(self.theme, True)
|
||||||
|
|
||||||
def updateLinesText(self, lines):
|
def updateLinesText(self, lines):
|
||||||
"""
|
"""
|
||||||
|
@ -301,7 +301,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
|
||||||
'Edit Theme - %s')) % self.theme.theme_name)
|
'Edit Theme - %s')) % self.theme.theme_name)
|
||||||
self.next()
|
self.next()
|
||||||
else:
|
else:
|
||||||
self.setWindowTitle(translate('OpenLP.ThemeWizard', 'New Theme'))
|
self.setWindowTitle(UiStrings.NewTheme)
|
||||||
return QtGui.QWizard.exec_(self)
|
return QtGui.QWizard.exec_(self)
|
||||||
|
|
||||||
def initializePage(self, id):
|
def initializePage(self, id):
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -32,10 +32,11 @@ import logging
|
||||||
from xml.etree.ElementTree import ElementTree, XML
|
from xml.etree.ElementTree import ElementTree, XML
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import OpenLPToolbar, ThemeXML, get_text_file_string, \
|
from openlp.core.lib import OpenLPToolbar, get_text_file_string, build_icon, \
|
||||||
build_icon, Receiver, SettingsManager, translate, check_item_selected, \
|
Receiver, SettingsManager, translate, check_item_selected, \
|
||||||
BackgroundType, BackgroundGradientType, check_directory_exists, \
|
check_directory_exists
|
||||||
VerticalType
|
from openlp.core.lib.theme import ThemeXML, BackgroundType, VerticalType, \
|
||||||
|
BackgroundGradientType
|
||||||
from openlp.core.lib.ui import UiStrings, critical_error_message_box
|
from openlp.core.lib.ui import UiStrings, critical_error_message_box
|
||||||
from openlp.core.theme import Theme
|
from openlp.core.theme import Theme
|
||||||
from openlp.core.ui import FileRenameForm, ThemeForm
|
from openlp.core.ui import FileRenameForm, ThemeForm
|
||||||
|
@ -62,8 +63,7 @@ class ThemeManager(QtGui.QWidget):
|
||||||
self.layout.setMargin(0)
|
self.layout.setMargin(0)
|
||||||
self.layout.setObjectName(u'layout')
|
self.layout.setObjectName(u'layout')
|
||||||
self.toolbar = OpenLPToolbar(self)
|
self.toolbar = OpenLPToolbar(self)
|
||||||
self.toolbar.addToolbarButton(
|
self.toolbar.addToolbarButton(UiStrings.NewTheme,
|
||||||
translate('OpenLP.ThemeManager', 'New Theme'),
|
|
||||||
u':/themes/theme_new.png',
|
u':/themes/theme_new.png',
|
||||||
translate('OpenLP.ThemeManager', 'Create a new theme.'),
|
translate('OpenLP.ThemeManager', 'Create a new theme.'),
|
||||||
self.onAddTheme)
|
self.onAddTheme)
|
||||||
|
@ -145,6 +145,20 @@ class ThemeManager(QtGui.QWidget):
|
||||||
# Last little bits of setting up
|
# Last little bits of setting up
|
||||||
self.configUpdated()
|
self.configUpdated()
|
||||||
|
|
||||||
|
def firstTime(self):
|
||||||
|
"""
|
||||||
|
Import new themes downloaded by the first time wizard
|
||||||
|
"""
|
||||||
|
Receiver.send_message(u'cursor_busy')
|
||||||
|
encoding = get_filesystem_encoding()
|
||||||
|
files = SettingsManager.get_files(self.settingsSection, u'.otz')
|
||||||
|
for file in files:
|
||||||
|
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, firstTime=False):
|
||||||
"""
|
"""
|
||||||
Triggered when Config dialog is updated.
|
Triggered when Config dialog is updated.
|
||||||
|
@ -266,7 +280,7 @@ class ThemeManager(QtGui.QWidget):
|
||||||
oldThemeName = unicode(item.data(QtCore.Qt.UserRole).toString())
|
oldThemeName = unicode(item.data(QtCore.Qt.UserRole).toString())
|
||||||
self.fileRenameForm.fileNameEdit.setText(oldThemeName)
|
self.fileRenameForm.fileNameEdit.setText(oldThemeName)
|
||||||
if self.fileRenameForm.exec_():
|
if self.fileRenameForm.exec_():
|
||||||
newThemeName = unicode(self.fileRenameForm.fileNameEdit.text())
|
newThemeName = unicode(self.fileRenameForm.fileNameEdit.text())
|
||||||
if self.checkIfThemeExists(newThemeName):
|
if self.checkIfThemeExists(newThemeName):
|
||||||
oldThemeData = self.getThemeData(oldThemeName)
|
oldThemeData = self.getThemeData(oldThemeName)
|
||||||
self.cloneThemeData(oldThemeData, newThemeName)
|
self.cloneThemeData(oldThemeData, newThemeName)
|
||||||
|
@ -284,7 +298,7 @@ class ThemeManager(QtGui.QWidget):
|
||||||
oldThemeName = unicode(item.data(QtCore.Qt.UserRole).toString())
|
oldThemeName = unicode(item.data(QtCore.Qt.UserRole).toString())
|
||||||
self.fileRenameForm.fileNameEdit.setText(oldThemeName)
|
self.fileRenameForm.fileNameEdit.setText(oldThemeName)
|
||||||
if self.fileRenameForm.exec_(True):
|
if self.fileRenameForm.exec_(True):
|
||||||
newThemeName = unicode(self.fileRenameForm.fileNameEdit.text())
|
newThemeName = unicode(self.fileRenameForm.fileNameEdit.text())
|
||||||
if self.checkIfThemeExists(newThemeName):
|
if self.checkIfThemeExists(newThemeName):
|
||||||
themeData = self.getThemeData(oldThemeName)
|
themeData = self.getThemeData(oldThemeName)
|
||||||
self.cloneThemeData(themeData, newThemeName)
|
self.cloneThemeData(themeData, newThemeName)
|
||||||
|
@ -370,6 +384,7 @@ class ThemeManager(QtGui.QWidget):
|
||||||
'Save Theme - (%s)')) % theme,
|
'Save Theme - (%s)')) % theme,
|
||||||
SettingsManager.get_last_dir(self.settingsSection, 1))
|
SettingsManager.get_last_dir(self.settingsSection, 1))
|
||||||
path = unicode(path)
|
path = unicode(path)
|
||||||
|
Receiver.send_message(u'cursor_busy')
|
||||||
if path:
|
if path:
|
||||||
SettingsManager.set_last_dir(self.settingsSection, path, 1)
|
SettingsManager.set_last_dir(self.settingsSection, path, 1)
|
||||||
themePath = os.path.join(path, theme + u'.otz')
|
themePath = os.path.join(path, theme + u'.otz')
|
||||||
|
@ -395,11 +410,12 @@ class ThemeManager(QtGui.QWidget):
|
||||||
finally:
|
finally:
|
||||||
if zip:
|
if zip:
|
||||||
zip.close()
|
zip.close()
|
||||||
|
Receiver.send_message(u'cursor_normal')
|
||||||
|
|
||||||
def onImportTheme(self):
|
def onImportTheme(self):
|
||||||
"""
|
"""
|
||||||
Opens a file dialog to select the theme file(s) to import before
|
Opens a file dialog to select the theme file(s) to import before
|
||||||
attempting to extract OpenLP themes from those files. This process
|
attempting to extract OpenLP themes from those files. This process
|
||||||
will load both OpenLP version 1 and version 2 themes.
|
will load both OpenLP version 1 and version 2 themes.
|
||||||
"""
|
"""
|
||||||
files = QtGui.QFileDialog.getOpenFileNames(self,
|
files = QtGui.QFileDialog.getOpenFileNames(self,
|
||||||
|
@ -408,12 +424,14 @@ class ThemeManager(QtGui.QWidget):
|
||||||
unicode(translate('OpenLP.ThemeManager',
|
unicode(translate('OpenLP.ThemeManager',
|
||||||
'OpenLP Themes (*.theme *.otz)')))
|
'OpenLP Themes (*.theme *.otz)')))
|
||||||
log.info(u'New Themes %s', unicode(files))
|
log.info(u'New Themes %s', unicode(files))
|
||||||
|
Receiver.send_message(u'cursor_busy')
|
||||||
if files:
|
if files:
|
||||||
for file in files:
|
for file in files:
|
||||||
SettingsManager.set_last_dir(
|
SettingsManager.set_last_dir(
|
||||||
self.settingsSection, unicode(file))
|
self.settingsSection, unicode(file))
|
||||||
self.unzipTheme(file, self.path)
|
self.unzipTheme(file, self.path)
|
||||||
self.loadThemes()
|
self.loadThemes()
|
||||||
|
Receiver.send_message(u'cursor_normal')
|
||||||
|
|
||||||
def loadThemes(self):
|
def loadThemes(self):
|
||||||
"""
|
"""
|
||||||
|
@ -529,6 +547,18 @@ class ThemeManager(QtGui.QWidget):
|
||||||
else:
|
else:
|
||||||
outfile = open(fullpath, u'wb')
|
outfile = open(fullpath, u'wb')
|
||||||
outfile.write(zip.read(file))
|
outfile.write(zip.read(file))
|
||||||
|
except (IOError, NameError):
|
||||||
|
critical_error_message_box(
|
||||||
|
translate('OpenLP.ThemeManager', 'Validation Error'),
|
||||||
|
translate('OpenLP.ThemeManager', 'File is not a valid theme.'))
|
||||||
|
log.exception(u'Importing theme from zip failed %s' % filename)
|
||||||
|
finally:
|
||||||
|
# Close the files, to be able to continue creating the theme.
|
||||||
|
if zip:
|
||||||
|
zip.close()
|
||||||
|
if outfile:
|
||||||
|
outfile.close()
|
||||||
|
# As all files are closed, we can create the Theme.
|
||||||
if filexml:
|
if filexml:
|
||||||
theme = self._createThemeFromXml(filexml, self.path)
|
theme = self._createThemeFromXml(filexml, self.path)
|
||||||
self.generateAndSaveImage(dir, themename, theme)
|
self.generateAndSaveImage(dir, themename, theme)
|
||||||
|
@ -539,17 +569,6 @@ class ThemeManager(QtGui.QWidget):
|
||||||
'File is not a valid theme.'))
|
'File is not a valid theme.'))
|
||||||
log.exception(u'Theme file does not contain XML data %s' %
|
log.exception(u'Theme file does not contain XML data %s' %
|
||||||
filename)
|
filename)
|
||||||
except (IOError, NameError):
|
|
||||||
critical_error_message_box(
|
|
||||||
translate('OpenLP.ThemeManager', 'Validation Error'),
|
|
||||||
translate('OpenLP.ThemeManager',
|
|
||||||
'File is not a valid theme.'))
|
|
||||||
log.exception(u'Importing theme from zip failed %s' % filename)
|
|
||||||
finally:
|
|
||||||
if zip:
|
|
||||||
zip.close()
|
|
||||||
if outfile:
|
|
||||||
outfile.close()
|
|
||||||
|
|
||||||
def checkIfThemeExists(self, themeName):
|
def checkIfThemeExists(self, themeName):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -26,7 +26,8 @@
|
||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import SettingsTab, Receiver, ThemeLevel, translate
|
from openlp.core.lib import SettingsTab, Receiver, translate
|
||||||
|
from openlp.core.lib.theme import ThemeLevel
|
||||||
from openlp.core.lib.ui import UiStrings
|
from openlp.core.lib.ui import UiStrings
|
||||||
|
|
||||||
class ThemesTab(SettingsTab):
|
class ThemesTab(SettingsTab):
|
||||||
|
@ -199,7 +200,7 @@ class ThemesTab(SettingsTab):
|
||||||
"""
|
"""
|
||||||
Utility method to update the global theme preview image.
|
Utility method to update the global theme preview image.
|
||||||
"""
|
"""
|
||||||
image = self.parent.ThemeManagerContents.getPreviewImage(
|
image = self.parent.themeManagerContents.getPreviewImage(
|
||||||
self.global_theme)
|
self.global_theme)
|
||||||
preview = QtGui.QPixmap(unicode(image))
|
preview = QtGui.QPixmap(unicode(image))
|
||||||
if not preview.isNull():
|
if not preview.isNull():
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -27,7 +27,9 @@
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import translate, build_icon
|
from openlp.core.lib import translate, build_icon
|
||||||
from openlp.core.lib.ui import add_welcome_page, create_valign_combo
|
from openlp.core.lib.theme import HorizontalType, BackgroundType, \
|
||||||
|
BackgroundGradientType
|
||||||
|
from openlp.core.lib.ui import UiStrings, add_welcome_page, create_valign_combo
|
||||||
|
|
||||||
class Ui_ThemeWizard(object):
|
class Ui_ThemeWizard(object):
|
||||||
def setupUi(self, themeWizard):
|
def setupUi(self, themeWizard):
|
||||||
|
@ -417,12 +419,12 @@ class Ui_ThemeWizard(object):
|
||||||
'according to the parameters below.'))
|
'according to the parameters below.'))
|
||||||
self.backgroundLabel.setText(
|
self.backgroundLabel.setText(
|
||||||
translate('OpenLP.ThemeWizard', 'Background type:'))
|
translate('OpenLP.ThemeWizard', 'Background type:'))
|
||||||
self.backgroundComboBox.setItemText(0,
|
self.backgroundComboBox.setItemText(BackgroundType.Solid,
|
||||||
translate('OpenLP.ThemeWizard', 'Solid Color'))
|
translate('OpenLP.ThemeWizard', 'Solid Color'))
|
||||||
self.backgroundComboBox.setItemText(1,
|
self.backgroundComboBox.setItemText(BackgroundType.Gradient,
|
||||||
translate('OpenLP.ThemeWizard', 'Gradient'))
|
translate('OpenLP.ThemeWizard', 'Gradient'))
|
||||||
self.backgroundComboBox.setItemText(2,
|
self.backgroundComboBox.setItemText(
|
||||||
translate('OpenLP.ThemeWizard', 'Image'))
|
BackgroundType.Image, UiStrings.Image)
|
||||||
self.colorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:'))
|
self.colorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:'))
|
||||||
self.gradientStartLabel.setText(
|
self.gradientStartLabel.setText(
|
||||||
translate(u'OpenLP.ThemeWizard', 'Starting color:'))
|
translate(u'OpenLP.ThemeWizard', 'Starting color:'))
|
||||||
|
@ -430,17 +432,17 @@ class Ui_ThemeWizard(object):
|
||||||
translate(u'OpenLP.ThemeWizard', 'Ending color:'))
|
translate(u'OpenLP.ThemeWizard', 'Ending color:'))
|
||||||
self.gradientTypeLabel.setText(
|
self.gradientTypeLabel.setText(
|
||||||
translate('OpenLP.ThemeWizard', 'Gradient:'))
|
translate('OpenLP.ThemeWizard', 'Gradient:'))
|
||||||
self.gradientComboBox.setItemText(0,
|
self.gradientComboBox.setItemText(BackgroundGradientType.Horizontal,
|
||||||
translate('OpenLP.ThemeWizard', 'Horizontal'))
|
translate('OpenLP.ThemeWizard', 'Horizontal'))
|
||||||
self.gradientComboBox.setItemText(1,
|
self.gradientComboBox.setItemText(BackgroundGradientType.Vertical,
|
||||||
translate('OpenLP.ThemeWizard', 'Vertical'))
|
translate('OpenLP.ThemeWizard', 'Vertical'))
|
||||||
self.gradientComboBox.setItemText(2,
|
self.gradientComboBox.setItemText(BackgroundGradientType.Circular,
|
||||||
translate('OpenLP.ThemeWizard', 'Circular'))
|
translate('OpenLP.ThemeWizard', 'Circular'))
|
||||||
self.gradientComboBox.setItemText(3,
|
self.gradientComboBox.setItemText(BackgroundGradientType.LeftTop,
|
||||||
translate('OpenLP.ThemeWizard', 'Top Left - Bottom Right'))
|
translate('OpenLP.ThemeWizard', 'Top Left - Bottom Right'))
|
||||||
self.gradientComboBox.setItemText(4,
|
self.gradientComboBox.setItemText(BackgroundGradientType.LeftBottom,
|
||||||
translate('OpenLP.ThemeWizard', 'Bottom Left - Top Right'))
|
translate('OpenLP.ThemeWizard', 'Bottom Left - Top Right'))
|
||||||
self.imageLabel.setText(translate('OpenLP.ThemeWizard', 'Image:'))
|
self.imageLabel.setText(u'%s:' % UiStrings.Image)
|
||||||
self.mainAreaPage.setTitle(
|
self.mainAreaPage.setTitle(
|
||||||
translate('OpenLP.ThemeWizard', 'Main Area Font Details'))
|
translate('OpenLP.ThemeWizard', 'Main Area Font Details'))
|
||||||
self.mainAreaPage.setSubTitle(
|
self.mainAreaPage.setSubTitle(
|
||||||
|
@ -449,17 +451,17 @@ class Ui_ThemeWizard(object):
|
||||||
self.mainFontLabel.setText(translate('OpenLP.ThemeWizard', 'Font:'))
|
self.mainFontLabel.setText(translate('OpenLP.ThemeWizard', 'Font:'))
|
||||||
self.mainColorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:'))
|
self.mainColorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:'))
|
||||||
self.mainSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:'))
|
self.mainSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:'))
|
||||||
self.mainSizeSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt'))
|
self.mainSizeSpinBox.setSuffix(UiStrings.FontSizePtUnit)
|
||||||
self.lineSpacingLabel.setText(
|
self.lineSpacingLabel.setText(
|
||||||
translate('OpenLP.ThemeWizard', 'Line Spacing:'))
|
translate('OpenLP.ThemeWizard', 'Line Spacing:'))
|
||||||
self.lineSpacingSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt'))
|
self.lineSpacingSpinBox.setSuffix(UiStrings.FontSizePtUnit)
|
||||||
self.outlineCheckBox.setText(
|
self.outlineCheckBox.setText(
|
||||||
translate('OpenLP.ThemeWizard', '&Outline:'))
|
translate('OpenLP.ThemeWizard', '&Outline:'))
|
||||||
self.outlineSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:'))
|
self.outlineSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:'))
|
||||||
self.outlineSizeSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt'))
|
self.outlineSizeSpinBox.setSuffix(UiStrings.FontSizePtUnit)
|
||||||
self.shadowCheckBox.setText(translate('OpenLP.ThemeWizard', '&Shadow:'))
|
self.shadowCheckBox.setText(translate('OpenLP.ThemeWizard', '&Shadow:'))
|
||||||
self.shadowSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:'))
|
self.shadowSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:'))
|
||||||
self.shadowSizeSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt'))
|
self.shadowSizeSpinBox.setSuffix(UiStrings.FontSizePtUnit)
|
||||||
self.mainBoldCheckBox.setText(translate('OpenLP.ThemeWizard', 'Bold'))
|
self.mainBoldCheckBox.setText(translate('OpenLP.ThemeWizard', 'Bold'))
|
||||||
self.mainItalicsCheckBox.setText(
|
self.mainItalicsCheckBox.setText(
|
||||||
translate('OpenLP.ThemeWizard', 'Italic'))
|
translate('OpenLP.ThemeWizard', 'Italic'))
|
||||||
|
@ -471,7 +473,7 @@ class Ui_ThemeWizard(object):
|
||||||
self.footerFontLabel.setText(translate('OpenLP.ThemeWizard', 'Font:'))
|
self.footerFontLabel.setText(translate('OpenLP.ThemeWizard', 'Font:'))
|
||||||
self.footerColorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:'))
|
self.footerColorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:'))
|
||||||
self.footerSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:'))
|
self.footerSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:'))
|
||||||
self.footerSizeSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt'))
|
self.footerSizeSpinBox.setSuffix(UiStrings.FontSizePtUnit)
|
||||||
self.alignmentPage.setTitle(
|
self.alignmentPage.setTitle(
|
||||||
translate('OpenLP.ThemeWizard', 'Text Formatting Details'))
|
translate('OpenLP.ThemeWizard', 'Text Formatting Details'))
|
||||||
self.alignmentPage.setSubTitle(
|
self.alignmentPage.setSubTitle(
|
||||||
|
@ -479,11 +481,11 @@ class Ui_ThemeWizard(object):
|
||||||
'formatting information to be defined'))
|
'formatting information to be defined'))
|
||||||
self.horizontalLabel.setText(
|
self.horizontalLabel.setText(
|
||||||
translate('OpenLP.ThemeWizard', 'Horizontal Align:'))
|
translate('OpenLP.ThemeWizard', 'Horizontal Align:'))
|
||||||
self.horizontalComboBox.setItemText(0,
|
self.horizontalComboBox.setItemText(HorizontalType.Left,
|
||||||
translate('OpenLP.ThemeWizard', 'Left'))
|
translate('OpenLP.ThemeWizard', 'Left'))
|
||||||
self.horizontalComboBox.setItemText(1,
|
self.horizontalComboBox.setItemText(HorizontalType.Right,
|
||||||
translate('OpenLP.ThemeWizard', 'Right'))
|
translate('OpenLP.ThemeWizard', 'Right'))
|
||||||
self.horizontalComboBox.setItemText(2,
|
self.horizontalComboBox.setItemText(HorizontalType.Center,
|
||||||
translate('OpenLP.ThemeWizard', 'Center'))
|
translate('OpenLP.ThemeWizard', 'Center'))
|
||||||
self.transitionsLabel.setText(
|
self.transitionsLabel.setText(
|
||||||
translate('OpenLP.ThemeWizard', 'Transitions:'))
|
translate('OpenLP.ThemeWizard', 'Transitions:'))
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -31,11 +31,51 @@ import os
|
||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import build_icon, Receiver, SettingsManager
|
from openlp.core.lib import build_icon, Receiver, SettingsManager, translate
|
||||||
from openlp.core.lib.ui import UiStrings, add_welcome_page
|
from openlp.core.lib.ui import UiStrings, add_welcome_page
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
class WizardStrings(object):
|
||||||
|
"""
|
||||||
|
Provide standard strings for wizards to use.
|
||||||
|
"""
|
||||||
|
# Applications/Formats we import from or export to. These get used in
|
||||||
|
# multiple places but do not need translating unless you find evidence of
|
||||||
|
# the writers translating their own product name.
|
||||||
|
CCLI = u'CCLI/SongSelect'
|
||||||
|
CSV = u'CSV'
|
||||||
|
EW = u'EasyWorship'
|
||||||
|
ES = u'EasiSlides'
|
||||||
|
FP = u'Foilpresenter'
|
||||||
|
OL = u'OpenLyrics'
|
||||||
|
OS = u'OpenSong'
|
||||||
|
OSIS = u'OSIS'
|
||||||
|
SB = u'SongBeamer'
|
||||||
|
SoF = u'Songs of Fellowship'
|
||||||
|
SSP = u'SongShow Plus'
|
||||||
|
WoW = u'Words of Worship'
|
||||||
|
# These strings should need a good reason to be retranslated elsewhere.
|
||||||
|
FinishedImport = translate('OpenLP.Ui', 'Finished import.')
|
||||||
|
FormatLabel = translate('OpenLP.Ui', 'Format:')
|
||||||
|
HeaderStyle = u'<span style="font-size:14pt; font-weight:600;">%s</span>'
|
||||||
|
Importing = translate('OpenLP.Ui', 'Importing')
|
||||||
|
ImportingType = unicode(translate('OpenLP.Ui', 'Importing "%s"...'))
|
||||||
|
ImportSelect = translate('OpenLP.Ui', 'Select Import Source')
|
||||||
|
ImportSelectLong = unicode(translate('OpenLP.Ui',
|
||||||
|
'Select the import format and the location to import from.'))
|
||||||
|
NoSqlite = translate('OpenLP.Ui', 'The openlp.org 1.x importer has been '
|
||||||
|
'disabled due to a missing Python module. If you want to use this '
|
||||||
|
'importer, you will need to install the "python-sqlite" '
|
||||||
|
'module.')
|
||||||
|
OpenTypeFile = unicode(translate('OpenLP.Ui', 'Open %s File'))
|
||||||
|
PercentSymbolFormat = unicode(translate('OpenLP.Ui', '%p%'))
|
||||||
|
Ready = translate('OpenLP.Ui', 'Ready.')
|
||||||
|
StartingImport = translate('OpenLP.Ui', 'Starting import...')
|
||||||
|
YouSpecifyFile = unicode(translate('OpenLP.Ui', 'You need to specify at '
|
||||||
|
'least one %s file to import from.', 'A file type e.g. OpenSong'))
|
||||||
|
|
||||||
|
|
||||||
class OpenLPWizard(QtGui.QWizard):
|
class OpenLPWizard(QtGui.QWizard):
|
||||||
"""
|
"""
|
||||||
Generic OpenLP wizard to provide generic functionality and a unified look
|
Generic OpenLP wizard to provide generic functionality and a unified look
|
||||||
|
@ -43,6 +83,7 @@ class OpenLPWizard(QtGui.QWizard):
|
||||||
"""
|
"""
|
||||||
def __init__(self, parent, plugin, name, image):
|
def __init__(self, parent, plugin, name, image):
|
||||||
QtGui.QWizard.__init__(self, parent)
|
QtGui.QWizard.__init__(self, parent)
|
||||||
|
self.plugin = plugin
|
||||||
self.setObjectName(name)
|
self.setObjectName(name)
|
||||||
self.openIcon = build_icon(u':/general/general_open.png')
|
self.openIcon = build_icon(u':/general/general_open.png')
|
||||||
self.deleteIcon = build_icon(u':/general/general_delete.png')
|
self.deleteIcon = build_icon(u':/general/general_delete.png')
|
||||||
|
@ -50,7 +91,6 @@ class OpenLPWizard(QtGui.QWizard):
|
||||||
self.cancelButton = self.button(QtGui.QWizard.CancelButton)
|
self.cancelButton = self.button(QtGui.QWizard.CancelButton)
|
||||||
self.setupUi(image)
|
self.setupUi(image)
|
||||||
self.registerFields()
|
self.registerFields()
|
||||||
self.plugin = plugin
|
|
||||||
self.customInit()
|
self.customInit()
|
||||||
self.customSignals()
|
self.customSignals()
|
||||||
QtCore.QObject.connect(self, QtCore.SIGNAL(u'currentIdChanged(int)'),
|
QtCore.QObject.connect(self, QtCore.SIGNAL(u'currentIdChanged(int)'),
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -242,7 +242,7 @@ def add_actions(target, actions):
|
||||||
The menu or toolbar to add actions to.
|
The menu or toolbar to add actions to.
|
||||||
|
|
||||||
``actions``
|
``actions``
|
||||||
The actions to be added. An action consisting of the keyword 'None'
|
The actions to be added. An action consisting of the keyword 'None'
|
||||||
will result in a separator being inserted into the target.
|
will result in a separator being inserted into the target.
|
||||||
"""
|
"""
|
||||||
for action in actions:
|
for action in actions:
|
||||||
|
@ -318,7 +318,7 @@ def get_web_page(url, header=None, update_openlp=False):
|
||||||
Tells OpenLP to update itself if the page is successfully downloaded.
|
Tells OpenLP to update itself if the page is successfully downloaded.
|
||||||
Defaults to False.
|
Defaults to False.
|
||||||
"""
|
"""
|
||||||
# TODO: Add proxy usage. Get proxy info from OpenLP settings, add to a
|
# TODO: Add proxy usage. Get proxy info from OpenLP settings, add to a
|
||||||
# proxy_handler, build into an opener and install the opener into urllib2.
|
# proxy_handler, build into an opener and install the opener into urllib2.
|
||||||
# http://docs.python.org/library/urllib2.html
|
# http://docs.python.org/library/urllib2.html
|
||||||
if not url:
|
if not url:
|
||||||
|
@ -387,7 +387,7 @@ def get_uno_command():
|
||||||
if UNO_CONNECTION_TYPE == u'pipe':
|
if UNO_CONNECTION_TYPE == u'pipe':
|
||||||
CONNECTION = u'"-accept=pipe,name=openlp_pipe;urp;"'
|
CONNECTION = u'"-accept=pipe,name=openlp_pipe;urp;"'
|
||||||
else:
|
else:
|
||||||
CONNECTION = u'"-accept=socket,host=localhost,port=2002;urp;"'
|
CONNECTION = u'"-accept=socket,host=localhost,port=2002;urp;"'
|
||||||
return u'%s %s %s' % (COMMAND, OPTIONS, CONNECTION)
|
return u'%s %s %s' % (COMMAND, OPTIONS, CONNECTION)
|
||||||
|
|
||||||
def get_uno_instance(resolver):
|
def get_uno_instance(resolver):
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -100,12 +100,15 @@ class LanguageManager(object):
|
||||||
return language
|
return language
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def set_language(action):
|
def set_language(action, message=True):
|
||||||
"""
|
"""
|
||||||
Set the language to translate OpenLP into
|
Set the language to translate OpenLP into
|
||||||
|
|
||||||
``action``
|
``action``
|
||||||
The language menu option
|
The language menu option
|
||||||
|
|
||||||
|
``message``
|
||||||
|
Display the message option
|
||||||
"""
|
"""
|
||||||
language = u'en'
|
language = u'en'
|
||||||
if action:
|
if action:
|
||||||
|
@ -114,13 +117,16 @@ class LanguageManager(object):
|
||||||
language = u'%s' % qm_list[action_name]
|
language = u'%s' % qm_list[action_name]
|
||||||
if LanguageManager.auto_language:
|
if LanguageManager.auto_language:
|
||||||
language = u'[%s]' % language
|
language = u'[%s]' % language
|
||||||
QtCore.QSettings().setValue(
|
# This needs to be here for the setValue to work
|
||||||
|
settings = QtCore.QSettings(u'OpenLP', u'OpenLP')
|
||||||
|
settings.setValue(
|
||||||
u'general/language', QtCore.QVariant(language))
|
u'general/language', QtCore.QVariant(language))
|
||||||
log.info(u'Language file: \'%s\' written to conf file' % language)
|
log.info(u'Language file: \'%s\' written to conf file' % language)
|
||||||
QtGui.QMessageBox.information(None,
|
if message:
|
||||||
translate('OpenLP.LanguageManager', 'Language'),
|
QtGui.QMessageBox.information(None,
|
||||||
translate('OpenLP.LanguageManager',
|
translate('OpenLP.LanguageManager', 'Language'),
|
||||||
'Please restart OpenLP to use your new language setting.'))
|
translate('OpenLP.LanguageManager',
|
||||||
|
'Please restart OpenLP to use your new language setting.'))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def init_qm_list():
|
def init_qm_list():
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -25,4 +25,4 @@
|
||||||
###############################################################################
|
###############################################################################
|
||||||
"""
|
"""
|
||||||
The :mod:`plugins` module provides all the project produced plugins
|
The :mod:`plugins` module provides all the project produced plugins
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -26,4 +26,4 @@
|
||||||
"""
|
"""
|
||||||
The :mod:`alerts` module provides the Alerts plugin for producing impromptu
|
The :mod:`alerts` module provides the Alerts plugin for producing impromptu
|
||||||
on-screen announcements during a service.
|
on-screen announcements during a service.
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -24,4 +24,4 @@
|
||||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
from alertform import AlertForm
|
from alertform import AlertForm
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -163,7 +163,7 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog):
|
||||||
# We found '<>' in the alert text, but the ParameterEdit field is empty.
|
# We found '<>' in the alert text, but the ParameterEdit field is empty.
|
||||||
if text.find(u'<>') != -1 and not self.parameterEdit.text() and \
|
if text.find(u'<>') != -1 and not self.parameterEdit.text() and \
|
||||||
QtGui.QMessageBox.question(self,
|
QtGui.QMessageBox.question(self,
|
||||||
translate('AlertPlugin.AlertForm', 'No Parameter found'),
|
translate('AlertPlugin.AlertForm', 'No Parameter Found'),
|
||||||
translate('AlertPlugin.AlertForm', 'You have not entered a '
|
translate('AlertPlugin.AlertForm', 'You have not entered a '
|
||||||
'parameter to be replaced.\nDo you want to continue anyway?'),
|
'parameter to be replaced.\nDo you want to continue anyway?'),
|
||||||
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.No |
|
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.No |
|
||||||
|
@ -174,9 +174,9 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog):
|
||||||
# in the alert text.
|
# in the alert text.
|
||||||
elif text.find(u'<>') == -1 and self.parameterEdit.text() and \
|
elif text.find(u'<>') == -1 and self.parameterEdit.text() and \
|
||||||
QtGui.QMessageBox.question(self,
|
QtGui.QMessageBox.question(self,
|
||||||
translate('AlertPlugin.AlertForm', 'No Placeholder found'),
|
translate('AlertPlugin.AlertForm', 'No Placeholder Found'),
|
||||||
translate('AlertPlugin.AlertForm', 'The alert text does not'
|
translate('AlertPlugin.AlertForm', 'The alert text does not'
|
||||||
' contain \'<>\'.\nDo want to continue anyway?'),
|
' contain \'<>\'.\nDo you want to continue anyway?'),
|
||||||
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.No |
|
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.No |
|
||||||
QtGui.QMessageBox.Yes)) == QtGui.QMessageBox.No:
|
QtGui.QMessageBox.Yes)) == QtGui.QMessageBox.No:
|
||||||
self.parameterEdit.setFocus()
|
self.parameterEdit.setFocus()
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -25,4 +25,4 @@
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
from alertsmanager import AlertsManager
|
from alertsmanager import AlertsManager
|
||||||
from alertstab import AlertsTab
|
from alertstab import AlertsTab
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -109,12 +109,10 @@ class AlertsTab(SettingsTab):
|
||||||
translate('AlertsPlugin.AlertsTab', 'Background color:'))
|
translate('AlertsPlugin.AlertsTab', 'Background color:'))
|
||||||
self.FontSizeLabel.setText(
|
self.FontSizeLabel.setText(
|
||||||
translate('AlertsPlugin.AlertsTab', 'Font size:'))
|
translate('AlertsPlugin.AlertsTab', 'Font size:'))
|
||||||
self.FontSizeSpinBox.setSuffix(
|
self.FontSizeSpinBox.setSuffix(UiStrings.FontSizePtUnit)
|
||||||
translate('AlertsPlugin.AlertsTab', 'pt'))
|
|
||||||
self.TimeoutLabel.setText(
|
self.TimeoutLabel.setText(
|
||||||
translate('AlertsPlugin.AlertsTab', 'Alert timeout:'))
|
translate('AlertsPlugin.AlertsTab', 'Alert timeout:'))
|
||||||
self.TimeoutSpinBox.setSuffix(
|
self.TimeoutSpinBox.setSuffix(UiStrings.S)
|
||||||
translate('AlertsPlugin.AlertsTab', 's'))
|
|
||||||
self.PreviewGroupBox.setTitle(UiStrings.Preview)
|
self.PreviewGroupBox.setTitle(UiStrings.Preview)
|
||||||
self.FontPreview.setText(UiStrings.OLPV2)
|
self.FontPreview.setText(UiStrings.OLPV2)
|
||||||
|
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -55,4 +55,4 @@ def init_schema(url):
|
||||||
mapper(AlertItem, alerts_table)
|
mapper(AlertItem, alerts_table)
|
||||||
|
|
||||||
metadata.create_all(checkfirst=True)
|
metadata.create_all(checkfirst=True)
|
||||||
return session
|
return session
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -26,4 +26,4 @@
|
||||||
"""
|
"""
|
||||||
The :mod:`bibles` module provides the Bible plugin to enable OpenLP to display
|
The :mod:`bibles` module provides the Bible plugin to enable OpenLP to display
|
||||||
scripture.
|
scripture.
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -53,4 +53,4 @@ from the .ui files later if necessary.
|
||||||
|
|
||||||
from bibleimportform import BibleImportForm
|
from bibleimportform import BibleImportForm
|
||||||
|
|
||||||
__all__ = ['BibleImportForm']
|
__all__ = ['BibleImportForm']
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -35,8 +35,8 @@ from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import Receiver, translate
|
from openlp.core.lib import Receiver, translate
|
||||||
from openlp.core.lib.db import delete_database
|
from openlp.core.lib.db import delete_database
|
||||||
from openlp.core.lib.ui import critical_error_message_box
|
from openlp.core.lib.ui import UiStrings, critical_error_message_box
|
||||||
from openlp.core.ui.wizard import OpenLPWizard
|
from openlp.core.ui.wizard import OpenLPWizard, WizardStrings
|
||||||
from openlp.core.utils import AppLocation, string_is_unicode
|
from openlp.core.utils import AppLocation, string_is_unicode
|
||||||
from openlp.plugins.bibles.lib.manager import BibleFormat
|
from openlp.plugins.bibles.lib.manager import BibleFormat
|
||||||
|
|
||||||
|
@ -51,18 +51,7 @@ class WebDownload(object):
|
||||||
BibleGateway = 1
|
BibleGateway = 1
|
||||||
Bibleserver = 2
|
Bibleserver = 2
|
||||||
|
|
||||||
Names = {
|
Names = [u'Crosswalk', u'BibleGateway', u'Bibleserver']
|
||||||
0: u'Crosswalk',
|
|
||||||
1: u'BibleGateway',
|
|
||||||
2: u'Bibleserver'
|
|
||||||
}
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def get_name(cls, name):
|
|
||||||
"""
|
|
||||||
Get the web bible type name.
|
|
||||||
"""
|
|
||||||
return cls.Names[name]
|
|
||||||
|
|
||||||
|
|
||||||
class BibleImportForm(OpenLPWizard):
|
class BibleImportForm(OpenLPWizard):
|
||||||
|
@ -363,32 +352,22 @@ class BibleImportForm(OpenLPWizard):
|
||||||
"""
|
"""
|
||||||
self.setWindowTitle(
|
self.setWindowTitle(
|
||||||
translate('BiblesPlugin.ImportWizardForm', 'Bible Import Wizard'))
|
translate('BiblesPlugin.ImportWizardForm', 'Bible Import Wizard'))
|
||||||
self.titleLabel.setText(
|
self.titleLabel.setText(WizardStrings.HeaderStyle %
|
||||||
u'<span style="font-size:14pt; font-weight:600;">%s</span>' % \
|
translate('OpenLP.Ui', 'Welcome to the Bible Import Wizard'))
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
|
||||||
'Welcome to the Bible Import Wizard'))
|
|
||||||
self.informationLabel.setText(
|
self.informationLabel.setText(
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
translate('BiblesPlugin.ImportWizardForm',
|
||||||
'This wizard will help you to import Bibles from a '
|
'This wizard will help you to import Bibles from a variety of '
|
||||||
'variety of formats. Click the next button below to start the '
|
'formats. Click the next button below to start the process by '
|
||||||
'process by selecting a format to import from.'))
|
'selecting a format to import from.'))
|
||||||
self.selectPage.setTitle(translate('BiblesPlugin.ImportWizardForm',
|
self.selectPage.setTitle(WizardStrings.ImportSelect)
|
||||||
'Select Import Source'))
|
self.selectPage.setSubTitle(WizardStrings.ImportSelectLong)
|
||||||
self.selectPage.setSubTitle(
|
self.formatLabel.setText(WizardStrings.FormatLabel)
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
self.formatComboBox.setItemText(BibleFormat.OSIS, WizardStrings.OSIS)
|
||||||
'Select the import format, and where to import from.'))
|
self.formatComboBox.setItemText(BibleFormat.CSV, WizardStrings.CSV)
|
||||||
self.formatLabel.setText(
|
self.formatComboBox.setItemText(BibleFormat.OpenSong, WizardStrings.OS)
|
||||||
translate('BiblesPlugin.ImportWizardForm', 'Format:'))
|
self.formatComboBox.setItemText(BibleFormat.WebDownload,
|
||||||
self.formatComboBox.setItemText(0,
|
|
||||||
translate('BiblesPlugin.ImportWizardForm', 'OSIS'))
|
|
||||||
self.formatComboBox.setItemText(1,
|
|
||||||
translate('BiblesPlugin.ImportWizardForm', 'CSV'))
|
|
||||||
self.formatComboBox.setItemText(2,
|
|
||||||
translate('BiblesPlugin.ImportWizardForm', 'OpenSong'))
|
|
||||||
self.formatComboBox.setItemText(3,
|
|
||||||
translate('BiblesPlugin.ImportWizardForm', 'Web Download'))
|
translate('BiblesPlugin.ImportWizardForm', 'Web Download'))
|
||||||
self.formatComboBox.setItemText(4,
|
self.formatComboBox.setItemText(BibleFormat.OpenLP1, UiStrings.OLPV1)
|
||||||
translate('BiblesPlugin.ImportWizardForm', 'openlp.org 1.x'))
|
|
||||||
self.openlp1FileLabel.setText(
|
self.openlp1FileLabel.setText(
|
||||||
translate('BiblesPlugin.ImportWizardForm', 'Bible file:'))
|
translate('BiblesPlugin.ImportWizardForm', 'Bible file:'))
|
||||||
self.osisFileLabel.setText(
|
self.osisFileLabel.setText(
|
||||||
|
@ -403,11 +382,11 @@ class BibleImportForm(OpenLPWizard):
|
||||||
translate('BiblesPlugin.ImportWizardForm', 'Bible file:'))
|
translate('BiblesPlugin.ImportWizardForm', 'Bible file:'))
|
||||||
self.webSourceLabel.setText(
|
self.webSourceLabel.setText(
|
||||||
translate('BiblesPlugin.ImportWizardForm', 'Location:'))
|
translate('BiblesPlugin.ImportWizardForm', 'Location:'))
|
||||||
self.webSourceComboBox.setItemText(0,
|
self.webSourceComboBox.setItemText(WebDownload.Crosswalk,
|
||||||
translate('BiblesPlugin.ImportWizardForm', 'Crosswalk'))
|
translate('BiblesPlugin.ImportWizardForm', 'Crosswalk'))
|
||||||
self.webSourceComboBox.setItemText(1,
|
self.webSourceComboBox.setItemText(WebDownload.BibleGateway,
|
||||||
translate('BiblesPlugin.ImportWizardForm', 'BibleGateway'))
|
translate('BiblesPlugin.ImportWizardForm', 'BibleGateway'))
|
||||||
self.webSourceComboBox.setItemText(2,
|
self.webSourceComboBox.setItemText(WebDownload.Bibleserver,
|
||||||
translate('BiblesPlugin.ImportWizardForm', 'Bibleserver'))
|
translate('BiblesPlugin.ImportWizardForm', 'Bibleserver'))
|
||||||
self.webTranslationLabel.setText(
|
self.webTranslationLabel.setText(
|
||||||
translate('BiblesPlugin.ImportWizardForm', 'Bible:'))
|
translate('BiblesPlugin.ImportWizardForm', 'Bible:'))
|
||||||
|
@ -435,19 +414,13 @@ class BibleImportForm(OpenLPWizard):
|
||||||
translate('BiblesPlugin.ImportWizardForm', 'Copyright:'))
|
translate('BiblesPlugin.ImportWizardForm', 'Copyright:'))
|
||||||
self.permissionsLabel.setText(
|
self.permissionsLabel.setText(
|
||||||
translate('BiblesPlugin.ImportWizardForm', 'Permissions:'))
|
translate('BiblesPlugin.ImportWizardForm', 'Permissions:'))
|
||||||
self.progressPage.setTitle(
|
self.progressPage.setTitle(WizardStrings.Importing)
|
||||||
translate('BiblesPlugin.ImportWizardForm', 'Importing'))
|
|
||||||
self.progressPage.setSubTitle(
|
self.progressPage.setSubTitle(
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
translate('BiblesPlugin.ImportWizardForm',
|
||||||
'Please wait while your Bible is imported.'))
|
'Please wait while your Bible is imported.'))
|
||||||
self.progressLabel.setText(
|
self.progressLabel.setText(WizardStrings.Ready)
|
||||||
translate('BiblesPlugin.ImportWizardForm', 'Ready.'))
|
|
||||||
self.progressBar.setFormat(u'%p%')
|
self.progressBar.setFormat(u'%p%')
|
||||||
self.openlp1DisabledLabel.setText(
|
self.openlp1DisabledLabel.setText(WizardStrings.NoSqlite)
|
||||||
translate('BiblesPlugin.ImportWizardForm', 'The openlp.org 1.x '
|
|
||||||
'importer has been disabled due to a missing Python module. If '
|
|
||||||
'you want to use this importer, you will need to install the '
|
|
||||||
'"python-sqlite" module.'))
|
|
||||||
# Align all QFormLayouts towards each other.
|
# Align all QFormLayouts towards each other.
|
||||||
labelWidth = max(self.formatLabel.minimumSizeHint().width(),
|
labelWidth = max(self.formatLabel.minimumSizeHint().width(),
|
||||||
self.osisFileLabel.minimumSizeHint().width(),
|
self.osisFileLabel.minimumSizeHint().width(),
|
||||||
|
@ -468,37 +441,28 @@ class BibleImportForm(OpenLPWizard):
|
||||||
elif self.currentPage() == self.selectPage:
|
elif self.currentPage() == self.selectPage:
|
||||||
if self.field(u'source_format').toInt()[0] == BibleFormat.OSIS:
|
if self.field(u'source_format').toInt()[0] == BibleFormat.OSIS:
|
||||||
if not self.field(u'osis_location').toString():
|
if not self.field(u'osis_location').toString():
|
||||||
critical_error_message_box(
|
critical_error_message_box(UiStrings.NFSs,
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
WizardStrings.YouSpecifyFile % WizardStrings.OSIS)
|
||||||
'Invalid Bible Location'),
|
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
|
||||||
'You need to specify a file to import your '
|
|
||||||
'Bible from.'))
|
|
||||||
self.osisFileEdit.setFocus()
|
self.osisFileEdit.setFocus()
|
||||||
return False
|
return False
|
||||||
elif self.field(u'source_format').toInt()[0] == BibleFormat.CSV:
|
elif self.field(u'source_format').toInt()[0] == BibleFormat.CSV:
|
||||||
if not self.field(u'csv_testamentsfile').toString():
|
if not self.field(u'csv_testamentsfile').toString():
|
||||||
answer = critical_error_message_box(translate(
|
answer = critical_error_message_box(UiStrings.NFSs,
|
||||||
'BiblesPlugin.ImportWizardForm', 'No Testaments File'),
|
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
translate('BiblesPlugin.ImportWizardForm',
|
||||||
'You have not specified a testaments file. Do you '
|
'You have not specified a testaments file. Do you '
|
||||||
'want to proceed with the import?'), question=True)
|
'want to proceed with the import?'), question=True)
|
||||||
if answer == QtGui.QMessageBox.No:
|
if answer == QtGui.QMessageBox.No:
|
||||||
self.csvTestamentsEdit.setFocus()
|
self.csvTestamentsEdit.setFocus()
|
||||||
return False
|
return False
|
||||||
elif not self.field(u'csv_booksfile').toString():
|
if not self.field(u'csv_booksfile').toString():
|
||||||
critical_error_message_box(
|
critical_error_message_box(UiStrings.NFSs,
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
|
||||||
'Invalid Books File'),
|
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
translate('BiblesPlugin.ImportWizardForm',
|
||||||
'You need to specify a file with books of '
|
'You need to specify a file with books of '
|
||||||
'the Bible to use in the import.'))
|
'the Bible to use in the import.'))
|
||||||
self.csvBooksEdit.setFocus()
|
self.csvBooksEdit.setFocus()
|
||||||
return False
|
return False
|
||||||
elif not self.field(u'csv_versefile').toString():
|
elif not self.field(u'csv_versefile').toString():
|
||||||
critical_error_message_box(
|
critical_error_message_box(UiStrings.NFSs,
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
|
||||||
'Invalid Verse File'),
|
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
translate('BiblesPlugin.ImportWizardForm',
|
||||||
'You need to specify a file of Bible '
|
'You need to specify a file of Bible '
|
||||||
'verses to import.'))
|
'verses to import.'))
|
||||||
|
@ -507,22 +471,14 @@ class BibleImportForm(OpenLPWizard):
|
||||||
elif self.field(u'source_format').toInt()[0] == \
|
elif self.field(u'source_format').toInt()[0] == \
|
||||||
BibleFormat.OpenSong:
|
BibleFormat.OpenSong:
|
||||||
if not self.field(u'opensong_file').toString():
|
if not self.field(u'opensong_file').toString():
|
||||||
critical_error_message_box(
|
critical_error_message_box(UiStrings.NFSs,
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
WizardStrings.YouSpecifyFile % WizardStrings.OS)
|
||||||
'Invalid OpenSong Bible'),
|
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
|
||||||
'You need to specify an OpenSong Bible '
|
|
||||||
'file to import.'))
|
|
||||||
self.openSongFileEdit.setFocus()
|
self.openSongFileEdit.setFocus()
|
||||||
return False
|
return False
|
||||||
elif self.field(u'source_format').toInt()[0] == BibleFormat.OpenLP1:
|
elif self.field(u'source_format').toInt()[0] == BibleFormat.OpenLP1:
|
||||||
if not self.field(u'openlp1_location').toString():
|
if not self.field(u'openlp1_location').toString():
|
||||||
critical_error_message_box(
|
critical_error_message_box(UiStrings.NFSs,
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
WizardStrings.YouSpecifyFile % UiStrings.OLPV1)
|
||||||
'Invalid Bible Location'),
|
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
|
||||||
'You need to specify a file to import your '
|
|
||||||
'Bible from.'))
|
|
||||||
self.openlp1FileEdit.setFocus()
|
self.openlp1FileEdit.setFocus()
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
@ -531,17 +487,13 @@ class BibleImportForm(OpenLPWizard):
|
||||||
license_copyright = \
|
license_copyright = \
|
||||||
unicode(self.field(u'license_copyright').toString())
|
unicode(self.field(u'license_copyright').toString())
|
||||||
if not license_version:
|
if not license_version:
|
||||||
critical_error_message_box(
|
critical_error_message_box(UiStrings.EmptyField,
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
|
||||||
'Empty Version Name'),
|
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
translate('BiblesPlugin.ImportWizardForm',
|
||||||
'You need to specify a version name for your Bible.'))
|
'You need to specify a version name for your Bible.'))
|
||||||
self.versionNameEdit.setFocus()
|
self.versionNameEdit.setFocus()
|
||||||
return False
|
return False
|
||||||
elif not license_copyright:
|
elif not license_copyright:
|
||||||
critical_error_message_box(
|
critical_error_message_box(UiStrings.EmptyField,
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
|
||||||
'Empty Copyright'),
|
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
translate('BiblesPlugin.ImportWizardForm',
|
||||||
'You need to set a copyright for your Bible. '
|
'You need to set a copyright for your Bible. '
|
||||||
'Bibles in the Public Domain need to be marked as such.'))
|
'Bibles in the Public Domain need to be marked as such.'))
|
||||||
|
@ -576,24 +528,22 @@ class BibleImportForm(OpenLPWizard):
|
||||||
"""
|
"""
|
||||||
Show the file open dialog for the OSIS file.
|
Show the file open dialog for the OSIS file.
|
||||||
"""
|
"""
|
||||||
self.getFileName(
|
self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.OSIS,
|
||||||
translate('BiblesPlugin.ImportWizardForm', 'Open OSIS File'),
|
|
||||||
self.osisFileEdit)
|
self.osisFileEdit)
|
||||||
|
|
||||||
def onCsvTestamentsBrowseButtonClicked(self):
|
def onCsvTestamentsBrowseButtonClicked(self):
|
||||||
"""
|
"""
|
||||||
Show the file open dialog for the testaments CSV file.
|
Show the file open dialog for the testaments CSV file.
|
||||||
"""
|
"""
|
||||||
self.getFileName(translate('BiblesPlugin.ImportWizardForm',
|
self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.CSV,
|
||||||
'Open Testaments CSV File'), self.csvTestamentsEdit, u'%s (*.csv)'
|
self.csvTestamentsEdit, u'%s (*.csv)'
|
||||||
% translate('BiblesPlugin.ImportWizardForm', 'CSV File'))
|
% translate('BiblesPlugin.ImportWizardForm', 'CSV File'))
|
||||||
|
|
||||||
def onCsvBooksBrowseButtonClicked(self):
|
def onCsvBooksBrowseButtonClicked(self):
|
||||||
"""
|
"""
|
||||||
Show the file open dialog for the books CSV file.
|
Show the file open dialog for the books CSV file.
|
||||||
"""
|
"""
|
||||||
self.getFileName(
|
self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.CSV,
|
||||||
translate('BiblesPlugin.ImportWizardForm', 'Open Books CSV File'),
|
|
||||||
self.csvBooksEdit, u'%s (*.csv)'
|
self.csvBooksEdit, u'%s (*.csv)'
|
||||||
% translate('BiblesPlugin.ImportWizardForm', 'CSV File'))
|
% translate('BiblesPlugin.ImportWizardForm', 'CSV File'))
|
||||||
|
|
||||||
|
@ -601,27 +551,25 @@ class BibleImportForm(OpenLPWizard):
|
||||||
"""
|
"""
|
||||||
Show the file open dialog for the verses CSV file.
|
Show the file open dialog for the verses CSV file.
|
||||||
"""
|
"""
|
||||||
self.getFileName(translate('BiblesPlugin.ImportWizardForm',
|
self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.CSV,
|
||||||
'Open Verses CSV File'), self.csvVersesEdit, u'%s (*.csv)'
|
self.csvVersesEdit, u'%s (*.csv)'
|
||||||
% translate('BiblesPlugin.ImportWizardForm', 'CSV File'))
|
% translate('BiblesPlugin.ImportWizardForm', 'CSV File'))
|
||||||
|
|
||||||
def onOpenSongBrowseButtonClicked(self):
|
def onOpenSongBrowseButtonClicked(self):
|
||||||
"""
|
"""
|
||||||
Show the file open dialog for the OpenSong file.
|
Show the file open dialog for the OpenSong file.
|
||||||
"""
|
"""
|
||||||
self.getFileName(
|
self.getFileName(WizardStrings.OpenTypeFile % WizardStrings.OS,
|
||||||
translate('BiblesPlugin.ImportWizardForm', 'Open OpenSong Bible'),
|
|
||||||
self.openSongFileEdit)
|
self.openSongFileEdit)
|
||||||
|
|
||||||
def onOpenlp1BrowseButtonClicked(self):
|
def onOpenlp1BrowseButtonClicked(self):
|
||||||
"""
|
"""
|
||||||
Show the file open dialog for the openlp.org 1.x file.
|
Show the file open dialog for the openlp.org 1.x file.
|
||||||
"""
|
"""
|
||||||
self.getFileName(
|
self.getFileName(WizardStrings.OpenTypeFile % UiStrings.OLPV1,
|
||||||
|
self.openlp1FileEdit, u'%s (*.bible)' %
|
||||||
translate('BiblesPlugin.ImportWizardForm',
|
translate('BiblesPlugin.ImportWizardForm',
|
||||||
'Open openlp.org 1.x Bible'), self.openlp1FileEdit,
|
'openlp.org 1.x Bible Files'))
|
||||||
u'%s (*.bible)' % translate('BiblesPlugin.ImportWizardForm',
|
|
||||||
'openlp.org 1.x bible'))
|
|
||||||
|
|
||||||
def registerFields(self):
|
def registerFields(self):
|
||||||
"""
|
"""
|
||||||
|
@ -722,7 +670,7 @@ class BibleImportForm(OpenLPWizard):
|
||||||
self.web_bible_list[download_type][ver] = name.strip()
|
self.web_bible_list[download_type][ver] = name.strip()
|
||||||
except IOError:
|
except IOError:
|
||||||
log.exception(u'%s resources missing' %
|
log.exception(u'%s resources missing' %
|
||||||
WebDownload.get_name(download_type))
|
WebDownload.Names[download_type])
|
||||||
finally:
|
finally:
|
||||||
if books_file:
|
if books_file:
|
||||||
books_file.close()
|
books_file.close()
|
||||||
|
@ -738,8 +686,7 @@ class BibleImportForm(OpenLPWizard):
|
||||||
'BiblesPlugin.ImportWizardForm',
|
'BiblesPlugin.ImportWizardForm',
|
||||||
'Starting Registering bible...'))
|
'Starting Registering bible...'))
|
||||||
else:
|
else:
|
||||||
self.progressLabel.setText(translate(
|
self.progressLabel.setText(WizardStrings.StartingImport)
|
||||||
'BiblesPlugin.ImportWizardForm', 'Starting import...'))
|
|
||||||
Receiver.send_message(u'openlp_process_events')
|
Receiver.send_message(u'openlp_process_events')
|
||||||
|
|
||||||
def performWizard(self):
|
def performWizard(self):
|
||||||
|
@ -777,18 +724,10 @@ class BibleImportForm(OpenLPWizard):
|
||||||
self.progressBar.setMaximum(1)
|
self.progressBar.setMaximum(1)
|
||||||
download_location = self.field(u'web_location').toInt()[0]
|
download_location = self.field(u'web_location').toInt()[0]
|
||||||
bible_version = unicode(self.webTranslationComboBox.currentText())
|
bible_version = unicode(self.webTranslationComboBox.currentText())
|
||||||
if download_location == WebDownload.Crosswalk:
|
bible = self.web_bible_list[download_location][bible_version]
|
||||||
bible = \
|
|
||||||
self.web_bible_list[WebDownload.Crosswalk][bible_version]
|
|
||||||
elif download_location == WebDownload.BibleGateway:
|
|
||||||
bible = \
|
|
||||||
self.web_bible_list[WebDownload.BibleGateway][bible_version]
|
|
||||||
elif download_location == WebDownload.Bibleserver:
|
|
||||||
bible = \
|
|
||||||
self.web_bible_list[WebDownload.Bibleserver][bible_version]
|
|
||||||
importer = self.manager.import_bible(
|
importer = self.manager.import_bible(
|
||||||
BibleFormat.WebDownload, name=license_version,
|
BibleFormat.WebDownload, name=license_version,
|
||||||
download_source=WebDownload.get_name(download_location),
|
download_source=WebDownload.Names[download_location],
|
||||||
download_name=bible,
|
download_name=bible,
|
||||||
proxy_server=unicode(self.field(u'proxy_server').toString()),
|
proxy_server=unicode(self.field(u'proxy_server').toString()),
|
||||||
proxy_username=\
|
proxy_username=\
|
||||||
|
@ -811,9 +750,9 @@ class BibleImportForm(OpenLPWizard):
|
||||||
'bible. Please note, that verses will be downloaded on\n'
|
'bible. Please note, that verses will be downloaded on\n'
|
||||||
'demand and thus an internet connection is required.'))
|
'demand and thus an internet connection is required.'))
|
||||||
else:
|
else:
|
||||||
self.progressLabel.setText(translate(
|
self.progressLabel.setText(WizardStrings.FinishedImport)
|
||||||
'BiblesPlugin.ImportWizardForm', 'Finished import.'))
|
|
||||||
else:
|
else:
|
||||||
self.progressLabel.setText(translate(
|
self.progressLabel.setText(translate(
|
||||||
'BiblesPlugin.ImportWizardForm', 'Your Bible import failed.'))
|
'BiblesPlugin.ImportWizardForm', 'Your Bible import failed.'))
|
||||||
|
del self.manager.db_cache[importer.name]
|
||||||
delete_database(self.plugin.settingsSection, importer.file)
|
delete_database(self.plugin.settingsSection, importer.file)
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -32,6 +32,25 @@ import re
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
class LayoutStyle(object):
|
||||||
|
"""
|
||||||
|
An enumeration for bible screen layout styles.
|
||||||
|
"""
|
||||||
|
VersePerSlide = 0
|
||||||
|
VersePerLine = 1
|
||||||
|
Continuous = 2
|
||||||
|
|
||||||
|
|
||||||
|
class DisplayStyle(object):
|
||||||
|
"""
|
||||||
|
An enumeration for bible text bracket display styles.
|
||||||
|
"""
|
||||||
|
NoBrackets = 0
|
||||||
|
Round = 1
|
||||||
|
Curly = 2
|
||||||
|
Square = 3
|
||||||
|
|
||||||
|
|
||||||
def get_reference_match(match_type):
|
def get_reference_match(match_type):
|
||||||
"""
|
"""
|
||||||
Provides the regexes and matches to use while parsing strings for bible
|
Provides the regexes and matches to use while parsing strings for bible
|
||||||
|
@ -81,37 +100,37 @@ def parse_reference(reference):
|
||||||
this::
|
this::
|
||||||
|
|
||||||
(book, chapter, from_verse, to_verse)
|
(book, chapter, from_verse, to_verse)
|
||||||
|
|
||||||
For example::
|
For example::
|
||||||
|
|
||||||
[(u'John', 3, 16, 18), (u'John', 4, 1, 1)]
|
[(u'John', 3, 16, 18), (u'John', 4, 1, 1)]
|
||||||
|
|
||||||
**Reference string details:**
|
**Reference string details:**
|
||||||
|
|
||||||
Each reference starts with the book name and a chapter number. These are
|
Each reference starts with the book name and a chapter number. These are
|
||||||
both mandatory.
|
both mandatory.
|
||||||
|
|
||||||
* ``John 3`` refers to Gospel of John chapter 3
|
* ``John 3`` refers to Gospel of John chapter 3
|
||||||
|
|
||||||
A reference range can be given after a range separator.
|
A reference range can be given after a range separator.
|
||||||
|
|
||||||
* ``John 3-5`` refers to John chapters 3 to 5
|
* ``John 3-5`` refers to John chapters 3 to 5
|
||||||
|
|
||||||
Single verses can be addressed after a verse separator.
|
Single verses can be addressed after a verse separator.
|
||||||
|
|
||||||
* ``John 3:16`` refers to John chapter 3 verse 16
|
* ``John 3:16`` refers to John chapter 3 verse 16
|
||||||
* ``John 3:16-4:3`` refers to John chapter 3 verse 16 to chapter 4 verse 3
|
* ``John 3:16-4:3`` refers to John chapter 3 verse 16 to chapter 4 verse 3
|
||||||
|
|
||||||
After a verse reference all further single values are treat as verse in
|
After a verse reference all further single values are treat as verse in
|
||||||
the last selected chapter.
|
the last selected chapter.
|
||||||
|
|
||||||
* ``John 3:16-18`` refers to John chapter 3 verses 16 to 18
|
* ``John 3:16-18`` refers to John chapter 3 verses 16 to 18
|
||||||
|
|
||||||
After a list separator it is possible to refer to additional verses. They
|
After a list separator it is possible to refer to additional verses. They
|
||||||
are build analog to the first ones. This way it is possible to define each
|
are build analog to the first ones. This way it is possible to define each
|
||||||
number of verse references. It is not possible to refer to verses in
|
number of verse references. It is not possible to refer to verses in
|
||||||
additional books.
|
additional books.
|
||||||
|
|
||||||
* ``John 3:16,18`` refers to John chapter 3 verses 16 and 18
|
* ``John 3:16,18`` refers to John chapter 3 verses 16 and 18
|
||||||
* ``John 3:16-18,20`` refers to John chapter 3 verses 16 to 18 and 20
|
* ``John 3:16-18,20`` refers to John chapter 3 verses 16 to 18 and 20
|
||||||
* ``John 3:16-18,4:1`` refers to John chapter 3 verses 16 to 18 and
|
* ``John 3:16-18,4:1`` refers to John chapter 3 verses 16 to 18 and
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -29,6 +29,7 @@ import logging
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import Receiver, SettingsTab, translate
|
from openlp.core.lib import Receiver, SettingsTab, translate
|
||||||
|
from openlp.plugins.bibles.lib import LayoutStyle, DisplayStyle
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -122,19 +123,19 @@ class BiblesTab(SettingsTab):
|
||||||
translate('BiblesPlugin.BiblesTab', 'Display style:'))
|
translate('BiblesPlugin.BiblesTab', 'Display style:'))
|
||||||
self.BibleThemeLabel.setText(
|
self.BibleThemeLabel.setText(
|
||||||
translate('BiblesPlugin.BiblesTab', 'Bible theme:'))
|
translate('BiblesPlugin.BiblesTab', 'Bible theme:'))
|
||||||
self.LayoutStyleComboBox.setItemText(0,
|
self.LayoutStyleComboBox.setItemText(LayoutStyle.VersePerSlide,
|
||||||
translate('BiblesPlugin.BiblesTab', 'Verse Per Slide'))
|
translate('BiblesPlugin.BiblesTab', 'Verse Per Slide'))
|
||||||
self.LayoutStyleComboBox.setItemText(1,
|
self.LayoutStyleComboBox.setItemText(LayoutStyle.VersePerLine,
|
||||||
translate('BiblesPlugin.BiblesTab', 'Verse Per Line'))
|
translate('BiblesPlugin.BiblesTab', 'Verse Per Line'))
|
||||||
self.LayoutStyleComboBox.setItemText(2,
|
self.LayoutStyleComboBox.setItemText(LayoutStyle.Continuous,
|
||||||
translate('BiblesPlugin.BiblesTab', 'Continuous'))
|
translate('BiblesPlugin.BiblesTab', 'Continuous'))
|
||||||
self.DisplayStyleComboBox.setItemText(0,
|
self.DisplayStyleComboBox.setItemText(DisplayStyle.NoBrackets,
|
||||||
translate('BiblesPlugin.BiblesTab', 'No Brackets'))
|
translate('BiblesPlugin.BiblesTab', 'No Brackets'))
|
||||||
self.DisplayStyleComboBox.setItemText(1,
|
self.DisplayStyleComboBox.setItemText(DisplayStyle.Round,
|
||||||
translate('BiblesPlugin.BiblesTab', '( And )'))
|
translate('BiblesPlugin.BiblesTab', '( And )'))
|
||||||
self.DisplayStyleComboBox.setItemText(2,
|
self.DisplayStyleComboBox.setItemText(DisplayStyle.Curly,
|
||||||
translate('BiblesPlugin.BiblesTab', '{ And }'))
|
translate('BiblesPlugin.BiblesTab', '{ And }'))
|
||||||
self.DisplayStyleComboBox.setItemText(3,
|
self.DisplayStyleComboBox.setItemText(DisplayStyle.Square,
|
||||||
translate('BiblesPlugin.BiblesTab', '[ And ]'))
|
translate('BiblesPlugin.BiblesTab', '[ And ]'))
|
||||||
self.ChangeNoteLabel.setText(translate('BiblesPlugin.BiblesTab',
|
self.ChangeNoteLabel.setText(translate('BiblesPlugin.BiblesTab',
|
||||||
'Note:\nChanges do not affect verses already in the service.'))
|
'Note:\nChanges do not affect verses already in the service.'))
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -69,8 +69,6 @@ import logging
|
||||||
import chardet
|
import chardet
|
||||||
import csv
|
import csv
|
||||||
|
|
||||||
from PyQt4 import QtCore
|
|
||||||
|
|
||||||
from openlp.core.lib import Receiver, translate
|
from openlp.core.lib import Receiver, translate
|
||||||
from openlp.plugins.bibles.lib.db import BibleDB, Testament
|
from openlp.plugins.bibles.lib.db import BibleDB, Testament
|
||||||
|
|
||||||
|
@ -94,8 +92,6 @@ class CSVBible(BibleDB):
|
||||||
self.testamentsfile = None
|
self.testamentsfile = None
|
||||||
self.booksfile = kwargs[u'booksfile']
|
self.booksfile = kwargs[u'booksfile']
|
||||||
self.versesfile = kwargs[u'versefile']
|
self.versesfile = kwargs[u'versefile']
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
|
||||||
QtCore.SIGNAL(u'openlp_stop_wizard'), self.stop_import)
|
|
||||||
|
|
||||||
def setup_testaments(self):
|
def setup_testaments(self):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -33,7 +33,7 @@ from sqlalchemy import Column, ForeignKey, or_, Table, types
|
||||||
from sqlalchemy.orm import class_mapper, mapper, relation
|
from sqlalchemy.orm import class_mapper, mapper, relation
|
||||||
from sqlalchemy.orm.exc import UnmappedClassError
|
from sqlalchemy.orm.exc import UnmappedClassError
|
||||||
|
|
||||||
from openlp.core.lib import translate
|
from openlp.core.lib import Receiver, translate
|
||||||
from openlp.core.lib.db import BaseModel, init_db, Manager
|
from openlp.core.lib.db import BaseModel, init_db, Manager
|
||||||
from openlp.core.lib.ui import critical_error_message_box
|
from openlp.core.lib.ui import critical_error_message_box
|
||||||
|
|
||||||
|
@ -162,6 +162,8 @@ class BibleDB(QtCore.QObject, Manager):
|
||||||
if u'file' in kwargs:
|
if u'file' in kwargs:
|
||||||
self.get_name()
|
self.get_name()
|
||||||
self.wizard = None
|
self.wizard = None
|
||||||
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
|
QtCore.SIGNAL(u'openlp_stop_wizard'), self.stop_import)
|
||||||
|
|
||||||
def stop_import(self):
|
def stop_import(self):
|
||||||
"""
|
"""
|
||||||
|
@ -320,7 +322,7 @@ class BibleDB(QtCore.QObject, Manager):
|
||||||
def get_books(self):
|
def get_books(self):
|
||||||
"""
|
"""
|
||||||
A wrapper so both local and web bibles have a get_books() method that
|
A wrapper so both local and web bibles have a get_books() method that
|
||||||
manager can call. Used in the media manager advanced search tab.
|
manager can call. Used in the media manager advanced search tab.
|
||||||
"""
|
"""
|
||||||
return self.get_all_objects(Book, order_by_ref=Book.id)
|
return self.get_all_objects(Book, order_by_ref=Book.id)
|
||||||
|
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -35,7 +35,7 @@ import socket
|
||||||
import urllib
|
import urllib
|
||||||
from HTMLParser import HTMLParseError
|
from HTMLParser import HTMLParseError
|
||||||
|
|
||||||
from BeautifulSoup import BeautifulSoup, NavigableString
|
from BeautifulSoup import BeautifulSoup, NavigableString, Tag
|
||||||
|
|
||||||
from openlp.core.lib import Receiver, translate
|
from openlp.core.lib import Receiver, translate
|
||||||
from openlp.core.lib.ui import critical_error_message_box
|
from openlp.core.lib.ui import critical_error_message_box
|
||||||
|
@ -221,24 +221,42 @@ class BGExtract(object):
|
||||||
crossrefs = soup.findAll(u'sup', u'xref')
|
crossrefs = soup.findAll(u'sup', u'xref')
|
||||||
if crossrefs:
|
if crossrefs:
|
||||||
[crossref.extract() for crossref in crossrefs]
|
[crossref.extract() for crossref in crossrefs]
|
||||||
|
headings = soup.findAll(u'h5')
|
||||||
|
if headings:
|
||||||
|
[heading.extract() for heading in headings]
|
||||||
cleanup = [(re.compile('\s+'), lambda match: ' ')]
|
cleanup = [(re.compile('\s+'), lambda match: ' ')]
|
||||||
verses = BeautifulSoup(str(soup), markupMassage=cleanup)
|
verses = BeautifulSoup(str(soup), markupMassage=cleanup)
|
||||||
content = verses.find(u'div', u'result-text-style-normal')
|
verse_list = {}
|
||||||
if not content:
|
for verse in verses(u'sup', u'versenum'):
|
||||||
content = verses.find(u'div', u'result-text-style-rtl-serif')
|
raw_verse_num = verse.next
|
||||||
if not content:
|
clean_verse_num = 0
|
||||||
|
# Not all verses exist in all translations and may or may not be
|
||||||
|
# represented by a verse number. If they are not fine, if they are
|
||||||
|
# it will probably be in a format that breaks int(). We will then
|
||||||
|
# have no idea what garbage may be sucked in to the verse text so
|
||||||
|
# if we do not get a clean int() then ignore the verse completely.
|
||||||
|
try:
|
||||||
|
clean_verse_num = int(str(raw_verse_num))
|
||||||
|
except ValueError:
|
||||||
|
log.exception(u'Illegal verse number in %s %s %s:%s',
|
||||||
|
version, bookname, chapter, unicode(raw_verse_num))
|
||||||
|
if clean_verse_num:
|
||||||
|
verse_text = raw_verse_num.next
|
||||||
|
part = raw_verse_num.next.next
|
||||||
|
while not (isinstance(part, Tag) and part.attrMap and
|
||||||
|
part.attrMap[u'class'] == u'versenum'):
|
||||||
|
# While we are still in the same verse grab all the text.
|
||||||
|
if isinstance(part, NavigableString):
|
||||||
|
verse_text = verse_text + part
|
||||||
|
if isinstance(part.next, Tag) and part.next.name == u'div':
|
||||||
|
# Run out of verses so stop.
|
||||||
|
break
|
||||||
|
part = part.next
|
||||||
|
verse_list[clean_verse_num] = unicode(verse_text)
|
||||||
|
if not verse_list:
|
||||||
log.debug(u'No content found in the BibleGateway response.')
|
log.debug(u'No content found in the BibleGateway response.')
|
||||||
send_error_message(u'parse')
|
send_error_message(u'parse')
|
||||||
return None
|
return None
|
||||||
verse_count = len(verses.findAll(u'sup', u'versenum'))
|
|
||||||
found_count = 0
|
|
||||||
verse_list = {}
|
|
||||||
while found_count < verse_count:
|
|
||||||
content = content.findNext(u'sup', u'versenum')
|
|
||||||
raw_verse_num = content.next
|
|
||||||
raw_verse_text = raw_verse_num.next
|
|
||||||
verse_list[int(str(raw_verse_num))] = unicode(raw_verse_text)
|
|
||||||
found_count += 1
|
|
||||||
return SearchResults(bookname, chapter, verse_list)
|
return SearchResults(bookname, chapter, verse_list)
|
||||||
|
|
||||||
|
|
||||||
|
@ -372,7 +390,7 @@ class HTTPBible(BibleDB):
|
||||||
BibleDB.__init__(self, parent, **kwargs)
|
BibleDB.__init__(self, parent, **kwargs)
|
||||||
self.download_source = kwargs[u'download_source']
|
self.download_source = kwargs[u'download_source']
|
||||||
self.download_name = kwargs[u'download_name']
|
self.download_name = kwargs[u'download_name']
|
||||||
# TODO: Clean up proxy stuff. We probably want one global proxy per
|
# TODO: Clean up proxy stuff. We probably want one global proxy per
|
||||||
# connection type (HTTP and HTTPS) at most.
|
# connection type (HTTP and HTTPS) at most.
|
||||||
self.proxy_server = None
|
self.proxy_server = None
|
||||||
self.proxy_username = None
|
self.proxy_username = None
|
||||||
|
@ -446,8 +464,8 @@ class HTTPBible(BibleDB):
|
||||||
search_results = self.get_chapter(book, reference[1])
|
search_results = self.get_chapter(book, reference[1])
|
||||||
if search_results and search_results.has_verselist():
|
if search_results and search_results.has_verselist():
|
||||||
## We have found a book of the bible lets check to see
|
## We have found a book of the bible lets check to see
|
||||||
## if it was there. By reusing the returned book name
|
## if it was there. By reusing the returned book name
|
||||||
## we get a correct book. For example it is possible
|
## we get a correct book. For example it is possible
|
||||||
## to request ac and get Acts back.
|
## to request ac and get Acts back.
|
||||||
bookname = search_results.book
|
bookname = search_results.book
|
||||||
Receiver.send_message(u'openlp_process_events')
|
Receiver.send_message(u'openlp_process_events')
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -40,22 +40,12 @@ from osis import OSISBible
|
||||||
# Imports that might fail.
|
# Imports that might fail.
|
||||||
try:
|
try:
|
||||||
from openlp1 import OpenLP1Bible
|
from openlp1 import OpenLP1Bible
|
||||||
has_openlp1 = True
|
HAS_OPENLP1 = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
has_openlp1 = False
|
HAS_OPENLP1 = False
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
class BibleMode(object):
|
|
||||||
"""
|
|
||||||
This is basically an enumeration class which specifies the mode of a Bible.
|
|
||||||
Mode refers to whether or not a Bible in OpenLP is a full Bible or needs to
|
|
||||||
be downloaded from the Internet on an as-needed basis.
|
|
||||||
"""
|
|
||||||
Full = 1
|
|
||||||
Partial = 2
|
|
||||||
|
|
||||||
|
|
||||||
class BibleFormat(object):
|
class BibleFormat(object):
|
||||||
"""
|
"""
|
||||||
This is a special enumeration class that holds the various types of Bibles,
|
This is a special enumeration class that holds the various types of Bibles,
|
||||||
|
@ -260,7 +250,7 @@ class BibleManager(object):
|
||||||
if not bible:
|
if not bible:
|
||||||
Receiver.send_message(u'openlp_information_message', {
|
Receiver.send_message(u'openlp_information_message', {
|
||||||
u'title': translate('BiblesPlugin.BibleManager',
|
u'title': translate('BiblesPlugin.BibleManager',
|
||||||
'No Bibles available'),
|
'No Bibles Available'),
|
||||||
u'message': translate('BiblesPlugin.BibleManager',
|
u'message': translate('BiblesPlugin.BibleManager',
|
||||||
'There are no Bibles currently installed. Please use the '
|
'There are no Bibles currently installed. Please use the '
|
||||||
'Import Wizard to install one or more Bibles.')
|
'Import Wizard to install one or more Bibles.')
|
||||||
|
@ -275,7 +265,7 @@ class BibleManager(object):
|
||||||
'Scripture Reference Error'),
|
'Scripture Reference Error'),
|
||||||
u'message': translate('BiblesPlugin.BibleManager',
|
u'message': translate('BiblesPlugin.BibleManager',
|
||||||
'Your scripture reference is either not supported by OpenLP '
|
'Your scripture reference is either not supported by OpenLP '
|
||||||
'or is invalid. Please make sure your reference conforms to '
|
'or is invalid. Please make sure your reference conforms to '
|
||||||
'one of the following patterns:\n\n'
|
'one of the following patterns:\n\n'
|
||||||
'Book Chapter\n'
|
'Book Chapter\n'
|
||||||
'Book Chapter-Chapter\n'
|
'Book Chapter-Chapter\n'
|
||||||
|
@ -367,6 +357,6 @@ class BibleManager(object):
|
||||||
for bible in self.db_cache:
|
for bible in self.db_cache:
|
||||||
self.db_cache[bible].finalise()
|
self.db_cache[bible].finalise()
|
||||||
|
|
||||||
BibleFormat.set_availability(BibleFormat.OpenLP1, has_openlp1)
|
BibleFormat.set_availability(BibleFormat.OpenLP1, HAS_OPENLP1)
|
||||||
|
|
||||||
__all__ = [u'BibleFormat']
|
__all__ = [u'BibleFormat']
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -34,7 +34,8 @@ from openlp.core.lib.searchedit import SearchEdit
|
||||||
from openlp.core.lib.ui import UiStrings, add_widget_completer, \
|
from openlp.core.lib.ui import UiStrings, add_widget_completer, \
|
||||||
media_item_combo_box, critical_error_message_box
|
media_item_combo_box, critical_error_message_box
|
||||||
from openlp.plugins.bibles.forms import BibleImportForm
|
from openlp.plugins.bibles.forms import BibleImportForm
|
||||||
from openlp.plugins.bibles.lib import get_reference_match
|
from openlp.plugins.bibles.lib import LayoutStyle, DisplayStyle, \
|
||||||
|
get_reference_match
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -56,6 +57,7 @@ class BibleMediaItem(MediaManagerItem):
|
||||||
self.IconPath = u'songs/song'
|
self.IconPath = u'songs/song'
|
||||||
MediaManagerItem.__init__(self, parent, plugin, icon)
|
MediaManagerItem.__init__(self, parent, plugin, icon)
|
||||||
# Place to store the search results for both bibles.
|
# Place to store the search results for both bibles.
|
||||||
|
self.settings = self.parent.settings_tab
|
||||||
self.search_results = {}
|
self.search_results = {}
|
||||||
self.second_search_results = {}
|
self.second_search_results = {}
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
|
@ -235,18 +237,15 @@ class BibleMediaItem(MediaManagerItem):
|
||||||
|
|
||||||
def retranslateUi(self):
|
def retranslateUi(self):
|
||||||
log.debug(u'retranslateUi')
|
log.debug(u'retranslateUi')
|
||||||
self.quickVersionLabel.setText(
|
self.quickVersionLabel.setText(u'%s:' % UiStrings.Version)
|
||||||
translate('BiblesPlugin.MediaItem', 'Version:'))
|
|
||||||
self.quickSecondLabel.setText(
|
self.quickSecondLabel.setText(
|
||||||
translate('BiblesPlugin.MediaItem', 'Second:'))
|
translate('BiblesPlugin.MediaItem', 'Second:'))
|
||||||
self.quickSearchLabel.setText(
|
self.quickSearchLabel.setText(
|
||||||
translate('BiblesPlugin.MediaItem', 'Find:'))
|
translate('BiblesPlugin.MediaItem', 'Find:'))
|
||||||
self.quickSearchButton.setText(
|
self.quickSearchButton.setText(UiStrings.Search)
|
||||||
translate('BiblesPlugin.MediaItem', 'Search'))
|
|
||||||
self.quickClearLabel.setText(
|
self.quickClearLabel.setText(
|
||||||
translate('BiblesPlugin.MediaItem', 'Results:'))
|
translate('BiblesPlugin.MediaItem', 'Results:'))
|
||||||
self.advancedVersionLabel.setText(
|
self.advancedVersionLabel.setText(u'%s:' % UiStrings.Version)
|
||||||
translate('BiblesPlugin.MediaItem', 'Version:'))
|
|
||||||
self.advancedSecondLabel.setText(
|
self.advancedSecondLabel.setText(
|
||||||
translate('BiblesPlugin.MediaItem', 'Second:'))
|
translate('BiblesPlugin.MediaItem', 'Second:'))
|
||||||
self.advancedBookLabel.setText(
|
self.advancedBookLabel.setText(
|
||||||
|
@ -261,8 +260,7 @@ class BibleMediaItem(MediaManagerItem):
|
||||||
translate('BiblesPlugin.MediaItem', 'To:'))
|
translate('BiblesPlugin.MediaItem', 'To:'))
|
||||||
self.advancedClearLabel.setText(
|
self.advancedClearLabel.setText(
|
||||||
translate('BiblesPlugin.MediaItem', 'Results:'))
|
translate('BiblesPlugin.MediaItem', 'Results:'))
|
||||||
self.advancedSearchButton.setText(
|
self.advancedSearchButton.setText(UiStrings.Search)
|
||||||
translate('BiblesPlugin.MediaItem', 'Search'))
|
|
||||||
self.quickClearComboBox.addItem(
|
self.quickClearComboBox.addItem(
|
||||||
translate('BiblesPlugin.MediaItem', 'Clear'))
|
translate('BiblesPlugin.MediaItem', 'Clear'))
|
||||||
self.quickClearComboBox.addItem(
|
self.quickClearComboBox.addItem(
|
||||||
|
@ -348,7 +346,7 @@ class BibleMediaItem(MediaManagerItem):
|
||||||
self.advancedSearchButton.setEnabled(False)
|
self.advancedSearchButton.setEnabled(False)
|
||||||
critical_error_message_box(
|
critical_error_message_box(
|
||||||
message=translate('BiblePlugin.MediaItem',
|
message=translate('BiblePlugin.MediaItem',
|
||||||
'Bible not fully loaded'))
|
'Bible not fully loaded.'))
|
||||||
else:
|
else:
|
||||||
self.advancedSearchButton.setEnabled(True)
|
self.advancedSearchButton.setEnabled(True)
|
||||||
self.adjustComboBox(1, self.chapter_count, self.advancedFromChapter)
|
self.adjustComboBox(1, self.chapter_count, self.advancedFromChapter)
|
||||||
|
@ -484,7 +482,7 @@ class BibleMediaItem(MediaManagerItem):
|
||||||
self.listView.clear()
|
self.listView.clear()
|
||||||
if self.listView.count() != 0:
|
if self.listView.count() != 0:
|
||||||
self.__checkSecondBible(bible, second_bible)
|
self.__checkSecondBible(bible, second_bible)
|
||||||
else:
|
elif self.search_results:
|
||||||
self.displayResults(bible, second_bible)
|
self.displayResults(bible, second_bible)
|
||||||
Receiver.send_message(u'cursor_normal')
|
Receiver.send_message(u'cursor_normal')
|
||||||
self.advancedSearchButton.setEnabled(True)
|
self.advancedSearchButton.setEnabled(True)
|
||||||
|
@ -541,8 +539,9 @@ class BibleMediaItem(MediaManagerItem):
|
||||||
self.displayResults(bible, second_bible)
|
self.displayResults(bible, second_bible)
|
||||||
elif critical_error_message_box(
|
elif critical_error_message_box(
|
||||||
message=translate('BiblePlugin.MediaItem',
|
message=translate('BiblePlugin.MediaItem',
|
||||||
'You cannot combine single and second bible verses. Do you '
|
'You cannot combine single and dual Bible verse search results. '
|
||||||
'want to delete your search results and start a new search?'),
|
'Do you want to delete your search results and start a new '
|
||||||
|
'search?'),
|
||||||
parent=self, question=True) == QtGui.QMessageBox.Yes:
|
parent=self, question=True) == QtGui.QMessageBox.Yes:
|
||||||
self.listView.clear()
|
self.listView.clear()
|
||||||
self.displayResults(bible, second_bible)
|
self.displayResults(bible, second_bible)
|
||||||
|
@ -637,7 +636,6 @@ class BibleMediaItem(MediaManagerItem):
|
||||||
bible_text = u''
|
bible_text = u''
|
||||||
old_item = None
|
old_item = None
|
||||||
old_chapter = -1
|
old_chapter = -1
|
||||||
raw_footer = []
|
|
||||||
raw_slides = []
|
raw_slides = []
|
||||||
raw_title = []
|
raw_title = []
|
||||||
for item in items:
|
for item in items:
|
||||||
|
@ -658,24 +656,24 @@ class BibleMediaItem(MediaManagerItem):
|
||||||
second_text = self._decodeQtObject(bitem, 'second_text')
|
second_text = self._decodeQtObject(bitem, 'second_text')
|
||||||
verse_text = self.formatVerse(old_chapter, chapter, verse)
|
verse_text = self.formatVerse(old_chapter, chapter, verse)
|
||||||
footer = u'%s (%s %s %s)' % (book, version, copyright, permissions)
|
footer = u'%s (%s %s %s)' % (book, version, copyright, permissions)
|
||||||
if footer not in raw_footer:
|
if footer not in service_item.raw_footer:
|
||||||
raw_footer.append(footer)
|
service_item.raw_footer.append(footer)
|
||||||
if second_bible:
|
if second_bible:
|
||||||
footer = u'%s (%s %s %s)' % (book, second_version,
|
footer = u'%s (%s %s %s)' % (book, second_version,
|
||||||
second_copyright, second_permissions)
|
second_copyright, second_permissions)
|
||||||
if footer not in raw_footer:
|
if footer not in service_item.raw_footer:
|
||||||
raw_footer.append(footer)
|
service_item.raw_footer.append(footer)
|
||||||
bible_text = u'%s %s\n\n%s %s' % (verse_text, text,
|
bible_text = u'%s %s\n\n%s %s' % (verse_text, text,
|
||||||
verse_text, second_text)
|
verse_text, second_text)
|
||||||
raw_slides.append(bible_text.rstrip())
|
raw_slides.append(bible_text.rstrip())
|
||||||
bible_text = u''
|
bible_text = u''
|
||||||
# If we are 'Verse Per Slide' then create a new slide.
|
# If we are 'Verse Per Slide' then create a new slide.
|
||||||
elif self.parent.settings_tab.layout_style == 0:
|
elif self.settings.layout_style == LayoutStyle.VersePerSlide:
|
||||||
bible_text = u'%s %s' % (verse_text, text)
|
bible_text = u'%s %s' % (verse_text, text)
|
||||||
raw_slides.append(bible_text.rstrip())
|
raw_slides.append(bible_text.rstrip())
|
||||||
bible_text = u''
|
bible_text = u''
|
||||||
# If we are 'Verse Per Line' then force a new line.
|
# If we are 'Verse Per Line' then force a new line.
|
||||||
elif self.parent.settings_tab.layout_style == 1:
|
elif self.settings.layout_style == LayoutStyle.VersePerLine:
|
||||||
bible_text = u'%s %s %s\n' % (bible_text, verse_text, text)
|
bible_text = u'%s %s %s\n' % (bible_text, verse_text, text)
|
||||||
# We have to be 'Continuous'.
|
# We have to be 'Continuous'.
|
||||||
else:
|
else:
|
||||||
|
@ -693,29 +691,21 @@ class BibleMediaItem(MediaManagerItem):
|
||||||
raw_slides.append(bible_text.lstrip())
|
raw_slides.append(bible_text.lstrip())
|
||||||
bible_text = u''
|
bible_text = u''
|
||||||
# Service Item: Capabilities
|
# Service Item: Capabilities
|
||||||
if self.parent.settings_tab.layout_style == 2 and not second_bible:
|
if self.settings.layout_style == LayoutStyle.Continuous and \
|
||||||
|
not second_bible:
|
||||||
# Split the line but do not replace line breaks in renderer.
|
# Split the line but do not replace line breaks in renderer.
|
||||||
service_item.add_capability(ItemCapabilities.NoLineBreaks)
|
service_item.add_capability(ItemCapabilities.NoLineBreaks)
|
||||||
service_item.add_capability(ItemCapabilities.AllowsPreview)
|
service_item.add_capability(ItemCapabilities.AllowsPreview)
|
||||||
service_item.add_capability(ItemCapabilities.AllowsLoop)
|
service_item.add_capability(ItemCapabilities.AllowsLoop)
|
||||||
# Service Item: Title
|
# Service Item: Title
|
||||||
for title in raw_title:
|
service_item.title = u', '.join(raw_title)
|
||||||
if not service_item.title:
|
|
||||||
service_item.title = title
|
|
||||||
else:
|
|
||||||
service_item.title += u', ' + title
|
|
||||||
# Service Item: Theme
|
# Service Item: Theme
|
||||||
if len(self.parent.settings_tab.bible_theme) == 0:
|
if len(self.settings.bible_theme) == 0:
|
||||||
service_item.theme = None
|
service_item.theme = None
|
||||||
else:
|
else:
|
||||||
service_item.theme = self.parent.settings_tab.bible_theme
|
service_item.theme = self.settings.bible_theme
|
||||||
for slide in raw_slides:
|
for slide in raw_slides:
|
||||||
service_item.add_from_text(slide[:30], slide)
|
service_item.add_from_text(slide[:30], slide)
|
||||||
if service_item.raw_footer:
|
|
||||||
for footer in raw_footer:
|
|
||||||
service_item.raw_footer.append(footer)
|
|
||||||
else:
|
|
||||||
service_item.raw_footer = raw_footer
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def formatTitle(self, start_item, old_item):
|
def formatTitle(self, start_item, old_item):
|
||||||
|
@ -817,16 +807,15 @@ class BibleMediaItem(MediaManagerItem):
|
||||||
The verse number (int).
|
The verse number (int).
|
||||||
"""
|
"""
|
||||||
verse_separator = get_reference_match(u'sep_v_display')
|
verse_separator = get_reference_match(u'sep_v_display')
|
||||||
if not self.parent.settings_tab.show_new_chapters or \
|
if not self.settings.show_new_chapters or old_chapter != chapter:
|
||||||
old_chapter != chapter:
|
|
||||||
verse_text = unicode(chapter) + verse_separator + unicode(verse)
|
verse_text = unicode(chapter) + verse_separator + unicode(verse)
|
||||||
else:
|
else:
|
||||||
verse_text = unicode(verse)
|
verse_text = unicode(verse)
|
||||||
if self.parent.settings_tab.display_style == 1:
|
if self.settings.display_style == DisplayStyle.Round:
|
||||||
verse_text = u'{su}(' + verse_text + u'){/su}'
|
verse_text = u'{su}(' + verse_text + u'){/su}'
|
||||||
elif self.parent.settings_tab.display_style == 2:
|
elif self.settings.display_style == DisplayStyle.Curly:
|
||||||
verse_text = u'{su}{' + verse_text + u'}{/su}'
|
verse_text = u'{su}{' + verse_text + u'}{/su}'
|
||||||
elif self.parent.settings_tab.display_style == 3:
|
elif self.settings.display_style == DisplayStyle.Square:
|
||||||
verse_text = u'{su}[' + verse_text + u']{/su}'
|
verse_text = u'{su}[' + verse_text + u']{/su}'
|
||||||
else:
|
else:
|
||||||
verse_text = u'{su}' + verse_text + u'{/su}'
|
verse_text = u'{su}' + verse_text + u'{/su}'
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -27,9 +27,8 @@
|
||||||
import logging
|
import logging
|
||||||
import sqlite
|
import sqlite
|
||||||
|
|
||||||
from PyQt4 import QtCore
|
from openlp.core.lib import Receiver
|
||||||
|
from openlp.core.ui.wizard import WizardStrings
|
||||||
from openlp.core.lib import Receiver, translate
|
|
||||||
from openlp.plugins.bibles.lib.db import BibleDB
|
from openlp.plugins.bibles.lib.db import BibleDB
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
@ -45,8 +44,6 @@ class OpenLP1Bible(BibleDB):
|
||||||
log.debug(self.__class__.__name__)
|
log.debug(self.__class__.__name__)
|
||||||
BibleDB.__init__(self, parent, **kwargs)
|
BibleDB.__init__(self, parent, **kwargs)
|
||||||
self.filename = kwargs[u'filename']
|
self.filename = kwargs[u'filename']
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
|
||||||
QtCore.SIGNAL(u'openlp_stop_wizard'), self.stop_import)
|
|
||||||
|
|
||||||
def do_import(self):
|
def do_import(self):
|
||||||
"""
|
"""
|
||||||
|
@ -73,8 +70,7 @@ class OpenLP1Bible(BibleDB):
|
||||||
abbreviation = unicode(book[3], u'cp1252')
|
abbreviation = unicode(book[3], u'cp1252')
|
||||||
self.create_book(name, abbreviation, testament_id)
|
self.create_book(name, abbreviation, testament_id)
|
||||||
# Update the progess bar.
|
# Update the progess bar.
|
||||||
self.wizard.incrementProgressBar(unicode(translate(
|
self.wizard.incrementProgressBar(WizardStrings.ImportingType % name)
|
||||||
'BiblesPlugin.OpenLP1Import', 'Importing %s...')) % name)
|
|
||||||
# Import the verses for this book.
|
# Import the verses for this book.
|
||||||
cursor.execute(u'SELECT chapter, verse, text || \'\' AS text FROM '
|
cursor.execute(u'SELECT chapter, verse, text || \'\' AS text FROM '
|
||||||
'verse WHERE book_id=%s' % book_id)
|
'verse WHERE book_id=%s' % book_id)
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -25,9 +25,7 @@
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from lxml import objectify
|
from lxml import objectify
|
||||||
from PyQt4 import QtCore
|
|
||||||
|
|
||||||
from openlp.core.lib import Receiver, translate
|
from openlp.core.lib import Receiver, translate
|
||||||
from openlp.plugins.bibles.lib.db import BibleDB
|
from openlp.plugins.bibles.lib.db import BibleDB
|
||||||
|
@ -46,8 +44,6 @@ class OpenSongBible(BibleDB):
|
||||||
log.debug(self.__class__.__name__)
|
log.debug(self.__class__.__name__)
|
||||||
BibleDB.__init__(self, parent, **kwargs)
|
BibleDB.__init__(self, parent, **kwargs)
|
||||||
self.filename = kwargs['filename']
|
self.filename = kwargs['filename']
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
|
||||||
QtCore.SIGNAL(u'openlp_stop_wizard'), self.stop_import)
|
|
||||||
|
|
||||||
def do_import(self):
|
def do_import(self):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||||
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||||
# Carsten Tinggaard, Frode Woldsund #
|
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# This program is free software; you can redistribute it and/or modify it #
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
# under the terms of the GNU General Public License as published by the Free #
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
@ -31,8 +31,6 @@ import chardet
|
||||||
import codecs
|
import codecs
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from PyQt4 import QtCore
|
|
||||||
|
|
||||||
from openlp.core.lib import Receiver, translate
|
from openlp.core.lib import Receiver, translate
|
||||||
from openlp.core.utils import AppLocation
|
from openlp.core.utils import AppLocation
|
||||||
from openlp.plugins.bibles.lib.db import BibleDB
|
from openlp.plugins.bibles.lib.db import BibleDB
|
||||||
|
@ -41,15 +39,11 @@ log = logging.getLogger(__name__)
|
||||||
|
|
||||||
class OSISBible(BibleDB):
|
class OSISBible(BibleDB):
|
||||||
"""
|
"""
|
||||||
OSIS Bible format importer class.
|
`OSIS <http://www.bibletechnologies.net/>`_ Bible format importer class.
|
||||||
"""
|
"""
|
||||||
log.info(u'BibleOSISImpl loaded')
|
log.info(u'BibleOSISImpl loaded')
|
||||||
|
|
||||||
def __init__(self, parent, **kwargs):
|
def __init__(self, parent, **kwargs):
|
||||||
"""
|
|
||||||
Constructor to create and set up an instance of the OpenSongBible
|
|
||||||
class. This class is used to import Bibles from OpenSong's XML format.
|
|
||||||
"""
|
|
||||||
log.debug(self.__class__.__name__)
|
log.debug(self.__class__.__name__)
|
||||||
BibleDB.__init__(self, parent, **kwargs)
|
BibleDB.__init__(self, parent, **kwargs)
|
||||||
self.filename = kwargs[u'filename']
|
self.filename = kwargs[u'filename']
|
||||||
|
@ -69,7 +63,7 @@ class OSISBible(BibleDB):
|
||||||
self.q1_regex = re.compile(r'<q(.*?)level="1"(.*?)>')
|
self.q1_regex = re.compile(r'<q(.*?)level="1"(.*?)>')
|
||||||
self.q2_regex = re.compile(r'<q(.*?)level="2"(.*?)>')
|
self.q2_regex = re.compile(r'<q(.*?)level="2"(.*?)>')
|
||||||
self.trans_regex = re.compile(r'<transChange(.*?)>(.*?)</transChange>')
|
self.trans_regex = re.compile(r'<transChange(.*?)>(.*?)</transChange>')
|
||||||
self.divineName_regex = re.compile(
|
self.divine_name_regex = re.compile(
|
||||||
r'<divineName(.*?)>(.*?)</divineName>')
|
r'<divineName(.*?)>(.*?)</divineName>')
|
||||||
self.spaces_regex = re.compile(r'([ ]{2,})')
|
self.spaces_regex = re.compile(r'([ ]{2,})')
|
||||||
filepath = os.path.join(
|
filepath = os.path.join(
|
||||||
|
@ -86,8 +80,6 @@ class OSISBible(BibleDB):
|
||||||
finally:
|
finally:
|
||||||
if fbibles:
|
if fbibles:
|
||||||
fbibles.close()
|
fbibles.close()
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
|
||||||
QtCore.SIGNAL(u'openlp_stop_wizard'), self.stop_import)
|
|
||||||
|
|
||||||
def do_import(self):
|
def do_import(self):
|
||||||
"""
|
"""
|
||||||
|
@ -126,7 +118,7 @@ class OSISBible(BibleDB):
|
||||||
verse_text = match.group(4)
|
verse_text = match.group(4)
|
||||||
if not db_book or db_book.name != self.books[book][0]:
|
if not db_book or db_book.name != self.books[book][0]:
|
||||||
log.debug(u'New book: "%s"', self.books[book][0])
|
log.debug(u'New book: "%s"', self.books[book][0])
|
||||||
if book == u'Matt':
|
if book == u'Matt' or book == u'Jdt':
|
||||||
testament += 1
|
testament += 1
|
||||||
db_book = self.create_book(
|
db_book = self.create_book(
|
||||||
unicode(self.books[book][0]),
|
unicode(self.books[book][0]),
|
||||||
|
@ -161,7 +153,7 @@ class OSISBible(BibleDB):
|
||||||
verse_text = self.q1_regex.sub(u'"', verse_text)
|
verse_text = self.q1_regex.sub(u'"', verse_text)
|
||||||
verse_text = self.q2_regex.sub(u'\'', verse_text)
|
verse_text = self.q2_regex.sub(u'\'', verse_text)
|
||||||
verse_text = self.trans_regex.sub(u'', verse_text)
|
verse_text = self.trans_regex.sub(u'', verse_text)
|
||||||
verse_text = self.divineName_regex.sub(u'', verse_text)
|
verse_text = self.divine_name_regex.sub(u'', verse_text)
|
||||||
verse_text = verse_text.replace(u'</lb>', u'')\
|
verse_text = verse_text.replace(u'</lb>', u'')\
|
||||||
.replace(u'</l>', u'').replace(u'<lg>', u'')\
|
.replace(u'</l>', u'').replace(u'<lg>', u'')\
|
||||||
.replace(u'</lg>', u'').replace(u'</q>', u'')\
|
.replace(u'</lg>', u'').replace(u'</q>', u'')\
|
||||||
|
|
|
@ -64,3 +64,13 @@ Jas,James,Jas
|
||||||
3John,3 John,3John
|
3John,3 John,3John
|
||||||
Jude,Jude,Jude
|
Jude,Jude,Jude
|
||||||
Rev,Revelation,Rev
|
Rev,Revelation,Rev
|
||||||
|
Jdt,Judith,Jdt
|
||||||
|
Wis,Wisdom,Wis
|
||||||
|
Tob,Tobit,Tob
|
||||||
|
Sir,Sirach,Sir
|
||||||
|
Bar,Baruch,Bar
|
||||||
|
1Macc,1 Maccabees,1Macc
|
||||||
|
2Macc,2 Maccabees,2Macc
|
||||||
|
AddDan,Rest of Daniel,AddDan
|
||||||
|
AddEsth,Rest of Esther,AddEsth
|
||||||
|
PrMan,Prayer of Manasses,PrMan
|
||||||
|
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue