mirror of https://gitlab.com/openlp/openlp.git
HEAD
This commit is contained in:
commit
8758020568
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Edwin Lunando, Joshua Miller, Stevan Pettit, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -122,6 +122,9 @@ class OpenLP(OpenLPMixin, QtGui.QApplication):
|
|||
ftw.initialize(screens)
|
||||
if ftw.exec_() == QtGui.QDialog.Accepted:
|
||||
Settings().setValue('core/has run wizard', True)
|
||||
elif ftw.was_cancelled:
|
||||
QtCore.QCoreApplication.exit()
|
||||
sys.exit()
|
||||
# Correct stylesheet bugs
|
||||
application_stylesheet = ''
|
||||
if not Settings().value('advanced/alternate rows'):
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -126,10 +126,6 @@ class Registry(object):
|
|||
:param event: The function description..
|
||||
:param function: The function to be called when the event happens.
|
||||
"""
|
||||
if not self.running_under_test:
|
||||
trace_error_handler(log)
|
||||
log.error('Invalid Method call for key %s' % event)
|
||||
raise KeyError('Invalid Method call for key %s' % event)
|
||||
if event in self.functions_list:
|
||||
self.functions_list[event].remove(function)
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -67,6 +67,7 @@ class UiStrings(object):
|
|||
self.Browse = translate('OpenLP.Ui', 'Browse...')
|
||||
self.Cancel = translate('OpenLP.Ui', 'Cancel')
|
||||
self.CCLINumberLabel = translate('OpenLP.Ui', 'CCLI number:')
|
||||
self.CCLISongNumberLabel = translate('OpenLP.Ui', 'CCLI song number:')
|
||||
self.CreateService = translate('OpenLP.Ui', 'Create a new service.')
|
||||
self.ConfirmDelete = translate('OpenLP.Ui', 'Confirm Delete')
|
||||
self.Continuous = translate('OpenLP.Ui', 'Continuous')
|
||||
|
@ -115,7 +116,7 @@ class UiStrings(object):
|
|||
self.NISs = translate('OpenLP.Ui', 'No Item Selected', 'Singular')
|
||||
self.NISp = translate('OpenLP.Ui', 'No Items Selected', 'Plural')
|
||||
self.OLPV2 = translate('OpenLP.Ui', 'OpenLP 2')
|
||||
self.OLPV2x = translate('OpenLP.Ui', 'OpenLP 2.1')
|
||||
self.OLPV2x = translate('OpenLP.Ui', 'OpenLP 2.2')
|
||||
self.OpenLPStart = translate('OpenLP.Ui', 'OpenLP is already running. Do you wish to continue?')
|
||||
self.OpenService = translate('OpenLP.Ui', 'Open service.')
|
||||
self.PlaySlidesInLoop = translate('OpenLP.Ui', 'Play Slides in Loop')
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -73,7 +73,7 @@ class ColorButton(QtGui.QPushButton):
|
|||
@color.setter
|
||||
def color(self, color):
|
||||
"""
|
||||
Property setter to change the imstamce color
|
||||
Property setter to change the instance color
|
||||
|
||||
:param color: String representation of a hexidecimal color
|
||||
"""
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -250,7 +250,13 @@ class Renderer(OpenLPMixin, RegistryMixin, RegistryProperties):
|
|||
# Remove two or more option slide breaks next to each other (causing infinite loop).
|
||||
while '\n[---]\n[---]\n' in text:
|
||||
text = text.replace('\n[---]\n[---]\n', '\n[---]\n')
|
||||
while True:
|
||||
while ' [---]' in text:
|
||||
text = text.replace(' [---]', '[---]')
|
||||
while '[---] ' in text:
|
||||
text = text.replace('[---] ', '[---]')
|
||||
count = 0
|
||||
# only loop 5 times as there will never be more than 5 incorrect logical splits on a single slide.
|
||||
while True and count < 5:
|
||||
slides = text.split('\n[---]\n', 2)
|
||||
# If there are (at least) two occurrences of [---] we use the first two slides (and neglect the last
|
||||
# for now).
|
||||
|
@ -296,6 +302,7 @@ class Renderer(OpenLPMixin, RegistryMixin, RegistryProperties):
|
|||
lines = text.strip('\n').split('\n')
|
||||
pages.extend(self._paginate_slide(lines, line_end))
|
||||
break
|
||||
count += 1
|
||||
else:
|
||||
# Clean up line endings.
|
||||
pages = self._paginate_slide(text.split('\n'), line_end)
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -36,6 +36,7 @@ import html
|
|||
import logging
|
||||
import os
|
||||
import uuid
|
||||
import ntpath
|
||||
|
||||
from PyQt4 import QtGui
|
||||
|
||||
|
@ -423,8 +424,12 @@ class ServiceItem(RegistryProperties):
|
|||
if 'background_audio' in header:
|
||||
self.background_audio = []
|
||||
for filename in header['background_audio']:
|
||||
# Give them real file paths
|
||||
self.background_audio.append(os.path.join(path, filename))
|
||||
# Give them real file paths.
|
||||
filepath = filename
|
||||
if path:
|
||||
# Windows can handle both forward and backward slashes, so we use ntpath to get the basename
|
||||
filepath = os.path.join(path, ntpath.basename(filename))
|
||||
self.background_audio.append(filepath)
|
||||
self.theme_overwritten = header.get('theme_overwritten', False)
|
||||
if self.service_item_type == ServiceItemType.Text:
|
||||
for slide in service_item['serviceitem']['data']:
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -225,10 +225,10 @@ class Ui_AboutDialog(object):
|
|||
'\n'
|
||||
'Built With\n'
|
||||
' Python: http://www.python.org/\n'
|
||||
' Qt4: http://qt.digia.com/\n'
|
||||
' PyQt4: http://www.riverbankcomputing.co.uk/software/pyqt/'
|
||||
'intro\n'
|
||||
' Oxygen Icons: http://oxygen-icons.org/\n'
|
||||
' Qt4: http://qt.io\n'
|
||||
' PyQt4: http://www.riverbankcomputing.co.uk/software/pyqt/intro\n'
|
||||
' Oxygen Icons: http://techbase.kde.org/Projects/Oxygen/\n'
|
||||
' MuPDF: http://www.mupdf.com/\n'
|
||||
'\n'
|
||||
'Final Credit\n'
|
||||
' "For God so loved the world that He gave\n'
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -31,49 +31,67 @@ This module contains the first time wizard.
|
|||
"""
|
||||
import logging
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
import urllib.request
|
||||
import urllib.parse
|
||||
import urllib.error
|
||||
from tempfile import gettempdir
|
||||
from configparser import ConfigParser
|
||||
from configparser import ConfigParser, MissingSectionHeaderError, NoSectionError, NoOptionError
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.common import Registry, RegistryProperties, AppLocation, Settings, check_directory_exists, \
|
||||
translate, clean_button_text
|
||||
translate, clean_button_text, trace_error_handler
|
||||
from openlp.core.lib import PluginStatus, build_icon
|
||||
from openlp.core.utils import get_web_page
|
||||
from openlp.core.lib.ui import critical_error_message_box
|
||||
from openlp.core.utils import get_web_page, CONNECTION_RETRIES, CONNECTION_TIMEOUT
|
||||
from .firsttimewizard import UiFirstTimeWizard, FirstTimePage
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class ThemeScreenshotThread(QtCore.QThread):
|
||||
class ThemeScreenshotWorker(QtCore.QObject):
|
||||
"""
|
||||
This thread downloads the theme screenshots.
|
||||
This thread downloads a theme's screenshot
|
||||
"""
|
||||
screenshot_downloaded = QtCore.pyqtSignal(str, str)
|
||||
finished = QtCore.pyqtSignal()
|
||||
|
||||
def __init__(self, themes_url, title, filename, screenshot):
|
||||
"""
|
||||
Set up the worker object
|
||||
"""
|
||||
self.was_download_cancelled = False
|
||||
self.themes_url = themes_url
|
||||
self.title = title
|
||||
self.filename = filename
|
||||
self.screenshot = screenshot
|
||||
super(ThemeScreenshotWorker, self).__init__()
|
||||
|
||||
def run(self):
|
||||
"""
|
||||
Overridden method to run the thread.
|
||||
"""
|
||||
themes = self.parent().config.get('themes', 'files')
|
||||
themes = themes.split(',')
|
||||
config = self.parent().config
|
||||
for theme in themes:
|
||||
# Stop if the wizard has been cancelled.
|
||||
if self.parent().was_download_cancelled:
|
||||
return
|
||||
title = config.get('theme_%s' % theme, 'title')
|
||||
filename = config.get('theme_%s' % theme, 'filename')
|
||||
screenshot = config.get('theme_%s' % theme, 'screenshot')
|
||||
urllib.request.urlretrieve('%s%s' % (self.parent().themes_url, screenshot),
|
||||
os.path.join(gettempdir(), 'openlp', screenshot))
|
||||
item = QtGui.QListWidgetItem(title, self.parent().themes_list_widget)
|
||||
item.setData(QtCore.Qt.UserRole, filename)
|
||||
item.setCheckState(QtCore.Qt.Unchecked)
|
||||
item.setFlags(item.flags() | QtCore.Qt.ItemIsUserCheckable)
|
||||
if self.was_download_cancelled:
|
||||
return
|
||||
try:
|
||||
urllib.request.urlretrieve('%s%s' % (self.themes_url, self.screenshot),
|
||||
os.path.join(gettempdir(), 'openlp', self.screenshot))
|
||||
# Signal that the screenshot has been downloaded
|
||||
self.screenshot_downloaded.emit(self.title, self.filename)
|
||||
except:
|
||||
log.exception('Unable to download screenshot')
|
||||
finally:
|
||||
self.finished.emit()
|
||||
|
||||
@QtCore.pyqtSlot(bool)
|
||||
def set_download_canceled(self, toggle):
|
||||
"""
|
||||
Externally set if the download was canceled
|
||||
|
||||
:param toggle: Set if the download was canceled or not
|
||||
"""
|
||||
self.was_download_cancelled = toggle
|
||||
|
||||
|
||||
class FirstTimeForm(QtGui.QWizard, UiFirstTimeWizard, RegistryProperties):
|
||||
|
@ -87,25 +105,46 @@ class FirstTimeForm(QtGui.QWizard, UiFirstTimeWizard, RegistryProperties):
|
|||
Create and set up the first time wizard.
|
||||
"""
|
||||
super(FirstTimeForm, self).__init__(parent)
|
||||
self.web_access = True
|
||||
self.web = ''
|
||||
self.setup_ui(self)
|
||||
|
||||
def get_next_page_id(self):
|
||||
"""
|
||||
Returns the id of the next FirstTimePage to go to based on enabled plugins
|
||||
"""
|
||||
if FirstTimePage.Welcome < self.currentId() < FirstTimePage.Songs and self.songs_check_box.isChecked():
|
||||
# If the songs plugin is enabled then go to the songs page
|
||||
return FirstTimePage.Songs
|
||||
elif FirstTimePage.Welcome < self.currentId() < FirstTimePage.Bibles and self.bible_check_box.isChecked():
|
||||
# Otherwise, if the Bibles plugin is enabled then go to the Bibles page
|
||||
return FirstTimePage.Bibles
|
||||
elif FirstTimePage.Welcome < self.currentId() < FirstTimePage.Themes:
|
||||
# Otherwise, if the current page is somewhere between the Welcome and the Themes pages, go to the themes
|
||||
return FirstTimePage.Themes
|
||||
else:
|
||||
# If all else fails, go to the next page
|
||||
return self.currentId() + 1
|
||||
|
||||
def nextId(self):
|
||||
"""
|
||||
Determine the next page in the Wizard to go to.
|
||||
"""
|
||||
self.application.process_events()
|
||||
if self.currentId() == FirstTimePage.Plugins:
|
||||
if self.currentId() == FirstTimePage.Download:
|
||||
if not self.web_access:
|
||||
return FirstTimePage.NoInternet
|
||||
else:
|
||||
return FirstTimePage.Songs
|
||||
return FirstTimePage.Plugins
|
||||
elif self.currentId() == FirstTimePage.Plugins:
|
||||
return self.get_next_page_id()
|
||||
elif self.currentId() == FirstTimePage.Progress:
|
||||
return -1
|
||||
elif self.currentId() == FirstTimePage.NoInternet:
|
||||
return FirstTimePage.Progress
|
||||
elif self.currentId() == FirstTimePage.Themes:
|
||||
self.application.set_busy_cursor()
|
||||
while not self.theme_screenshot_thread.isFinished():
|
||||
while not all([thread.isFinished() for thread in self.theme_screenshot_threads]):
|
||||
time.sleep(0.1)
|
||||
self.application.process_events()
|
||||
# Build the screenshot icons, as this can not be done in the thread.
|
||||
|
@ -113,7 +152,7 @@ class FirstTimeForm(QtGui.QWizard, UiFirstTimeWizard, RegistryProperties):
|
|||
self.application.set_normal_cursor()
|
||||
return FirstTimePage.Defaults
|
||||
else:
|
||||
return self.currentId() + 1
|
||||
return self.get_next_page_id()
|
||||
|
||||
def exec_(self):
|
||||
"""
|
||||
|
@ -129,42 +168,53 @@ class FirstTimeForm(QtGui.QWizard, UiFirstTimeWizard, RegistryProperties):
|
|||
:param screens: The screens detected by OpenLP
|
||||
"""
|
||||
self.screens = screens
|
||||
self.was_cancelled = False
|
||||
self.theme_screenshot_threads = []
|
||||
self.theme_screenshot_workers = []
|
||||
self.has_run_wizard = False
|
||||
|
||||
def _download_index(self):
|
||||
"""
|
||||
Download the configuration file and kick off the theme screenshot download threads
|
||||
"""
|
||||
# check to see if we have web access
|
||||
self.web = 'http://openlp.org/files/frw/'
|
||||
self.web_access = False
|
||||
self.config = ConfigParser()
|
||||
user_agent = 'OpenLP/' + Registry().get('application').applicationVersion()
|
||||
self.web_access = get_web_page('%s%s' % (self.web, 'download.cfg'), header=('User-Agent', user_agent))
|
||||
if self.web_access:
|
||||
files = self.web_access.read()
|
||||
self.config.read_string(files.decode())
|
||||
self.web = self.config.get('general', 'base url')
|
||||
self.songs_url = self.web + self.config.get('songs', 'directory') + '/'
|
||||
self.bibles_url = self.web + self.config.get('bibles', 'directory') + '/'
|
||||
self.themes_url = self.web + self.config.get('themes', 'directory') + '/'
|
||||
self.application.process_events()
|
||||
web_config = get_web_page('%s%s' % (self.web, 'download.cfg'), header=('User-Agent', user_agent))
|
||||
if web_config:
|
||||
files = web_config.read()
|
||||
try:
|
||||
self.config.read_string(files.decode())
|
||||
self.web = self.config.get('general', 'base url')
|
||||
self.songs_url = self.web + self.config.get('songs', 'directory') + '/'
|
||||
self.bibles_url = self.web + self.config.get('bibles', 'directory') + '/'
|
||||
self.themes_url = self.web + self.config.get('themes', 'directory') + '/'
|
||||
self.web_access = True
|
||||
except (NoSectionError, NoOptionError, MissingSectionHeaderError):
|
||||
log.debug('A problem occured while parsing the downloaded config file')
|
||||
trace_error_handler(log)
|
||||
self.update_screen_list_combo()
|
||||
self.was_download_cancelled = False
|
||||
self.theme_screenshot_thread = None
|
||||
self.has_run_wizard = False
|
||||
self.application.process_events()
|
||||
self.downloading = translate('OpenLP.FirstTimeWizard', 'Downloading %s...')
|
||||
self.cancel_button.clicked.connect(self.on_cancel_button_clicked)
|
||||
self.no_internet_finish_button.clicked.connect(self.on_no_internet_finish_button_clicked)
|
||||
self.currentIdChanged.connect(self.on_current_id_changed)
|
||||
Registry().register_function('config_screen_changed', self.update_screen_list_combo)
|
||||
|
||||
def set_defaults(self):
|
||||
"""
|
||||
Set up display at start of theme edit.
|
||||
"""
|
||||
self.restart()
|
||||
check_directory_exists(os.path.join(gettempdir(), 'openlp'))
|
||||
self.no_internet_finish_button.setVisible(False)
|
||||
# Check if this is a re-run of the wizard.
|
||||
self.has_run_wizard = Settings().value('core/has run wizard')
|
||||
if self.has_run_wizard:
|
||||
self.songs_check_box.setChecked(self.plugin_manager.get_plugin_by_name('songs').is_active())
|
||||
self.bible_check_box.setChecked(self.plugin_manager.get_plugin_by_name('bibles').is_active())
|
||||
self.presentation_check_box.setChecked(self.plugin_manager.get_plugin_by_name('presentations').is_active())
|
||||
self.image_check_box.setChecked(self.plugin_manager.get_plugin_by_name('images').is_active())
|
||||
self.media_check_box.setChecked(self.plugin_manager.get_plugin_by_name('media').is_active())
|
||||
self.remote_check_box.setChecked(self.plugin_manager.get_plugin_by_name('remotes').is_active())
|
||||
self.custom_check_box.setChecked(self.plugin_manager.get_plugin_by_name('custom').is_active())
|
||||
self.song_usage_check_box.setChecked(self.plugin_manager.get_plugin_by_name('songusage').is_active())
|
||||
self.alert_check_box.setChecked(self.plugin_manager.get_plugin_by_name('alerts').is_active())
|
||||
self.application.set_normal_cursor()
|
||||
# Sort out internet access for downloads
|
||||
if self.web_access:
|
||||
songs = self.config.get('songs', 'languages')
|
||||
songs = songs.split(',')
|
||||
for song in songs:
|
||||
self.application.process_events()
|
||||
title = self.config.get('songs_%s' % song, 'title')
|
||||
filename = self.config.get('songs_%s' % song, 'filename')
|
||||
item = QtGui.QListWidgetItem(title, self.songs_list_widget)
|
||||
|
@ -174,11 +224,13 @@ class FirstTimeForm(QtGui.QWizard, UiFirstTimeWizard, RegistryProperties):
|
|||
bible_languages = self.config.get('bibles', 'languages')
|
||||
bible_languages = bible_languages.split(',')
|
||||
for lang in bible_languages:
|
||||
self.application.process_events()
|
||||
language = self.config.get('bibles_%s' % lang, 'title')
|
||||
lang_item = QtGui.QTreeWidgetItem(self.bibles_tree_widget, [language])
|
||||
bibles = self.config.get('bibles_%s' % lang, 'translations')
|
||||
bibles = bibles.split(',')
|
||||
for bible in bibles:
|
||||
self.application.process_events()
|
||||
title = self.config.get('bible_%s' % bible, 'title')
|
||||
filename = self.config.get('bible_%s' % bible, 'filename')
|
||||
item = QtGui.QTreeWidgetItem(lang_item, [title])
|
||||
|
@ -186,10 +238,38 @@ class FirstTimeForm(QtGui.QWizard, UiFirstTimeWizard, RegistryProperties):
|
|||
item.setCheckState(0, QtCore.Qt.Unchecked)
|
||||
item.setFlags(item.flags() | QtCore.Qt.ItemIsUserCheckable)
|
||||
self.bibles_tree_widget.expandAll()
|
||||
# Download the theme screenshots.
|
||||
self.theme_screenshot_thread = ThemeScreenshotThread(self)
|
||||
self.theme_screenshot_thread.start()
|
||||
self.application.set_normal_cursor()
|
||||
self.application.process_events()
|
||||
# Download the theme screenshots
|
||||
themes = self.config.get('themes', 'files').split(',')
|
||||
for theme in themes:
|
||||
self.application.process_events()
|
||||
title = self.config.get('theme_%s' % theme, 'title')
|
||||
filename = self.config.get('theme_%s' % theme, 'filename')
|
||||
screenshot = self.config.get('theme_%s' % theme, 'screenshot')
|
||||
worker = ThemeScreenshotWorker(self.themes_url, title, filename, screenshot)
|
||||
self.theme_screenshot_workers.append(worker)
|
||||
worker.screenshot_downloaded.connect(self.on_screenshot_downloaded)
|
||||
thread = QtCore.QThread(self)
|
||||
self.theme_screenshot_threads.append(thread)
|
||||
thread.started.connect(worker.run)
|
||||
worker.finished.connect(thread.quit)
|
||||
worker.moveToThread(thread)
|
||||
thread.start()
|
||||
|
||||
def set_defaults(self):
|
||||
"""
|
||||
Set up display at start of theme edit.
|
||||
"""
|
||||
self.restart()
|
||||
self.web = 'http://openlp.org/files/frw/'
|
||||
self.cancel_button.clicked.connect(self.on_cancel_button_clicked)
|
||||
self.no_internet_finish_button.clicked.connect(self.on_no_internet_finish_button_clicked)
|
||||
self.currentIdChanged.connect(self.on_current_id_changed)
|
||||
Registry().register_function('config_screen_changed', self.update_screen_list_combo)
|
||||
self.no_internet_finish_button.setVisible(False)
|
||||
# Check if this is a re-run of the wizard.
|
||||
self.has_run_wizard = Settings().value('core/has run wizard')
|
||||
check_directory_exists(os.path.join(gettempdir(), 'openlp'))
|
||||
|
||||
def update_screen_list_combo(self):
|
||||
"""
|
||||
|
@ -208,12 +288,20 @@ class FirstTimeForm(QtGui.QWizard, UiFirstTimeWizard, RegistryProperties):
|
|||
self.application.process_events()
|
||||
if page_id != -1:
|
||||
self.last_id = page_id
|
||||
if page_id == FirstTimePage.Plugins:
|
||||
if page_id == FirstTimePage.Download:
|
||||
self.back_button.setVisible(False)
|
||||
self.next_button.setVisible(False)
|
||||
# Set the no internet page text.
|
||||
if self.has_run_wizard:
|
||||
self.no_internet_label.setText(self.no_internet_text)
|
||||
else:
|
||||
self.no_internet_label.setText(self.no_internet_text + self.cancel_wizard_text)
|
||||
self.application.set_busy_cursor()
|
||||
self._download_index()
|
||||
self.application.set_normal_cursor()
|
||||
self.back_button.setVisible(False)
|
||||
self.next_button.setVisible(True)
|
||||
self.next()
|
||||
elif page_id == FirstTimePage.Defaults:
|
||||
self.theme_combo_box.clear()
|
||||
for index in range(self.themes_list_widget.count()):
|
||||
|
@ -233,15 +321,12 @@ class FirstTimeForm(QtGui.QWizard, UiFirstTimeWizard, RegistryProperties):
|
|||
elif page_id == FirstTimePage.NoInternet:
|
||||
self.back_button.setVisible(False)
|
||||
self.next_button.setVisible(False)
|
||||
self.cancel_button.setVisible(False)
|
||||
self.no_internet_finish_button.setVisible(True)
|
||||
if self.has_run_wizard:
|
||||
self.cancel_button.setVisible(False)
|
||||
elif page_id == FirstTimePage.Plugins:
|
||||
self.back_button.setVisible(False)
|
||||
elif page_id == FirstTimePage.Progress:
|
||||
self.application.set_busy_cursor()
|
||||
self.repaint()
|
||||
self.application.process_events()
|
||||
# Try to give the wizard a chance to redraw itself
|
||||
time.sleep(0.2)
|
||||
self._pre_wizard()
|
||||
self._perform_wizard()
|
||||
self._post_wizard()
|
||||
|
@ -251,17 +336,28 @@ class FirstTimeForm(QtGui.QWizard, UiFirstTimeWizard, RegistryProperties):
|
|||
"""
|
||||
Process the triggering of the cancel button.
|
||||
"""
|
||||
if self.last_id == FirstTimePage.NoInternet or \
|
||||
(self.last_id <= FirstTimePage.Plugins and not self.has_run_wizard):
|
||||
QtCore.QCoreApplication.exit()
|
||||
sys.exit()
|
||||
self.was_download_cancelled = True
|
||||
self.was_cancelled = True
|
||||
if self.theme_screenshot_workers:
|
||||
for worker in self.theme_screenshot_workers:
|
||||
worker.set_download_canceled(True)
|
||||
# Was the thread created.
|
||||
if self.theme_screenshot_thread:
|
||||
while self.theme_screenshot_thread.isRunning():
|
||||
if self.theme_screenshot_threads:
|
||||
while any([thread.isRunning() for thread in self.theme_screenshot_threads]):
|
||||
time.sleep(0.1)
|
||||
self.application.set_normal_cursor()
|
||||
|
||||
def on_screenshot_downloaded(self, title, filename):
|
||||
"""
|
||||
Add an item to the list when a theme has been downloaded
|
||||
|
||||
:param title: The title of the theme
|
||||
:param filename: The filename of the theme
|
||||
"""
|
||||
item = QtGui.QListWidgetItem(title, self.themes_list_widget)
|
||||
item.setData(QtCore.Qt.UserRole, filename)
|
||||
item.setCheckState(QtCore.Qt.Unchecked)
|
||||
item.setFlags(item.flags() | QtCore.Qt.ItemIsUserCheckable)
|
||||
|
||||
def on_no_internet_finish_button_clicked(self):
|
||||
"""
|
||||
Process the triggering of the "Finish" button on the No Internet page.
|
||||
|
@ -275,24 +371,42 @@ class FirstTimeForm(QtGui.QWizard, UiFirstTimeWizard, RegistryProperties):
|
|||
def url_get_file(self, url, f_path):
|
||||
""""
|
||||
Download a file given a URL. The file is retrieved in chunks, giving the ability to cancel the download at any
|
||||
point.
|
||||
point. Returns False on download error.
|
||||
|
||||
:param url: URL to download
|
||||
:param f_path: Destination file
|
||||
"""
|
||||
block_count = 0
|
||||
block_size = 4096
|
||||
url_file = urllib.request.urlopen(url)
|
||||
filename = open(f_path, "wb")
|
||||
# Download until finished or canceled.
|
||||
while not self.was_download_cancelled:
|
||||
data = url_file.read(block_size)
|
||||
if not data:
|
||||
break
|
||||
filename.write(data)
|
||||
block_count += 1
|
||||
self._download_progress(block_count, block_size)
|
||||
filename.close()
|
||||
retries = 0
|
||||
while True:
|
||||
try:
|
||||
url_file = urllib.request.urlopen(url, timeout=CONNECTION_TIMEOUT)
|
||||
filename = open(f_path, "wb")
|
||||
# Download until finished or canceled.
|
||||
while not self.was_cancelled:
|
||||
data = url_file.read(block_size)
|
||||
if not data:
|
||||
break
|
||||
filename.write(data)
|
||||
block_count += 1
|
||||
self._download_progress(block_count, block_size)
|
||||
filename.close()
|
||||
except ConnectionError:
|
||||
trace_error_handler(log)
|
||||
filename.close()
|
||||
os.remove(f_path)
|
||||
if retries > CONNECTION_RETRIES:
|
||||
return False
|
||||
else:
|
||||
retries += 1
|
||||
time.sleep(0.1)
|
||||
continue
|
||||
break
|
||||
# Delete file if cancelled, it may be a partial file.
|
||||
if self.was_download_cancelled:
|
||||
if self.was_cancelled:
|
||||
os.remove(f_path)
|
||||
return True
|
||||
|
||||
def _build_theme_screenshots(self):
|
||||
"""
|
||||
|
@ -303,6 +417,7 @@ class FirstTimeForm(QtGui.QWizard, UiFirstTimeWizard, RegistryProperties):
|
|||
for index, theme in enumerate(themes):
|
||||
screenshot = self.config.get('theme_%s' % theme, 'screenshot')
|
||||
item = self.themes_list_widget.item(index)
|
||||
# if item:
|
||||
item.setIcon(build_icon(os.path.join(gettempdir(), 'openlp', screenshot)))
|
||||
|
||||
def _get_file_size(self, url):
|
||||
|
@ -311,9 +426,19 @@ class FirstTimeForm(QtGui.QWizard, UiFirstTimeWizard, RegistryProperties):
|
|||
|
||||
:param url: The URL of the file we want to download.
|
||||
"""
|
||||
site = urllib.request.urlopen(url)
|
||||
meta = site.info()
|
||||
return int(meta.get("Content-Length"))
|
||||
retries = 0
|
||||
while True:
|
||||
try:
|
||||
site = urllib.request.urlopen(url, timeout=CONNECTION_TIMEOUT)
|
||||
meta = site.info()
|
||||
return int(meta.get("Content-Length"))
|
||||
except ConnectionException:
|
||||
if retries > CONNECTION_RETRIES:
|
||||
raise
|
||||
else:
|
||||
retries += 1
|
||||
time.sleep(0.1)
|
||||
continue
|
||||
|
||||
def _download_progress(self, count, block_size):
|
||||
"""
|
||||
|
@ -343,32 +468,41 @@ class FirstTimeForm(QtGui.QWizard, UiFirstTimeWizard, RegistryProperties):
|
|||
self.max_progress = 0
|
||||
self.finish_button.setVisible(False)
|
||||
self.application.process_events()
|
||||
# Loop through the songs list and increase for each selected item
|
||||
for i in range(self.songs_list_widget.count()):
|
||||
self.application.process_events()
|
||||
item = self.songs_list_widget.item(i)
|
||||
if item.checkState() == QtCore.Qt.Checked:
|
||||
filename = item.data(QtCore.Qt.UserRole)
|
||||
size = self._get_file_size('%s%s' % (self.songs_url, filename))
|
||||
self.max_progress += size
|
||||
# Loop through the Bibles list and increase for each selected item
|
||||
iterator = QtGui.QTreeWidgetItemIterator(self.bibles_tree_widget)
|
||||
while iterator.value():
|
||||
self.application.process_events()
|
||||
item = iterator.value()
|
||||
if item.parent() and item.checkState(0) == QtCore.Qt.Checked:
|
||||
filename = item.data(0, QtCore.Qt.UserRole)
|
||||
size = self._get_file_size('%s%s' % (self.bibles_url, filename))
|
||||
self.max_progress += size
|
||||
iterator += 1
|
||||
# Loop through the themes list and increase for each selected item
|
||||
for i in range(self.themes_list_widget.count()):
|
||||
self.application.process_events()
|
||||
item = self.themes_list_widget.item(i)
|
||||
if item.checkState() == QtCore.Qt.Checked:
|
||||
filename = item.data(QtCore.Qt.UserRole)
|
||||
size = self._get_file_size('%s%s' % (self.themes_url, filename))
|
||||
self.max_progress += size
|
||||
try:
|
||||
# Loop through the songs list and increase for each selected item
|
||||
for i in range(self.songs_list_widget.count()):
|
||||
self.application.process_events()
|
||||
item = self.songs_list_widget.item(i)
|
||||
if item.checkState() == QtCore.Qt.Checked:
|
||||
filename = item.data(QtCore.Qt.UserRole)
|
||||
size = self._get_file_size('%s%s' % (self.songs_url, filename))
|
||||
self.max_progress += size
|
||||
# Loop through the Bibles list and increase for each selected item
|
||||
iterator = QtGui.QTreeWidgetItemIterator(self.bibles_tree_widget)
|
||||
while iterator.value():
|
||||
self.application.process_events()
|
||||
item = iterator.value()
|
||||
if item.parent() and item.checkState(0) == QtCore.Qt.Checked:
|
||||
filename = item.data(0, QtCore.Qt.UserRole)
|
||||
size = self._get_file_size('%s%s' % (self.bibles_url, filename))
|
||||
self.max_progress += size
|
||||
iterator += 1
|
||||
# Loop through the themes list and increase for each selected item
|
||||
for i in range(self.themes_list_widget.count()):
|
||||
self.application.process_events()
|
||||
item = self.themes_list_widget.item(i)
|
||||
if item.checkState() == QtCore.Qt.Checked:
|
||||
filename = item.data(QtCore.Qt.UserRole)
|
||||
size = self._get_file_size('%s%s' % (self.themes_url, filename))
|
||||
self.max_progress += size
|
||||
except ConnectionError:
|
||||
trace_error_handler(log)
|
||||
critical_error_message_box(translate('OpenLP.FirstTimeWizard', 'Download Error'),
|
||||
translate('OpenLP.FirstTimeWizard', 'There was a connection problem during '
|
||||
'download, so further downloads will be skipped. Try to re-run the '
|
||||
'First Time Wizard later.'))
|
||||
self.max_progress = 0
|
||||
self.web_access = None
|
||||
if self.max_progress:
|
||||
# Add on 2 for plugins status setting plus a "finished" point.
|
||||
self.max_progress += 2
|
||||
|
@ -432,38 +566,11 @@ class FirstTimeForm(QtGui.QWizard, UiFirstTimeWizard, RegistryProperties):
|
|||
self._set_plugin_status(self.song_usage_check_box, 'songusage/status')
|
||||
self._set_plugin_status(self.alert_check_box, 'alerts/status')
|
||||
if self.web_access:
|
||||
# Build directories for downloads
|
||||
songs_destination = os.path.join(gettempdir(), 'openlp')
|
||||
bibles_destination = AppLocation.get_section_data_path('bibles')
|
||||
themes_destination = AppLocation.get_section_data_path('themes')
|
||||
# Download songs
|
||||
for i in range(self.songs_list_widget.count()):
|
||||
item = self.songs_list_widget.item(i)
|
||||
if item.checkState() == QtCore.Qt.Checked:
|
||||
filename = item.data(QtCore.Qt.UserRole)
|
||||
self._increment_progress_bar(self.downloading % filename, 0)
|
||||
self.previous_size = 0
|
||||
destination = os.path.join(songs_destination, str(filename))
|
||||
self.url_get_file('%s%s' % (self.songs_url, filename), destination)
|
||||
# Download Bibles
|
||||
bibles_iterator = QtGui.QTreeWidgetItemIterator(
|
||||
self.bibles_tree_widget)
|
||||
while bibles_iterator.value():
|
||||
item = bibles_iterator.value()
|
||||
if item.parent() and item.checkState(0) == QtCore.Qt.Checked:
|
||||
bible = item.data(0, QtCore.Qt.UserRole)
|
||||
self._increment_progress_bar(self.downloading % bible, 0)
|
||||
self.previous_size = 0
|
||||
self.url_get_file('%s%s' % (self.bibles_url, bible), os.path.join(bibles_destination, bible))
|
||||
bibles_iterator += 1
|
||||
# Download themes
|
||||
for i in range(self.themes_list_widget.count()):
|
||||
item = self.themes_list_widget.item(i)
|
||||
if item.checkState() == QtCore.Qt.Checked:
|
||||
theme = item.data(QtCore.Qt.UserRole)
|
||||
self._increment_progress_bar(self.downloading % theme, 0)
|
||||
self.previous_size = 0
|
||||
self.url_get_file('%s%s' % (self.themes_url, theme), os.path.join(themes_destination, theme))
|
||||
if not self._download_selected():
|
||||
critical_error_message_box(translate('OpenLP.FirstTimeWizard', 'Download Error'),
|
||||
translate('OpenLP.FirstTimeWizard', 'There was a connection problem while '
|
||||
'downloading, so further downloads will be skipped. Try to re-run '
|
||||
'the First Time Wizard later.'))
|
||||
# Set Default Display
|
||||
if self.display_combo_box.currentIndex() != -1:
|
||||
Settings().setValue('core/monitor', self.display_combo_box.currentIndex())
|
||||
|
@ -472,6 +579,46 @@ class FirstTimeForm(QtGui.QWizard, UiFirstTimeWizard, RegistryProperties):
|
|||
if self.theme_combo_box.currentIndex() != -1:
|
||||
Settings().setValue('themes/global theme', self.theme_combo_box.currentText())
|
||||
|
||||
def _download_selected(self):
|
||||
"""
|
||||
Download selected songs, bibles and themes. Returns False on download error
|
||||
"""
|
||||
# Build directories for downloads
|
||||
songs_destination = os.path.join(gettempdir(), 'openlp')
|
||||
bibles_destination = AppLocation.get_section_data_path('bibles')
|
||||
themes_destination = AppLocation.get_section_data_path('themes')
|
||||
# Download songs
|
||||
for i in range(self.songs_list_widget.count()):
|
||||
item = self.songs_list_widget.item(i)
|
||||
if item.checkState() == QtCore.Qt.Checked:
|
||||
filename = item.data(QtCore.Qt.UserRole)
|
||||
self._increment_progress_bar(self.downloading % filename, 0)
|
||||
self.previous_size = 0
|
||||
destination = os.path.join(songs_destination, str(filename))
|
||||
if not self.url_get_file('%s%s' % (self.songs_url, filename), destination):
|
||||
return False
|
||||
# Download Bibles
|
||||
bibles_iterator = QtGui.QTreeWidgetItemIterator(self.bibles_tree_widget)
|
||||
while bibles_iterator.value():
|
||||
item = bibles_iterator.value()
|
||||
if item.parent() and item.checkState(0) == QtCore.Qt.Checked:
|
||||
bible = item.data(0, QtCore.Qt.UserRole)
|
||||
self._increment_progress_bar(self.downloading % bible, 0)
|
||||
self.previous_size = 0
|
||||
if not self.url_get_file('%s%s' % (self.bibles_url, bible), os.path.join(bibles_destination, bible)):
|
||||
return False
|
||||
bibles_iterator += 1
|
||||
# Download themes
|
||||
for i in range(self.themes_list_widget.count()):
|
||||
item = self.themes_list_widget.item(i)
|
||||
if item.checkState() == QtCore.Qt.Checked:
|
||||
theme = item.data(QtCore.Qt.UserRole)
|
||||
self._increment_progress_bar(self.downloading % theme, 0)
|
||||
self.previous_size = 0
|
||||
if not self.url_get_file('%s%s' % (self.themes_url, theme), os.path.join(themes_destination, theme)):
|
||||
return False
|
||||
return True
|
||||
|
||||
def _set_plugin_status(self, field, tag):
|
||||
"""
|
||||
Set the status of a plugin.
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -41,13 +41,14 @@ class FirstTimePage(object):
|
|||
An enumeration class with each of the pages of the wizard.
|
||||
"""
|
||||
Welcome = 0
|
||||
Plugins = 1
|
||||
Download = 1
|
||||
NoInternet = 2
|
||||
Songs = 3
|
||||
Bibles = 4
|
||||
Themes = 5
|
||||
Defaults = 6
|
||||
Progress = 7
|
||||
Plugins = 3
|
||||
Songs = 4
|
||||
Bibles = 5
|
||||
Themes = 6
|
||||
Defaults = 7
|
||||
Progress = 8
|
||||
|
||||
|
||||
class UiFirstTimeWizard(object):
|
||||
|
@ -78,6 +79,27 @@ class UiFirstTimeWizard(object):
|
|||
self.next_button = self.button(QtGui.QWizard.NextButton)
|
||||
self.back_button = self.button(QtGui.QWizard.BackButton)
|
||||
add_welcome_page(first_time_wizard, ':/wizards/wizard_firsttime.bmp')
|
||||
# The download page
|
||||
self.download_page = QtGui.QWizardPage()
|
||||
self.download_page.setObjectName('download_page')
|
||||
self.download_layout = QtGui.QVBoxLayout(self.download_page)
|
||||
self.download_layout.setMargin(48)
|
||||
self.download_layout.setObjectName('download_layout')
|
||||
self.download_label = QtGui.QLabel(self.download_page)
|
||||
self.download_label.setObjectName('download_label')
|
||||
self.download_layout.addWidget(self.download_label)
|
||||
first_time_wizard.setPage(FirstTimePage.Download, self.download_page)
|
||||
# The "you don't have an internet connection" page.
|
||||
self.no_internet_page = QtGui.QWizardPage()
|
||||
self.no_internet_page.setObjectName('no_internet_page')
|
||||
self.no_internet_layout = QtGui.QVBoxLayout(self.no_internet_page)
|
||||
self.no_internet_layout.setContentsMargins(50, 30, 50, 40)
|
||||
self.no_internet_layout.setObjectName('no_internet_layout')
|
||||
self.no_internet_label = QtGui.QLabel(self.no_internet_page)
|
||||
self.no_internet_label.setWordWrap(True)
|
||||
self.no_internet_label.setObjectName('no_internet_label')
|
||||
self.no_internet_layout.addWidget(self.no_internet_label)
|
||||
first_time_wizard.setPage(FirstTimePage.NoInternet, self.no_internet_page)
|
||||
# The plugins page
|
||||
self.plugin_page = QtGui.QWizardPage()
|
||||
self.plugin_page.setObjectName('plugin_page')
|
||||
|
@ -120,17 +142,6 @@ class UiFirstTimeWizard(object):
|
|||
self.alert_check_box.setObjectName('alert_check_box')
|
||||
self.plugin_layout.addWidget(self.alert_check_box)
|
||||
first_time_wizard.setPage(FirstTimePage.Plugins, self.plugin_page)
|
||||
# The "you don't have an internet connection" page.
|
||||
self.no_internet_page = QtGui.QWizardPage()
|
||||
self.no_internet_page.setObjectName('no_internet_page')
|
||||
self.no_internet_layout = QtGui.QVBoxLayout(self.no_internet_page)
|
||||
self.no_internet_layout.setContentsMargins(50, 30, 50, 40)
|
||||
self.no_internet_layout.setObjectName('no_internet_layout')
|
||||
self.no_internet_label = QtGui.QLabel(self.no_internet_page)
|
||||
self.no_internet_label.setWordWrap(True)
|
||||
self.no_internet_label.setObjectName('no_internet_label')
|
||||
self.no_internet_layout.addWidget(self.no_internet_label)
|
||||
first_time_wizard.setPage(FirstTimePage.NoInternet, self.no_internet_page)
|
||||
# The song samples page
|
||||
self.songs_page = QtGui.QWizardPage()
|
||||
self.songs_page.setObjectName('songs_page')
|
||||
|
@ -221,6 +232,11 @@ class UiFirstTimeWizard(object):
|
|||
translate('OpenLP.FirstTimeWizard', 'This wizard will help you to configure OpenLP for initial use. '
|
||||
'Click the %s button below to start.') %
|
||||
clean_button_text(first_time_wizard.buttonText(QtGui.QWizard.NextButton)))
|
||||
self.download_page.setTitle(translate('OpenLP.FirstTimeWizard', 'Downloading Resource Index'))
|
||||
self.download_page.setSubTitle(translate('OpenLP.FirstTimeWizard', 'Please wait while the resource index is '
|
||||
'downloaded.'))
|
||||
self.download_label.setText(translate('OpenLP.FirstTimeWizard', 'Please wait while OpenLP downloads the '
|
||||
'resource index file...'))
|
||||
self.plugin_page.setTitle(translate('OpenLP.FirstTimeWizard', 'Activate required Plugins'))
|
||||
self.plugin_page.setSubTitle(translate('OpenLP.FirstTimeWizard', 'Select the Plugins you wish to use. '))
|
||||
self.songs_check_box.setText(translate('OpenLP.FirstTimeWizard', 'Songs'))
|
||||
|
@ -257,5 +273,8 @@ class UiFirstTimeWizard(object):
|
|||
'Set up default settings to be used by OpenLP.'))
|
||||
self.display_label.setText(translate('OpenLP.FirstTimeWizard', 'Default output display:'))
|
||||
self.theme_label.setText(translate('OpenLP.FirstTimeWizard', 'Select default theme:'))
|
||||
self.progress_page.setTitle(translate('OpenLP.FirstTimeWizard', 'Downloading and Configuring'))
|
||||
self.progress_page.setSubTitle(translate('OpenLP.FirstTimeWizard', 'Please wait while resources are downloaded '
|
||||
'and OpenLP is configured.'))
|
||||
self.progress_label.setText(translate('OpenLP.FirstTimeWizard', 'Starting configuration process...'))
|
||||
first_time_wizard.setButtonText(QtGui.QWizard.CustomButton1, translate('OpenLP.FirstTimeWizard', 'Finish'))
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -174,6 +174,16 @@ class MainDisplay(OpenLPMixin, Display, RegistryProperties):
|
|||
Registry().register_function('live_display_show', self.show_display)
|
||||
Registry().register_function('update_display_css', self.css_changed)
|
||||
|
||||
def close(self):
|
||||
"""
|
||||
Remove registered function on close.
|
||||
"""
|
||||
if self.is_live:
|
||||
Registry().remove_function('live_display_hide', self.hide_display)
|
||||
Registry().remove_function('live_display_show', self.show_display)
|
||||
Registry().remove_function('update_display_css', self.css_changed)
|
||||
super().close()
|
||||
|
||||
def set_transparency(self, enabled):
|
||||
"""
|
||||
Set the transparency of the window
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -690,7 +690,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow, RegistryProperties):
|
|||
first_run_wizard = FirstTimeForm(self)
|
||||
first_run_wizard.initialize(ScreenList())
|
||||
first_run_wizard.exec_()
|
||||
if first_run_wizard.was_download_cancelled:
|
||||
if first_run_wizard.was_cancelled:
|
||||
return
|
||||
self.application.set_busy_cursor()
|
||||
self.first_time()
|
||||
|
@ -706,7 +706,10 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow, RegistryProperties):
|
|||
self.active_plugin.toggle_status(PluginStatus.Inactive)
|
||||
# Set global theme and
|
||||
Registry().execute('theme_update_global')
|
||||
# Load the themes from files
|
||||
self.theme_manager_contents.load_first_time_themes()
|
||||
# Update the theme widget
|
||||
self.theme_manager_contents.load_themes()
|
||||
# Check if any Bibles downloaded. If there are, they will be processed.
|
||||
Registry().execute('bibles_load_list', True)
|
||||
self.application.set_normal_cursor()
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -217,6 +217,8 @@ class MediaController(RegistryMixin, OpenLPMixin, RegistryProperties):
|
|||
if self.current_media_players[source].state != MediaState.Paused:
|
||||
display = self._define_display(self.display_controllers[source])
|
||||
display.controller.seek_slider.setSliderPosition(0)
|
||||
display.controller.mediabar.actions['playbackPlay'].setVisible(True)
|
||||
display.controller.mediabar.actions['playbackPause'].setVisible(False)
|
||||
self.timer.stop()
|
||||
|
||||
def get_media_display_css(self):
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -39,6 +39,7 @@ from openlp.core.lib import translate
|
|||
|
||||
from openlp.core.ui.media import MediaState
|
||||
from openlp.core.ui.media.mediaplayer import MediaPlayer
|
||||
from openlp.core.common import is_macosx
|
||||
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
@ -124,7 +125,11 @@ class PhononPlayer(MediaPlayer):
|
|||
"""
|
||||
Check if the player is available
|
||||
"""
|
||||
return True
|
||||
# At the moment we don't have support for phononplayer on Mac OS X
|
||||
if is_macosx():
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
def load(self, display):
|
||||
"""
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Eric Ludin, Edwin Lunando, Brian T. Meyer, #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Eric Ludin, Edwin Lunando, Brian T. Meyer, #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -77,6 +77,7 @@ VIDEO_EXT = [
|
|||
'*.asf', '*.wmv',
|
||||
'*.au',
|
||||
'*.avi',
|
||||
'*.divx',
|
||||
'*.flv',
|
||||
'*.mov',
|
||||
'*.mp4', '*.m4v',
|
||||
|
@ -95,7 +96,8 @@ VIDEO_EXT = [
|
|||
'*.xa',
|
||||
'*.iso',
|
||||
'*.vob',
|
||||
'*.webm'
|
||||
'*.webm',
|
||||
'*.xvid'
|
||||
]
|
||||
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -33,7 +33,7 @@ from PyQt4 import QtGui
|
|||
|
||||
import logging
|
||||
|
||||
from openlp.core.common import Settings
|
||||
from openlp.core.common import Settings, is_macosx
|
||||
from openlp.core.lib import translate
|
||||
from openlp.core.ui.media import MediaState
|
||||
from openlp.core.ui.media.mediaplayer import MediaPlayer
|
||||
|
@ -231,7 +231,11 @@ class WebkitPlayer(MediaPlayer):
|
|||
"""
|
||||
Check the availability of the media player
|
||||
"""
|
||||
return True
|
||||
# At the moment we don't have support for webkitplayer on Mac OS X
|
||||
if is_macosx():
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
def load(self, display):
|
||||
"""
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -132,6 +132,7 @@ class Ui_ProjectorEditForm(object):
|
|||
self.location_label.setText(translate('OpenLP.ProjectorEditForm', 'Location'))
|
||||
self.location_text.setText(self.projector.location)
|
||||
self.notes_label.setText(translate('OpenLP.ProjectorEditForm', 'Notes'))
|
||||
self.notes_text.clear()
|
||||
self.notes_text.insertPlainText(self.projector.notes)
|
||||
|
||||
|
||||
|
@ -167,7 +168,6 @@ class ProjectorEditForm(QDialog, Ui_ProjectorEditForm):
|
|||
self.new_projector = False
|
||||
self.retranslateUi(self)
|
||||
reply = QDialog.exec_(self)
|
||||
self.projector = None
|
||||
return reply
|
||||
|
||||
@pyqtSlot()
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -562,9 +562,8 @@ class ProjectorManager(OpenLPMixin, RegistryMixin, QWidget, Ui_ProjectorManager,
|
|||
return
|
||||
self.old_projector = projector
|
||||
projector.link.disconnect_from_host()
|
||||
record = self.projectordb.get_projector_by_ip(projector.link.ip)
|
||||
self.projector_form.exec_(record)
|
||||
new_record = self.projectordb.get_projector_by_id(record.id)
|
||||
self.projector_form.exec_(projector.db_item)
|
||||
projector.db_item = self.projectordb.get_projector_by_id(self.old_projector.db_item.id)
|
||||
|
||||
def on_poweroff_projector(self, opt=None):
|
||||
"""
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -152,16 +152,19 @@ def set_button_tooltip(bar):
|
|||
"""
|
||||
for button in bar.buttons():
|
||||
if bar.standardButton(button) == QDialogButtonBox.Cancel:
|
||||
tip = "Ignoring current changes and return to OpenLP"
|
||||
button.setToolTip(translate('OpenLP.SourceSelectForm',
|
||||
'Ignoring current changes and return to OpenLP'))
|
||||
elif bar.standardButton(button) == QDialogButtonBox.Reset:
|
||||
tip = "Delete all user-defined text and revert to PJLink default text"
|
||||
button.setToolTip(translate('OpenLP.SourceSelectForm',
|
||||
'Delete all user-defined text and revert to PJLink default text'))
|
||||
elif bar.standardButton(button) == QDialogButtonBox.Discard:
|
||||
tip = "Discard changes and reset to previous user-defined text"
|
||||
button.setToolTip(translate('OpenLP.SourceSelectForm',
|
||||
'Discard changes and reset to previous user-defined text'))
|
||||
elif bar.standardButton(button) == QDialogButtonBox.Ok:
|
||||
tip = "Save changes and return to OpenLP"
|
||||
button.setToolTip(translate('OpenLP.SourceSelectForm',
|
||||
'Save changes and return to OpenLP'))
|
||||
else:
|
||||
tip = ""
|
||||
button.setToolTip(tip)
|
||||
log.debug('No tooltip for button {}'.format(button.text()))
|
||||
|
||||
|
||||
class FingerTabBarWidget(QTabBar):
|
||||
|
@ -237,12 +240,13 @@ class SourceSelectTabs(QDialog):
|
|||
"""
|
||||
log.debug('Initializing SourceSelectTabs()')
|
||||
super(SourceSelectTabs, self).__init__(parent)
|
||||
self.setMinimumWidth(350)
|
||||
self.projectordb = projectordb
|
||||
self.edit = edit
|
||||
if self.edit:
|
||||
title = translate('OpenLP.SourceSelectForm', 'Select Projector Source')
|
||||
else:
|
||||
title = translate('OpenLP.SourceSelectForm', 'Edit Projector Source Text')
|
||||
else:
|
||||
title = translate('OpenLP.SourceSelectForm', 'Select Projector Source')
|
||||
self.setWindowTitle(title)
|
||||
self.setObjectName('source_select_tabs')
|
||||
self.setWindowIcon(build_icon(':/icon/openlp-log-32x32.png'))
|
||||
|
@ -286,6 +290,10 @@ class SourceSelectTabs(QDialog):
|
|||
thistab = self.tabwidget.addTab(tab, PJLINK_DEFAULT_SOURCES[key])
|
||||
if buttonchecked:
|
||||
self.tabwidget.setCurrentIndex(thistab)
|
||||
self.button_box = QDialogButtonBox(QtGui.QDialogButtonBox.Reset |
|
||||
QtGui.QDialogButtonBox.Discard |
|
||||
QtGui.QDialogButtonBox.Ok |
|
||||
QtGui.QDialogButtonBox.Cancel)
|
||||
else:
|
||||
for key in keys:
|
||||
(tab, button_count, buttonchecked) = Build_Tab(group=self.button_group,
|
||||
|
@ -297,10 +305,8 @@ class SourceSelectTabs(QDialog):
|
|||
thistab = self.tabwidget.addTab(tab, PJLINK_DEFAULT_SOURCES[key])
|
||||
if buttonchecked:
|
||||
self.tabwidget.setCurrentIndex(thistab)
|
||||
self.button_box = QDialogButtonBox(QtGui.QDialogButtonBox.Reset |
|
||||
QtGui.QDialogButtonBox.Discard |
|
||||
QtGui.QDialogButtonBox.Ok |
|
||||
QtGui.QDialogButtonBox.Cancel)
|
||||
self.button_box = QDialogButtonBox(QtGui.QDialogButtonBox.Ok |
|
||||
QtGui.QDialogButtonBox.Cancel)
|
||||
self.button_box.clicked.connect(self.button_clicked)
|
||||
self.layout.addWidget(self.button_box)
|
||||
set_button_tooltip(self.button_box)
|
||||
|
@ -321,9 +327,9 @@ class SourceSelectTabs(QDialog):
|
|||
if self.button_box.standardButton(button) == self.button_box.Cancel:
|
||||
self.done(0)
|
||||
elif self.button_box.standardButton(button) == self.button_box.Reset:
|
||||
self.delete_sources()
|
||||
elif self.button_box.standardButton(button) == self.button_box.Discard:
|
||||
self.done(100)
|
||||
elif self.button_box.standardButton(button) == self.button_box.Discard:
|
||||
self.delete_sources()
|
||||
elif self.button_box.standardButton(button) == self.button_box.Ok:
|
||||
return self.accept_me()
|
||||
else:
|
||||
|
@ -331,9 +337,11 @@ class SourceSelectTabs(QDialog):
|
|||
|
||||
def delete_sources(self):
|
||||
msg = QtGui.QMessageBox()
|
||||
msg.setText('Delete entries for this projector')
|
||||
msg.setInformativeText('Are you sure you want to delete ALL user-defined '
|
||||
'source input text for this projector?')
|
||||
msg.setText(translate('OpenLP.SourceSelectForm', 'Delete entries for this projector'))
|
||||
msg.setInformativeText(translate('OpenLP.SourceSelectForm',
|
||||
'Are you sure you want to delete ALL user-defined '),
|
||||
translate('OpenLP.SourceSelectForm',
|
||||
'source input text for this projector?'))
|
||||
msg.setStandardButtons(msg.Cancel | msg.Ok)
|
||||
msg.setDefaultButton(msg.Cancel)
|
||||
ans = msg.exec_()
|
||||
|
@ -382,7 +390,11 @@ class SourceSelectSingle(QDialog):
|
|||
log.debug('Initializing SourceSelectSingle()')
|
||||
self.projectordb = projectordb
|
||||
super(SourceSelectSingle, self).__init__(parent)
|
||||
self.setWindowTitle(translate('OpenLP.SourceSelectSingle', 'Select Projector Source'))
|
||||
self.edit = edit
|
||||
if self.edit:
|
||||
title = translate('OpenLP.SourceSelectForm', 'Edit Projector Source Text')
|
||||
else:
|
||||
title = translate('OpenLP.SourceSelectForm', 'Select Projector Source')
|
||||
self.setObjectName('source_select_single')
|
||||
self.setWindowIcon(build_icon(':/icon/openlp-log-32x32.png'))
|
||||
self.setModal(True)
|
||||
|
@ -418,6 +430,10 @@ class SourceSelectSingle(QDialog):
|
|||
item.setText(source_item.text)
|
||||
self.layout.addRow(PJLINK_DEFAULT_CODES[key], item)
|
||||
self.button_group.append(item)
|
||||
self.button_box = QDialogButtonBox(QtGui.QDialogButtonBox.Reset |
|
||||
QtGui.QDialogButtonBox.Discard |
|
||||
QtGui.QDialogButtonBox.Ok |
|
||||
QtGui.QDialogButtonBox.Cancel)
|
||||
else:
|
||||
for key in keys:
|
||||
source_text = self.projectordb.get_source_by_code(code=key, projector_id=self.projector.db_item.id)
|
||||
|
@ -427,10 +443,8 @@ class SourceSelectSingle(QDialog):
|
|||
self.layout.addWidget(button)
|
||||
self.button_group.addButton(button, int(key))
|
||||
button_list.append(key)
|
||||
self.button_box = QDialogButtonBox(QtGui.QDialogButtonBox.Reset |
|
||||
QtGui.QDialogButtonBox.Discard |
|
||||
QtGui.QDialogButtonBox.Ok |
|
||||
QtGui.QDialogButtonBox.Cancel)
|
||||
self.button_box = QDialogButtonBox(QtGui.QDialogButtonBox.Ok |
|
||||
QtGui.QDialogButtonBox.Cancel)
|
||||
self.button_box.clicked.connect(self.button_clicked)
|
||||
self.layout.addWidget(self.button_box)
|
||||
self.setMinimumHeight(key_count*25)
|
||||
|
@ -452,9 +466,9 @@ class SourceSelectSingle(QDialog):
|
|||
if self.button_box.standardButton(button) == self.button_box.Cancel:
|
||||
self.done(0)
|
||||
elif self.button_box.standardButton(button) == self.button_box.Reset:
|
||||
self.delete_sources()
|
||||
elif self.button_box.standardButton(button) == self.button_box.Discard:
|
||||
self.done(100)
|
||||
elif self.button_box.standardButton(button) == self.button_box.Discard:
|
||||
self.delete_sources()
|
||||
elif self.button_box.standardButton(button) == self.button_box.Ok:
|
||||
return self.accept_me()
|
||||
else:
|
||||
|
@ -462,9 +476,11 @@ class SourceSelectSingle(QDialog):
|
|||
|
||||
def delete_sources(self):
|
||||
msg = QtGui.QMessageBox()
|
||||
msg.setText('Delete entries for this projector')
|
||||
msg.setInformativeText('Are you sure you want to delete ALL user-defined '
|
||||
'source input text for this projector?')
|
||||
msg.setText(translate('OpenLP.SourceSelectForm', 'Delete entries for this projector'))
|
||||
msg.setInformativeText(translate('OpenLP.SourceSelectForm',
|
||||
'Are you sure you want to delete ALL user-defined '),
|
||||
translate('OpenLP.SourceSelectForm',
|
||||
'source input text for this projector?'))
|
||||
msg.setStandardButtons(msg.Cancel | msg.Ok)
|
||||
msg.setDefaultButton(msg.Cancel)
|
||||
ans = msg.exec_()
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -747,8 +747,7 @@ class ServiceManager(OpenLPMixin, RegistryMixin, QtGui.QWidget, Ui_ServiceManage
|
|||
'File is not a valid service.\n The content encoding is not UTF-8.'))
|
||||
continue
|
||||
os_file = ucs_file.replace('/', os.path.sep)
|
||||
if not os_file.startswith('audio'):
|
||||
os_file = os.path.split(os_file)[1]
|
||||
os_file = os.path.basename(os_file)
|
||||
self.log_debug('Extract file: %s' % os_file)
|
||||
zip_info.filename = os_file
|
||||
zip_file.extract(zip_info, self.service_path)
|
||||
|
@ -884,7 +883,8 @@ class ServiceManager(OpenLPMixin, RegistryMixin, QtGui.QWidget, Ui_ServiceManage
|
|||
# TODO for future: make group explains itself more visually
|
||||
else:
|
||||
self.auto_play_slides_menu.menuAction().setVisible(False)
|
||||
if service_item['service_item'].is_capable(ItemCapabilities.HasVariableStartTime):
|
||||
if service_item['service_item'].is_capable(ItemCapabilities.HasVariableStartTime) and \
|
||||
not service_item['service_item'].is_capable(ItemCapabilities.IsOptical):
|
||||
self.time_action.setVisible(True)
|
||||
if service_item['service_item'].is_capable(ItemCapabilities.CanAutoStartForLive):
|
||||
self.auto_start_action.setVisible(True)
|
||||
|
@ -1479,8 +1479,6 @@ class ServiceManager(OpenLPMixin, RegistryMixin, QtGui.QWidget, Ui_ServiceManage
|
|||
if self.service_items and item < len(self.service_items) and \
|
||||
self.service_items[item]['service_item'].is_capable(ItemCapabilities.CanPreview):
|
||||
self.preview_controller.add_service_manager_item(self.service_items[item]['service_item'], 0)
|
||||
next_item = self.service_manager_list.topLevelItem(item)
|
||||
self.service_manager_list.setCurrentItem(next_item)
|
||||
self.live_controller.preview_widget.setFocus()
|
||||
else:
|
||||
critical_error_message_box(translate('OpenLP.ServiceManager', 'Missing Display Handler'),
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -33,6 +33,7 @@ The :mod:`slidecontroller` module contains the most important part of OpenLP - t
|
|||
import os
|
||||
import copy
|
||||
from collections import deque
|
||||
from threading import Lock
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
|
@ -104,6 +105,35 @@ class DisplayController(QtGui.QWidget):
|
|||
Registry().execute('%s' % sender, [controller, args])
|
||||
|
||||
|
||||
class InfoLabel(QtGui.QLabel):
|
||||
"""
|
||||
InfoLabel is a subclassed QLabel. Created to provide the ablilty to add a ellipsis if the text is cut off. Original
|
||||
source: https://stackoverflow.com/questions/11446478/pyside-pyqt-truncate-text-in-qlabel-based-on-minimumsize
|
||||
"""
|
||||
|
||||
def paintEvent(self, event):
|
||||
"""
|
||||
Reimplemented to allow the drawing of elided text if the text is longer than the width of the label
|
||||
"""
|
||||
painter = QtGui.QPainter(self)
|
||||
metrics = QtGui.QFontMetrics(self.font())
|
||||
elided = metrics.elidedText(self.text(), QtCore.Qt.ElideRight, self.width())
|
||||
# If the text is elided align it left to stop it jittering as the label is resized
|
||||
if elided == self.text():
|
||||
alignment = QtCore.Qt.AlignCenter
|
||||
else:
|
||||
alignment = QtCore.Qt.AlignLeft
|
||||
painter.drawText(self.rect(), alignment, elided)
|
||||
|
||||
|
||||
def setText(self, text):
|
||||
"""
|
||||
Reimplemented to set the tool tip text.
|
||||
"""
|
||||
self.setToolTip(text)
|
||||
super().setText(text)
|
||||
|
||||
|
||||
class SlideController(DisplayController, RegistryProperties):
|
||||
"""
|
||||
SlideController is the slide controller widget. This widget is what the
|
||||
|
@ -131,6 +161,8 @@ class SlideController(DisplayController, RegistryProperties):
|
|||
self.ratio = self.screens.current['size'].width() / self.screens.current['size'].height()
|
||||
except ZeroDivisionError:
|
||||
self.ratio = 1
|
||||
self.process_queue_lock = Lock()
|
||||
self.slide_selected_lock = Lock()
|
||||
self.timer_id = 0
|
||||
self.song_edit = False
|
||||
self.selected_row = 0
|
||||
|
@ -141,6 +173,7 @@ class SlideController(DisplayController, RegistryProperties):
|
|||
self.slide_list = {}
|
||||
self.slide_count = 0
|
||||
self.slide_image = None
|
||||
self.controller_width = -1
|
||||
# Layout for holding panel
|
||||
self.panel_layout = QtGui.QVBoxLayout(self.panel)
|
||||
self.panel_layout.setSpacing(0)
|
||||
|
@ -155,8 +188,8 @@ class SlideController(DisplayController, RegistryProperties):
|
|||
self.type_label.setText(UiStrings().Preview)
|
||||
self.panel_layout.addWidget(self.type_label)
|
||||
# Info label for the title of the current item, at the top of the slide controller
|
||||
self.info_label = QtGui.QLabel(self.panel)
|
||||
self.info_label.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.info_label = InfoLabel(self.panel)
|
||||
self.info_label.setSizePolicy(QtGui.QSizePolicy.Ignored, QtGui.QSizePolicy.Preferred)
|
||||
self.panel_layout.addWidget(self.info_label)
|
||||
# Splitter
|
||||
self.splitter = QtGui.QSplitter(self.panel)
|
||||
|
@ -331,9 +364,6 @@ class SlideController(DisplayController, RegistryProperties):
|
|||
self.slide_layout.setMargin(0)
|
||||
self.slide_layout.setObjectName('SlideLayout')
|
||||
self.preview_display = Display(self)
|
||||
self.preview_display.setGeometry(QtCore.QRect(0, 0, 300, 300))
|
||||
self.preview_display.screen = {'size': self.preview_display.geometry()}
|
||||
self.preview_display.setup()
|
||||
self.slide_layout.insertWidget(0, self.preview_display)
|
||||
self.preview_display.hide()
|
||||
# Actual preview screen
|
||||
|
@ -382,13 +412,11 @@ class SlideController(DisplayController, RegistryProperties):
|
|||
Registry().register_function('slidecontroller_live_spin_delay', self.receive_spin_delay)
|
||||
self.toolbar.set_widget_visible(LOOP_LIST, False)
|
||||
self.toolbar.set_widget_visible(WIDE_MENU, False)
|
||||
else:
|
||||
self.preview_widget.doubleClicked.connect(self.on_preview_add_to_service)
|
||||
self.toolbar.set_widget_visible(['editSong'], False)
|
||||
if self.is_live:
|
||||
self.set_live_hot_keys(self)
|
||||
self.__add_actions_to_widget(self.controller)
|
||||
else:
|
||||
self.preview_widget.doubleClicked.connect(self.on_preview_add_to_service)
|
||||
self.toolbar.set_widget_visible(['editSong'], False)
|
||||
self.controller.addActions([self.next_item, self.previous_item])
|
||||
Registry().register_function('slidecontroller_%s_stop_loop' % self.type_prefix, self.on_stop_loop)
|
||||
Registry().register_function('slidecontroller_%s_change' % self.type_prefix, self.on_slide_change)
|
||||
|
@ -493,6 +521,11 @@ class SlideController(DisplayController, RegistryProperties):
|
|||
"""
|
||||
self.display.setVisible(False)
|
||||
self.media_controller.media_stop(self)
|
||||
# Stop looping if active
|
||||
if self.play_slides_loop.isChecked():
|
||||
self.on_play_slides_loop(False)
|
||||
elif self.play_slides_once.isChecked():
|
||||
self.on_play_slides_once(False)
|
||||
|
||||
def toggle_display(self, action):
|
||||
"""
|
||||
|
@ -530,9 +563,9 @@ class SlideController(DisplayController, RegistryProperties):
|
|||
Process the service item request queue. The key presses can arrive
|
||||
faster than the processing so implement a FIFO queue.
|
||||
"""
|
||||
if self.keypress_queue:
|
||||
while len(self.keypress_queue) and not self.keypress_loop:
|
||||
self.keypress_loop = True
|
||||
# Make sure only one thread get in here. Just return if already locked.
|
||||
if self.keypress_queue and self.process_queue_lock.acquire(False):
|
||||
while len(self.keypress_queue):
|
||||
keypress_command = self.keypress_queue.popleft()
|
||||
if keypress_command == ServiceItemAction.Previous:
|
||||
self.service_manager.previous_item()
|
||||
|
@ -541,7 +574,7 @@ class SlideController(DisplayController, RegistryProperties):
|
|||
self.service_manager.previous_item(last_slide=True)
|
||||
else:
|
||||
self.service_manager.next_item()
|
||||
self.keypress_loop = False
|
||||
self.process_queue_lock.release()
|
||||
|
||||
def screen_size_changed(self):
|
||||
"""
|
||||
|
@ -599,7 +632,10 @@ class SlideController(DisplayController, RegistryProperties):
|
|||
self.slide_preview.setFixedSize(QtCore.QSize(max_width, max_width / self.ratio))
|
||||
self.preview_display.setFixedSize(QtCore.QSize(max_width, max_width / self.ratio))
|
||||
self.preview_display.screen = {'size': self.preview_display.geometry()}
|
||||
self.on_controller_size_changed(self.controller.width())
|
||||
# Only update controller layout if width has actually changed
|
||||
if self.controller_width != self.controller.width():
|
||||
self.controller_width = self.controller.width()
|
||||
self.on_controller_size_changed(self.controller_width)
|
||||
|
||||
def on_controller_size_changed(self, width):
|
||||
"""
|
||||
|
@ -618,6 +654,10 @@ class SlideController(DisplayController, RegistryProperties):
|
|||
elif width < used_space - HIDE_MENU_THRESHOLD and not self.hide_menu.isVisible():
|
||||
self.set_blank_menu(False)
|
||||
self.toolbar.set_widget_visible(NARROW_MENU)
|
||||
# Fallback to the standard blank toolbar if the hide_menu is not visible.
|
||||
elif not self.hide_menu.isVisible():
|
||||
self.toolbar.set_widget_visible(NARROW_MENU, False)
|
||||
self.set_blank_menu()
|
||||
|
||||
def set_blank_menu(self, visible=True):
|
||||
"""
|
||||
|
@ -692,7 +732,9 @@ class SlideController(DisplayController, RegistryProperties):
|
|||
self.mediabar.show()
|
||||
self.previous_item.setVisible(not item.is_media())
|
||||
self.next_item.setVisible(not item.is_media())
|
||||
# The layout of the toolbar is size dependent, so make sure it fits
|
||||
# The layout of the toolbar is size dependent, so make sure it fits. Reset stored controller_width.
|
||||
if self.is_live:
|
||||
self.controller_width = -1
|
||||
self.on_controller_size_changed(self.controller.width())
|
||||
# Work-around for OS X, hide and then show the toolbar
|
||||
# See bug #791050
|
||||
|
@ -853,7 +895,8 @@ class SlideController(DisplayController, RegistryProperties):
|
|||
if service_item.is_media():
|
||||
self.on_media_start(service_item)
|
||||
self.slide_selected(True)
|
||||
self.preview_widget.setFocus()
|
||||
if service_item.from_service:
|
||||
self.preview_widget.setFocus()
|
||||
if old_item:
|
||||
# Close the old item after the new one is opened
|
||||
# This avoids the service theme/desktop flashing on screen
|
||||
|
@ -1029,6 +1072,10 @@ class SlideController(DisplayController, RegistryProperties):
|
|||
|
||||
:param start:
|
||||
"""
|
||||
# Only one thread should be in here at the time. If already locked just skip, since the update will be
|
||||
# done by the thread holding the lock. If it is a "start" slide, we must wait for the lock.
|
||||
if not self.slide_selected_lock.acquire(start):
|
||||
return
|
||||
row = self.preview_widget.current_slide_number()
|
||||
self.selected_row = 0
|
||||
if -1 < row < self.preview_widget.slide_count():
|
||||
|
@ -1051,6 +1098,8 @@ class SlideController(DisplayController, RegistryProperties):
|
|||
self.update_preview()
|
||||
self.preview_widget.change_slide(row)
|
||||
self.display.setFocus()
|
||||
# Release lock
|
||||
self.slide_selected_lock.release()
|
||||
|
||||
def on_slide_change(self, row):
|
||||
"""
|
||||
|
@ -1395,7 +1444,6 @@ class LiveController(RegistryMixin, OpenLPMixin, SlideController):
|
|||
self.split = 1
|
||||
self.type_prefix = 'live'
|
||||
self.keypress_queue = deque()
|
||||
self.keypress_loop = False
|
||||
self.category = UiStrings().LiveToolbar
|
||||
ActionList.get_instance().add_category(str(self.category), CategoryOrder.standard_toolbar)
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -56,7 +56,9 @@ class StartTimeForm(QtGui.QDialog, Ui_StartTimeDialog, RegistryProperties):
|
|||
self.hour_spin_box.setValue(hour)
|
||||
self.minute_spin_box.setValue(minutes)
|
||||
self.second_spin_box.setValue(seconds)
|
||||
hours, minutes, seconds = self._time_split(self.item['service_item'].media_length)
|
||||
hours, minutes, seconds = self._time_split(self.item['service_item'].end_time)
|
||||
if hours == 0 and minutes == 0 and seconds == 0:
|
||||
hours, minutes, seconds = self._time_split(self.item['service_item'].media_length)
|
||||
self.hour_finish_spin_box.setValue(hours)
|
||||
self.minute_finish_spin_box.setValue(minutes)
|
||||
self.second_finish_spin_box.setValue(seconds)
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -67,8 +67,8 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard, RegistryProperties):
|
|||
self.gradient_combo_box.currentIndexChanged.connect(self.on_gradient_combo_box_current_index_changed)
|
||||
self.color_button.colorChanged.connect(self.on_color_changed)
|
||||
self.image_color_button.colorChanged.connect(self.on_image_color_changed)
|
||||
self.gradient_start_button.colorChanged.connect(self.on_gradient_start_button_changed)
|
||||
self.gradient_end_button.colorChanged.connect(self.on_gradient_end_button_changed)
|
||||
self.gradient_start_button.colorChanged.connect(self.on_gradient_start_color_changed)
|
||||
self.gradient_end_button.colorChanged.connect(self.on_gradient_end_color_changed)
|
||||
self.image_browse_button.clicked.connect(self.on_image_browse_button_clicked)
|
||||
self.image_file_edit.editingFinished.connect(self.on_image_file_edit_editing_finished)
|
||||
self.main_color_button.colorChanged.connect(self.on_main_color_changed)
|
||||
|
@ -411,13 +411,13 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard, RegistryProperties):
|
|||
"""
|
||||
self.theme.background_border_color = color
|
||||
|
||||
def on_gradient_start_button_changed(self, color):
|
||||
def on_gradient_start_color_changed(self, color):
|
||||
"""
|
||||
Gradient 2 _color button pushed.
|
||||
"""
|
||||
self.theme.background_start_color = color
|
||||
|
||||
def on_gradient_end_button_changed(self, color):
|
||||
def on_gradient_end_color_changed(self, color):
|
||||
"""
|
||||
Gradient 2 _color button pushed.
|
||||
"""
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -35,6 +35,8 @@ import logging
|
|||
import locale
|
||||
import os
|
||||
import re
|
||||
import time
|
||||
from shutil import which
|
||||
from subprocess import Popen, PIPE
|
||||
import sys
|
||||
import urllib.request
|
||||
|
@ -62,7 +64,6 @@ log = logging.getLogger(__name__ + '.__init__')
|
|||
APPLICATION_VERSION = {}
|
||||
IMAGES_FILTER = None
|
||||
ICU_COLLATOR = None
|
||||
UNO_CONNECTION_TYPE = 'pipe'
|
||||
CONTROL_CHARS = re.compile(r'[\x00-\x1F\x7F-\x9F]', re.UNICODE)
|
||||
INVALID_FILE_CHARS = re.compile(r'[\\/:\*\?"<>\|\+\[\]%]', re.UNICODE)
|
||||
DIGITS_OR_NONDIGITS = re.compile(r'\d+|\D+', re.UNICODE)
|
||||
|
@ -91,6 +92,8 @@ USER_AGENTS = {
|
|||
'Mozilla/5.0 (X11; NetBSD amd64; rv:18.0) Gecko/20130120 Firefox/18.0'
|
||||
]
|
||||
}
|
||||
CONNECTION_TIMEOUT = 30
|
||||
CONNECTION_RETRIES = 2
|
||||
|
||||
|
||||
class VersionThread(QtCore.QThread):
|
||||
|
@ -250,10 +253,19 @@ def check_latest_version(current_version):
|
|||
req = urllib.request.Request('http://www.openlp.org/files/version.txt')
|
||||
req.add_header('User-Agent', 'OpenLP/%s' % current_version['full'])
|
||||
remote_version = None
|
||||
try:
|
||||
remote_version = str(urllib.request.urlopen(req, None).read().decode()).strip()
|
||||
except IOError:
|
||||
log.exception('Failed to download the latest OpenLP version file')
|
||||
retries = 0
|
||||
while True:
|
||||
try:
|
||||
remote_version = str(urllib.request.urlopen(req, None,
|
||||
timeout=CONNECTION_TIMEOUT).read().decode()).strip()
|
||||
except ConnectionException:
|
||||
if retries > CONNECTION_RETRIES:
|
||||
log.exception('Failed to download the latest OpenLP version file')
|
||||
else:
|
||||
retries += 1
|
||||
time.sleep(0.1)
|
||||
continue
|
||||
break
|
||||
if remote_version:
|
||||
version_string = remote_version
|
||||
return version_string
|
||||
|
@ -389,11 +401,19 @@ def get_web_page(url, header=None, update_openlp=False):
|
|||
req.add_header(header[0], header[1])
|
||||
page = None
|
||||
log.debug('Downloading URL = %s' % url)
|
||||
try:
|
||||
page = urllib.request.urlopen(req)
|
||||
log.debug('Downloaded URL = %s' % page.geturl())
|
||||
except urllib.error.URLError:
|
||||
log.exception('The web page could not be downloaded')
|
||||
retries = 0
|
||||
while True:
|
||||
try:
|
||||
page = urllib.request.urlopen(req, timeout=CONNECTION_TIMEOUT)
|
||||
log.debug('Downloaded URL = %s' % page.geturl())
|
||||
except (urllib.error.URLError, ConnectionError):
|
||||
if retries > CONNECTION_RETRIES:
|
||||
log.exception('The web page could not be downloaded')
|
||||
raise
|
||||
else:
|
||||
time.sleep(0.1)
|
||||
continue
|
||||
break
|
||||
if not page:
|
||||
return None
|
||||
if update_openlp:
|
||||
|
@ -402,27 +422,32 @@ def get_web_page(url, header=None, update_openlp=False):
|
|||
return page
|
||||
|
||||
|
||||
def get_uno_command():
|
||||
def get_uno_command(connection_type='pipe'):
|
||||
"""
|
||||
Returns the UNO command to launch an openoffice.org instance.
|
||||
"""
|
||||
COMMAND = 'soffice'
|
||||
for command in ['libreoffice', 'soffice']:
|
||||
if which(command):
|
||||
break
|
||||
else:
|
||||
raise FileNotFoundError('Command not found')
|
||||
|
||||
OPTIONS = '--nologo --norestore --minimized --nodefault --nofirststartwizard'
|
||||
if UNO_CONNECTION_TYPE == 'pipe':
|
||||
if connection_type == 'pipe':
|
||||
CONNECTION = '"--accept=pipe,name=openlp_pipe;urp;"'
|
||||
else:
|
||||
CONNECTION = '"--accept=socket,host=localhost,port=2002;urp;"'
|
||||
return '%s %s %s' % (COMMAND, OPTIONS, CONNECTION)
|
||||
return '%s %s %s' % (command, OPTIONS, CONNECTION)
|
||||
|
||||
|
||||
def get_uno_instance(resolver):
|
||||
def get_uno_instance(resolver, connection_type='pipe'):
|
||||
"""
|
||||
Returns a running openoffice.org instance.
|
||||
|
||||
:param resolver: The UNO resolver to use to find a running instance.
|
||||
"""
|
||||
log.debug('get UNO Desktop Openoffice - resolve')
|
||||
if UNO_CONNECTION_TYPE == 'pipe':
|
||||
if connection_type == 'pipe':
|
||||
return resolver.resolve('uno:pipe,name=openlp_pipe;urp;StarOffice.ComponentContext')
|
||||
else:
|
||||
return resolver.resolve('uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext')
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2015 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2015 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue