This commit is contained in:
Andreas Preikschat 2011-03-04 18:13:00 +01:00
commit 5f32b3217e
225 changed files with 42659 additions and 31293 deletions

14
LICENSE
View File

@ -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

View 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 #

View File

@ -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
@ -179,14 +178,8 @@ 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 # Decide how many screens we have and their size
for screen in xrange(0, self.desktop().numScreens()): screens = ScreenList(self.desktop())
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.appClipboard = self.clipboard() self.appClipboard = self.clipboard()
self.mainWindow = MainWindow(screens, app_version, self.appClipboard) self.mainWindow = MainWindow(screens, app_version, self.appClipboard)
@ -273,6 +266,9 @@ 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)
if sys.platform == 'darwin':
OpenLP.addLibraryPath(QtGui.QApplication.applicationDirPath()
+ "/qt4_plugins")
#i18n Set Language #i18n Set Language
language = LanguageManager.get_language() language = LanguageManager.get_language()
appTranslator = LanguageManager.get_translator(language) appTranslator = LanguageManager.get_translator(language)

View 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 #

View 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 #

View 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 #
@ -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.

View 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 #
@ -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)

View 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 #

View 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 #

View 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 #

View 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 #

View 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 #

View 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 #

View 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 #
@ -220,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])
@ -232,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'],

View 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 #

View 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 #

View 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 #

View 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 #
@ -34,6 +34,15 @@ 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
@ -202,28 +211,17 @@ class RenderManager(object):
self.force_page = force_page self.force_page = force_page
# set the default image size for previews # set the default image size for previews
self.calculate_default(self.screens.preview[u'size']) self.calculate_default(self.screens.preview[u'size'])
verse = u'The Lord said to {r}Noah{/r}: \n' \
'There\'s gonna be a {su}floody{/su}, {sb}floody{/sb}\n' \
'The Lord said to {g}Noah{/g}:\n' \
'There\'s gonna be a {st}floody{/st}, {it}floody{/it}\n' \
'Get those children out of the muddy, muddy \n' \
'{r}C{/r}{b}h{/b}{bl}i{/bl}{y}l{/y}{g}d{/g}{pk}' \
'r{/pk}{o}e{/o}{pp}n{/pp} of the Lord\n'
# make big page for theme edit dialog to get line count
if self.force_page:
verse = verse + verse + verse
else:
self.image_manager.del_image(theme_data.theme_name)
footer = []
footer.append(u'Arky Arky (Unknown)')
footer.append(u'Public Domain')
footer.append(u'CCLI 123456')
# build a service item to generate preview # build a service item to generate preview
serviceItem = ServiceItem() serviceItem = ServiceItem()
serviceItem.theme = theme_data serviceItem.theme = theme_data
serviceItem.add_from_text(u'', verse, footer) if self.force_page:
# make big page for theme edit dialog to get line count
serviceItem.add_from_text(u'', VERSE + VERSE + VERSE, FOOTER)
else:
self.image_manager.del_image(theme_data.theme_name)
serviceItem.add_from_text(u'', VERSE, FOOTER)
serviceItem.render_manager = self serviceItem.render_manager = self
serviceItem.raw_footer = footer serviceItem.raw_footer = FOOTER
serviceItem.render(True) serviceItem.render(True)
if not self.force_page: if not self.force_page:
self.display.buildHtml(serviceItem) self.display.buildHtml(serviceItem)

View 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 #

View 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 #
@ -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
@ -187,11 +185,7 @@ class ServiceItem(object):
self.title = clean_tags(self.title) self.title = clean_tags(self.title)
self.foot_text = None self.foot_text = None
if self.raw_footer: if self.raw_footer:
for foot in self.raw_footer: self.foot_text = u'<br>'.join(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 +198,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()

View 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 #
@ -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:

View 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 #

View 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 #

View 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 #
@ -91,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.
@ -123,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.
@ -200,6 +202,7 @@ INTEGER_LIST = [u'size', u'line_adjustment', u'x', u'height', u'y',
u'width', u'shadow_size', u'outline_size', u'horizontal_align', u'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.

View 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 #

View 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 #
@ -130,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.
@ -185,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)
@ -210,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'))
@ -295,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.

View 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 #

View 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 #
@ -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

View 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 #
@ -63,10 +63,10 @@ from splashscreen import SplashScreen
from generaltab import GeneralTab from generaltab import GeneralTab
from themestab import ThemesTab from themestab import ThemesTab
from advancedtab import AdvancedTab from advancedtab import AdvancedTab
from displaytagtab import DisplayTagTab
from aboutform import AboutForm from aboutform import AboutForm
from pluginform import PluginForm from pluginform import PluginForm
from settingsform import SettingsForm from settingsform import SettingsForm
from displaytagform import DisplayTagForm
from shortcutlistform import ShortcutListForm from shortcutlistform import ShortcutListForm
from mediadockmanager import MediaDockManager from mediadockmanager import MediaDockManager
from servicemanager import ServiceManager from servicemanager import ServiceManager

View 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 #
@ -106,38 +106,36 @@ class Ui_AboutDialog(object):
)) ))
self.aboutNotebook.setTabText( self.aboutNotebook.setTabText(
self.aboutNotebook.indexOf(self.aboutTab), UiStrings.About) self.aboutNotebook.indexOf(self.aboutTab), UiStrings.About)
self.creditsTextEdit.setPlainText(translate('OpenLP.AboutForm', lead = u'Raoul "superfly" Snyman'
developers = [u'Tim "TRB143" Bentley', u'Jonathan "gushie" Corwin',
u'Michael "cocooncrash" Gorven', u'Scott "sguerrieri" Guerrieri',
u'Raoul "superfly" Snyman', u'Martin "mijiti" Thompson',
u'Jon "Meths" Tibble<']
contributors = [u'Meinert "m2j" Jordan', u'Andreas "googol" Preikschat',
u'Christian "crichter" Richter', u'Philip "Phill" Ridout',
u'Maikel Stuivenberg', u'Carsten "catini" Tingaard',
u'Frode "frodus" Woldsund']
testers = [u'Philip "Phill" Ridout', u'Wesley "wrst" Stout (lead)']
packagers = [u'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)']
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'
' Michael "cocooncrash" Gorven (Ubuntu)\n'
' Matthias "matthub" Hub (Mac OS X)\n'
' Raoul "superfly" Snyman (Windows, Ubuntu)\n'
'\n' '\n'
'Built With\n' 'Built With\n'
' Python: http://www.python.org/\n' ' Python: http://www.python.org/\n'
@ -155,31 +153,30 @@ 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)))
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 '
@ -549,7 +546,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'))

View 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 #

View 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 #
@ -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(UiStrings.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()

View File

@ -0,0 +1,154 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
# Tibble, Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# This program is free software; you can redistribute it and/or modify it #
# under the terms of the GNU General Public License as published by the Free #
# Software Foundation; version 2 of the License. #
# #
# This program is distributed in the hope that it will be useful, but WITHOUT #
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
# more details. #
# #
# You should have received a copy of the GNU General Public License along #
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
from PyQt4 import QtCore, QtGui
from openlp.core.lib import translate
from openlp.core.lib.ui import UiStrings, create_accept_reject_button_box
class Ui_DisplayTagDialog(object):
def setupUi(self, displayTagDialog):
displayTagDialog.setObjectName(u'displayTagDialog')
displayTagDialog.resize(725, 548)
self.widget = QtGui.QWidget(displayTagDialog)
self.widget.setGeometry(QtCore.QRect(10, 10, 701, 521))
self.widget.setObjectName(u'widget')
self.listdataGridLayout = QtGui.QGridLayout(self.widget)
self.listdataGridLayout.setMargin(0)
self.listdataGridLayout.setObjectName(u'listdataGridLayout')
self.tagTableWidget = QtGui.QTableWidget(self.widget)
self.tagTableWidget.setHorizontalScrollBarPolicy(
QtCore.Qt.ScrollBarAlwaysOff)
self.tagTableWidget.setEditTriggers(
QtGui.QAbstractItemView.NoEditTriggers)
self.tagTableWidget.setAlternatingRowColors(True)
self.tagTableWidget.setSelectionMode(
QtGui.QAbstractItemView.SingleSelection)
self.tagTableWidget.setSelectionBehavior(
QtGui.QAbstractItemView.SelectRows)
self.tagTableWidget.setCornerButtonEnabled(False)
self.tagTableWidget.setObjectName(u'tagTableWidget')
self.tagTableWidget.setColumnCount(4)
self.tagTableWidget.setRowCount(0)
item = QtGui.QTableWidgetItem()
self.tagTableWidget.setHorizontalHeaderItem(0, item)
item = QtGui.QTableWidgetItem()
self.tagTableWidget.setHorizontalHeaderItem(1, item)
item = QtGui.QTableWidgetItem()
self.tagTableWidget.setHorizontalHeaderItem(2, item)
item = QtGui.QTableWidgetItem()
self.tagTableWidget.setHorizontalHeaderItem(3, item)
self.listdataGridLayout.addWidget(self.tagTableWidget, 0, 0, 1, 1)
self.horizontalLayout = QtGui.QHBoxLayout()
self.horizontalLayout.setObjectName(u'horizontalLayout')
spacerItem = QtGui.QSpacerItem(40, 20,
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem)
self.defaultPushButton = QtGui.QPushButton(self.widget)
self.defaultPushButton.setObjectName(u'defaultPushButton')
self.horizontalLayout.addWidget(self.defaultPushButton)
self.deletePushButton = QtGui.QPushButton(self.widget)
self.deletePushButton.setObjectName(u'deletePushButton')
self.horizontalLayout.addWidget(self.deletePushButton)
self.listdataGridLayout.addLayout(self.horizontalLayout, 1, 0, 1, 1)
self.editGroupBox = QtGui.QGroupBox(self.widget)
self.editGroupBox.setObjectName(u'editGroupBox')
self.dataGridLayout = QtGui.QGridLayout(self.editGroupBox)
self.dataGridLayout.setObjectName(u'dataGridLayout')
self.descriptionLabel = QtGui.QLabel(self.editGroupBox)
self.descriptionLabel.setAlignment(QtCore.Qt.AlignCenter)
self.descriptionLabel.setObjectName(u'descriptionLabel')
self.dataGridLayout.addWidget(self.descriptionLabel, 0, 0, 1, 1)
self.descriptionLineEdit = QtGui.QLineEdit(self.editGroupBox)
self.descriptionLineEdit.setObjectName(u'descriptionLineEdit')
self.dataGridLayout.addWidget(self.descriptionLineEdit, 0, 1, 2, 1)
self.newPushButton = QtGui.QPushButton(self.editGroupBox)
self.newPushButton.setObjectName(u'newPushButton')
self.dataGridLayout.addWidget(self.newPushButton, 0, 2, 2, 1)
self.tagLabel = QtGui.QLabel(self.editGroupBox)
self.tagLabel.setAlignment(QtCore.Qt.AlignCenter)
self.tagLabel.setObjectName(u'tagLabel')
self.dataGridLayout.addWidget(self.tagLabel, 2, 0, 1, 1)
self.tagLineEdit = QtGui.QLineEdit(self.editGroupBox)
self.tagLineEdit.setMaximumSize(QtCore.QSize(50, 16777215))
self.tagLineEdit.setMaxLength(5)
self.tagLineEdit.setObjectName(u'tagLineEdit')
self.dataGridLayout.addWidget(self.tagLineEdit, 2, 1, 1, 1)
self.startTagLabel = QtGui.QLabel(self.editGroupBox)
self.startTagLabel.setAlignment(QtCore.Qt.AlignCenter)
self.startTagLabel.setObjectName(u'startTagLabel')
self.dataGridLayout.addWidget(self.startTagLabel, 3, 0, 1, 1)
self.startTagLineEdit = QtGui.QLineEdit(self.editGroupBox)
self.startTagLineEdit.setObjectName(u'startTagLineEdit')
self.dataGridLayout.addWidget(self.startTagLineEdit, 3, 1, 1, 1)
self.endTagLabel = QtGui.QLabel(self.editGroupBox)
self.endTagLabel.setAlignment(QtCore.Qt.AlignCenter)
self.endTagLabel.setObjectName(u'endTagLabel')
self.dataGridLayout.addWidget(self.endTagLabel, 4, 0, 1, 1)
self.endTagLineEdit = QtGui.QLineEdit(self.editGroupBox)
self.endTagLineEdit.setObjectName(u'endTagLineEdit')
self.dataGridLayout.addWidget(self.endTagLineEdit, 4, 1, 1, 1)
self.updatePushButton = QtGui.QPushButton(self.editGroupBox)
self.updatePushButton.setObjectName(u'updatePushButton')
self.dataGridLayout.addWidget(self.updatePushButton, 4, 2, 1, 1)
self.listdataGridLayout.addWidget(self.editGroupBox, 2, 0, 1, 1)
self.buttonBox = create_accept_reject_button_box(displayTagDialog)
self.listdataGridLayout.addWidget(self.buttonBox, 3, 0, 1, 1)
self.retranslateUi(displayTagDialog)
QtCore.QMetaObject.connectSlotsByName(displayTagDialog)
def retranslateUi(self, displayTagDialog):
displayTagDialog.setWindowTitle(translate('OpenLP.displayTagDialog',
'Configure Display Tags'))
self.editGroupBox.setTitle(
translate('OpenLP.DisplayTagDialog', 'Edit Selection'))
self.updatePushButton.setText(
translate('OpenLP.DisplayTagDialog', 'Update'))
self.descriptionLabel.setText(
translate('OpenLP.DisplayTagDialog', 'Description'))
self.tagLabel.setText(translate('OpenLP.DisplayTagDialog', 'Tag'))
self.startTagLabel.setText(
translate('OpenLP.DisplayTagDialog', 'Start tag'))
self.endTagLabel.setText(
translate('OpenLP.DisplayTagDialog', 'End tag'))
self.deletePushButton.setText(UiStrings.Delete)
self.defaultPushButton.setText(
translate('OpenLP.DisplayTagDialog', 'Default'))
self.newPushButton.setText(UiStrings.New)
self.tagTableWidget.horizontalHeaderItem(0).setText(
translate('OpenLP.DisplayTagDialog', 'Description'))
self.tagTableWidget.horizontalHeaderItem(1).setText(
translate('OpenLP.DisplayTagDialog', 'Tag id'))
self.tagTableWidget.horizontalHeaderItem(2).setText(
translate('OpenLP.DisplayTagDialog', 'Start Html'))
self.tagTableWidget.horizontalHeaderItem(3).setText(
translate('OpenLP.DisplayTagDialog', 'End Html'))
self.tagTableWidget.setColumnWidth(0, 120)
self.tagTableWidget.setColumnWidth(1, 40)
self.tagTableWidget.setColumnWidth(2, 240)
self.tagTableWidget.setColumnWidth(3, 240)

View 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 #
@ -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(UiStrings.New)
self.tagTableWidget.horizontalHeaderItem(0)\
.setText(translate('OpenLP.DisplayTagTab', 'Description'))
self.tagTableWidget.horizontalHeaderItem(1)\
.setText(translate('OpenLP.DisplayTagTab', 'Tag id'))
self.tagTableWidget.horizontalHeaderItem(2)\
.setText(translate('OpenLP.DisplayTagTab', 'Start Html'))
self.tagTableWidget.horizontalHeaderItem(3)\
.setText(translate('OpenLP.DisplayTagTab', 'End Html'))
QtCore.QMetaObject.connectSlotsByName(self.displayTagEdit)
self.tagTableWidget.setColumnWidth(0, 120)
self.tagTableWidget.setColumnWidth(1, 40)
self.tagTableWidget.setColumnWidth(2, 240)
self.tagTableWidget.setColumnWidth(3, 200)
QtCore.QObject.connect(self.tagTableWidget, QtCore.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):
""" """

View 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 #

View 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 #

View 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 #

View 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 #

View 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 #
@ -45,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')
@ -234,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):
""" """
@ -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(

View 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 #
@ -132,14 +132,22 @@ class MainDisplay(DisplayWidget):
painter_image.begin(self.black) painter_image.begin(self.black)
painter_image.fillRect(self.black.rect(), QtCore.Qt.black) painter_image.fillRect(self.black.rect(), QtCore.Qt.black)
# Build the initial frame. # Build the initial frame.
image_file = QtCore.QSettings().value(u'advanced/default image',
QtCore.QVariant(u':/graphics/openlp-splash-screen.png'))\
.toString()
background_color = QtGui.QColor(QtCore.QSettings().value(
u'advanced/default color',
QtCore.QVariant(u'#ffffff')).toString())
if not background_color.isValid():
background_color = QtCore.Qt.white
splash_image = QtGui.QImage(image_file)
initialFrame = QtGui.QImage( initialFrame = QtGui.QImage(
self.screens.current[u'size'].width(), self.screens.current[u'size'].width(),
self.screens.current[u'size'].height(), self.screens.current[u'size'].height(),
QtGui.QImage.Format_ARGB32_Premultiplied) QtGui.QImage.Format_ARGB32_Premultiplied)
splash_image = QtGui.QImage(u':/graphics/openlp-splash-screen.png')
painter_image = QtGui.QPainter() painter_image = QtGui.QPainter()
painter_image.begin(initialFrame) painter_image.begin(initialFrame)
painter_image.fillRect(initialFrame.rect(), QtCore.Qt.white) painter_image.fillRect(initialFrame.rect(), background_color)
painter_image.drawImage( painter_image.drawImage(
(self.screens.current[u'size'].width() - (self.screens.current[u'size'].width() -
splash_image.width()) / 2, splash_image.width()) / 2,
@ -150,6 +158,7 @@ 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()
@ -426,15 +435,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):
""" """
@ -484,6 +485,16 @@ class MainDisplay(DisplayWidget):
# Trigger actions when display is active again # Trigger actions when display is active again
Receiver.send_message(u'maindisplay_active') 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):
""" """

View 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 #
@ -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
@ -242,6 +242,8 @@ class Ui_MainWindow(object):
self.SettingsShortcutsItem = icon_action(mainWindow, self.SettingsShortcutsItem = icon_action(mainWindow,
u'SettingsShortcutsItem', u'SettingsShortcutsItem',
u':/system/system_configure_shortcuts.png') u':/system/system_configure_shortcuts.png')
self.DisplayTagItem = icon_action(mainWindow,
u'DisplayTagItem', u':/system/tag_editor.png')
self.SettingsConfigureItem = icon_action(mainWindow, self.SettingsConfigureItem = icon_action(mainWindow,
u'SettingsConfigureItem', u':/system/system_settings.png') u'SettingsConfigureItem', u':/system/system_settings.png')
mainWindow.actionList.add_action(self.SettingsShortcutsItem, mainWindow.actionList.add_action(self.SettingsShortcutsItem,
@ -277,7 +279,8 @@ 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,
@ -361,6 +364,8 @@ class Ui_MainWindow(object):
translate('OpenLP.MainWindow', '&Language')) translate('OpenLP.MainWindow', '&Language'))
self.SettingsShortcutsItem.setText( self.SettingsShortcutsItem.setText(
translate('OpenLP.MainWindow', 'Configure &Shortcuts...')) translate('OpenLP.MainWindow', 'Configure &Shortcuts...'))
self.DisplayTagItem.setText(
translate('OpenLP.MainWindow', '&Configure Display Tags'))
self.SettingsConfigureItem.setText( self.SettingsConfigureItem.setText(
translate('OpenLP.MainWindow', '&Configure OpenLP...')) translate('OpenLP.MainWindow', '&Configure OpenLP...'))
self.ViewMediaManagerItem.setText( self.ViewMediaManagerItem.setText(
@ -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
@ -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,
@ -716,6 +724,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

View 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 #

View 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 #

View 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 #

View 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 #
@ -29,7 +29,7 @@ from PyQt4 import QtCore, QtGui
from openlp.core.lib import build_icon, translate, SpellTextEdit from openlp.core.lib import build_icon, translate, SpellTextEdit
from openlp.core.lib.ui import UiStrings from openlp.core.lib.ui import UiStrings
class ZoomSize(): class ZoomSize(object):
""" """
Type enumeration for Combo Box sizes Type enumeration for Combo Box sizes
""" """
@ -45,6 +45,7 @@ class ZoomSize():
translate('OpenLP.PrintServiceDialog', 'Fit Width'), translate('OpenLP.PrintServiceDialog', 'Fit Width'),
u'100%', u'75%', u'50%', u'25%'] u'100%', u'75%', u'50%', u'25%']
class Ui_PrintServiceDialog(object): class Ui_PrintServiceDialog(object):
def setupUi(self, printServiceDialog): def setupUi(self, printServiceDialog):
printServiceDialog.setObjectName(u'printServiceDialog') printServiceDialog.setObjectName(u'printServiceDialog')

View 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 #
@ -174,7 +174,7 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog):
self.previewWidget.zoomIn(0.25) self.previewWidget.zoomIn(0.25)
settings = QtCore.QSettings() settings = QtCore.QSettings()
settings.beginGroup(u'advanced') settings.beginGroup(u'advanced')
settings.setValue(u'display size',QtCore.QVariant(display)) settings.setValue(u'display size', QtCore.QVariant(display))
settings.endGroup() settings.endGroup()
def copyText(self): def copyText(self):

View 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 #
@ -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,7 +181,10 @@ 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:
@ -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)

View 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 #

View 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 #

View 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 #

View 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 #

View 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 #

View 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 #
@ -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):
""" """

View 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 #

View 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 #

View 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 #

View 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 #

View 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 #

View 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 #

View 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 #

View 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 #
@ -266,7 +266,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 +284,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)
@ -399,7 +399,7 @@ class ThemeManager(QtGui.QWidget):
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,

View 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 #

View 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 #

View 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 #
@ -47,6 +47,7 @@ class WizardStrings(object):
CSV = u'CSV' CSV = u'CSV'
EW = u'EasyWorship' EW = u'EasyWorship'
ES = u'EasiSlides' ES = u'EasiSlides'
FP = u'Foilpresenter'
OL = u'OpenLyrics' OL = u'OpenLyrics'
OS = u'OpenSong' OS = u'OpenSong'
OSIS = u'OSIS' OSIS = u'OSIS'

View 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 #
@ -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:

View 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 #

View 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 #

View 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 #

View 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 #

View 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 #

View 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 #

View 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 #

View 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 #
@ -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()

View 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 #

View 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 #

View 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 #

View 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 #

View 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 #

View 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 #

View 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 #

View 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 #
@ -753,4 +753,5 @@ class BibleImportForm(OpenLPWizard):
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)

View 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 #

View 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 #

View 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 #
@ -94,8 +94,6 @@ class CSVBible(BibleDB):
self.testamentsfile = None self.testamentsfile = None
self.booksfile = kwargs[u'booksfile'] self.booksfile = kwargs[u'booksfile']
self.versesfile = kwargs[u'versefile'] self.versesfile = kwargs[u'versefile']
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'openlp_stop_wizard'), self.stop_import)
def setup_testaments(self): def setup_testaments(self):
""" """

View 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 #
@ -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)

View 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 #
@ -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')

View 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 #
@ -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,
@ -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']

View 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 #
@ -482,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)
@ -698,11 +698,7 @@ class BibleMediaItem(MediaManagerItem):
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.settings.bible_theme) == 0: if len(self.settings.bible_theme) == 0:
service_item.theme = None service_item.theme = None

View 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 #
@ -46,8 +46,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):
""" """

View 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 #
@ -46,8 +46,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):
""" """

View 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 #
@ -41,15 +41,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']
@ -86,8 +82,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 +120,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]),

View File

@ -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

1 Gen Genesis Gen
64 3John 3 John 3John
65 Jude Jude Jude
66 Rev Revelation Rev
67 Jdt Judith Jdt
68 Wis Wisdom Wis
69 Tob Tobit Tob
70 Sir Sirach Sir
71 Bar Baruch Bar
72 1Macc 1 Maccabees 1Macc
73 2Macc 2 Maccabees 2Macc
74 AddDan Rest of Daniel AddDan
75 AddEsth Rest of Esther AddEsth
76 PrMan Prayer of Manasses PrMan

View 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 #

View 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 #

View 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 #

View 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 #

View 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 #

View 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 #

View 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 #

View 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 #

Some files were not shown because too many files have changed in this diff Show More