Merged with trunk.

This commit is contained in:
Tomas Groth 2013-12-29 19:47:54 +00:00
commit 84334a039e
282 changed files with 2310 additions and 2256 deletions

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -5,8 +5,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Edwin Lunando, Joshua Miller, Stevan Pettit, # # Meinert Jordan, Armin Köhler, Edwin Lunando, Joshua Miller, Stevan Pettit, #
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, # # Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -222,8 +222,7 @@ class Settings(QtCore.QSettings):
'shortcuts/moveBottom': [QtGui.QKeySequence(QtCore.Qt.Key_End)], 'shortcuts/moveBottom': [QtGui.QKeySequence(QtCore.Qt.Key_End)],
'shortcuts/moveDown': [QtGui.QKeySequence(QtCore.Qt.Key_PageDown)], 'shortcuts/moveDown': [QtGui.QKeySequence(QtCore.Qt.Key_PageDown)],
'shortcuts/nextTrackItem': [], 'shortcuts/nextTrackItem': [],
'shortcuts/nextItem_live': [QtGui.QKeySequence(QtCore.Qt.Key_Down), 'shortcuts/nextItem_live': [QtGui.QKeySequence(QtCore.Qt.Key_Down), QtGui.QKeySequence(QtCore.Qt.Key_PageDown)],
QtGui.QKeySequence(QtCore.Qt.Key_PageDown)],
'shortcuts/nextItem_preview': [], 'shortcuts/nextItem_preview': [],
'shortcuts/nextService': [QtGui.QKeySequence(QtCore.Qt.Key_Right)], 'shortcuts/nextService': [QtGui.QKeySequence(QtCore.Qt.Key_Right)],
'shortcuts/newService': [], 'shortcuts/newService': [],
@ -231,8 +230,7 @@ class Settings(QtCore.QSettings):
'shortcuts/onlineHelpItem': [QtGui.QKeySequence('Alt+F1')], 'shortcuts/onlineHelpItem': [QtGui.QKeySequence('Alt+F1')],
'shortcuts/openService': [], 'shortcuts/openService': [],
'shortcuts/saveService': [], 'shortcuts/saveService': [],
'shortcuts/previousItem_live': [QtGui.QKeySequence(QtCore.Qt.Key_Up), 'shortcuts/previousItem_live': [QtGui.QKeySequence(QtCore.Qt.Key_Up), QtGui.QKeySequence(QtCore.Qt.Key_PageUp)],
QtGui.QKeySequence(QtCore.Qt.Key_PageUp)],
'shortcuts/playbackPause': [], 'shortcuts/playbackPause': [],
'shortcuts/playbackPlay': [], 'shortcuts/playbackPlay': [],
'shortcuts/playbackStop': [], 'shortcuts/playbackStop': [],

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -199,8 +199,7 @@ class Manager(object):
else: else:
self.db_url = 'sqlite:///%s/%s.sqlite' % (AppLocation.get_section_data_path(plugin_name), plugin_name) self.db_url = 'sqlite:///%s/%s.sqlite' % (AppLocation.get_section_data_path(plugin_name), plugin_name)
else: else:
self.db_url = '%s://%s:%s@%s/%s' % (db_type, self.db_url = '%s://%s:%s@%s/%s' % (db_type, urlquote(settings.value('db username')),
urlquote(settings.value('db username')),
urlquote(settings.value('db password')), urlquote(settings.value('db password')),
urlquote(settings.value('db hostname')), urlquote(settings.value('db hostname')),
urlquote(settings.value('db database'))) urlquote(settings.value('db database')))
@ -214,18 +213,17 @@ class Manager(object):
critical_error_message_box( critical_error_message_box(
translate('OpenLP.Manager', 'Database Error'), translate('OpenLP.Manager', 'Database Error'),
translate('OpenLP.Manager', 'The database being loaded was created in a more recent version of ' translate('OpenLP.Manager', 'The database being loaded was created in a more recent version of '
'OpenLP. The database is version %d, while OpenLP expects version %d. The database will not ' 'OpenLP. The database is version %d, while OpenLP expects version %d. The database will '
'be loaded.\n\nDatabase: %s') % (db_ver, up_ver, self.db_url) 'not be loaded.\n\nDatabase: %s') % (db_ver, up_ver, self.db_url)
) )
return return
try: try:
self.session = init_schema(self.db_url) self.session = init_schema(self.db_url)
except (SQLAlchemyError, DBAPIError): except (SQLAlchemyError, DBAPIError):
log.exception('Error loading database: %s', self.db_url) log.exception('Error loading database: %s', self.db_url)
critical_error_message_box( critical_error_message_box(translate('OpenLP.Manager', 'Database Error'),
translate('OpenLP.Manager', 'Database Error'), translate('OpenLP.Manager', 'OpenLP cannot load your database.\n\nDatabase: %s')
translate('OpenLP.Manager', 'OpenLP cannot load your database.\n\nDatabase: %s') % self.db_url % self.db_url)
)
def save_object(self, object_instance, commit=True): def save_object(self, object_instance, commit=True):
""" """

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -40,6 +40,7 @@ from openlp.core.common import UiStrings
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
class FileDialog(QtGui.QFileDialog): class FileDialog(QtGui.QFileDialog):
""" """
Subclass QFileDialog to work round a bug Subclass QFileDialog to work round a bug
@ -54,13 +55,12 @@ class FileDialog(QtGui.QFileDialog):
file_list = [] file_list = []
for file in files: for file in files:
if not os.path.exists(file): if not os.path.exists(file):
log.info('File %s not found. Attempting to unquote.') log.info('File not found. Attempting to unquote.')
file = parse.unquote(file) file = parse.unquote(file)
if not os.path.exists(file): if not os.path.exists(file):
log.error('File %s not found.' % file) log.error('File %s not found.' % file)
QtGui.QMessageBox.information(parent, UiStrings().FileNotFound, QtGui.QMessageBox.information(parent, UiStrings().FileNotFound,
UiStrings().FileNotFoundMessage % file) UiStrings().FileNotFoundMessage % file)
continue continue
log.info('File %s found.')
file_list.append(file) file_list.append(file)
return file_list return file_list

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -68,47 +68,56 @@ class FormattingTags(object):
FormattingTags.html_expands = [] FormattingTags.html_expands = []
base_tags = [] base_tags = []
# Append the base tags. # Append the base tags.
base_tags.append({'desc': translate('OpenLP.FormattingTags', 'Red'), base_tags.append({
'desc': translate('OpenLP.FormattingTags', 'Red'),
'start tag': '{r}', 'start tag': '{r}',
'start html': '<span style="-webkit-text-fill-color:red">', 'start html': '<span style="-webkit-text-fill-color:red">',
'end tag': '{/r}', 'end html': '</span>', 'protected': True, 'end tag': '{/r}', 'end html': '</span>', 'protected': True,
'temporary': False}) 'temporary': False})
base_tags.append({'desc': translate('OpenLP.FormattingTags', 'Black'), base_tags.append({
'desc': translate('OpenLP.FormattingTags', 'Black'),
'start tag': '{b}', 'start tag': '{b}',
'start html': '<span style="-webkit-text-fill-color:black">', 'start html': '<span style="-webkit-text-fill-color:black">',
'end tag': '{/b}', 'end html': '</span>', 'protected': True, 'end tag': '{/b}', 'end html': '</span>', 'protected': True,
'temporary': False}) 'temporary': False})
base_tags.append({'desc': translate('OpenLP.FormattingTags', 'Blue'), base_tags.append({
'desc': translate('OpenLP.FormattingTags', 'Blue'),
'start tag': '{bl}', 'start tag': '{bl}',
'start html': '<span style="-webkit-text-fill-color:blue">', 'start html': '<span style="-webkit-text-fill-color:blue">',
'end tag': '{/bl}', 'end html': '</span>', 'protected': True, 'end tag': '{/bl}', 'end html': '</span>', 'protected': True,
'temporary': False}) 'temporary': False})
base_tags.append({'desc': translate('OpenLP.FormattingTags', 'Yellow'), base_tags.append({
'desc': translate('OpenLP.FormattingTags', 'Yellow'),
'start tag': '{y}', 'start tag': '{y}',
'start html': '<span style="-webkit-text-fill-color:yellow">', 'start html': '<span style="-webkit-text-fill-color:yellow">',
'end tag': '{/y}', 'end html': '</span>', 'protected': True, 'end tag': '{/y}', 'end html': '</span>', 'protected': True,
'temporary': False}) 'temporary': False})
base_tags.append({'desc': translate('OpenLP.FormattingTags', 'Green'), base_tags.append({
'desc': translate('OpenLP.FormattingTags', 'Green'),
'start tag': '{g}', 'start tag': '{g}',
'start html': '<span style="-webkit-text-fill-color:green">', 'start html': '<span style="-webkit-text-fill-color:green">',
'end tag': '{/g}', 'end html': '</span>', 'protected': True, 'end tag': '{/g}', 'end html': '</span>', 'protected': True,
'temporary': False}) 'temporary': False})
base_tags.append({'desc': translate('OpenLP.FormattingTags', 'Pink'), base_tags.append({
'desc': translate('OpenLP.FormattingTags', 'Pink'),
'start tag': '{pk}', 'start tag': '{pk}',
'start html': '<span style="-webkit-text-fill-color:#FFC0CB">', 'start html': '<span style="-webkit-text-fill-color:#FFC0CB">',
'end tag': '{/pk}', 'end html': '</span>', 'protected': True, 'end tag': '{/pk}', 'end html': '</span>', 'protected': True,
'temporary': False}) 'temporary': False})
base_tags.append({'desc': translate('OpenLP.FormattingTags', 'Orange'), base_tags.append({
'desc': translate('OpenLP.FormattingTags', 'Orange'),
'start tag': '{o}', 'start tag': '{o}',
'start html': '<span style="-webkit-text-fill-color:#FFA500">', 'start html': '<span style="-webkit-text-fill-color:#FFA500">',
'end tag': '{/o}', 'end html': '</span>', 'protected': True, 'end tag': '{/o}', 'end html': '</span>', 'protected': True,
'temporary': False}) 'temporary': False})
base_tags.append({'desc': translate('OpenLP.FormattingTags', 'Purple'), base_tags.append({
'desc': translate('OpenLP.FormattingTags', 'Purple'),
'start tag': '{pp}', 'start tag': '{pp}',
'start html': '<span style="-webkit-text-fill-color:#800080">', 'start html': '<span style="-webkit-text-fill-color:#800080">',
'end tag': '{/pp}', 'end html': '</span>', 'protected': True, 'end tag': '{/pp}', 'end html': '</span>', 'protected': True,
'temporary': False}) 'temporary': False})
base_tags.append({'desc': translate('OpenLP.FormattingTags', 'White'), base_tags.append({
'desc': translate('OpenLP.FormattingTags', 'White'),
'start tag': '{w}', 'start tag': '{w}',
'start html': '<span style="-webkit-text-fill-color:white">', 'start html': '<span style="-webkit-text-fill-color:white">',
'end tag': '{/w}', 'end html': '</span>', 'protected': True, 'end tag': '{/w}', 'end html': '</span>', 'protected': True,
@ -128,7 +137,8 @@ class FormattingTags(object):
'start tag': '{p}', 'start html': '<p>', 'end tag': '{/p}', 'start tag': '{p}', 'start html': '<p>', 'end tag': '{/p}',
'end html': '</p>', 'protected': True, 'end html': '</p>', 'protected': True,
'temporary': False}) 'temporary': False})
base_tags.append({'desc': translate('OpenLP.FormattingTags', 'Bold'), base_tags.append({
'desc': translate('OpenLP.FormattingTags', 'Bold'),
'start tag': '{st}', 'start html': '<strong>', 'start tag': '{st}', 'start html': '<strong>',
'end tag': '{/st}', 'end html': '</strong>', 'end tag': '{/st}', 'end html': '</strong>',
'protected': True, 'temporary': False}) 'protected': True, 'temporary': False})
@ -142,9 +152,11 @@ class FormattingTags(object):
'start html': '<span style="text-decoration: underline;">', 'start html': '<span style="text-decoration: underline;">',
'end tag': '{/u}', 'end html': '</span>', 'protected': True, 'end tag': '{/u}', 'end html': '</span>', 'protected': True,
'temporary': False}) 'temporary': False})
base_tags.append({'desc': translate('OpenLP.FormattingTags', 'Break'), base_tags.append({
'desc': translate('OpenLP.FormattingTags', 'Break'),
'start tag': '{br}', 'start html': '<br>', 'end tag': '', 'start tag': '{br}', 'start html': '<br>', 'end tag': '',
'end html': '', 'protected': True, 'temporary': False}) 'end html': '', 'protected': True,
'temporary': False})
FormattingTags.add_html_tags(base_tags) FormattingTags.add_html_tags(base_tags)
FormattingTags.add_html_tags(temporary_tags) FormattingTags.add_html_tags(temporary_tags)
user_expands_string = str(Settings().value('formattingTags/html_tags')) user_expands_string = str(Settings().value('formattingTags/html_tags'))

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -576,7 +576,7 @@ def build_html(item, screen, is_live, background, image=None, plugins=None):
""" """
width = screen['size'].width() width = screen['size'].width()
height = screen['size'].height() height = screen['size'].height()
theme_data = item.themedata theme_data = item.theme_data
# Image generated and poked in # Image generated and poked in
if background: if background:
bgimage_src = 'src="data:image/png;base64,%s"' % background bgimage_src = 'src="data:image/png;base64,%s"' % background
@ -630,7 +630,7 @@ def build_background_css(item, width):
Service Item containing theme and location information Service Item containing theme and location information
""" """
width = int(width) // 2 width = int(width) // 2
theme = item.themedata theme = item.theme_data
background = 'background-color: black' background = 'background-color: black'
if theme: if theme:
if theme.background_type == BackgroundType.to_string(BackgroundType.Transparent): if theme.background_type == BackgroundType.to_string(BackgroundType.Transparent):
@ -681,7 +681,7 @@ def build_lyrics_css(item):
%s %s
} }
""" """
theme_data = item.themedata theme_data = item.theme_data
lyricstable = '' lyricstable = ''
lyrics = '' lyrics = ''
lyricsmain = '' lyricsmain = ''
@ -769,7 +769,7 @@ def build_footer_css(item, height):
text-align: left; text-align: left;
white-space: nowrap; white-space: nowrap;
""" """
theme = item.themedata theme = item.theme_data
if not theme or not item.footer: if not theme or not item.footer:
return '' return ''
bottom = height - int(item.footer.y()) - int(item.footer.height()) bottom = height - int(item.footer.y()) - int(item.footer.height())

View File

@ -5,8 +5,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -45,8 +45,7 @@ class ListWidgetWithDnD(QtGui.QListWidget):
Initialise the list widget Initialise the list widget
""" """
super(ListWidgetWithDnD, self).__init__(parent) super(ListWidgetWithDnD, self).__init__(parent)
self.mimeDataText = name self.mime_data_text = name
assert(self.mimeDataText)
def activateDnD(self): def activateDnD(self):
""" """
@ -54,7 +53,7 @@ class ListWidgetWithDnD(QtGui.QListWidget):
""" """
self.setAcceptDrops(True) self.setAcceptDrops(True)
self.setDragDropMode(QtGui.QAbstractItemView.DragDrop) self.setDragDropMode(QtGui.QAbstractItemView.DragDrop)
Registry().register_function(('%s_dnd' % self.mimeDataText), self.parent().load_file) Registry().register_function(('%s_dnd' % self.mime_data_text), self.parent().load_file)
def mouseMoveEvent(self, event): def mouseMoveEvent(self, event):
""" """
@ -68,9 +67,9 @@ class ListWidgetWithDnD(QtGui.QListWidget):
event.ignore() event.ignore()
return return
drag = QtGui.QDrag(self) drag = QtGui.QDrag(self)
mimeData = QtCore.QMimeData() mime_data = QtCore.QMimeData()
drag.setMimeData(mimeData) drag.setMimeData(mime_data)
mimeData.setText(self.mimeDataText) mime_data.setText(self.mime_data_text)
drag.start(QtCore.Qt.CopyAction) drag.start(QtCore.Qt.CopyAction)
def dragEnterEvent(self, event): def dragEnterEvent(self, event):
@ -104,13 +103,13 @@ class ListWidgetWithDnD(QtGui.QListWidget):
event.accept() event.accept()
files = [] files = []
for url in event.mimeData().urls(): for url in event.mimeData().urls():
localFile = url.toLocalFile() local_file = url.toLocalFile()
if os.path.isfile(localFile): if os.path.isfile(local_file):
files.append(localFile) files.append(local_file)
elif os.path.isdir(localFile): elif os.path.isdir(local_file):
listing = os.listdir(localFile) listing = os.listdir(local_file)
for file in listing: for file in listing:
files.append(os.path.join(localFile, file)) files.append(os.path.join(local_file, file))
Registry().execute('%s_dnd' % self.mimeDataText, files) Registry().execute('%s_dnd' % self.mime_data_text, files)
else: else:
event.ignore() event.ignore()

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -291,15 +291,15 @@ class MediaManagerItem(QtGui.QWidget):
def add_custom_context_actions(self): def add_custom_context_actions(self):
""" """
Implement this method in your descendent media manager item to Implement this method in your descendant media manager item to add any context menu items.
add any context menu items. This method is called automatically. This method is called automatically.
""" """
pass pass
def initialise(self): def initialise(self):
""" """
Implement this method in your descendent media manager item to Implement this method in your descendant media manager item to do any UI or other initialisation.
do any UI or other initialisation. This method is called automatically. This method is called automatically.
""" """
pass pass
@ -320,8 +320,9 @@ class MediaManagerItem(QtGui.QWidget):
Add a file to the list widget to make it available for showing Add a file to the list widget to make it available for showing
""" """
files = FileDialog.getOpenFileNames(self, self.on_new_prompt, files = FileDialog.getOpenFileNames(self, self.on_new_prompt,
Settings().value(self.settings_section + '/last directory'), self.on_new_file_masks) Settings().value(self.settings_section + '/last directory'),
log.info('New files(s) %s', files) self.on_new_file_masks)
log.info('New files(s) %s' % files)
if files: if files:
self.application.set_busy_cursor() self.application.set_busy_cursor()
self.validate_and_load(files) self.validate_and_load(files)
@ -341,7 +342,8 @@ class MediaManagerItem(QtGui.QWidget):
if file_type.lower() not in self.on_new_file_masks: if file_type.lower() not in self.on_new_file_masks:
if not error_shown: if not error_shown:
critical_error_message_box(translate('OpenLP.MediaManagerItem', 'Invalid File Type'), critical_error_message_box(translate('OpenLP.MediaManagerItem', 'Invalid File Type'),
translate('OpenLP.MediaManagerItem', 'Invalid File %s.\nSuffix not supported') % file_name) translate('OpenLP.MediaManagerItem',
'Invalid File %s.\nSuffix not supported') % file_name)
error_shown = True error_shown = True
else: else:
new_files.append(file_name) new_files.append(file_name)
@ -391,7 +393,8 @@ class MediaManagerItem(QtGui.QWidget):
Settings().setValue('%s/%s files' % (self.settings_section, self.settings_section), self.get_file_list()) Settings().setValue('%s/%s files' % (self.settings_section, self.settings_section), self.get_file_list())
if duplicates_found: if duplicates_found:
critical_error_message_box(UiStrings().Duplicate, critical_error_message_box(UiStrings().Duplicate,
translate('OpenLP.MediaManagerItem', 'Duplicate files were found on import and were ignored.')) translate('OpenLP.MediaManagerItem',
'Duplicate files were found on import and were ignored.'))
def context_menu(self, point): def context_menu(self, point):
""" """
@ -411,12 +414,12 @@ class MediaManagerItem(QtGui.QWidget):
""" """
file_list = [] file_list = []
for index in range(self.list_view.count()): for index in range(self.list_view.count()):
bitem = self.list_view.item(index) list_item = self.list_view.item(index)
filename = bitem.data(QtCore.Qt.UserRole) filename = list_item.data(QtCore.Qt.UserRole)
file_list.append(filename) file_list.append(filename)
return file_list return file_list
def load_list(self, list, target_group): def load_list(self, load_list, target_group):
""" """
Load a list. Needs to be implemented by the plugin. Load a list. Needs to be implemented by the plugin.
""" """
@ -477,9 +480,10 @@ class MediaManagerItem(QtGui.QWidget):
""" """
if not self.list_view.selectedIndexes() and not self.remote_triggered: if not self.list_view.selectedIndexes() and not self.remote_triggered:
QtGui.QMessageBox.information(self, UiStrings().NISp, QtGui.QMessageBox.information(self, UiStrings().NISp,
translate('OpenLP.MediaManagerItem', 'You must select one or more items to preview.')) translate('OpenLP.MediaManagerItem',
'You must select one or more items to preview.'))
else: else:
log.debug('%s Preview requested', self.plugin.name) log.debug('%s Preview requested' % self.plugin.name)
service_item = self.build_service_item() service_item = self.build_service_item()
if service_item: if service_item:
service_item.from_plugin = True service_item.from_plugin = True
@ -493,7 +497,8 @@ class MediaManagerItem(QtGui.QWidget):
""" """
if not self.list_view.selectedIndexes(): if not self.list_view.selectedIndexes():
QtGui.QMessageBox.information(self, UiStrings().NISp, QtGui.QMessageBox.information(self, UiStrings().NISp,
translate('OpenLP.MediaManagerItem', 'You must select one or more items to send live.')) translate('OpenLP.MediaManagerItem',
'You must select one or more items to send live.'))
else: else:
self.go_live() self.go_live()
@ -536,7 +541,8 @@ class MediaManagerItem(QtGui.QWidget):
""" """
if not self.list_view.selectedIndexes(): if not self.list_view.selectedIndexes():
QtGui.QMessageBox.information(self, UiStrings().NISp, QtGui.QMessageBox.information(self, UiStrings().NISp,
translate('OpenLP.MediaManagerItem', 'You must select one or more items to add.')) translate('OpenLP.MediaManagerItem',
'You must select one or more items to add.'))
else: else:
# Is it possible to process multiple list items to generate # Is it possible to process multiple list items to generate
# multiple service items? # multiple service items?
@ -578,14 +584,16 @@ class MediaManagerItem(QtGui.QWidget):
service_item = self.service_manager.get_service_item() service_item = self.service_manager.get_service_item()
if not service_item: if not service_item:
QtGui.QMessageBox.information(self, UiStrings().NISs, QtGui.QMessageBox.information(self, UiStrings().NISs,
translate('OpenLP.MediaManagerItem', 'You must select an existing service item to add to.')) translate('OpenLP.MediaManagerItem',
'You must select an existing service item to add to.'))
elif self.plugin.name == service_item.name: elif self.plugin.name == service_item.name:
self.generate_slide_data(service_item) self.generate_slide_data(service_item)
self.service_manager.add_service_item(service_item, replace=True) self.service_manager.add_service_item(service_item, replace=True)
else: else:
# Turn off the remote edit update message indicator # Turn off the remote edit update message indicator
QtGui.QMessageBox.information(self, translate('OpenLP.MediaManagerItem', 'Invalid Service Item'), QtGui.QMessageBox.information(self, translate('OpenLP.MediaManagerItem', 'Invalid Service Item'),
translate('OpenLP.MediaManagerItem', 'You must select a %s service item.') % self.title) translate('OpenLP.MediaManagerItem',
'You must select a %s service item.') % self.title)
def build_service_item(self, item=None, xml_version=False, remote=False, context=ServiceItemContext.Live): def build_service_item(self, item=None, xml_version=False, remote=False, context=ServiceItemContext.Live):
""" """

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -227,29 +227,29 @@ class Plugin(QtCore.QObject):
""" """
pass pass
def add_import_menu_item(self, importMenu): def add_import_menu_item(self, import_menu):
""" """
Create a menu item and add it to the "Import" menu. Create a menu item and add it to the "Import" menu.
``importMenu`` ``import_menu``
The Import menu. The Import menu.
""" """
pass pass
def add_export_menu_Item(self, exportMenu): def add_export_menu_Item(self, export_menu):
""" """
Create a menu item and add it to the "Export" menu. Create a menu item and add it to the "Export" menu.
``exportMenu`` ``export_menu``
The Export menu The Export menu
""" """
pass pass
def add_tools_menu_item(self, toolsMenu): def add_tools_menu_item(self, tools_menu):
""" """
Create a menu item and add it to the "Tools" menu. Create a menu item and add it to the "Tools" menu.
``toolsMenu`` ``tools_menu``
The Tools menu The Tools menu
""" """
pass pass
@ -261,7 +261,8 @@ class Plugin(QtCore.QObject):
""" """
if self.settings_tab_class: if self.settings_tab_class:
self.settings_tab = self.settings_tab_class(parent, self.name, self.settings_tab = self.settings_tab_class(parent, self.name,
self.get_string(StringContent.VisibleName)['title'], self.icon_path) self.get_string(StringContent.VisibleName)['title'],
self.icon_path)
def add_to_menu(self, menubar): def add_to_menu(self, menubar):
""" """
@ -324,14 +325,14 @@ class Plugin(QtCore.QObject):
""" """
return False return False
def rename_theme(self, oldTheme, newTheme): def rename_theme(self, old_theme, new_theme):
""" """
Renames a theme a plugin is using making the plugin use the new name. Renames a theme a plugin is using making the plugin use the new name.
``oldTheme`` ``old_theme``
The name of the theme the plugin should stop using. The name of the theme the plugin should stop using.
``newTheme`` ``new_theme``
The new name the plugin should now use. The new name the plugin should now use.
""" """
pass pass
@ -365,9 +366,8 @@ class Plugin(QtCore.QObject):
def __set_name_text_string(self, name, title, tooltip): def __set_name_text_string(self, name, title, tooltip):
""" """
Utility method for creating a plugin's text_strings. This method makes Utility method for creating a plugin's text_strings. This method makes use of the singular name of the
use of the singular name of the plugin object so must only be called plugin object so must only be called after this has been set.
after this has been set.
""" """
self.text_strings[name] = {'title': title, 'tooltip': tooltip} self.text_strings[name] = {'title': title, 'tooltip': tooltip}

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -229,7 +229,7 @@ class Renderer(object):
self.image_manager.add_image( self.image_manager.add_image(
theme_data.background_filename, ImageSource.Theme, QtGui.QColor(theme_data.background_border_color)) theme_data.background_filename, ImageSource.Theme, QtGui.QColor(theme_data.background_border_color))
theme_data, main, footer = self.pre_render(theme_data) theme_data, main, footer = self.pre_render(theme_data)
service_item.themedata = theme_data service_item.theme_data = theme_data
service_item.main = main service_item.main = main
service_item.footer = footer service_item.footer = footer
service_item.render(True) service_item.render(True)
@ -357,7 +357,8 @@ class Renderer(object):
return QtCore.QRect(10, self.footer_start, self.width - 20, self.height - self.footer_start) return QtCore.QRect(10, self.footer_start, self.width - 20, self.height - self.footer_start)
else: else:
return QtCore.QRect(theme_data.font_footer_x, return QtCore.QRect(theme_data.font_footer_x,
theme_data.font_footer_y, theme_data.font_footer_width - 1, theme_data.font_footer_height - 1) theme_data.font_footer_y, theme_data.font_footer_width - 1,
theme_data.font_footer_height - 1)
def _set_text_rectangle(self, theme_data, rect_main, rect_footer): def _set_text_rectangle(self, theme_data, rect_main, rect_footer):
""" """
@ -400,8 +401,8 @@ class Renderer(object):
</script><style>*{margin: 0; padding: 0; border: 0;} </script><style>*{margin: 0; padding: 0; border: 0;}
#main {position: absolute; top: 0px; %s %s}</style></head><body> #main {position: absolute; top: 0px; %s %s}</style></head><body>
<div id="main"></div></body></html>""" % \ <div id="main"></div></body></html>""" % \
(build_lyrics_format_css(theme_data, self.page_width, (build_lyrics_format_css(theme_data, self.page_width, self.page_height),
self.page_height), build_lyrics_outline_css(theme_data)) build_lyrics_outline_css(theme_data))
self.web.setHtml(html) self.web.setHtml(html)
self.empty_height = self.web_frame.contentsSize().height() self.empty_height = self.web_frame.contentsSize().height()

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -90,17 +90,17 @@ class ScreenList(object):
log.info('screen_resolution_changed %d' % number) log.info('screen_resolution_changed %d' % number)
for screen in self.screen_list: for screen in self.screen_list:
if number == screen['number']: if number == screen['number']:
newScreen = { new_screen = {
'number': number, 'number': number,
'size': self.desktop.screenGeometry(number), 'size': self.desktop.screenGeometry(number),
'primary': self.desktop.primaryScreen() == number 'primary': self.desktop.primaryScreen() == number
} }
self.remove_screen(number) self.remove_screen(number)
self.add_screen(newScreen) self.add_screen(new_screen)
# The screen's default size is used, that is why we have to # The screen's default size is used, that is why we have to
# update the override screen. # update the override screen.
if screen == self.override: if screen == self.override:
self.override = copy.deepcopy(newScreen) self.override = copy.deepcopy(new_screen)
self.set_override_display() self.set_override_display()
Registry().execute('config_screen_changed') Registry().execute('config_screen_changed')
break break
@ -160,7 +160,7 @@ class ScreenList(object):
u'size': PyQt4.QtCore.QRect(0, 0, 1024, 768) u'size': PyQt4.QtCore.QRect(0, 0, 1024, 768)
} }
""" """
log.info('Screen %d found with resolution %s', screen['number'], screen['size']) log.info('Screen %d found with resolution %s' % (screen['number'], screen['size']))
if screen['primary']: if screen['primary']:
self.current = screen self.current = screen
self.override = copy.deepcopy(self.current) self.override = copy.deepcopy(self.current)
@ -200,7 +200,7 @@ class ScreenList(object):
``number`` ``number``
The screen number (int). The screen number (int).
""" """
log.debug('set_current_display %s', number) log.debug('set_current_display %s' % number)
if number + 1 > self.display_count: if number + 1 > self.display_count:
self.current = self.screen_list[0] self.current = self.screen_list[0]
else: else:

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -161,7 +161,7 @@ class ServiceItem(object):
self.capabilities = [] self.capabilities = []
self.is_valid = True self.is_valid = True
self.icon = None self.icon = None
self.themedata = None self.theme_data = None
self.main = None self.main = None
self.footer = None self.footer = None
self.bg_image_bytes = None self.bg_image_bytes = None
@ -238,7 +238,7 @@ class ServiceItem(object):
self.bg_image_bytes = None self.bg_image_bytes = None
if not provides_own_theme_data: if not provides_own_theme_data:
self.renderer.set_item_theme(self.theme) self.renderer.set_item_theme(self.theme)
self.themedata, self.main, self.footer = self.renderer.pre_render() self.theme_data, self.main, self.footer = self.renderer.pre_render()
if self.service_item_type == ServiceItemType.Text: if self.service_item_type == ServiceItemType.Text:
log.debug('Formatting slides: %s' % self.title) log.debug('Formatting slides: %s' % self.title)
# Save rendered pages to this dict. In the case that a slide is used # Save rendered pages to this dict. In the case that a slide is used

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -125,7 +125,7 @@ class SettingsTab(QtGui.QWidget):
""" """
self.load() self.load()
def post_set_up(self, postUpdate=False): def post_set_up(self, post_update=False):
""" """
Changes which need to be made after setup of application Changes which need to be made after setup of application

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -133,7 +133,7 @@ class SpellTextEdit(QtGui.QPlainTextEdit):
""" """
self.dictionary = enchant.Dict(action.text()) self.dictionary = enchant.Dict(action.text())
self.highlighter.spelling_dictionary = self.dictionary self.highlighter.spelling_dictionary = self.dictionary
self.highlighter.highlightBlock(self.toPlainText()) self.highlighter.highlight_block(self.toPlainText())
self.highlighter.rehighlight() self.highlighter.rehighlight()
def correct_word(self, word): def correct_word(self, word):
@ -180,7 +180,7 @@ class Highlighter(QtGui.QSyntaxHighlighter):
super(Highlighter, self).__init__(*args) super(Highlighter, self).__init__(*args)
self.spelling_dictionary = None self.spelling_dictionary = None
def highlightBlock(self, text): def highlight_block(self, text):
""" """
Highlight misspelt words in a block of text. Highlight misspelt words in a block of text.
""" """

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -260,7 +260,7 @@ class ThemeXML(object):
# Create direction element # Create direction element
self.child_element(background, 'direction', str(direction)) self.child_element(background, 'direction', str(direction))
def add_background_image(self, filename, borderColor): def add_background_image(self, filename, border_color):
""" """
Add a image background. Add a image background.
@ -273,7 +273,7 @@ class ThemeXML(object):
# Create Filename element # Create Filename element
self.child_element(background, 'filename', filename) self.child_element(background, 'filename', filename)
# Create endColor element # Create endColor element
self.child_element(background, 'borderColor', str(borderColor)) self.child_element(background, 'borderColor', str(border_color))
def add_font(self, name, color, size, override, fonttype='main', bold='False', italics='False', def add_font(self, name, color, size, override, fonttype='main', bold='False', italics='False',
line_adjustment=0, xpos=0, ypos=0, width=0, height=0, outline='False', outline_color='#ffffff', line_adjustment=0, xpos=0, ypos=0, width=0, height=0, outline='False', outline_color='#ffffff',

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -72,7 +72,7 @@ class OpenLPToolbar(QtGui.QToolBar):
def set_widget_visible(self, widgets, visible=True): def set_widget_visible(self, widgets, visible=True):
""" """
Set the visibitity for a widget or a list of widgets. Set the visibility for a widget or a list of widgets.
``widget`` ``widget``
A list of string with widget object names. A list of string with widget object names.

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -45,13 +45,12 @@ class TreeWidgetWithDnD(QtGui.QTreeWidget):
Initialise the tree widget Initialise the tree widget
""" """
super(TreeWidgetWithDnD, self).__init__(parent) super(TreeWidgetWithDnD, self).__init__(parent)
self.mimeDataText = name self.mime_data_text = name
self.allow_internal_dnd = False self.allow_internal_dnd = False
self.header().close() self.header().close()
self.default_indentation = self.indentation() self.default_indentation = self.indentation()
self.setIndentation(0) self.setIndentation(0)
self.setAnimated(True) self.setAnimated(True)
assert(self.mimeDataText)
def activateDnD(self): def activateDnD(self):
""" """
@ -59,8 +58,8 @@ class TreeWidgetWithDnD(QtGui.QTreeWidget):
""" """
self.setAcceptDrops(True) self.setAcceptDrops(True)
self.setDragDropMode(QtGui.QAbstractItemView.DragDrop) self.setDragDropMode(QtGui.QAbstractItemView.DragDrop)
Registry().register_function(('%s_dnd' % self.mimeDataText), self.parent().load_file) Registry().register_function(('%s_dnd' % self.mime_data_text), self.parent().load_file)
Registry().register_function(('%s_dnd_internal' % self.mimeDataText), self.parent().dnd_move_internal) Registry().register_function(('%s_dnd_internal' % self.mime_data_text), self.parent().dnd_move_internal)
def mouseMoveEvent(self, event): def mouseMoveEvent(self, event):
""" """
@ -77,9 +76,9 @@ class TreeWidgetWithDnD(QtGui.QTreeWidget):
event.ignore() event.ignore()
return return
drag = QtGui.QDrag(self) drag = QtGui.QDrag(self)
mimeData = QtCore.QMimeData() mime_data = QtCore.QMimeData()
drag.setMimeData(mimeData) drag.setMimeData(mime_data)
mimeData.setText(self.mimeDataText) mime_data.setText(self.mime_data_text)
drag.start(QtCore.Qt.CopyAction) drag.start(QtCore.Qt.CopyAction)
def dragEnterEvent(self, event): def dragEnterEvent(self, event):
@ -132,11 +131,11 @@ class TreeWidgetWithDnD(QtGui.QTreeWidget):
listing = os.listdir(local_file) listing = os.listdir(local_file)
for file_name in listing: for file_name in listing:
files.append(os.path.join(local_file, file_name)) files.append(os.path.join(local_file, file_name))
Registry().execute('%s_dnd' % self.mimeDataText, {'files': files, 'target': self.itemAt(event.pos())}) Registry().execute('%s_dnd' % self.mime_Data_Text, {'files': files, 'target': self.itemAt(event.pos())})
elif self.allow_internal_dnd: elif self.allow_internal_dnd:
event.setDropAction(QtCore.Qt.CopyAction) event.setDropAction(QtCore.Qt.CopyAction)
event.accept() event.accept()
Registry().execute('%s_dnd_internal' % self.mimeDataText, self.itemAt(event.pos())) Registry().execute('%s_dnd_internal' % self.mime_data_text, self.itemAt(event.pos()))
else: else:
event.ignore() event.ignore()

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -131,7 +131,8 @@ def critical_error_message_box(title=None, message=None, parent=None, question=F
""" """
if question: if question:
return QtGui.QMessageBox.critical(parent, UiStrings().Error, message, return QtGui.QMessageBox.critical(parent, UiStrings().Error, message,
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)) QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes |
QtGui.QMessageBox.No))
return Registry().get('main_window').error_message(title if title else UiStrings().Error, message) return Registry().get('main_window').error_message(title if title else UiStrings().Error, message)
@ -293,9 +294,8 @@ def create_action(parent, name, **kwargs):
if kwargs.get('triggers'): if kwargs.get('triggers'):
action.triggered.connect(kwargs.pop('triggers')) action.triggered.connect(kwargs.pop('triggers'))
for key in list(kwargs.keys()): for key in list(kwargs.keys()):
if key not in ['text', 'icon', 'tooltip', 'statustip', 'checked', 'can_shortcuts', if key not in ['text', 'icon', 'tooltip', 'statustip', 'checked', 'can_shortcuts', 'category', 'triggers']:
'category', 'triggers']: log.warn('Parameter %s was not consumed in create_action().' % key)
log.warn('Parameter %s was not consumed in create_action().', key)
return action return action

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -272,8 +272,8 @@ class Ui_AboutDialog(object):
self.about_notebook.setTabText(self.about_notebook.indexOf(self.credits_tab), self.about_notebook.setTabText(self.about_notebook.indexOf(self.credits_tab),
translate('OpenLP.AboutForm', 'Credits')) translate('OpenLP.AboutForm', 'Credits'))
copyright_note = translate('OpenLP.AboutForm', copyright_note = translate('OpenLP.AboutForm',
'Copyright \xa9 2004-2013 %s\n' 'Copyright \xa9 2004-2014 %s\n'
'Portions copyright \xa9 2004-2013 %s') % ('Raoul Snyman', 'Portions copyright \xa9 2004-2014 %s') % ('Raoul Snyman',
'Tim Bentley, Gerald Britton, Jonathan Corwin, Samuel Findlay, ' 'Tim Bentley, Gerald Britton, Jonathan Corwin, Samuel Findlay, '
'Michael Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, ' 'Michael Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, '
'Armin K\xf6hler, Erik Lundin, Edwin Lunando, Joshua Miller, ' 'Armin K\xf6hler, Erik Lundin, Edwin Lunando, Joshua Miller, '

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -375,8 +375,7 @@ class AdvancedTab(SettingsTab):
self.current_data_path = AppLocation.get_data_path() self.current_data_path = AppLocation.get_data_path()
if not os.path.exists(self.current_data_path): if not os.path.exists(self.current_data_path):
log.error('Data path not found %s' % self.current_data_path) log.error('Data path not found %s' % self.current_data_path)
answer = QtGui.QMessageBox.critical(self, answer = QtGui.QMessageBox.critical(self, translate('OpenLP.AdvancedTab', 'Data Directory Error'),
translate('OpenLP.AdvancedTab', 'Data Directory Error'),
translate('OpenLP.AdvancedTab', 'OpenLP data directory was not found\n\n%s\n\n' translate('OpenLP.AdvancedTab', 'OpenLP data directory was not found\n\n%s\n\n'
'This data directory was previously changed from the OpenLP ' 'This data directory was previously changed from the OpenLP '
'default location. If the new location was on removable ' 'default location. If the new location was on removable '
@ -524,9 +523,9 @@ class AdvancedTab(SettingsTab):
""" """
old_root_path = str(self.data_directory_label.text()) old_root_path = str(self.data_directory_label.text())
# Get the new directory location. # Get the new directory location.
new_data_path = QtGui.QFileDialog.getExistingDirectory( new_data_path = QtGui.QFileDialog.getExistingDirectory(self, translate('OpenLP.AdvancedTab',
self, translate('OpenLP.AdvancedTab', 'Select Data Directory Location'), old_root_path, 'Select Data Directory Location'),
options=QtGui.QFileDialog.ShowDirsOnly) old_root_path, options=QtGui.QFileDialog.ShowDirsOnly)
# Set the new data path. # Set the new data path.
if new_data_path: if new_data_path:
new_data_path = os.path.normpath(new_data_path) new_data_path = os.path.normpath(new_data_path)
@ -536,12 +535,13 @@ class AdvancedTab(SettingsTab):
else: else:
return return
# Make sure they want to change the data. # Make sure they want to change the data.
answer = QtGui.QMessageBox.question(self, answer = QtGui.QMessageBox.question(self, translate('OpenLP.AdvancedTab', 'Confirm Data Directory Change'),
translate('OpenLP.AdvancedTab', 'Confirm Data Directory Change'), translate('OpenLP.AdvancedTab', 'Are you sure you want to change the '
translate('OpenLP.AdvancedTab', 'Are you sure you want to change the location of the OpenLP ' 'location of the OpenLP data directory to:\n\n%s\n\nThe data directory '
'data directory to:\n\n%s\n\n ' 'will be changed when OpenLP is closed.').replace('%s', new_data_path),
'The data directory will be changed when OpenLP is closed.').replace('%s', new_data_path), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes |
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes | QtGui.QMessageBox.No), QtGui.QMessageBox.No) QtGui.QMessageBox.No),
QtGui.QMessageBox.No)
if answer != QtGui.QMessageBox.Yes: if answer != QtGui.QMessageBox.Yes:
return return
# Check if data already exists here. # Check if data already exists here.
@ -559,11 +559,13 @@ class AdvancedTab(SettingsTab):
if self.current_data_path.lower() != new_data_path.lower(): if self.current_data_path.lower() != new_data_path.lower():
# Make sure they want to change the data location back to the # Make sure they want to change the data location back to the
# default. # default.
answer = QtGui.QMessageBox.question(self, answer = QtGui.QMessageBox.question(self, translate('OpenLP.AdvancedTab', 'Reset Data Directory'),
translate('OpenLP.AdvancedTab', 'Reset Data Directory'), translate('OpenLP.AdvancedTab', 'Are you sure you want to change the '
translate('OpenLP.AdvancedTab', 'Are you sure you want to change the location of the OpenLP ' 'location of the OpenLP data directory to the default location?\n\nThis'
'data directory to the default location?\n\nThis location will be used after OpenLP is closed.'), ' location will be used after OpenLP is closed.'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes | QtGui.QMessageBox.No), QtGui.QMessageBox.No) QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes |
QtGui.QMessageBox.No),
QtGui.QMessageBox.No)
if answer != QtGui.QMessageBox.Yes: if answer != QtGui.QMessageBox.Yes:
return return
self.check_data_overwrite(new_data_path) self.check_data_overwrite(new_data_path)
@ -597,10 +599,14 @@ class AdvancedTab(SettingsTab):
# Check is they want to replace existing data. # Check is they want to replace existing data.
answer = QtGui.QMessageBox.warning(self, answer = QtGui.QMessageBox.warning(self,
translate('OpenLP.AdvancedTab', 'Overwrite Existing Data'), translate('OpenLP.AdvancedTab', 'Overwrite Existing Data'),
translate('OpenLP.AdvancedTab', 'WARNING: \n\nThe location you have selected \n\n%s\n\n' translate('OpenLP.AdvancedTab',
'appears to contain OpenLP data files. Do you wish to replace these files with the current data files?' 'WARNING: \n\nThe location you have selected \n\n%s\n\n'
).replace('%s', os.path.abspath(data_path,)), 'appears to contain OpenLP data files. Do you wish to '
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes | QtGui.QMessageBox.No), QtGui.QMessageBox.No) 'replace these files with the current data files?').replace
('%s', os.path.abspath(data_path,)),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes |
QtGui.QMessageBox.No),
QtGui.QMessageBox.No)
if answer == QtGui.QMessageBox.Yes: if answer == QtGui.QMessageBox.Yes:
self.data_directory_copy_check_box.setChecked(True) self.data_directory_copy_check_box.setChecked(True)
self.new_data_directory_has_files_label.show() self.new_data_directory_has_files_label.show()
@ -638,9 +644,9 @@ class AdvancedTab(SettingsTab):
``checked`` ``checked``
The state of the check box (boolean). The state of the check box (boolean).
""" """
QtGui.QMessageBox.information(self, QtGui.QMessageBox.information(self, translate('OpenLP.AdvancedTab', 'Restart Required'),
translate('OpenLP.AdvancedTab', 'Restart Required'), translate('OpenLP.AdvancedTab', 'This change will only take effect once OpenLP '
translate('OpenLP.AdvancedTab', 'This change will only take effect once OpenLP has been restarted.')) 'has been restarted.'))
def on_end_slide_button_clicked(self): def on_end_slide_button_clicked(self):
""" """

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -75,13 +75,17 @@ class Ui_ExceptionDialog(object):
self.exception_text_edit.setObjectName('exception_text_edit') self.exception_text_edit.setObjectName('exception_text_edit')
self.exception_layout.addWidget(self.exception_text_edit) self.exception_layout.addWidget(self.exception_text_edit)
self.send_report_button = create_button(exception_dialog, 'send_report_button', self.send_report_button = create_button(exception_dialog, 'send_report_button',
icon=':/general/general_email.png', click=self.on_send_report_button_clicked) icon=':/general/general_email.png',
click=self.on_send_report_button_clicked)
self.save_report_button = create_button(exception_dialog, 'save_report_button', self.save_report_button = create_button(exception_dialog, 'save_report_button',
icon=':/general/general_save.png', click=self.on_save_report_button_clicked) icon=':/general/general_save.png',
click=self.on_save_report_button_clicked)
self.attach_tile_button = create_button(exception_dialog, 'attach_tile_button', self.attach_tile_button = create_button(exception_dialog, 'attach_tile_button',
icon=':/general/general_open.png', click=self.on_attach_file_button_clicked) icon=':/general/general_open.png',
click=self.on_attach_file_button_clicked)
self.button_box = create_button_box(exception_dialog, 'button_box', self.button_box = create_button_box(exception_dialog, 'button_box',
['close'], [self.send_report_button, self.save_report_button, self.attach_tile_button]) ['close'], [self.send_report_button,
self.save_report_button, self.attach_tile_button])
self.exception_layout.addWidget(self.button_box) self.exception_layout.addWidget(self.button_box)
self.retranslateUi(exception_dialog) self.retranslateUi(exception_dialog)
@ -93,8 +97,8 @@ class Ui_ExceptionDialog(object):
""" """
exception_dialog.setWindowTitle(translate('OpenLP.ExceptionDialog', 'Error Occurred')) exception_dialog.setWindowTitle(translate('OpenLP.ExceptionDialog', 'Error Occurred'))
self.description_explanation.setText(translate('OpenLP.ExceptionDialog', self.description_explanation.setText(translate('OpenLP.ExceptionDialog',
'Please enter a description of what you were doing to cause this ' 'Please enter a description of what you were doing to cause this error '
'error \n(Minimum 20 characters)')) '\n(Minimum 20 characters)'))
self.message_label.setText(translate('OpenLP.ExceptionDialog', 'Oops! ' self.message_label.setText(translate('OpenLP.ExceptionDialog', 'Oops! '
'OpenLP hit a problem, and couldn\'t recover. The text in the box ' 'OpenLP hit a problem, and couldn\'t recover. The text in the box '
'below contains information that might be helpful to the OpenLP ' 'below contains information that might be helpful to the OpenLP '

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -144,7 +144,7 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog):
system += 'Desktop: GNOME\n' system += 'Desktop: GNOME\n'
elif os.environ.get('DESKTOP_SESSION') == 'xfce': elif os.environ.get('DESKTOP_SESSION') == 'xfce':
system += 'Desktop: Xfce\n' system += 'Desktop: Xfce\n'
return (openlp_version, description, traceback, system, libraries) return openlp_version, description, traceback, system, libraries
def on_save_report_button_clicked(self): def on_save_report_button_clicked(self):
""" """
@ -202,12 +202,12 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog):
if ':' in line: if ':' in line:
exception = line.split('\n')[-1].split(':')[0] exception = line.split('\n')[-1].split(':')[0]
subject = 'Bug report: %s in %s' % (exception, source) subject = 'Bug report: %s in %s' % (exception, source)
mailto_url = QtCore.QUrl('mailto:bugs@openlp.org') mail_to_url = QtCore.QUrl('mailto:bugs@openlp.org')
mailto_url.addQueryItem('subject', subject) mail_to_url.addQueryItem('subject', subject)
mailto_url.addQueryItem('body', body % content) mail_to_url.addQueryItem('body', body % content)
if self.file_attachment: if self.file_attachment:
mailto_url.addQueryItem('attach', self.file_attachment) mail_to_url.addQueryItem('attach', self.file_attachment)
QtGui.QDesktopServices.openUrl(mailto_url) QtGui.QDesktopServices.openUrl(mail_to_url)
def on_description_updated(self): def on_description_updated(self):
""" """
@ -226,9 +226,9 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog):
""" """
Attache files to the bug report e-mail. Attache files to the bug report e-mail.
""" """
files = QtGui.QFileDialog.getOpenFileName( files = QtGui.QFileDialog.getOpenFileName(self, translate('ImagePlugin.ExceptionDialog', 'Select Attachment'),
self, translate('ImagePlugin.ExceptionDialog', 'Select Attachment'), Settings().value(self.settings_section + '/last directory'),
Settings().value(self.settings_section + '/last directory'), '%s (*.*) (*)' % UiStrings().AllFiles) '%s (*.*) (*)' % UiStrings().AllFiles)
log.info('New files(s) %s', str(files)) log.info('New files(s) %s', str(files))
if files: if files:
self.file_attachment = str(files) self.file_attachment = str(files)

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -137,13 +137,13 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
bible_languages = bible_languages.split(',') bible_languages = bible_languages.split(',')
for lang in bible_languages: for lang in bible_languages:
language = self.config.get('bibles_%s' % lang, 'title') language = self.config.get('bibles_%s' % lang, 'title')
langItem = QtGui.QTreeWidgetItem(self.bibles_tree_widget, [language]) lang_item = QtGui.QTreeWidgetItem(self.bibles_tree_widget, [language])
bibles = self.config.get('bibles_%s' % lang, 'translations') bibles = self.config.get('bibles_%s' % lang, 'translations')
bibles = bibles.split(',') bibles = bibles.split(',')
for bible in bibles: for bible in bibles:
title = self.config.get('bible_%s' % bible, 'title') title = self.config.get('bible_%s' % bible, 'title')
filename = self.config.get('bible_%s' % bible, 'filename') filename = self.config.get('bible_%s' % bible, 'filename')
item = QtGui.QTreeWidgetItem(langItem, [title]) item = QtGui.QTreeWidgetItem(lang_item, [title])
item.setData(0, QtCore.Qt.UserRole, filename) item.setData(0, QtCore.Qt.UserRole, filename)
item.setCheckState(0, QtCore.Qt.Unchecked) item.setCheckState(0, QtCore.Qt.Unchecked)
item.setFlags(item.flags() | QtCore.Qt.ItemIsUserCheckable) item.setFlags(item.flags() | QtCore.Qt.ItemIsUserCheckable)
@ -239,7 +239,8 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
""" """
Process the triggering of the cancel button. 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): if self.last_id == FirstTimePage.NoInternet or \
(self.last_id <= FirstTimePage.Plugins and not self.has_run_wizard):
QtCore.QCoreApplication.exit() QtCore.QCoreApplication.exit()
sys.exit() sys.exit()
self.was_download_cancelled = True self.was_download_cancelled = True

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -46,9 +46,9 @@ class FirstTimeLanguageForm(QtGui.QDialog, Ui_FirstTimeLanguageDialog):
""" """
super(FirstTimeLanguageForm, self).__init__(parent) super(FirstTimeLanguageForm, self).__init__(parent)
self.setupUi(self) self.setupUi(self)
self.qmList = LanguageManager.get_qm_list() self.qm_list = LanguageManager.get_qm_list()
self.language_combo_box.addItem('Autodetect') self.language_combo_box.addItem('Autodetect')
self.language_combo_box.addItems(sorted(self.qmList.keys())) self.language_combo_box.addItems(sorted(self.qm_list.keys()))
def exec_(self): def exec_(self):
""" """

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -212,7 +212,8 @@ class Ui_FirstTimeWizard(object):
self.title_label.setText('<span style="font-size:14pt; font-weight:600;">%s</span>' % self.title_label.setText('<span style="font-size:14pt; font-weight:600;">%s</span>' %
translate('OpenLP.FirstTimeWizard', 'Welcome to the First Time Wizard')) translate('OpenLP.FirstTimeWizard', 'Welcome to the First Time Wizard'))
self.information_label.setText(translate('OpenLP.FirstTimeWizard', self.information_label.setText(translate('OpenLP.FirstTimeWizard',
'This wizard will help you to configure OpenLP for initial use. Click the next button below to start.')) 'This wizard will help you to configure OpenLP for initial use. '
'Click the next button below to start.'))
self.plugin_page.setTitle(translate('OpenLP.FirstTimeWizard', 'Activate required Plugins')) 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.plugin_page.setSubTitle(translate('OpenLP.FirstTimeWizard', 'Select the Plugins you wish to use. '))
self.songs_check_box.setText(translate('OpenLP.FirstTimeWizard', 'Songs')) self.songs_check_box.setText(translate('OpenLP.FirstTimeWizard', 'Songs'))
@ -231,13 +232,15 @@ class Ui_FirstTimeWizard(object):
self.no_internet_page.setSubTitle( self.no_internet_page.setSubTitle(
translate('OpenLP.FirstTimeWizard', 'Unable to detect an Internet connection.')) translate('OpenLP.FirstTimeWizard', 'Unable to detect an Internet connection.'))
self.no_internet_text = translate('OpenLP.FirstTimeWizard', self.no_internet_text = translate('OpenLP.FirstTimeWizard',
'No Internet connection was found. The First Time Wizard needs an Internet connection in order to be able ' 'No Internet connection was found. The First Time Wizard needs an Internet '
'to download sample songs, Bibles and themes. Click the Finish button now to start OpenLP with initial ' 'connection in order to be able to download sample songs, Bibles and themes.'
'settings and no sample data.\n\nTo re-run the First Time Wizard and import this sample data at a later ' ' Click the Finish button now to start OpenLP with initial settings and '
'time, check your Internet connection and re-run this wizard by selecting "Tools/Re-run First Time Wizard" ' 'no sample data.\n\nTo re-run the First Time Wizard and import this sample '
'from OpenLP.') 'data at a later time, check your Internet connection and re-run this '
'wizard by selecting "Tools/Re-run First Time Wizard" from OpenLP.')
self.cancelWizardText = translate('OpenLP.FirstTimeWizard', self.cancelWizardText = translate('OpenLP.FirstTimeWizard',
'\n\nTo cancel the First Time Wizard completely (and not start OpenLP), click the Cancel button now.') '\n\nTo cancel the First Time Wizard completely (and not start OpenLP), '
'click the Cancel button now.')
self.songs_page.setTitle(translate('OpenLP.FirstTimeWizard', 'Sample Songs')) self.songs_page.setTitle(translate('OpenLP.FirstTimeWizard', 'Sample Songs'))
self.songs_page.setSubTitle(translate('OpenLP.FirstTimeWizard', 'Select and download public domain songs.')) self.songs_page.setSubTitle(translate('OpenLP.FirstTimeWizard', 'Select and download public domain songs.'))
self.bibles_page.setTitle(translate('OpenLP.FirstTimeWizard', 'Sample Bibles')) self.bibles_page.setTitle(translate('OpenLP.FirstTimeWizard', 'Sample Bibles'))

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -45,7 +45,8 @@ class FormattingTagController(object):
""" """
Initiator Initiator
""" """
self.html_tag_regex = re.compile(r'<(?:(?P<close>/(?=[^\s/>]+>))?' self.html_tag_regex = re.compile(
r'<(?:(?P<close>/(?=[^\s/>]+>))?'
r'(?P<tag>[^\s/!\?>]+)(?:\s+[^\s=]+="[^"]*")*\s*(?P<empty>/)?' r'(?P<tag>[^\s/!\?>]+)(?:\s+[^\s=]+="[^"]*")*\s*(?P<empty>/)?'
r'|(?P<cdata>!\[CDATA\[(?:(?!\]\]>).)*\]\])' r'|(?P<cdata>!\[CDATA\[(?:(?!\]\]>).)*\]\])'
r'|(?P<procinst>\?(?:(?!\?>).)*\?)' r'|(?P<procinst>\?(?:(?!\?>).)*\?)'
@ -76,12 +77,12 @@ class FormattingTagController(object):
The end html tag. The end html tag.
""" """
for linenumber, html1 in enumerate(self.protected_tags): for line_number, html1 in enumerate(self.protected_tags):
if self._strip(html1['start tag']) == tag: if self._strip(html1['start tag']) == tag:
return translate('OpenLP.FormattingTagForm', 'Tag %s already defined.') % tag return translate('OpenLP.FormattingTagForm', 'Tag %s already defined.') % tag
if self._strip(html1['desc']) == desc: if self._strip(html1['desc']) == desc:
return translate('OpenLP.FormattingTagForm', 'Description %s already defined.') % tag return translate('OpenLP.FormattingTagForm', 'Description %s already defined.') % tag
for linenumber, html1 in enumerate(self.custom_tags): for line_number, html1 in enumerate(self.custom_tags):
if self._strip(html1['start tag']) == tag: if self._strip(html1['start tag']) == tag:
return translate('OpenLP.FormattingTagForm', 'Tag %s already defined.') % tag return translate('OpenLP.FormattingTagForm', 'Tag %s already defined.') % tag
if self._strip(html1['desc']) == desc: if self._strip(html1['desc']) == desc:

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -93,7 +93,8 @@ class FormattingTagForm(QtGui.QDialog, Ui_FormattingTagDialog, FormattingTagCont
new_row = self.tag_table_widget.rowCount() new_row = self.tag_table_widget.rowCount()
self.tag_table_widget.insertRow(new_row) self.tag_table_widget.insertRow(new_row)
self.tag_table_widget.setItem(new_row, 0, self.tag_table_widget.setItem(new_row, 0,
QtGui.QTableWidgetItem(translate('OpenLP.FormattingTagForm', 'New Tag%s') % str(new_row))) QtGui.QTableWidgetItem(translate('OpenLP.FormattingTagForm', 'New Tag%s')
% str(new_row)))
self.tag_table_widget.setItem(new_row, 1, QtGui.QTableWidgetItem('n%s' % str(new_row))) self.tag_table_widget.setItem(new_row, 1, QtGui.QTableWidgetItem('n%s' % str(new_row)))
self.tag_table_widget.setItem(new_row, 2, self.tag_table_widget.setItem(new_row, 2,
QtGui.QTableWidgetItem(translate('OpenLP.FormattingTagForm', '<HTML here>'))) QtGui.QTableWidgetItem(translate('OpenLP.FormattingTagForm', '<HTML here>')))
@ -119,11 +120,12 @@ class FormattingTagForm(QtGui.QDialog, Ui_FormattingTagDialog, FormattingTagCont
self.services.pre_save() self.services.pre_save()
while count < self.tag_table_widget.rowCount(): while count < self.tag_table_widget.rowCount():
error = self.services.validate_for_save(self.tag_table_widget.item(count, 0).text(), error = self.services.validate_for_save(self.tag_table_widget.item(count, 0).text(),
self.tag_table_widget.item(count, 1).text(), self.tag_table_widget.item(count, 2).text(), self.tag_table_widget.item(count, 1).text(),
self.tag_table_widget.item(count, 2).text(),
self.tag_table_widget.item(count, 3).text()) self.tag_table_widget.item(count, 3).text())
if error: if error:
QtGui.QMessageBox.warning(self, QtGui.QMessageBox.warning(self, translate('OpenLP.FormattingTagForm', 'Validation Error'), error,
translate('OpenLP.FormattingTagForm', 'Validation Error'), error, QtGui.QMessageBox.Ok) QtGui.QMessageBox.Ok)
self.tag_table_widget.selectRow(count) self.tag_table_widget.selectRow(count)
return return
count += 1 count += 1
@ -141,7 +143,7 @@ class FormattingTagForm(QtGui.QDialog, Ui_FormattingTagDialog, FormattingTagCont
self.tag_table_widget.setRowCount(0) self.tag_table_widget.setRowCount(0)
self.new_button.setEnabled(True) self.new_button.setEnabled(True)
self.delete_button.setEnabled(False) self.delete_button.setEnabled(False)
for linenumber, html in enumerate(FormattingTags.get_html_tags()): for line_number, html in enumerate(FormattingTags.get_html_tags()):
if html['protected']: if html['protected']:
line = self.tag_table_widget_read.rowCount() line = self.tag_table_widget_read.rowCount()
self.tag_table_widget_read.setRowCount(line + 1) self.tag_table_widget_read.setRowCount(line + 1)
@ -198,8 +200,8 @@ class FormattingTagForm(QtGui.QDialog, Ui_FormattingTagDialog, FormattingTagCont
if tag: if tag:
self.tag_table_widget.setItem(pre_row, 3, QtGui.QTableWidgetItem(tag)) self.tag_table_widget.setItem(pre_row, 3, QtGui.QTableWidgetItem(tag))
if errors: if errors:
QtGui.QMessageBox.warning(self, QtGui.QMessageBox.warning(self, translate('OpenLP.FormattingTagForm', 'Validation Error'), errors,
translate('OpenLP.FormattingTagForm', 'Validation Error'), errors, QtGui.QMessageBox.Ok) QtGui.QMessageBox.Ok)
#self.tag_table_widget.selectRow(pre_row - 1) #self.tag_table_widget.selectRow(pre_row - 1)
self.tag_table_widget.resizeRowsToContents() self.tag_table_widget.resizeRowsToContents()

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -248,8 +248,8 @@ class GeneralTab(SettingsTab):
settings.beginGroup(self.settings_section) settings.beginGroup(self.settings_section)
self.monitor_combo_box.clear() self.monitor_combo_box.clear()
self.monitor_combo_box.addItems(self.screens.get_screen_list()) self.monitor_combo_box.addItems(self.screens.get_screen_list())
monitorNumber = settings.value('monitor') monitor_number = settings.value('monitor')
self.monitor_combo_box.setCurrentIndex(monitorNumber) self.monitor_combo_box.setCurrentIndex(monitor_number)
self.number_edit.setText(settings.value('ccli number')) self.number_edit.setText(settings.value('ccli number'))
self.username_edit.setText(settings.value('songselect username')) self.username_edit.setText(settings.value('songselect username'))
self.password_edit.setText(settings.value('songselect password')) self.password_edit.setText(settings.value('songselect password'))

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -75,9 +75,9 @@ class ListPreviewWidget(QtGui.QTableWidget):
self.resizeRowsToContents() self.resizeRowsToContents()
else: else:
# Sort out image heights. # Sort out image heights.
for framenumber in range(len(self.service_item.get_frames())): for frame_number in range(len(self.service_item.get_frames())):
height = self.viewport().width() // self.screen_ratio height = self.viewport().width() // self.screen_ratio
self.setRowHeight(framenumber, height) self.setRowHeight(frame_number, height)
def screen_size_changed(self, screen_ratio): def screen_size_changed(self, screen_ratio):
""" """
@ -87,7 +87,7 @@ class ListPreviewWidget(QtGui.QTableWidget):
self.screen_ratio = screen_ratio self.screen_ratio = screen_ratio
self.__recalculate_layout() self.__recalculate_layout()
def replace_service_item(self, service_item, width, slideNumber): def replace_service_item(self, service_item, width, slide_number):
""" """
Replaces the current preview items with the ones in service_item. Replaces the current preview items with the ones in service_item.
Displays the given slide. Displays the given slide.
@ -98,7 +98,7 @@ class ListPreviewWidget(QtGui.QTableWidget):
self.setColumnWidth(0, width) self.setColumnWidth(0, width)
row = 0 row = 0
text = [] text = []
for framenumber, frame in enumerate(self.service_item.get_frames()): for frame_number, frame in enumerate(self.service_item.get_frames()):
self.setRowCount(self.slide_count() + 1) self.setRowCount(self.slide_count() + 1)
item = QtGui.QTableWidgetItem() item = QtGui.QTableWidgetItem()
slide_height = 0 slide_height = 0
@ -124,19 +124,19 @@ class ListPreviewWidget(QtGui.QTableWidget):
else: else:
image = self.image_manager.get_image(frame['path'], ImageSource.ImagePlugin) image = self.image_manager.get_image(frame['path'], ImageSource.ImagePlugin)
label.setPixmap(QtGui.QPixmap.fromImage(image)) label.setPixmap(QtGui.QPixmap.fromImage(image))
self.setCellWidget(framenumber, 0, label) self.setCellWidget(frame_number, 0, label)
slide_height = width // self.screen_ratio slide_height = width // self.screen_ratio
row += 1 row += 1
text.append(str(row)) text.append(str(row))
self.setItem(framenumber, 0, item) self.setItem(frame_number, 0, item)
if slide_height: if slide_height:
self.setRowHeight(framenumber, slide_height) self.setRowHeight(frame_number, slide_height)
self.setVerticalHeaderLabels(text) self.setVerticalHeaderLabels(text)
if self.service_item.is_text(): if self.service_item.is_text():
self.resizeRowsToContents() self.resizeRowsToContents()
self.setColumnWidth(0, self.viewport().width()) self.setColumnWidth(0, self.viewport().width())
self.setFocus() self.setFocus()
self.change_slide(slideNumber) self.change_slide(slide_number)
def change_slide(self, slide): def change_slide(self, slide):
""" """

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -283,7 +283,7 @@ class MainDisplay(Display):
if not hasattr(self, 'service_item'): if not hasattr(self, 'service_item'):
return False return False
self.override['image'] = path self.override['image'] = path
self.override['theme'] = self.service_item.themedata.background_filename self.override['theme'] = self.service_item.theme_data.background_filename
self.image(path) self.image(path)
# Update the preview frame. # Update the preview frame.
if self.is_live: if self.is_live:
@ -343,7 +343,7 @@ class MainDisplay(Display):
if self.is_live and hasattr(self, 'service_item'): if self.is_live and hasattr(self, 'service_item'):
# Wait for the fade to finish before geting the preview. # Wait for the fade to finish before geting the preview.
# Important otherwise preview will have incorrect text if at all! # Important otherwise preview will have incorrect text if at all!
if self.service_item.themedata and self.service_item.themedata.display_slide_transition: if self.service_item.theme_data and self.service_item.theme_data.display_slide_transition:
while not self.frame.evaluateJavaScript('show_text_completed()'): while not self.frame.evaluateJavaScript('show_text_completed()'):
self.application.process_events() self.application.process_events()
# Wait for the webview to update before getting the preview. # Wait for the webview to update before getting the preview.
@ -383,17 +383,17 @@ class MainDisplay(Display):
Registry().execute('video_background_replaced') Registry().execute('video_background_replaced')
self.override = {} self.override = {}
# We have a different theme. # We have a different theme.
elif self.override['theme'] != service_item.themedata.background_filename: elif self.override['theme'] != service_item.theme_data.background_filename:
Registry().execute('live_theme_changed') Registry().execute('live_theme_changed')
self.override = {} self.override = {}
else: else:
# replace the background # replace the background
background = self.image_manager.get_image_bytes(self.override['image'], ImageSource.ImagePlugin) background = self.image_manager.get_image_bytes(self.override['image'], ImageSource.ImagePlugin)
self.set_transparency(self.service_item.themedata.background_type == self.set_transparency(self.service_item.theme_data.background_type ==
BackgroundType.to_string(BackgroundType.Transparent)) BackgroundType.to_string(BackgroundType.Transparent))
if self.service_item.themedata.background_filename: if self.service_item.theme_data.background_filename:
self.service_item.bg_image_bytes = self.image_manager.get_image_bytes( self.service_item.bg_image_bytes = self.image_manager.get_image_bytes(
self.service_item.themedata.background_filename, ImageSource.Theme self.service_item.theme_data.background_filename, ImageSource.Theme
) )
if image_path: if image_path:
image_bytes = self.image_manager.get_image_bytes(image_path, ImageSource.ImagePlugin) image_bytes = self.image_manager.get_image_bytes(image_path, ImageSource.ImagePlugin)
@ -535,7 +535,7 @@ class AudioPlayer(QtCore.QObject):
""" """
log.debug('AudioPlayer Initialisation started') log.debug('AudioPlayer Initialisation started')
super(AudioPlayer, self).__init__(parent) super(AudioPlayer, self).__init__(parent)
self.currentIndex = -1 self.current_index = -1
self.playlist = [] self.playlist = []
self.repeat = False self.repeat = False
self.media_object = Phonon.MediaObject() self.media_object = Phonon.MediaObject()
@ -558,9 +558,9 @@ class AudioPlayer(QtCore.QObject):
Just before the audio player finishes the current track, queue the next Just before the audio player finishes the current track, queue the next
item in the playlist, if there is one. item in the playlist, if there is one.
""" """
self.currentIndex += 1 self.current_index += 1
if len(self.playlist) > self.currentIndex: if len(self.playlist) > self.current_index:
self.media_object.enqueue(self.playlist[self.currentIndex]) self.media_object.enqueue(self.playlist[self.current_index])
def on_finished(self): def on_finished(self):
""" """
@ -570,7 +570,7 @@ class AudioPlayer(QtCore.QObject):
log.debug('Repeat is enabled... here we go again!') log.debug('Repeat is enabled... here we go again!')
self.media_object.clearQueue() self.media_object.clearQueue()
self.media_object.clear() self.media_object.clear()
self.currentIndex = -1 self.current_index = -1
self.play() self.play()
def connectVolumeSlider(self, slider): def connectVolumeSlider(self, slider):
@ -583,7 +583,7 @@ class AudioPlayer(QtCore.QObject):
""" """
Reset the audio player, clearing the playlist and the queue. Reset the audio player, clearing the playlist and the queue.
""" """
self.currentIndex = -1 self.current_index = -1
self.playlist = [] self.playlist = []
self.stop() self.stop()
self.media_object.clear() self.media_object.clear()
@ -593,7 +593,7 @@ class AudioPlayer(QtCore.QObject):
We want to play the file so start it We want to play the file so start it
""" """
log.debug('AudioPlayer.play() called') log.debug('AudioPlayer.play() called')
if self.currentIndex == -1: if self.current_index == -1:
self.on_about_to_finish() self.on_about_to_finish()
self.media_object.play() self.media_object.play()
@ -611,43 +611,43 @@ class AudioPlayer(QtCore.QObject):
log.debug('AudioPlayer.stop() called') log.debug('AudioPlayer.stop() called')
self.media_object.stop() self.media_object.stop()
def add_to_playlist(self, filenames): def add_to_playlist(self, file_names):
""" """
Add another file to the playlist. Add another file to the playlist.
``filenames`` ``file_names``
A list with files to be added to the playlist. A list with files to be added to the playlist.
""" """
if not isinstance(filenames, list): if not isinstance(file_names, list):
filenames = [filenames] file_names = [file_names]
self.playlist.extend(list(map(Phonon.MediaSource, filenames))) self.playlist.extend(list(map(Phonon.MediaSource, file_names)))
def next(self): def next(self):
""" """
Skip forward to the next track in the list Skip forward to the next track in the list
""" """
if not self.repeat and self.currentIndex + 1 >= len(self.playlist): if not self.repeat and self.current_index + 1 >= len(self.playlist):
return return
isPlaying = self.media_object.state() == Phonon.PlayingState is_playing = self.media_object.state() == Phonon.PlayingState
self.currentIndex += 1 self.current_index += 1
if self.repeat and self.currentIndex == len(self.playlist): if self.repeat and self.current_index == len(self.playlist):
self.currentIndex = 0 self.current_index = 0
self.media_object.clearQueue() self.media_object.clearQueue()
self.media_object.clear() self.media_object.clear()
self.media_object.enqueue(self.playlist[self.currentIndex]) self.media_object.enqueue(self.playlist[self.current_index])
if isPlaying: if is_playing:
self.media_object.play() self.media_object.play()
def go_to(self, index): def go_to(self, index):
""" """
Go to a particular track in the list Go to a particular track in the list
""" """
isPlaying = self.media_object.state() == Phonon.PlayingState is_playing = self.media_object.state() == Phonon.PlayingState
self.media_object.clearQueue() self.media_object.clearQueue()
self.media_object.clear() self.media_object.clear()
self.currentIndex = index self.current_index = index
self.media_object.enqueue(self.playlist[self.currentIndex]) self.media_object.enqueue(self.playlist[self.current_index])
if isPlaying: if is_playing:
self.media_object.play() self.media_object.play()
def connectSlot(self, signal, slot): def connectSlot(self, signal, slot):

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Eric Ludin, Edwin Lunando, Brian T. Meyer, # # Meinert Jordan, Armin Köhler, Eric Ludin, Edwin Lunando, Brian T. Meyer, #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Eric Ludin, Edwin Lunando, Brian T. Meyer, # # Meinert Jordan, Armin Köhler, Eric Ludin, Edwin Lunando, Brian T. Meyer, #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -45,38 +45,38 @@ class Ui_PluginViewDialog(object):
""" """
pluginViewDialog.setObjectName('pluginViewDialog') pluginViewDialog.setObjectName('pluginViewDialog')
pluginViewDialog.setWindowModality(QtCore.Qt.ApplicationModal) pluginViewDialog.setWindowModality(QtCore.Qt.ApplicationModal)
self.pluginLayout = QtGui.QVBoxLayout(pluginViewDialog) self.plugin_layout = QtGui.QVBoxLayout(pluginViewDialog)
self.pluginLayout.setObjectName('pluginLayout') self.plugin_layout.setObjectName('plugin_layout')
self.listLayout = QtGui.QHBoxLayout() self.list_layout = QtGui.QHBoxLayout()
self.listLayout.setObjectName('listLayout') self.list_layout.setObjectName('list_layout')
self.pluginListWidget = QtGui.QListWidget(pluginViewDialog) self.plugin_list_widget = QtGui.QListWidget(pluginViewDialog)
self.pluginListWidget.setObjectName('pluginListWidget') self.plugin_list_widget.setObjectName('plugin_list_widget')
self.listLayout.addWidget(self.pluginListWidget) self.list_layout.addWidget(self.plugin_list_widget)
self.pluginInfoGroupBox = QtGui.QGroupBox(pluginViewDialog) self.plugin_info_group_box = QtGui.QGroupBox(pluginViewDialog)
self.pluginInfoGroupBox.setObjectName('pluginInfoGroupBox') self.plugin_info_group_box.setObjectName('plugin_info_group_box')
self.pluginInfoLayout = QtGui.QFormLayout(self.pluginInfoGroupBox) self.plugin_info_layout = QtGui.QFormLayout(self.plugin_info_group_box)
self.pluginInfoLayout.setObjectName('pluginInfoLayout') self.plugin_info_layout.setObjectName('plugin_info_layout')
self.statusLabel = QtGui.QLabel(self.pluginInfoGroupBox) self.status_label = QtGui.QLabel(self.plugin_info_group_box)
self.statusLabel.setObjectName('statusLabel') self.status_label.setObjectName('status_label')
self.statusComboBox = QtGui.QComboBox(self.pluginInfoGroupBox) self.status_combo_box = QtGui.QComboBox(self.plugin_info_group_box)
self.statusComboBox.addItems(('', '')) self.status_combo_box.addItems(('', ''))
self.statusComboBox.setObjectName('statusComboBox') self.status_combo_box.setObjectName('status_combo_box')
self.pluginInfoLayout.addRow(self.statusLabel, self.statusComboBox) self.plugin_info_layout.addRow(self.status_label, self.status_combo_box)
self.versionLabel = QtGui.QLabel(self.pluginInfoGroupBox) self.version_label = QtGui.QLabel(self.plugin_info_group_box)
self.versionLabel.setObjectName('versionLabel') self.version_label.setObjectName('version_label')
self.versionNumberLabel = QtGui.QLabel(self.pluginInfoGroupBox) self.version_number_label = QtGui.QLabel(self.plugin_info_group_box)
self.versionNumberLabel.setObjectName('versionNumberLabel') self.version_number_label.setObjectName('version_number_label')
self.pluginInfoLayout.addRow(self.versionLabel, self.versionNumberLabel) self.plugin_info_layout.addRow(self.version_label, self.version_number_label)
self.aboutLabel = QtGui.QLabel(self.pluginInfoGroupBox) self.about_label = QtGui.QLabel(self.plugin_info_group_box)
self.aboutLabel.setObjectName('aboutLabel') self.about_label.setObjectName('about_label')
self.aboutTextBrowser = QtGui.QTextBrowser(self.pluginInfoGroupBox) self.about_text_browser = QtGui.QTextBrowser(self.plugin_info_group_box)
self.aboutTextBrowser.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse) self.about_text_browser.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse)
self.aboutTextBrowser.setObjectName('aboutTextBrowser') self.about_text_browser.setObjectName('aboutTextBrowser')
self.pluginInfoLayout.addRow(self.aboutLabel, self.aboutTextBrowser) self.plugin_info_layout.addRow(self.about_label, self.about_text_browser)
self.listLayout.addWidget(self.pluginInfoGroupBox) self.list_layout.addWidget(self.plugin_info_group_box)
self.pluginLayout.addLayout(self.listLayout) self.plugin_layout.addLayout(self.list_layout)
self.button_box = create_button_box(pluginViewDialog, 'button_box', ['ok']) self.button_box = create_button_box(pluginViewDialog, 'button_box', ['ok'])
self.pluginLayout.addWidget(self.button_box) self.plugin_layout.addWidget(self.button_box)
self.retranslateUi(pluginViewDialog) self.retranslateUi(pluginViewDialog)
def retranslateUi(self, pluginViewDialog): def retranslateUi(self, pluginViewDialog):
@ -84,9 +84,9 @@ class Ui_PluginViewDialog(object):
Translate the UI on the fly Translate the UI on the fly
""" """
pluginViewDialog.setWindowTitle(translate('OpenLP.PluginForm', 'Plugin List')) pluginViewDialog.setWindowTitle(translate('OpenLP.PluginForm', 'Plugin List'))
self.pluginInfoGroupBox.setTitle(translate('OpenLP.PluginForm', 'Plugin Details')) self.plugin_info_group_box.setTitle(translate('OpenLP.PluginForm', 'Plugin Details'))
self.versionLabel.setText('%s:' % UiStrings().Version) self.version_label.setText('%s:' % UiStrings().Version)
self.aboutLabel.setText('%s:' % UiStrings().About) self.about_label.setText('%s:' % UiStrings().About)
self.statusLabel.setText(translate('OpenLP.PluginForm', 'Status:')) self.status_label.setText(translate('OpenLP.PluginForm', 'Status:'))
self.statusComboBox.setItemText(0, translate('OpenLP.PluginForm', 'Active')) self.status_combo_box.setItemText(0, translate('OpenLP.PluginForm', 'Active'))
self.statusComboBox.setItemText(1, translate('OpenLP.PluginForm', 'Inactive')) self.status_combo_box.setItemText(1, translate('OpenLP.PluginForm', 'Inactive'))

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -50,26 +50,26 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
Constructor Constructor
""" """
super(PluginForm, self).__init__(parent) super(PluginForm, self).__init__(parent)
self.activePlugin = None self.active_plugin = None
self.programaticChange = False self.programatic_change = False
self.setupUi(self) self.setupUi(self)
self.load() self.load()
self._clearDetails() self._clear_details()
# Right, now let's put some signals and slots together! # Right, now let's put some signals and slots together!
self.pluginListWidget.itemSelectionChanged.connect(self.onPluginListWidgetSelectionChanged) self.plugin_list_widget.itemSelectionChanged.connect(self.on_plugin_list_widget_selection_changed)
self.statusComboBox.currentIndexChanged.connect(self.onStatusComboBoxChanged) self.status_combo_box.currentIndexChanged.connect(self.on_status_combo_box_changed)
def load(self): def load(self):
""" """
Load the plugin details into the screen Load the plugin details into the screen
""" """
self.pluginListWidget.clear() self.plugin_list_widget.clear()
self.programaticChange = True self.programatic_change = True
self._clearDetails() self._clear_details()
self.programaticChange = True self.programatic_change = True
pluginListWidth = 0 plugin_list_width = 0
for plugin in self.plugin_manager.plugins: for plugin in self.plugin_manager.plugins:
item = QtGui.QListWidgetItem(self.pluginListWidget) item = QtGui.QListWidgetItem(self.plugin_list_widget)
# We do this just to make 100% sure the status is an integer as # We do this just to make 100% sure the status is an integer as
# sometimes when it's loaded from the config, it isn't cast to int. # sometimes when it's loaded from the config, it isn't cast to int.
plugin.status = int(plugin.status) plugin.status = int(plugin.status)
@ -85,76 +85,76 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
# If the plugin has an icon, set it! # If the plugin has an icon, set it!
if plugin.icon: if plugin.icon:
item.setIcon(plugin.icon) item.setIcon(plugin.icon)
self.pluginListWidget.addItem(item) self.plugin_list_widget.addItem(item)
pluginListWidth = max(pluginListWidth, self.fontMetrics().width( plugin_list_width = max(plugin_list_width, self.fontMetrics().width(
translate('OpenLP.PluginForm', '%s (Inactive)') % plugin.name_strings['singular'])) translate('OpenLP.PluginForm', '%s (Inactive)') % plugin.name_strings['singular']))
self.pluginListWidget.setFixedWidth(pluginListWidth + self.pluginListWidget.iconSize().width() + 48) self.plugin_list_widget.setFixedWidth(plugin_list_width + self.plugin_list_widget.iconSize().width() + 48)
def _clearDetails(self): def _clear_details(self):
""" """
Clear the plugin details widgets Clear the plugin details widgets
""" """
self.statusComboBox.setCurrentIndex(-1) self.status_combo_box.setCurrentIndex(-1)
self.versionNumberLabel.setText('') self.version_number_label.setText('')
self.aboutTextBrowser.setHtml('') self.about_text_browser.setHtml('')
self.statusComboBox.setEnabled(False) self.status_combo_box.setEnabled(False)
def _setDetails(self): def _set_details(self):
""" """
Set the details of the currently selected plugin Set the details of the currently selected plugin
""" """
log.debug('PluginStatus: %s', str(self.activePlugin.status)) log.debug('PluginStatus: %s', str(self.active_plugin.status))
self.versionNumberLabel.setText(self.activePlugin.version) self.version_number_label.setText(self.active_plugin.version)
self.aboutTextBrowser.setHtml(self.activePlugin.about()) self.about_text_browser.setHtml(self.active_plugin.about())
self.programaticChange = True self.programatic_change = True
status = PluginStatus.Active status = PluginStatus.Active
if self.activePlugin.status == PluginStatus.Active: if self.active_plugin.status == PluginStatus.Active:
status = PluginStatus.Inactive status = PluginStatus.Inactive
self.statusComboBox.setCurrentIndex(status) self.status_combo_box.setCurrentIndex(status)
self.statusComboBox.setEnabled(True) self.status_combo_box.setEnabled(True)
self.programaticChange = False self.programatic_change = False
def onPluginListWidgetSelectionChanged(self): def on_plugin_list_widget_selection_changed(self):
""" """
If the selected plugin changes, update the form If the selected plugin changes, update the form
""" """
if self.pluginListWidget.currentItem() is None: if self.plugin_list_widget.currentItem() is None:
self._clearDetails() self._clear_details()
return return
plugin_name_singular = self.pluginListWidget.currentItem().text().split('(')[0][:-1] plugin_name_singular = self.plugin_list_widget.currentItem().text().split('(')[0][:-1]
self.activePlugin = None self.active_plugin = None
for plugin in self.plugin_manager.plugins: for plugin in self.plugin_manager.plugins:
if plugin.status != PluginStatus.Disabled: if plugin.status != PluginStatus.Disabled:
if plugin.name_strings['singular'] == plugin_name_singular: if plugin.name_strings['singular'] == plugin_name_singular:
self.activePlugin = plugin self.active_plugin = plugin
break break
if self.activePlugin: if self.active_plugin:
self._setDetails() self._set_details()
else: else:
self._clearDetails() self._clear_details()
def onStatusComboBoxChanged(self, status): def on_status_combo_box_changed(self, status):
""" """
If the status of a plugin is altered, apply the change If the status of a plugin is altered, apply the change
""" """
if self.programaticChange or status == PluginStatus.Disabled: if self.programatic_change or status == PluginStatus.Disabled:
return return
if status == PluginStatus.Inactive: if status == PluginStatus.Inactive:
self.application.set_busy_cursor() self.application.set_busy_cursor()
self.activePlugin.toggle_status(PluginStatus.Active) self.active_plugin.toggle_status(PluginStatus.Active)
self.application.set_normal_cursor() self.application.set_normal_cursor()
self.activePlugin.app_startup() self.active_plugin.app_startup()
else: else:
self.activePlugin.toggle_status(PluginStatus.Inactive) self.active_plugin.toggle_status(PluginStatus.Inactive)
status_text = translate('OpenLP.PluginForm', '%s (Inactive)') status_text = translate('OpenLP.PluginForm', '%s (Inactive)')
if self.activePlugin.status == PluginStatus.Active: if self.active_plugin.status == PluginStatus.Active:
status_text = translate('OpenLP.PluginForm', '%s (Active)') status_text = translate('OpenLP.PluginForm', '%s (Active)')
elif self.activePlugin.status == PluginStatus.Inactive: elif self.active_plugin.status == PluginStatus.Inactive:
status_text = translate('OpenLP.PluginForm', '%s (Inactive)') status_text = translate('OpenLP.PluginForm', '%s (Inactive)')
elif self.activePlugin.status == PluginStatus.Disabled: elif self.active_plugin.status == PluginStatus.Disabled:
status_text = translate('OpenLP.PluginForm', '%s (Disabled)') status_text = translate('OpenLP.PluginForm', '%s (Disabled)')
self.pluginListWidget.currentItem().setText( self.plugin_list_widget.currentItem().setText(
status_text % self.activePlugin.name_strings['singular']) status_text % self.active_plugin.name_strings['singular'])
def _get_plugin_manager(self): def _get_plugin_manager(self):
""" """

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -29,7 +29,6 @@
""" """
The actual print service dialog The actual print service dialog
""" """
import cgi
import datetime import datetime
import os import os
@ -175,7 +174,7 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog):
custom_css = DEFAULT_CSS custom_css = DEFAULT_CSS
self._add_element('style', custom_css, html_data.head, attribute=('type', 'text/css')) self._add_element('style', custom_css, html_data.head, attribute=('type', 'text/css'))
self._add_element('body', parent=html_data) self._add_element('body', parent=html_data)
self._add_element('h1', cgi.escape(self.title_line_edit.text()), html_data.body, classId='serviceTitle') self._add_element('h1', html.escape(self.title_line_edit.text()), html_data.body, classId='serviceTitle')
for index, item in enumerate(self.service_manager.service_items): for index, item in enumerate(self.service_manager.service_items):
self._add_preview_item(html_data.body, item['service_item'], index) self._add_preview_item(html_data.body, item['service_item'], index)
# Add the custom service notes: # Add the custom service notes:
@ -183,7 +182,7 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog):
div = self._add_element('div', parent=html_data.body, classId='customNotes') div = self._add_element('div', parent=html_data.body, classId='customNotes')
self._add_element( self._add_element(
'span', translate('OpenLP.ServiceManager', 'Custom Service Notes: '), div, classId='customNotesTitle') 'span', translate('OpenLP.ServiceManager', 'Custom Service Notes: '), div, classId='customNotesTitle')
self._add_element('span', cgi.escape(self.footer_text_edit.toPlainText()), div, classId='customNotesText') self._add_element('span', html.escape(self.footer_text_edit.toPlainText()), div, classId='customNotesText')
self.document.setHtml(html.tostring(html_data).decode()) self.document.setHtml(html.tostring(html_data).decode())
self.preview_widget.updatePreview() self.preview_widget.updatePreview()
@ -195,7 +194,7 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog):
# Add the title of the service item. # Add the title of the service item.
item_title = self._add_element('h2', parent=div, classId='itemTitle') item_title = self._add_element('h2', parent=div, classId='itemTitle')
self._add_element('img', parent=item_title, attribute=('src', item.icon)) self._add_element('img', parent=item_title, attribute=('src', item.icon))
self._add_element('span', '&nbsp;' + cgi.escape(item.get_display_title()), item_title) self._add_element('span', '&nbsp;' + html.escape(item.get_display_title()), item_title)
if self.slide_text_check_box.isChecked(): if self.slide_text_check_box.isChecked():
# Add the text of the service item. # Add the text of the service item.
if item.is_text(): if item.is_text():
@ -219,14 +218,14 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog):
foot_text = item.foot_text foot_text = item.foot_text
foot_text = foot_text.partition('<br>')[2] foot_text = foot_text.partition('<br>')[2]
if foot_text: if foot_text:
foot_text = cgi.escape(foot_text.replace('<br>', '\n')) foot_text = html.escape(foot_text.replace('<br>', '\n'))
self._add_element('div', foot_text.replace('\n', '<br>'), parent=div, classId='itemFooter') self._add_element('div', foot_text.replace('\n', '<br>'), parent=div, classId='itemFooter')
# Add service items' notes. # Add service items' notes.
if self.notes_check_box.isChecked(): if self.notes_check_box.isChecked():
if item.notes: if item.notes:
p = self._add_element('div', classId='itemNotes', parent=div) p = self._add_element('div', classId='itemNotes', parent=div)
self._add_element('span', translate('OpenLP.ServiceManager', 'Notes: '), p, classId='itemNotesTitle') self._add_element('span', translate('OpenLP.ServiceManager', 'Notes: '), p, classId='itemNotesTitle')
self._add_element('span', cgi.escape(item.notes).replace('\n', '<br>'), p, classId='itemNotesText') self._add_element('span', html.escape(item.notes).replace('\n', '<br>'), p, classId='itemNotesText')
# Add play length of media files. # Add play length of media files.
if item.is_media() and self.meta_data_check_box.isChecked(): if item.is_media() and self.meta_data_check_box.isChecked():
tme = item.media_length tme = item.media_length

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -29,7 +29,7 @@
""" """
The service manager sets up, loads, saves and manages services. The service manager sets up, loads, saves and manages services.
""" """
import cgi import html
import logging import logging
import os import os
import shutil import shutil
@ -55,12 +55,12 @@ class ServiceManagerList(QtGui.QTreeWidget):
""" """
Set up key bindings and mouse behaviour for the service list Set up key bindings and mouse behaviour for the service list
""" """
def __init__(self, serviceManager, parent=None): def __init__(self, service_manager, parent=None):
""" """
Constructor Constructor
""" """
super(ServiceManagerList, self).__init__(parent) super(ServiceManagerList, self).__init__(parent)
self.serviceManager = serviceManager self.service_manager = service_manager
def keyPressEvent(self, event): def keyPressEvent(self, event):
""" """
@ -69,13 +69,13 @@ class ServiceManagerList(QtGui.QTreeWidget):
if isinstance(event, QtGui.QKeyEvent): if isinstance(event, QtGui.QKeyEvent):
# here accept the event and do something # here accept the event and do something
if event.key() == QtCore.Qt.Key_Up: if event.key() == QtCore.Qt.Key_Up:
self.serviceManager.on_move_selection_up() self.service_manager.on_move_selection_up()
event.accept() event.accept()
elif event.key() == QtCore.Qt.Key_Down: elif event.key() == QtCore.Qt.Key_Down:
self.serviceManager.on_move_selection_down() self.service_manager.on_move_selection_down()
event.accept() event.accept()
elif event.key() == QtCore.Qt.Key_Delete: elif event.key() == QtCore.Qt.Key_Delete:
self.serviceManager.onDeleteFromService() self.service_manager.onDeleteFromService()
event.accept() event.accept()
event.ignore() event.ignore()
else: else:
@ -117,7 +117,8 @@ class ServiceManagerDialog(object):
triggers=self.on_load_service_clicked) triggers=self.on_load_service_clicked)
self.toolbar.add_toolbar_action('saveService', text=UiStrings().SaveService, self.toolbar.add_toolbar_action('saveService', text=UiStrings().SaveService,
icon=':/general/general_save.png', icon=':/general/general_save.png',
tooltip=translate('OpenLP.ServiceManager', 'Save this service.'), triggers=self.decide_save_method) tooltip=translate('OpenLP.ServiceManager', 'Save this service.'),
triggers=self.decide_save_method)
self.toolbar.addSeparator() self.toolbar.addSeparator()
self.theme_label = QtGui.QLabel('%s:' % UiStrings().Theme, self) self.theme_label = QtGui.QLabel('%s:' % UiStrings().Theme, self)
self.theme_label.setMargin(3) self.theme_label.setMargin(3)
@ -153,19 +154,19 @@ class ServiceManagerDialog(object):
self.order_toolbar = OpenLPToolbar(self) self.order_toolbar = OpenLPToolbar(self)
action_list = ActionList.get_instance() action_list = ActionList.get_instance()
action_list.add_category(UiStrings().Service, CategoryOrder.standard_toolbar) action_list.add_category(UiStrings().Service, CategoryOrder.standard_toolbar)
self.service_manager_list.moveTop = self.order_toolbar.add_toolbar_action('moveTop', self.service_manager_list.move_top = self.order_toolbar.add_toolbar_action('moveTop',
text=translate('OpenLP.ServiceManager', 'Move to &top'), icon=':/services/service_top.png', text=translate('OpenLP.ServiceManager', 'Move to &top'), icon=':/services/service_top.png',
tooltip=translate('OpenLP.ServiceManager', 'Move item to the top of the service.'), tooltip=translate('OpenLP.ServiceManager', 'Move item to the top of the service.'),
can_shortcuts=True, category=UiStrings().Service, triggers=self.onServiceTop) can_shortcuts=True, category=UiStrings().Service, triggers=self.onServiceTop)
self.service_manager_list.moveUp = self.order_toolbar.add_toolbar_action('moveUp', self.service_manager_list.move_up = self.order_toolbar.add_toolbar_action('moveUp',
text=translate('OpenLP.ServiceManager', 'Move &up'), icon=':/services/service_up.png', text=translate('OpenLP.ServiceManager', 'Move &up'), icon=':/services/service_up.png',
tooltip=translate('OpenLP.ServiceManager', 'Move item up one position in the service.'), tooltip=translate('OpenLP.ServiceManager', 'Move item up one position in the service.'),
can_shortcuts=True, category=UiStrings().Service, triggers=self.onServiceUp) can_shortcuts=True, category=UiStrings().Service, triggers=self.onServiceUp)
self.service_manager_list.moveDown = self.order_toolbar.add_toolbar_action('moveDown', self.service_manager_list.move_down = self.order_toolbar.add_toolbar_action('moveDown',
text=translate('OpenLP.ServiceManager', 'Move &down'), icon=':/services/service_down.png', text=translate('OpenLP.ServiceManager', 'Move &down'), icon=':/services/service_down.png',
tooltip=translate('OpenLP.ServiceManager', 'Move item down one position in the service.'), tooltip=translate('OpenLP.ServiceManager', 'Move item down one position in the service.'),
can_shortcuts=True, category=UiStrings().Service, triggers=self.onServiceDown) can_shortcuts=True, category=UiStrings().Service, triggers=self.onServiceDown)
self.service_manager_list.moveBottom = self.order_toolbar.add_toolbar_action('moveBottom', self.service_manager_list.move_bottom = self.order_toolbar.add_toolbar_action('moveBottom',
text=translate('OpenLP.ServiceManager', 'Move to &bottom'), icon=':/services/service_bottom.png', text=translate('OpenLP.ServiceManager', 'Move to &bottom'), icon=':/services/service_bottom.png',
tooltip=translate('OpenLP.ServiceManager', 'Move item to the end of the service.'), tooltip=translate('OpenLP.ServiceManager', 'Move item to the end of the service.'),
can_shortcuts=True, category=UiStrings().Service, triggers=self.onServiceEnd) can_shortcuts=True, category=UiStrings().Service, triggers=self.onServiceEnd)
@ -188,11 +189,11 @@ class ServiceManagerDialog(object):
self.service_manager_list.expand = self.order_toolbar.add_toolbar_action('expand', can_shortcuts=True, self.service_manager_list.expand = self.order_toolbar.add_toolbar_action('expand', can_shortcuts=True,
text=translate('OpenLP.ServiceManager', '&Expand all'), icon=':/services/service_expand_all.png', text=translate('OpenLP.ServiceManager', '&Expand all'), icon=':/services/service_expand_all.png',
tooltip=translate('OpenLP.ServiceManager', 'Expand all the service items.'), tooltip=translate('OpenLP.ServiceManager', 'Expand all the service items.'),
category=UiStrings().Service, triggers=self.onExpandAll) category=UiStrings().Service, triggers=self.on_expand_all)
self.service_manager_list.collapse = self.order_toolbar.add_toolbar_action('collapse', can_shortcuts=True, self.service_manager_list.collapse = self.order_toolbar.add_toolbar_action('collapse', can_shortcuts=True,
text=translate('OpenLP.ServiceManager', '&Collapse all'), icon=':/services/service_collapse_all.png', text=translate('OpenLP.ServiceManager', '&Collapse all'), icon=':/services/service_collapse_all.png',
tooltip=translate('OpenLP.ServiceManager', 'Collapse all the service items.'), tooltip=translate('OpenLP.ServiceManager', 'Collapse all the service items.'),
category=UiStrings().Service, triggers=self.onCollapseAll) category=UiStrings().Service, triggers=self.on_collapse_all)
self.order_toolbar.addSeparator() self.order_toolbar.addSeparator()
self.service_manager_list.make_live = self.order_toolbar.add_toolbar_action('make_live', can_shortcuts=True, self.service_manager_list.make_live = self.order_toolbar.add_toolbar_action('make_live', can_shortcuts=True,
text=translate('OpenLP.ServiceManager', 'Go Live'), icon=':/general/general_live.png', text=translate('OpenLP.ServiceManager', 'Go Live'), icon=':/general/general_live.png',
@ -207,30 +208,35 @@ class ServiceManagerDialog(object):
self.service_manager_list.itemExpanded.connect(self.expanded) self.service_manager_list.itemExpanded.connect(self.expanded)
# Last little bits of setting up # Last little bits of setting up
self.service_theme = Settings().value(self.main_window.service_manager_settings_section + '/service theme') self.service_theme = Settings().value(self.main_window.service_manager_settings_section + '/service theme')
self.servicePath = AppLocation.get_section_data_path('servicemanager') self.service_path = AppLocation.get_section_data_path('servicemanager')
# build the drag and drop context menu # build the drag and drop context menu
self.dndMenu = QtGui.QMenu() self.dnd_menu = QtGui.QMenu()
self.newAction = self.dndMenu.addAction(translate('OpenLP.ServiceManager', '&Add New Item')) self.new_action = self.dnd_menu.addAction(translate('OpenLP.ServiceManager', '&Add New Item'))
self.newAction.setIcon(build_icon(':/general/general_edit.png')) self.new_action.setIcon(build_icon(':/general/general_edit.png'))
self.addToAction = self.dndMenu.addAction(translate('OpenLP.ServiceManager', '&Add to Selected Item')) self.add_to_action = self.dnd_menu.addAction(translate('OpenLP.ServiceManager', '&Add to Selected Item'))
self.addToAction.setIcon(build_icon(':/general/general_edit.png')) self.add_to_action.setIcon(build_icon(':/general/general_edit.png'))
# build the context menu # build the context menu
self.menu = QtGui.QMenu() self.menu = QtGui.QMenu()
self.edit_action = create_widget_action(self.menu, text=translate('OpenLP.ServiceManager', '&Edit Item'), self.edit_action = create_widget_action(self.menu, text=translate('OpenLP.ServiceManager', '&Edit Item'),
icon=':/general/general_edit.png', triggers=self.remote_edit) icon=':/general/general_edit.png', triggers=self.remote_edit)
self.maintain_action = create_widget_action(self.menu, text=translate('OpenLP.ServiceManager', '&Reorder Item'), self.maintain_action = create_widget_action(self.menu, text=translate('OpenLP.ServiceManager', '&Reorder Item'),
icon=':/general/general_edit.png', triggers=self.on_service_item_edit_form) icon=':/general/general_edit.png',
triggers=self.on_service_item_edit_form)
self.notes_action = create_widget_action(self.menu, text=translate('OpenLP.ServiceManager', '&Notes'), self.notes_action = create_widget_action(self.menu, text=translate('OpenLP.ServiceManager', '&Notes'),
icon=':/services/service_notes.png', triggers=self.on_service_item_note_form) icon=':/services/service_notes.png',
triggers=self.on_service_item_note_form)
self.time_action = create_widget_action(self.menu, text=translate('OpenLP.ServiceManager', '&Start Time'), self.time_action = create_widget_action(self.menu, text=translate('OpenLP.ServiceManager', '&Start Time'),
icon=':/media/media_time.png', triggers=self.on_start_time_form) icon=':/media/media_time.png', triggers=self.on_start_time_form)
self.auto_start_action = create_widget_action(self.menu, text='', self.auto_start_action = create_widget_action(self.menu, text='',
icon=':/media/auto-start_active.png', triggers=self.on_auto_start) icon=':/media/auto-start_active.png',
triggers=self.on_auto_start)
# Add already existing delete action to the menu. # Add already existing delete action to the menu.
self.menu.addAction(self.service_manager_list.delete) self.menu.addAction(self.service_manager_list.delete)
self.create_custom_action = create_widget_action(self.menu, self.create_custom_action = create_widget_action(self.menu,
text=translate('OpenLP.ServiceManager', 'Create New &Custom Slide'), text=translate('OpenLP.ServiceManager', 'Create New &Custom '
icon=':/general/general_edit.png', triggers=self.create_custom) 'Slide'),
icon=':/general/general_edit.png',
triggers=self.create_custom)
self.menu.addSeparator() self.menu.addSeparator()
# Add AutoPlay menu actions # Add AutoPlay menu actions
self.auto_play_slides_menu = QtGui.QMenu(translate('OpenLP.ServiceManager', '&Auto play slides')) self.auto_play_slides_menu = QtGui.QMenu(translate('OpenLP.ServiceManager', '&Auto play slides'))
@ -238,16 +244,19 @@ class ServiceManagerDialog(object):
auto_play_slides_group = QtGui.QActionGroup(self.auto_play_slides_menu) auto_play_slides_group = QtGui.QActionGroup(self.auto_play_slides_menu)
auto_play_slides_group.setExclusive(True) auto_play_slides_group.setExclusive(True)
self.auto_play_slides_loop = create_widget_action(self.auto_play_slides_menu, self.auto_play_slides_loop = create_widget_action(self.auto_play_slides_menu,
text=translate('OpenLP.ServiceManager', 'Auto play slides &Loop'), text=translate('OpenLP.ServiceManager', 'Auto play slides '
'&Loop'),
checked=False, triggers=self.toggle_auto_play_slides_loop) checked=False, triggers=self.toggle_auto_play_slides_loop)
auto_play_slides_group.addAction(self.auto_play_slides_loop) auto_play_slides_group.addAction(self.auto_play_slides_loop)
self.auto_play_slides_once = create_widget_action(self.auto_play_slides_menu, self.auto_play_slides_once = create_widget_action(self.auto_play_slides_menu,
text=translate('OpenLP.ServiceManager', 'Auto play slides &Once'), text=translate('OpenLP.ServiceManager', 'Auto play slides '
'&Once'),
checked=False, triggers=self.toggle_auto_play_slides_once) checked=False, triggers=self.toggle_auto_play_slides_once)
auto_play_slides_group.addAction(self.auto_play_slides_once) auto_play_slides_group.addAction(self.auto_play_slides_once)
self.auto_play_slides_menu.addSeparator() self.auto_play_slides_menu.addSeparator()
self.timed_slide_interval = create_widget_action(self.auto_play_slides_menu, self.timed_slide_interval = create_widget_action(self.auto_play_slides_menu,
text=translate('OpenLP.ServiceManager', '&Delay between slides'), text=translate('OpenLP.ServiceManager', '&Delay between '
'slides'),
triggers=self.on_timed_slide_interval) triggers=self.on_timed_slide_interval)
self.menu.addSeparator() self.menu.addSeparator()
self.preview_action = create_widget_action(self.menu, text=translate('OpenLP.ServiceManager', 'Show &Preview'), self.preview_action = create_widget_action(self.menu, text=translate('OpenLP.ServiceManager', 'Show &Preview'),
@ -258,18 +267,18 @@ class ServiceManagerDialog(object):
self.theme_menu = QtGui.QMenu(translate('OpenLP.ServiceManager', '&Change Item Theme')) self.theme_menu = QtGui.QMenu(translate('OpenLP.ServiceManager', '&Change Item Theme'))
self.menu.addMenu(self.theme_menu) self.menu.addMenu(self.theme_menu)
self.service_manager_list.addActions( self.service_manager_list.addActions(
[self.service_manager_list.moveDown, [self.service_manager_list.move_down,
self.service_manager_list.moveUp, self.service_manager_list.move_up,
self.service_manager_list.make_live, self.service_manager_list.make_live,
self.service_manager_list.moveTop, self.service_manager_list.move_top,
self.service_manager_list.moveBottom, self.service_manager_list.move_bottom,
self.service_manager_list.up, self.service_manager_list.up,
self.service_manager_list.down, self.service_manager_list.down,
self.service_manager_list.expand, self.service_manager_list.expand,
self.service_manager_list.collapse self.service_manager_list.collapse
]) ])
Registry().register_function('theme_update_list', self.update_theme_list) Registry().register_function('theme_update_list', self.update_theme_list)
Registry().register_function('config_screen_changed', self.regenerate_service_Items) Registry().register_function('config_screen_changed', self.regenerate_service_items)
Registry().register_function('theme_update_global', self.theme_change) Registry().register_function('theme_update_global', self.theme_change)
Registry().register_function('mediaitem_suffix_reset', self.reset_supported_suffixes) Registry().register_function('mediaitem_suffix_reset', self.reset_supported_suffixes)
@ -418,8 +427,10 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
return QtGui.QMessageBox.question(self.main_window, return QtGui.QMessageBox.question(self.main_window,
translate('OpenLP.ServiceManager', 'Modified Service'), translate('OpenLP.ServiceManager', 'Modified Service'),
translate('OpenLP.ServiceManager', translate('OpenLP.ServiceManager',
'The current service has been modified. Would you like to save this service?'), 'The current service has been modified. Would you like to save '
QtGui.QMessageBox.Save | QtGui.QMessageBox.Discard | QtGui.QMessageBox.Cancel, QtGui.QMessageBox.Save) 'this service?'),
QtGui.QMessageBox.Save | QtGui.QMessageBox.Discard |
QtGui.QMessageBox.Cancel, QtGui.QMessageBox.Save)
def on_recent_service_clicked(self): def on_recent_service_clicked(self):
""" """
@ -487,7 +498,8 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
'The following file(s) in the service are missing:\n\t%s\n\n' 'The following file(s) in the service are missing:\n\t%s\n\n'
'These files will be removed if you continue to save.') % "\n\t".join(missing_list) 'These files will be removed if you continue to save.') % "\n\t".join(missing_list)
answer = QtGui.QMessageBox.critical(self, title, message, answer = QtGui.QMessageBox.critical(self, title, message,
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel)) QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok |
QtGui.QMessageBox.Cancel))
if answer == QtGui.QMessageBox.Cancel: if answer == QtGui.QMessageBox.Cancel:
self.main_window.finished_progress_bar() self.main_window.finished_progress_bar()
return False return False
@ -529,8 +541,8 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
if audio_from.startswith('audio'): if audio_from.startswith('audio'):
# When items are saved, they get new unique_identifier. Let's copy the file to the new location. # When items are saved, they get new unique_identifier. Let's copy the file to the new location.
# Unused files can be ignored, OpenLP automatically cleans up the service manager dir on exit. # Unused files can be ignored, OpenLP automatically cleans up the service manager dir on exit.
audio_from = os.path.join(self.servicePath, audio_from) audio_from = os.path.join(self.service_path, audio_from)
save_file = os.path.join(self.servicePath, audio_to) save_file = os.path.join(self.service_path, audio_to)
save_path = os.path.split(save_file)[0] save_path = os.path.split(save_file)[0]
check_directory_exists(save_path) check_directory_exists(save_path)
if not os.path.exists(save_file): if not os.path.exists(save_file):
@ -539,8 +551,7 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
except IOError: except IOError:
log.exception('Failed to save service to disk: %s', temp_file_name) log.exception('Failed to save service to disk: %s', temp_file_name)
self.main_window.error_message(translate('OpenLP.ServiceManager', 'Error Saving File'), self.main_window.error_message(translate('OpenLP.ServiceManager', 'Error Saving File'),
translate('OpenLP.ServiceManager', 'There was an error saving your file.') translate('OpenLP.ServiceManager', 'There was an error saving your file.'))
)
success = False success = False
finally: finally:
if zip_file: if zip_file:
@ -589,15 +600,13 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
success = True success = True
self.main_window.increment_progress_bar() self.main_window.increment_progress_bar()
try: try:
zip_file = zipfile.ZipFile(temp_file_name, 'w', zipfile.ZIP_STORED, zip_file = zipfile.ZipFile(temp_file_name, 'w', zipfile.ZIP_STORED, True)
True)
# First we add service contents. # First we add service contents.
zip_file.writestr(service_file_name, service_content) zip_file.writestr(service_file_name, service_content)
except IOError: except IOError:
log.exception('Failed to save service to disk: %s', temp_file_name) log.exception('Failed to save service to disk: %s', temp_file_name)
self.main_window.error_message(translate('OpenLP.ServiceManager', 'Error Saving File'), self.main_window.error_message(translate('OpenLP.ServiceManager', 'Error Saving File'),
translate('OpenLP.ServiceManager', 'There was an error saving your file.') translate('OpenLP.ServiceManager', 'There was an error saving your file.'))
)
success = False success = False
finally: finally:
if zip_file: if zip_file:
@ -643,10 +652,12 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
if self._file_name.endswith('oszl') or self.service_has_all_original_files: if self._file_name.endswith('oszl') or self.service_has_all_original_files:
file_name = QtGui.QFileDialog.getSaveFileName(self.main_window, UiStrings().SaveService, path, file_name = QtGui.QFileDialog.getSaveFileName(self.main_window, UiStrings().SaveService, path,
translate('OpenLP.ServiceManager', translate('OpenLP.ServiceManager',
'OpenLP Service Files (*.osz);; OpenLP Service Files - lite (*.oszl)')) 'OpenLP Service Files (*.osz);; OpenLP Service Files - lite '
'(*.oszl)'))
else: else:
file_name = QtGui.QFileDialog.getSaveFileName(self.main_window, UiStrings().SaveService, path, file_name = QtGui.QFileDialog.getSaveFileName(self.main_window, UiStrings().SaveService, path,
translate('OpenLP.ServiceManager', 'OpenLP Service Files (*.osz);;')) translate('OpenLP.ServiceManager', 'OpenLP Service Files (*'
'.osz);;'))
if not file_name: if not file_name:
return False return False
if os.path.splitext(file_name)[1] == '': if os.path.splitext(file_name)[1] == '':
@ -690,14 +701,14 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
critical_error_message_box(message=translate('OpenLP.ServiceManager', critical_error_message_box(message=translate('OpenLP.ServiceManager',
'File is not a valid service.\n The content encoding is not UTF-8.')) 'File is not a valid service.\n The content encoding is not UTF-8.'))
continue continue
osfile = ucs_file.replace('/', os.path.sep) os_file = ucs_file.replace('/', os.path.sep)
if not osfile.startswith('audio'): if not os_file.startswith('audio'):
osfile = os.path.split(osfile)[1] os_file = os.path.split(os_file)[1]
log.debug('Extract file: %s', osfile) log.debug('Extract file: %s', os_file)
zip_info.filename = osfile zip_info.filename = os_file
zip_file.extract(zip_info, self.servicePath) zip_file.extract(zip_info, self.service_path)
if osfile.endswith('osj') or osfile.endswith('osd'): if os_file.endswith('osj') or os_file.endswith('osd'):
p_file = os.path.join(self.servicePath, osfile) p_file = os.path.join(self.service_path, os_file)
if 'p_file' in locals(): if 'p_file' in locals():
file_to = open(p_file, 'r') file_to = open(p_file, 'r')
if p_file.endswith('osj'): if p_file.endswith('osj'):
@ -717,7 +728,7 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
if self._save_lite: if self._save_lite:
service_item.set_from_service(item) service_item.set_from_service(item)
else: else:
service_item.set_from_service(item, self.servicePath) service_item.set_from_service(item, self.service_path)
service_item.validate_item(self.suffixes) service_item.validate_item(self.suffixes)
if service_item.is_capable(ItemCapabilities.OnLoadUpdate): if service_item.is_capable(ItemCapabilities.OnLoadUpdate):
new_item = Registry().get(service_item.name).service_load(service_item) new_item = Registry().get(service_item.name).service_load(service_item)
@ -739,10 +750,10 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
if os.path.getsize(file_name) == 0: if os.path.getsize(file_name) == 0:
log.exception('Service file is zero sized: %s' % file_name) log.exception('Service file is zero sized: %s' % file_name)
QtGui.QMessageBox.information(self, translate('OpenLP.ServiceManager', 'Empty File'), QtGui.QMessageBox.information(self, translate('OpenLP.ServiceManager', 'Empty File'),
translate('OpenLP.ServiceManager', 'This service file does not contain any data.')) translate('OpenLP.ServiceManager', 'This service file does not contain '
'any data.'))
else: else:
log.exception('Service file is cannot be extracted as zip: ' log.exception('Service file is cannot be extracted as zip: %s' % file_name)
'%s' % file_name)
QtGui.QMessageBox.information(self, translate('OpenLP.ServiceManager', 'Corrupt File'), QtGui.QMessageBox.information(self, translate('OpenLP.ServiceManager', 'Corrupt File'),
translate('OpenLP.ServiceManager', translate('OpenLP.ServiceManager',
'This file is either corrupt or it is not an OpenLP 2 service file.')) 'This file is either corrupt or it is not an OpenLP 2 service file.'))
@ -757,7 +768,7 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
self.application.set_normal_cursor() self.application.set_normal_cursor()
self.repaint_service_list(-1, -1) self.repaint_service_list(-1, -1)
def load_Last_file(self): def load_last_file(self):
""" """
Load the last service item from the service manager when the service was last closed. Can be blank if there was Load the last service item from the service manager when the service was last closed. Can be blank if there was
no service present. no service present.
@ -893,7 +904,9 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
else: else:
timed_slide_interval = service_item.timed_slide_interval timed_slide_interval = service_item.timed_slide_interval
timed_slide_interval, ok = QtGui.QInputDialog.getInteger(self, translate('OpenLP.ServiceManager', timed_slide_interval, ok = QtGui.QInputDialog.getInteger(self, translate('OpenLP.ServiceManager',
'Input delay'), translate('OpenLP.ServiceManager', 'Delay between slides in seconds.'), 'Input delay'),
translate('OpenLP.ServiceManager',
'Delay between slides in seconds.'),
timed_slide_interval, 0, 180, 1) timed_slide_interval, 0, 180, 1)
if ok: if ok:
service_item.timed_slide_interval = timed_slide_interval service_item.timed_slide_interval = timed_slide_interval
@ -945,19 +958,19 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
""" """
Called by the SlideController to select the next service item. Called by the SlideController to select the next service item.
""" """
if not self.service_manager_list.selectedItems(): if not self.service_manager_list.selected_items():
return return
selected = self.service_manager_list.selectedItems()[0] selected = self.service_manager_list.selected_items()[0]
lookFor = 0 look_for = 0
serviceIterator = QtGui.QTreeWidgetItemIterator(self.service_manager_list) service_iterator = QtGui.QTreeWidgetItemIterator(self.service_manager_list)
while serviceIterator.value(): while service_iterator.value():
if lookFor == 1 and serviceIterator.value().parent() is None: if look_for == 1 and service_iterator.value().parent() is None:
self.service_manager_list.setCurrentItem(serviceIterator.value()) self.service_manager_list.setCurrentItem(service_iterator.value())
self.make_live() self.make_live()
return return
if serviceIterator.value() == selected: if service_iterator.value() == selected:
lookFor = 1 look_for = 1
serviceIterator += 1 service_iterator += 1
def previous_item(self, last_slide=False): def previous_item(self, last_slide=False):
""" """
@ -967,31 +980,31 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
Is this the last slide in the service_item Is this the last slide in the service_item
""" """
if not self.service_manager_list.selectedItems(): if not self.service_manager_list.selected_items():
return return
selected = self.service_manager_list.selectedItems()[0] selected = self.service_manager_list.selected_items()[0]
prevItem = None prev_item = None
prevItemLastSlide = None prev_item_last_slide = None
serviceIterator = QtGui.QTreeWidgetItemIterator(self.service_manager_list) service_iterator = QtGui.QTreeWidgetItemIterator(self.service_manager_list)
while serviceIterator.value(): while service_iterator.value():
if serviceIterator.value() == selected: if service_iterator.value() == selected:
if last_slide and prevItemLastSlide: if last_slide and prev_item_last_slide:
pos = prevItem.data(0, QtCore.Qt.UserRole) pos = prev_item.data(0, QtCore.Qt.UserRole)
check_expanded = self.service_items[pos - 1]['expanded'] check_expanded = self.service_items[pos - 1]['expanded']
self.service_manager_list.setCurrentItem(prevItemLastSlide) self.service_manager_list.setCurrentItem(prev_item_last_slide)
if not check_expanded: if not check_expanded:
self.service_manager_list.collapseItem(prevItem) self.service_manager_list.collapseItem(prev_item)
self.make_live() self.make_live()
self.service_manager_list.setCurrentItem(prevItem) self.service_manager_list.setCurrentItem(prev_item)
elif prevItem: elif prev_item:
self.service_manager_list.setCurrentItem(prevItem) self.service_manager_list.setCurrentItem(prev_item)
self.make_live() self.make_live()
return return
if serviceIterator.value().parent() is None: if service_iterator.value().parent() is None:
prevItem = serviceIterator.value() prev_item = service_iterator.value()
if serviceIterator.value().parent() is prevItem: if service_iterator.value().parent() is prev_item:
prevItemLastSlide = serviceIterator.value() prev_item_last_slide = service_iterator.value()
serviceIterator += 1 service_iterator += 1
def on_set_item(self, message): def on_set_item(self, message):
""" """
@ -1013,22 +1026,22 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
Moves the cursor selection up the window. Called by the up arrow. Moves the cursor selection up the window. Called by the up arrow.
""" """
item = self.service_manager_list.currentItem() item = self.service_manager_list.currentItem()
itemBefore = self.service_manager_list.itemAbove(item) item_before = self.service_manager_list.item_above(item)
if itemBefore is None: if item_before is None:
return return
self.service_manager_list.setCurrentItem(itemBefore) self.service_manager_list.setCurrentItem(item_before)
def on_move_selection_down(self): def on_move_selection_down(self):
""" """
Moves the cursor selection down the window. Called by the down arrow. Moves the cursor selection down the window. Called by the down arrow.
""" """
item = self.service_manager_list.currentItem() item = self.service_manager_list.currentItem()
itemAfter = self.service_manager_list.itemBelow(item) item_after = self.service_manager_list.itemBelow(item)
if itemAfter is None: if item_after is None:
return return
self.service_manager_list.setCurrentItem(itemAfter) self.service_manager_list.setCurrentItem(item_after)
def onCollapseAll(self): def on_collapse_all(self):
""" """
Collapse all the service items. Collapse all the service items.
""" """
@ -1043,7 +1056,7 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
pos = item.data(0, QtCore.Qt.UserRole) pos = item.data(0, QtCore.Qt.UserRole)
self.service_items[pos - 1]['expanded'] = False self.service_items[pos - 1]['expanded'] = False
def onExpandAll(self): def on_expand_all(self):
""" """
Collapse all the service items. Collapse all the service items.
""" """
@ -1139,51 +1152,51 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
self.service_manager_list.clear() self.service_manager_list.clear()
self.service_manager_list.clearSelection() self.service_manager_list.clearSelection()
for item_count, item in enumerate(self.service_items): for item_count, item in enumerate(self.service_items):
serviceitem = item['service_item'] service_item_from_item = item['service_item']
treewidgetitem = QtGui.QTreeWidgetItem(self.service_manager_list) tree_widget_item = QtGui.QTreeWidgetItem(self.service_manager_list)
if serviceitem.is_valid: if service_item_from_item.is_valid:
if serviceitem.notes: if service_item_from_item.notes:
icon = QtGui.QImage(serviceitem.icon) icon = QtGui.QImage(service_item_from_item.icon)
icon = icon.scaled(80, 80, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation) icon = icon.scaled(80, 80, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation)
overlay = QtGui.QImage(':/services/service_item_notes.png') overlay = QtGui.QImage(':/services/service_item_notes.png')
overlay = overlay.scaled(80, 80, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation) overlay = overlay.scaled(80, 80, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation)
painter = QtGui.QPainter(icon) painter = QtGui.QPainter(icon)
painter.drawImage(0, 0, overlay) painter.drawImage(0, 0, overlay)
painter.end() painter.end()
treewidgetitem.setIcon(0, build_icon(icon)) tree_widget_item.setIcon(0, build_icon(icon))
elif serviceitem.temporary_edit: elif service_item_from_item.temporary_edit:
icon = QtGui.QImage(serviceitem.icon) icon = QtGui.QImage(service_item_from_item.icon)
icon = icon.scaled(80, 80, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation) icon = icon.scaled(80, 80, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation)
overlay = QtGui.QImage(':/general/general_export.png') overlay = QtGui.QImage(':/general/general_export.png')
overlay = overlay.scaled(40, 40, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation) overlay = overlay.scaled(40, 40, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation)
painter = QtGui.QPainter(icon) painter = QtGui.QPainter(icon)
painter.drawImage(40, 0, overlay) painter.drawImage(40, 0, overlay)
painter.end() painter.end()
treewidgetitem.setIcon(0, build_icon(icon)) tree_widget_item.setIcon(0, build_icon(icon))
else: else:
treewidgetitem.setIcon(0, serviceitem.iconic_representation) tree_widget_item.setIcon(0, service_item_from_item.iconic_representation)
else: else:
treewidgetitem.setIcon(0, build_icon(':/general/general_delete.png')) tree_widget_item.setIcon(0, build_icon(':/general/general_delete.png'))
treewidgetitem.setText(0, serviceitem.get_display_title()) tree_widget_item.setText(0, service_item_from_item.get_display_title())
tips = [] tips = []
if serviceitem.temporary_edit: if service_item_from_item.temporary_edit:
tips.append('<strong>%s:</strong> <em>%s</em>' % tips.append('<strong>%s:</strong> <em>%s</em>' %
(translate('OpenLP.ServiceManager', 'Edit'), (translate('OpenLP.ServiceManager', 'Edit'),
(translate('OpenLP.ServiceManager', 'Service copy only')))) (translate('OpenLP.ServiceManager', 'Service copy only'))))
if serviceitem.theme and serviceitem.theme != -1: if service_item_from_item.theme and service_item_from_item.theme != -1:
tips.append('<strong>%s:</strong> <em>%s</em>' % tips.append('<strong>%s:</strong> <em>%s</em>' %
(translate('OpenLP.ServiceManager', 'Slide theme'), serviceitem.theme)) (translate('OpenLP.ServiceManager', 'Slide theme'), service_item_from_item.theme))
if serviceitem.notes: if service_item_from_item.notes:
tips.append('<strong>%s: </strong> %s' % tips.append('<strong>%s: </strong> %s' %
(translate('OpenLP.ServiceManager', 'Notes'), cgi.escape(serviceitem.notes))) (translate('OpenLP.ServiceManager', 'Notes'), html.escape(service_item_from_item.notes)))
if item['service_item'].is_capable(ItemCapabilities.HasVariableStartTime): if item['service_item'].is_capable(ItemCapabilities.HasVariableStartTime):
tips.append(item['service_item'].get_media_time()) tips.append(item['service_item'].get_media_time())
treewidgetitem.setToolTip(0, '<br>'.join(tips)) tree_widget_item.setToolTip(0, '<br>'.join(tips))
treewidgetitem.setData(0, QtCore.Qt.UserRole, item['order']) tree_widget_item.setData(0, QtCore.Qt.UserRole, item['order'])
treewidgetitem.setSelected(item['selected']) tree_widget_item.setSelected(item['selected'])
# Add the children to their parent treewidgetitem. # Add the children to their parent tree_widget_item.
for count, frame in enumerate(serviceitem.get_frames()): for count, frame in enumerate(service_item_from_item.get_frames()):
child = QtGui.QTreeWidgetItem(treewidgetitem) child = QtGui.QTreeWidgetItem(tree_widget_item)
text = frame['title'].replace('\n', ' ') text = frame['title'].replace('\n', ' ')
child.setText(0, text[:40]) child.setText(0, text[:40])
child.setData(0, QtCore.Qt.UserRole, count) child.setData(0, QtCore.Qt.UserRole, count)
@ -1191,19 +1204,19 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
if item['expanded'] and service_item_child == count: if item['expanded'] and service_item_child == count:
self.service_manager_list.setCurrentItem(child) self.service_manager_list.setCurrentItem(child)
elif service_item_child == -1: elif service_item_child == -1:
self.service_manager_list.setCurrentItem(treewidgetitem) self.service_manager_list.setCurrentItem(tree_widget_item)
treewidgetitem.setExpanded(item['expanded']) tree_widget_item.setExpanded(item['expanded'])
def clean_up(self): def clean_up(self):
""" """
Empties the servicePath of temporary files on system exit. Empties the service_path of temporary files on system exit.
""" """
log.debug('Cleaning up servicePath') log.debug('Cleaning up service_path')
for file_name in os.listdir(self.servicePath): for file_name in os.listdir(self.service_path):
file_path = os.path.join(self.servicePath, file_name) file_path = os.path.join(self.service_path, file_name)
delete_file(file_path) delete_file(file_path)
if os.path.exists(os.path.join(self.servicePath, 'audio')): if os.path.exists(os.path.join(self.service_path, 'audio')):
shutil.rmtree(os.path.join(self.servicePath, 'audio'), True) shutil.rmtree(os.path.join(self.service_path, 'audio'), True)
def on_theme_combo_box_selected(self, currentIndex): def on_theme_combo_box_selected(self, currentIndex):
""" """
@ -1213,7 +1226,7 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
self.service_theme = self.theme_combo_box.currentText() self.service_theme = self.theme_combo_box.currentText()
self.renderer.set_service_theme(self.service_theme) self.renderer.set_service_theme(self.service_theme)
Settings().setValue(self.main_window.service_manager_settings_section + '/service theme', self.service_theme) Settings().setValue(self.main_window.service_manager_settings_section + '/service theme', self.service_theme)
self.regenerate_service_Items(True) self.regenerate_service_items(True)
def theme_change(self): def theme_change(self):
""" """
@ -1224,34 +1237,34 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
self.theme_label.setVisible(visible) self.theme_label.setVisible(visible)
self.theme_combo_box.setVisible(visible) self.theme_combo_box.setVisible(visible)
def regenerate_service_Items(self, changed=False): def regenerate_service_items(self, changed=False):
""" """
Rebuild the service list as things have changed and a repaint is the easiest way to do this. Rebuild the service list as things have changed and a repaint is the easiest way to do this.
""" """
self.application.set_busy_cursor() self.application.set_busy_cursor()
log.debug('regenerate_service_Items') log.debug('regenerate_service_items')
# force reset of renderer as theme data has changed # force reset of renderer as theme data has changed
self.service_has_all_original_files = True self.service_has_all_original_files = True
if self.service_items: if self.service_items:
for item in self.service_items: for item in self.service_items:
item['selected'] = False item['selected'] = False
serviceIterator = QtGui.QTreeWidgetItemIterator(self.service_manager_list) service_iterator = QtGui.QTreeWidgetItemIterator(self.service_manager_list)
selectedItem = None selected_item = None
while serviceIterator.value(): while service_iterator.value():
if serviceIterator.value().isSelected(): if service_iterator.value().isSelected():
selectedItem = serviceIterator.value() selected_item = service_iterator.value()
serviceIterator += 1 service_iterator += 1
if selectedItem is not None: if selected_item is not None:
if selectedItem.parent() is None: if selected_item.parent() is None:
pos = selectedItem.data(0, QtCore.Qt.UserRole) pos = selected_item.data(0, QtCore.Qt.UserRole)
else: else:
pos = selectedItem.parent().data(0, QtCore.Qt.UserRole) pos = selected_item.parent().data(0, QtCore.Qt.UserRole)
self.service_items[pos - 1]['selected'] = True self.service_items[pos - 1]['selected'] = True
tempServiceItems = self.service_items temp_service_items = self.service_items
self.service_manager_list.clear() self.service_manager_list.clear()
self.service_items = [] self.service_items = []
self.isNew = True self.is_new = True
for item in tempServiceItems: for item in temp_service_items:
self.add_service_item(item['service_item'], False, expand=item['expanded'], repaint=False, self.add_service_item(item['service_item'], False, expand=item['expanded'], repaint=False,
selected=item['selected']) selected=item['selected'])
# Set to False as items may have changed rendering does not impact the saved song so True may also be valid # Set to False as items may have changed rendering does not impact the saved song so True may also be valid
@ -1377,7 +1390,8 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
else: else:
critical_error_message_box(translate('OpenLP.ServiceManager', 'Missing Display Handler'), critical_error_message_box(translate('OpenLP.ServiceManager', 'Missing Display Handler'),
translate('OpenLP.ServiceManager', translate('OpenLP.ServiceManager',
'Your item cannot be displayed as the plugin required to display it is missing or inactive')) 'Your item cannot be displayed as the plugin required to display it '
'is missing or inactive'))
self.application.set_normal_cursor() self.application.set_normal_cursor()
def remote_edit(self): def remote_edit(self):
@ -1400,7 +1414,7 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
def find_service_item(self): def find_service_item(self):
""" """
Finds the first selected ServiceItem in the list and returns the position of the serviceitem and its selected Finds the first selected ServiceItem in the list and returns the position of the service_item_from_item and its selected
child item. For example, if the third child item (in the Slidecontroller known as slide) in the second service child item. For example, if the third child item (in the Slidecontroller known as slide) in the second service
item is selected this will return:: item is selected this will return::
@ -1446,18 +1460,18 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
item = self.service_manager_list.itemAt(event.pos()) item = self.service_manager_list.itemAt(event.pos())
# ServiceManager started the drag and drop # ServiceManager started the drag and drop
if plugin == 'ServiceManager': if plugin == 'ServiceManager':
startpos, child = self.find_service_item() start_pos, child = self.find_service_item()
# If no items selected # If no items selected
if startpos == -1: if start_pos == -1:
return return
if item is None: if item is None:
endpos = len(self.service_items) end_pos = len(self.service_items)
else: else:
endpos = self._get_parent_item_data(item) - 1 end_pos = self._get_parent_item_data(item) - 1
serviceItem = self.service_items[startpos] service_item = self.service_items[start_pos]
self.service_items.remove(serviceItem) self.service_items.remove(service_item)
self.service_items.insert(endpos, serviceItem) self.service_items.insert(end_pos, service_item)
self.repaint_service_list(endpos, child) self.repaint_service_list(end_pos, child)
self.set_modified() self.set_modified()
else: else:
# we are not over anything so drop # we are not over anything so drop
@ -1467,15 +1481,15 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
else: else:
# we are over something so lets investigate # we are over something so lets investigate
pos = self._get_parent_item_data(item) - 1 pos = self._get_parent_item_data(item) - 1
serviceItem = self.service_items[pos] service_item = self.service_items[pos]
if (plugin == serviceItem['service_item'].name and if (plugin == service_item['service_item'].name and
serviceItem['service_item'].is_capable(ItemCapabilities.CanAppend)): service_item['service_item'].is_capable(ItemCapabilities.CanAppend)):
action = self.dndMenu.exec_(QtGui.QCursor.pos()) action = self.dnd_menu.exec_(QtGui.QCursor.pos())
# New action required # New action required
if action == self.newAction: if action == self.new_action:
self.drop_position = self._get_parent_item_data(item) self.drop_position = self._get_parent_item_data(item)
# Append to existing action # Append to existing action
if action == self.addToAction: if action == self.add_to_action:
self.drop_position = self._get_parent_item_data(item) self.drop_position = self._get_parent_item_data(item)
item.setSelected(True) item.setSelected(True)
replace = True replace = True
@ -1498,10 +1512,10 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
theme_group.setObjectName('theme_group') theme_group.setObjectName('theme_group')
# Create a "Default" theme, which allows the user to reset the item's theme to the service theme or global # Create a "Default" theme, which allows the user to reset the item's theme to the service theme or global
# theme. # theme.
defaultTheme = create_widget_action(self.theme_menu, text=UiStrings().Default, checked=False, default_theme = create_widget_action(self.theme_menu, text=UiStrings().Default, checked=False,
triggers=self.on_theme_change_action) triggers=self.on_theme_change_action)
self.theme_menu.setDefaultAction(defaultTheme) self.theme_menu.setDefaultAction(default_theme)
theme_group.addAction(defaultTheme) theme_group.addAction(default_theme)
self.theme_menu.addSeparator() self.theme_menu.addSeparator()
for theme in theme_list: for theme in theme_list:
self.theme_combo_box.addItem(theme) self.theme_combo_box.addItem(theme)
@ -1509,7 +1523,7 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
triggers=self.on_theme_change_action)) triggers=self.on_theme_change_action))
find_and_set_in_combo_box(self.theme_combo_box, self.service_theme) find_and_set_in_combo_box(self.theme_combo_box, self.service_theme)
self.renderer.set_service_theme(self.service_theme) self.renderer.set_service_theme(self.service_theme)
self.regenerate_service_Items() self.regenerate_service_items()
def on_theme_change_action(self): def on_theme_change_action(self):
""" """
@ -1521,7 +1535,7 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
theme = None theme = None
item = self.find_service_item()[0] item = self.find_service_item()[0]
self.service_items[item]['service_item'].update_theme(theme) self.service_items[item]['service_item'].update_theme(theme)
self.regenerate_service_Items(True) self.regenerate_service_items(True)
def _get_parent_item_data(self, item): def _get_parent_item_data(self, item):
""" """
@ -1537,8 +1551,8 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
""" """
Print a Service Order Sheet. Print a Service Order Sheet.
""" """
settingDialog = PrintServiceForm() setting_dialog = PrintServiceForm()
settingDialog.exec_() setting_dialog.exec_()
def _get_renderer(self): def _get_renderer(self):
""" """

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -136,11 +136,11 @@ class SettingsForm(QtGui.QDialog, Ui_SettingsDialog):
if plugin.settings_tab: if plugin.settings_tab:
plugin.settings_tab.post_set_up() plugin.settings_tab.post_set_up()
def tab_changed(self, tabIndex): def tab_changed(self, tab_index):
""" """
A different settings tab is selected A different settings tab is selected
""" """
self.stacked_layout.setCurrentIndex(tabIndex) self.stacked_layout.setCurrentIndex(tab_index)
self.stacked_layout.currentWidget().tab_visible() self.stacked_layout.currentWidget().tab_visible()
def register_post_process(self, function): def register_post_process(self, function):

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -67,62 +67,62 @@ class Ui_ShortcutListDialog(object):
""" """
shortcutListDialog.setObjectName('shortcutListDialog') shortcutListDialog.setObjectName('shortcutListDialog')
shortcutListDialog.resize(500, 438) shortcutListDialog.resize(500, 438)
self.shortcutListLayout = QtGui.QVBoxLayout(shortcutListDialog) self.shortcut_list_layout = QtGui.QVBoxLayout(shortcutListDialog)
self.shortcutListLayout.setObjectName('shortcutListLayout') self.shortcut_list_layout.setObjectName('shortcut_list_layout')
self.description_label = QtGui.QLabel(shortcutListDialog) self.description_label = QtGui.QLabel(shortcutListDialog)
self.description_label.setObjectName('description_label') self.description_label.setObjectName('description_label')
self.description_label.setWordWrap(True) self.description_label.setWordWrap(True)
self.shortcutListLayout.addWidget(self.description_label) self.shortcut_list_layout.addWidget(self.description_label)
self.treeWidget = QtGui.QTreeWidget(shortcutListDialog) self.tree_widget = QtGui.QTreeWidget(shortcutListDialog)
self.treeWidget.setObjectName('treeWidget') self.tree_widget.setObjectName('tree_widget')
self.treeWidget.setAlternatingRowColors(True) self.tree_widget.setAlternatingRowColors(True)
self.treeWidget.setColumnCount(3) self.tree_widget.setColumnCount(3)
self.treeWidget.setColumnWidth(0, 250) self.tree_widget.setColumnWidth(0, 250)
self.shortcutListLayout.addWidget(self.treeWidget) self.shortcut_list_layout.addWidget(self.tree_widget)
self.detailsLayout = QtGui.QGridLayout() self.details_layout = QtGui.QGridLayout()
self.detailsLayout.setObjectName('detailsLayout') self.details_layout.setObjectName('details_layout')
self.detailsLayout.setContentsMargins(-1, 0, -1, -1) self.details_layout.setContentsMargins(-1, 0, -1, -1)
self.defaultRadioButton = QtGui.QRadioButton(shortcutListDialog) self.default_radio_button = QtGui.QRadioButton(shortcutListDialog)
self.defaultRadioButton.setObjectName('defaultRadioButton') self.default_radio_button.setObjectName('default_radio_button')
self.defaultRadioButton.setChecked(True) self.default_radio_button.setChecked(True)
self.detailsLayout.addWidget(self.defaultRadioButton, 0, 0, 1, 1) self.details_layout.addWidget(self.default_radio_button, 0, 0, 1, 1)
self.customRadioButton = QtGui.QRadioButton(shortcutListDialog) self.custom_radio_button = QtGui.QRadioButton(shortcutListDialog)
self.customRadioButton.setObjectName('customRadioButton') self.custom_radio_button.setObjectName('custom_radio_button')
self.detailsLayout.addWidget(self.customRadioButton, 1, 0, 1, 1) self.details_layout.addWidget(self.custom_radio_button, 1, 0, 1, 1)
self.primaryLayout = QtGui.QHBoxLayout() self.primary_layout = QtGui.QHBoxLayout()
self.primaryLayout.setObjectName('primaryLayout') self.primary_layout.setObjectName('primary_layout')
self.primaryPushButton = CaptureShortcutButton(shortcutListDialog) self.primary_push_button = CaptureShortcutButton(shortcutListDialog)
self.primaryPushButton.setObjectName('primaryPushButton') self.primary_push_button.setObjectName('primary_push_button')
self.primaryPushButton.setMinimumSize(QtCore.QSize(84, 0)) self.primary_push_button.setMinimumSize(QtCore.QSize(84, 0))
self.primaryPushButton.setIcon(build_icon(':/system/system_configure_shortcuts.png')) self.primary_push_button.setIcon(build_icon(':/system/system_configure_shortcuts.png'))
self.primaryLayout.addWidget(self.primaryPushButton) self.primary_layout.addWidget(self.primary_push_button)
self.clearPrimaryButton = QtGui.QToolButton(shortcutListDialog) self.clear_primary_button = QtGui.QToolButton(shortcutListDialog)
self.clearPrimaryButton.setObjectName('clearPrimaryButton') self.clear_primary_button.setObjectName('clear_primary_button')
self.clearPrimaryButton.setMinimumSize(QtCore.QSize(0, 16)) self.clear_primary_button.setMinimumSize(QtCore.QSize(0, 16))
self.clearPrimaryButton.setIcon(build_icon(':/system/clear_shortcut.png')) self.clear_primary_button.setIcon(build_icon(':/system/clear_shortcut.png'))
self.primaryLayout.addWidget(self.clearPrimaryButton) self.primary_layout.addWidget(self.clear_primary_button)
self.detailsLayout.addLayout(self.primaryLayout, 1, 1, 1, 1) self.details_layout.addLayout(self.primary_layout, 1, 1, 1, 1)
self.alternateLayout = QtGui.QHBoxLayout() self.alternate_layout = QtGui.QHBoxLayout()
self.alternateLayout.setObjectName('alternateLayout') self.alternate_layout.setObjectName('alternate_layout')
self.alternatePushButton = CaptureShortcutButton(shortcutListDialog) self.alternate_push_button = CaptureShortcutButton(shortcutListDialog)
self.alternatePushButton.setObjectName('alternatePushButton') self.alternate_push_button.setObjectName('alternate_push_button')
self.alternatePushButton.setIcon(build_icon(':/system/system_configure_shortcuts.png')) self.alternate_push_button.setIcon(build_icon(':/system/system_configure_shortcuts.png'))
self.alternateLayout.addWidget(self.alternatePushButton) self.alternate_layout.addWidget(self.alternate_push_button)
self.clearAlternateButton = QtGui.QToolButton(shortcutListDialog) self.clear_alternate_button = QtGui.QToolButton(shortcutListDialog)
self.clearAlternateButton.setObjectName('clearAlternateButton') self.clear_alternate_button.setObjectName('clear_alternate_button')
self.clearAlternateButton.setIcon(build_icon(':/system/clear_shortcut.png')) self.clear_alternate_button.setIcon(build_icon(':/system/clear_shortcut.png'))
self.alternateLayout.addWidget(self.clearAlternateButton) self.alternate_layout.addWidget(self.clear_alternate_button)
self.detailsLayout.addLayout(self.alternateLayout, 1, 2, 1, 1) self.details_layout.addLayout(self.alternate_layout, 1, 2, 1, 1)
self.primaryLabel = QtGui.QLabel(shortcutListDialog) self.primary_label = QtGui.QLabel(shortcutListDialog)
self.primaryLabel.setObjectName('primaryLabel') self.primary_label.setObjectName('primary_label')
self.detailsLayout.addWidget(self.primaryLabel, 0, 1, 1, 1) self.details_layout.addWidget(self.primary_label, 0, 1, 1, 1)
self.alternateLabel = QtGui.QLabel(shortcutListDialog) self.alternate_label = QtGui.QLabel(shortcutListDialog)
self.alternateLabel.setObjectName('alternateLabel') self.alternate_label.setObjectName('alternate_label')
self.detailsLayout.addWidget(self.alternateLabel, 0, 2, 1, 1) self.details_layout.addWidget(self.alternate_label, 0, 2, 1, 1)
self.shortcutListLayout.addLayout(self.detailsLayout) self.shortcut_list_layout.addLayout(self.details_layout)
self.button_box = create_button_box(shortcutListDialog, 'button_box', ['cancel', 'ok', 'defaults']) self.button_box = create_button_box(shortcutListDialog, 'button_box', ['cancel', 'ok', 'defaults'])
self.button_box.setOrientation(QtCore.Qt.Horizontal) self.button_box.setOrientation(QtCore.Qt.Horizontal)
self.shortcutListLayout.addWidget(self.button_box) self.shortcut_list_layout.addWidget(self.button_box)
self.retranslateUi(shortcutListDialog) self.retranslateUi(shortcutListDialog)
def retranslateUi(self, shortcutListDialog): def retranslateUi(self, shortcutListDialog):
@ -133,14 +133,14 @@ class Ui_ShortcutListDialog(object):
self.description_label.setText( self.description_label.setText(
translate('OpenLP.ShortcutListDialog', 'Select an action and click one of the buttons below to start ' translate('OpenLP.ShortcutListDialog', 'Select an action and click one of the buttons below to start '
'capturing a new primary or alternate shortcut, respectively.')) 'capturing a new primary or alternate shortcut, respectively.'))
self.treeWidget.setHeaderLabels([translate('OpenLP.ShortcutListDialog', 'Action'), self.tree_widget.setHeaderLabels([translate('OpenLP.ShortcutListDialog', 'Action'),
translate('OpenLP.ShortcutListDialog', 'Shortcut'), translate('OpenLP.ShortcutListDialog', 'Shortcut'),
translate('OpenLP.ShortcutListDialog', 'Alternate')]) translate('OpenLP.ShortcutListDialog', 'Alternate')])
self.defaultRadioButton.setText(translate('OpenLP.ShortcutListDialog', 'Default')) self.default_radio_button.setText(translate('OpenLP.ShortcutListDialog', 'Default'))
self.customRadioButton.setText(translate('OpenLP.ShortcutListDialog', 'Custom')) self.custom_radio_button.setText(translate('OpenLP.ShortcutListDialog', 'Custom'))
self.primaryPushButton.setToolTip(translate('OpenLP.ShortcutListDialog', 'Capture shortcut.')) self.primary_push_button.setToolTip(translate('OpenLP.ShortcutListDialog', 'Capture shortcut.'))
self.alternatePushButton.setToolTip(translate('OpenLP.ShortcutListDialog', 'Capture shortcut.')) self.alternate_push_button.setToolTip(translate('OpenLP.ShortcutListDialog', 'Capture shortcut.'))
self.clearPrimaryButton.setToolTip(translate('OpenLP.ShortcutListDialog', self.clear_primary_button.setToolTip(translate('OpenLP.ShortcutListDialog',
'Restore the default shortcut of this action.')) 'Restore the default shortcut of this action.'))
self.clearAlternateButton.setToolTip(translate('OpenLP.ShortcutListDialog', self.clear_alternate_button.setToolTip(translate('OpenLP.ShortcutListDialog',
'Restore the default shortcut of this action.')) 'Restore the default shortcut of this action.'))

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -54,18 +54,18 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog):
""" """
super(ShortcutListForm, self).__init__(parent) super(ShortcutListForm, self).__init__(parent)
self.setupUi(self) self.setupUi(self)
self.changedActions = {} self.changed_actions = {}
self.action_list = ActionList.get_instance() self.action_list = ActionList.get_instance()
self.dialog_was_shown = False self.dialog_was_shown = False
self.primaryPushButton.toggled.connect(self.onPrimaryPushButtonClicked) self.primary_push_button.toggled.connect(self.on_primary_push_button_clicked)
self.alternatePushButton.toggled.connect(self.onAlternatePushButtonClicked) self.alternate_push_button.toggled.connect(self.on_alternate_push_button_clicked)
self.treeWidget.currentItemChanged.connect(self.onCurrentItemChanged) self.tree_widget.currentItemChanged.connect(self.on_current_item_changed)
self.treeWidget.itemDoubleClicked.connect(self.onItemDoubleClicked) self.tree_widget.itemDoubleClicked.connect(self.on_item_double_clicked)
self.clearPrimaryButton.clicked.connect(self.onClearPrimaryButtonClicked) self.clear_primary_button.clicked.connect(self.on_clear_primary_button_clicked)
self.clearAlternateButton.clicked.connect(self.onClearAlternateButtonClicked) self.clear_alternate_button.clicked.connect(self.on_clear_alternate_button_clicked)
self.button_box.clicked.connect(self.onRestoreDefaultsClicked) self.button_box.clicked.connect(self.on_restore_defaults_clicked)
self.defaultRadioButton.clicked.connect(self.onDefaultRadioButtonClicked) self.default_radio_button.clicked.connect(self.on_default_radio_button_clicked)
self.customRadioButton.clicked.connect(self.onCustomRadioButtonClicked) self.custom_radio_button.clicked.connect(self.on_custom_radio_button_clicked)
def keyPressEvent(self, event): def keyPressEvent(self, event):
""" """
@ -73,7 +73,7 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog):
""" """
if event.key() == QtCore.Qt.Key_Space: if event.key() == QtCore.Qt.Key_Space:
self.keyReleaseEvent(event) self.keyReleaseEvent(event)
elif self.primaryPushButton.isChecked() or self.alternatePushButton.isChecked(): elif self.primary_push_button.isChecked() or self.alternate_push_button.isChecked():
self.keyReleaseEvent(event) self.keyReleaseEvent(event)
elif event.key() == QtCore.Qt.Key_Escape: elif event.key() == QtCore.Qt.Key_Escape:
event.accept() event.accept()
@ -83,7 +83,7 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog):
""" """
Respond to certain key presses Respond to certain key presses
""" """
if not self.primaryPushButton.isChecked() and not self.alternatePushButton.isChecked(): if not self.primary_push_button.isChecked() and not self.alternate_push_button.isChecked():
return return
# Do not continue, as the event is for the dialog (close it). # Do not continue, as the event is for the dialog (close it).
if self.dialog_was_shown and event.key() in (QtCore.Qt.Key_Escape, QtCore.Qt.Key_Enter, QtCore.Qt.Key_Return): if self.dialog_was_shown and event.key() in (QtCore.Qt.Key_Escape, QtCore.Qt.Key_Enter, QtCore.Qt.Key_Return):
@ -102,27 +102,27 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog):
if event.modifiers() & QtCore.Qt.MetaModifier == QtCore.Qt.MetaModifier: if event.modifiers() & QtCore.Qt.MetaModifier == QtCore.Qt.MetaModifier:
key_string = 'Meta+' + key_string key_string = 'Meta+' + key_string
key_sequence = QtGui.QKeySequence(key_string) key_sequence = QtGui.QKeySequence(key_string)
if self._validiate_shortcut(self._currentItemAction(), key_sequence): if self._validiate_shortcut(self._current_item_action(), key_sequence):
if self.primaryPushButton.isChecked(): if self.primary_push_button.isChecked():
self._adjustButton(self.primaryPushButton, False, text=key_sequence.toString()) self._adjust_button(self.primary_push_button, False, text=key_sequence.toString())
elif self.alternatePushButton.isChecked(): elif self.alternate_push_button.isChecked():
self._adjustButton(self.alternatePushButton, False, text=key_sequence.toString()) self._adjust_button(self.alternate_push_button, False, text=key_sequence.toString())
def exec_(self): def exec_(self):
""" """
Execute the dialog Execute the dialog
""" """
self.changedActions = {} self.changed_actions = {}
self.reloadShortcutList() self.reload_shortcut_list()
self._adjustButton(self.primaryPushButton, False, False, '') self._adjust_button(self.primary_push_button, False, False, '')
self._adjustButton(self.alternatePushButton, False, False, '') self._adjust_button(self.alternate_push_button, False, False, '')
return QtGui.QDialog.exec_(self) return QtGui.QDialog.exec_(self)
def reloadShortcutList(self): def reload_shortcut_list(self):
""" """
Reload the ``treeWidget`` list to add new and remove old actions. Reload the ``tree_widget`` list to add new and remove old actions.
""" """
self.treeWidget.clear() self.tree_widget.clear()
for category in self.action_list.categories: for category in self.action_list.categories:
# Check if the category is for internal use only. # Check if the category is for internal use only.
if category.name is None: if category.name is None:
@ -141,23 +141,23 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog):
action_item.setToolTip(1, tool_tip_text) action_item.setToolTip(1, tool_tip_text)
action_item.setToolTip(2, tool_tip_text) action_item.setToolTip(2, tool_tip_text)
item.addChild(action_item) item.addChild(action_item)
self.treeWidget.addTopLevelItem(item) self.tree_widget.addTopLevelItem(item)
item.setExpanded(True) item.setExpanded(True)
self.refreshShortcutList() self.refresh_shortcut_list()
def refreshShortcutList(self): def refresh_shortcut_list(self):
""" """
This refreshes the item's shortcuts shown in the list. Note, this neither adds new actions nor removes old This refreshes the item's shortcuts shown in the list. Note, this neither adds new actions nor removes old
actions. actions.
""" """
iterator = QtGui.QTreeWidgetItemIterator(self.treeWidget) iterator = QtGui.QTreeWidgetItemIterator(self.tree_widget)
while iterator.value(): while iterator.value():
item = iterator.value() item = iterator.value()
iterator += 1 iterator += 1
action = self._currentItemAction(item) action = self._current_item_action(item)
if action is None: if action is None:
continue continue
shortcuts = self._actionShortcuts(action) shortcuts = self._action_shortcuts(action)
if not shortcuts: if not shortcuts:
item.setText(1, '') item.setText(1, '')
item.setText(2, '') item.setText(2, '')
@ -167,117 +167,117 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog):
else: else:
item.setText(1, shortcuts[0].toString()) item.setText(1, shortcuts[0].toString())
item.setText(2, shortcuts[1].toString()) item.setText(2, shortcuts[1].toString())
self.onCurrentItemChanged() self.on_current_item_changed()
def onPrimaryPushButtonClicked(self, toggled): def on_primary_push_button_clicked(self, toggled):
""" """
Save the new primary shortcut. Save the new primary shortcut.
""" """
self.customRadioButton.setChecked(True) self.custom_radio_button.setChecked(True)
if toggled: if toggled:
self.alternatePushButton.setChecked(False) self.alternate_push_button.setChecked(False)
self.primaryPushButton.setText('') self.primary_push_button.setText('')
return return
action = self._currentItemAction() action = self._current_item_action()
if action is None: if action is None:
return return
shortcuts = self._actionShortcuts(action) shortcuts = self._action_shortcuts(action)
new_shortcuts = [QtGui.QKeySequence(self.primaryPushButton.text())] new_shortcuts = [QtGui.QKeySequence(self.primary_push_button.text())]
if len(shortcuts) == 2: if len(shortcuts) == 2:
new_shortcuts.append(shortcuts[1]) new_shortcuts.append(shortcuts[1])
self.changedActions[action] = new_shortcuts self.changed_actions[action] = new_shortcuts
self.refreshShortcutList() self.refresh_shortcut_list()
def onAlternatePushButtonClicked(self, toggled): def on_alternate_push_button_clicked(self, toggled):
""" """
Save the new alternate shortcut. Save the new alternate shortcut.
""" """
self.customRadioButton.setChecked(True) self.custom_radio_button.setChecked(True)
if toggled: if toggled:
self.primaryPushButton.setChecked(False) self.primary_push_button.setChecked(False)
self.alternatePushButton.setText('') self.alternate_push_button.setText('')
return return
action = self._currentItemAction() action = self._current_item_action()
if action is None: if action is None:
return return
shortcuts = self._actionShortcuts(action) shortcuts = self._action_shortcuts(action)
new_shortcuts = [] new_shortcuts = []
if shortcuts: if shortcuts:
new_shortcuts.append(shortcuts[0]) new_shortcuts.append(shortcuts[0])
new_shortcuts.append(QtGui.QKeySequence(self.alternatePushButton.text())) new_shortcuts.append(QtGui.QKeySequence(self.alternate_push_button.text()))
self.changedActions[action] = new_shortcuts self.changed_actions[action] = new_shortcuts
if not self.primaryPushButton.text(): if not self.primary_push_button.text():
# When we do not have a primary shortcut, the just entered alternate shortcut will automatically become the # When we do not have a primary shortcut, the just entered alternate shortcut will automatically become the
# primary shortcut. That is why we have to adjust the primary button's text. # primary shortcut. That is why we have to adjust the primary button's text.
self.primaryPushButton.setText(self.alternatePushButton.text()) self.primary_push_button.setText(self.alternate_push_button.text())
self.alternatePushButton.setText('') self.alternate_push_button.setText('')
self.refreshShortcutList() self.refresh_shortcut_list()
def onItemDoubleClicked(self, item, column): def on_item_double_clicked(self, item, column):
""" """
A item has been double clicked. The ``primaryPushButton`` will be checked and the item's shortcut will be A item has been double clicked. The ``primaryPushButton`` will be checked and the item's shortcut will be
displayed. displayed.
""" """
action = self._currentItemAction(item) action = self._current_item_action(item)
if action is None: if action is None:
return return
self.primaryPushButton.setChecked(column in [0, 1]) self.primary_push_button.setChecked(column in [0, 1])
self.alternatePushButton.setChecked(column not in [0, 1]) self.alternate_push_button.setChecked(column not in [0, 1])
if column in [0, 1]: if column in [0, 1]:
self.primaryPushButton.setText('') self.primary_push_button.setText('')
self.primaryPushButton.setFocus() self.primary_push_button.setFocus()
else: else:
self.alternatePushButton.setText('') self.alternate_push_button.setText('')
self.alternatePushButton.setFocus() self.alternate_push_button.setFocus()
def onCurrentItemChanged(self, item=None, previousItem=None): def on_current_item_changed(self, item=None, previousItem=None):
""" """
A item has been pressed. We adjust the button's text to the action's shortcut which is encapsulate in the item. A item has been pressed. We adjust the button's text to the action's shortcut which is encapsulate in the item.
""" """
action = self._currentItemAction(item) action = self._current_item_action(item)
self.primaryPushButton.setEnabled(action is not None) self.primary_push_button.setEnabled(action is not None)
self.alternatePushButton.setEnabled(action is not None) self.alternate_push_button.setEnabled(action is not None)
primary_text = '' primary_text = ''
alternate_text = '' alternate_text = ''
primary_label_text = '' primary_label_text = ''
alternate_label_text = '' alternate_label_text = ''
if action is None: if action is None:
self.primaryPushButton.setChecked(False) self.primary_push_button.setChecked(False)
self.alternatePushButton.setChecked(False) self.alternate_push_button.setChecked(False)
else: else:
if action.defaultShortcuts: if action.defaultShortcuts:
primary_label_text = action.defaultShortcuts[0].toString() primary_label_text = action.defaultShortcuts[0].toString()
if len(action.defaultShortcuts) == 2: if len(action.defaultShortcuts) == 2:
alternate_label_text = action.defaultShortcuts[1].toString() alternate_label_text = action.defaultShortcuts[1].toString()
shortcuts = self._actionShortcuts(action) shortcuts = self._action_shortcuts(action)
# We do not want to loose pending changes, that is why we have to keep the text when, this function has not # We do not want to loose pending changes, that is why we have to keep the text when, this function has not
# been triggered by a signal. # been triggered by a signal.
if item is None: if item is None:
primary_text = self.primaryPushButton.text() primary_text = self.primary_push_button.text()
alternate_text = self.alternatePushButton.text() alternate_text = self.alternate_push_button.text()
elif len(shortcuts) == 1: elif len(shortcuts) == 1:
primary_text = shortcuts[0].toString() primary_text = shortcuts[0].toString()
elif len(shortcuts) == 2: elif len(shortcuts) == 2:
primary_text = shortcuts[0].toString() primary_text = shortcuts[0].toString()
alternate_text = shortcuts[1].toString() alternate_text = shortcuts[1].toString()
# When we are capturing a new shortcut, we do not want, the buttons to display the current shortcut. # When we are capturing a new shortcut, we do not want, the buttons to display the current shortcut.
if self.primaryPushButton.isChecked(): if self.primary_push_button.isChecked():
primary_text = '' primary_text = ''
if self.alternatePushButton.isChecked(): if self.alternate_push_button.isChecked():
alternate_text = '' alternate_text = ''
self.primaryPushButton.setText(primary_text) self.primary_push_button.setText(primary_text)
self.alternatePushButton.setText(alternate_text) self.alternate_push_button.setText(alternate_text)
self.primaryLabel.setText(primary_label_text) self.primary_label.setText(primary_label_text)
self.alternateLabel.setText(alternate_label_text) self.alternate_label.setText(alternate_label_text)
# We do not want to toggle and radio button, as the function has not been triggered by a signal. # We do not want to toggle and radio button, as the function has not been triggered by a signal.
if item is None: if item is None:
return return
if primary_label_text == primary_text and alternate_label_text == alternate_text: if primary_label_text == primary_text and alternate_label_text == alternate_text:
self.defaultRadioButton.toggle() self.default_radio_button.toggle()
else: else:
self.customRadioButton.toggle() self.custom_radio_button.toggle()
def onRestoreDefaultsClicked(self, button): def on_restore_defaults_clicked(self, button):
""" """
Restores all default shortcuts. Restores all default shortcuts.
""" """
@ -286,47 +286,48 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog):
if QtGui.QMessageBox.question(self, translate('OpenLP.ShortcutListDialog', 'Restore Default Shortcuts'), if QtGui.QMessageBox.question(self, translate('OpenLP.ShortcutListDialog', 'Restore Default Shortcuts'),
translate('OpenLP.ShortcutListDialog', 'Do you want to restore all ' translate('OpenLP.ShortcutListDialog', 'Do you want to restore all '
'shortcuts to their defaults?'), 'shortcuts to their defaults?'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)) == QtGui.QMessageBox.No: QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes |
QtGui.QMessageBox.No)) == QtGui.QMessageBox.No:
return return
self._adjustButton(self.primaryPushButton, False, text='') self._adjust_button(self.primary_push_button, False, text='')
self._adjustButton(self.alternatePushButton, False, text='') self._adjust_button(self.alternate_push_button, False, text='')
for category in self.action_list.categories: for category in self.action_list.categories:
for action in category.actions: for action in category.actions:
self.changedActions[action] = action.defaultShortcuts self.changed_actions[action] = action.defaultShortcuts
self.refreshShortcutList() self.refresh_shortcut_list()
def onDefaultRadioButtonClicked(self, toggled): def on_default_radio_button_clicked(self, toggled):
""" """
The default radio button has been clicked, which means we have to make sure, that we use the default shortcuts The default radio button has been clicked, which means we have to make sure, that we use the default shortcuts
for the action. for the action.
""" """
if not toggled: if not toggled:
return return
action = self._currentItemAction() action = self._current_item_action()
if action is None: if action is None:
return return
temp_shortcuts = self._actionShortcuts(action) temp_shortcuts = self._action_shortcuts(action)
self.changedActions[action] = action.defaultShortcuts self.changed_actions[action] = action.defaultShortcuts
self.refreshShortcutList() self.refresh_shortcut_list()
primary_button_text = '' primary_button_text = ''
alternate_button_text = '' alternate_button_text = ''
if temp_shortcuts: if temp_shortcuts:
primary_button_text = temp_shortcuts[0].toString() primary_button_text = temp_shortcuts[0].toString()
if len(temp_shortcuts) == 2: if len(temp_shortcuts) == 2:
alternate_button_text = temp_shortcuts[1].toString() alternate_button_text = temp_shortcuts[1].toString()
self.primaryPushButton.setText(primary_button_text) self.primary_push_button.setText(primary_button_text)
self.alternatePushButton.setText(alternate_button_text) self.alternate_push_button.setText(alternate_button_text)
def onCustomRadioButtonClicked(self, toggled): def on_custom_radio_button_clicked(self, toggled):
""" """
The custom shortcut radio button was clicked, thus we have to restore the custom shortcuts by calling those The custom shortcut radio button was clicked, thus we have to restore the custom shortcuts by calling those
functions triggered by button clicks. functions triggered by button clicks.
""" """
if not toggled: if not toggled:
return return
self.onPrimaryPushButtonClicked(False) self.on_primary_push_button_clicked(False)
self.onAlternatePushButtonClicked(False) self.on_alternate_push_button_clicked(False)
self.refreshShortcutList() self.refresh_shortcut_list()
def save(self): def save(self):
""" """
@ -340,22 +341,22 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog):
if category.name is None: if category.name is None:
continue continue
for action in category.actions: for action in category.actions:
if action in self.changedActions: if action in self.changed_actions:
old_shortcuts = list(map(QtGui.QKeySequence.toString, action.shortcuts())) old_shortcuts = list(map(QtGui.QKeySequence.toString, action.shortcuts()))
action.setShortcuts(self.changedActions[action]) action.setShortcuts(self.changed_actions[action])
self.action_list.update_shortcut_map(action, old_shortcuts) self.action_list.update_shortcut_map(action, old_shortcuts)
settings.setValue(action.objectName(), action.shortcuts()) settings.setValue(action.objectName(), action.shortcuts())
settings.endGroup() settings.endGroup()
def onClearPrimaryButtonClicked(self, toggled): def on_clear_primary_button_clicked(self, toggled):
""" """
Restore the defaults of this action. Restore the defaults of this action.
""" """
self.primaryPushButton.setChecked(False) self.primary_push_button.setChecked(False)
action = self._currentItemAction() action = self._current_item_action()
if action is None: if action is None:
return return
shortcuts = self._actionShortcuts(action) shortcuts = self._action_shortcuts(action)
new_shortcuts = [] new_shortcuts = []
if action.defaultShortcuts: if action.defaultShortcuts:
new_shortcuts.append(action.defaultShortcuts[0]) new_shortcuts.append(action.defaultShortcuts[0])
@ -367,19 +368,19 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog):
return return
if len(shortcuts) == 2: if len(shortcuts) == 2:
new_shortcuts.append(shortcuts[1]) new_shortcuts.append(shortcuts[1])
self.changedActions[action] = new_shortcuts self.changed_actions[action] = new_shortcuts
self.refreshShortcutList() self.refresh_shortcut_list()
self.onCurrentItemChanged(self.treeWidget.currentItem()) self.on_current_item_changed(self.tree_widget.currentItem())
def onClearAlternateButtonClicked(self, toggled): def on_clear_alternate_button_clicked(self, toggled):
""" """
Restore the defaults of this action. Restore the defaults of this action.
""" """
self.alternatePushButton.setChecked(False) self.alternate_push_button.setChecked(False)
action = self._currentItemAction() action = self._current_item_action()
if action is None: if action is None:
return return
shortcuts = self._actionShortcuts(action) shortcuts = self._action_shortcuts(action)
new_shortcuts = [] new_shortcuts = []
if shortcuts: if shortcuts:
new_shortcuts.append(shortcuts[0]) new_shortcuts.append(shortcuts[0])
@ -388,9 +389,9 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog):
if len(new_shortcuts) == 2: if len(new_shortcuts) == 2:
if not self._validiate_shortcut(action, new_shortcuts[1]): if not self._validiate_shortcut(action, new_shortcuts[1]):
return return
self.changedActions[action] = new_shortcuts self.changed_actions[action] = new_shortcuts
self.refreshShortcutList() self.refresh_shortcut_list()
self.onCurrentItemChanged(self.treeWidget.currentItem()) self.on_current_item_changed(self.tree_widget.currentItem())
def _validiate_shortcut(self, changing_action, key_sequence): def _validiate_shortcut(self, changing_action, key_sequence):
""" """
@ -406,19 +407,19 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog):
is_valid = True is_valid = True
for category in self.action_list.categories: for category in self.action_list.categories:
for action in category.actions: for action in category.actions:
shortcuts = self._actionShortcuts(action) shortcuts = self._action_shortcuts(action)
if key_sequence not in shortcuts: if key_sequence not in shortcuts:
continue continue
if action is changing_action: if action is changing_action:
if self.primaryPushButton.isChecked() and shortcuts.index(key_sequence) == 0: if self.primary_push_button.isChecked() and shortcuts.index(key_sequence) == 0:
continue continue
if self.alternatePushButton.isChecked() and shortcuts.index(key_sequence) == 1: if self.alternate_push_button.isChecked() and shortcuts.index(key_sequence) == 1:
continue continue
# Have the same parent, thus they cannot have the same shortcut. # Have the same parent, thus they cannot have the same shortcut.
if action.parent() is changing_action.parent(): if action.parent() is changing_action.parent():
is_valid = False is_valid = False
# The new shortcut is already assigned, but if both shortcuts are only valid in a different widget the # The new shortcut is already assigned, but if both shortcuts are only valid in a different widget the
# new shortcut is vaild, because they will not interfere. # new shortcut is valid, because they will not interfere.
if action.shortcutContext() in [QtCore.Qt.WindowShortcut, QtCore.Qt.ApplicationShortcut]: if action.shortcutContext() in [QtCore.Qt.WindowShortcut, QtCore.Qt.ApplicationShortcut]:
is_valid = False is_valid = False
if changing_action.shortcutContext() in [QtCore.Qt.WindowShortcut, QtCore.Qt.ApplicationShortcut]: if changing_action.shortcutContext() in [QtCore.Qt.WindowShortcut, QtCore.Qt.ApplicationShortcut]:
@ -426,33 +427,32 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog):
if not is_valid: if not is_valid:
self.main_window.warning_message(translate('OpenLP.ShortcutListDialog', 'Duplicate Shortcut'), self.main_window.warning_message(translate('OpenLP.ShortcutListDialog', 'Duplicate Shortcut'),
translate('OpenLP.ShortcutListDialog', translate('OpenLP.ShortcutListDialog',
'The shortcut "%s" is already assigned to another action, please use a different shortcut.') % 'The shortcut "%s" is already assigned to another action, please'
key_sequence.toString() ' use a different shortcut.') % key_sequence.toString())
)
self.dialog_was_shown = True self.dialog_was_shown = True
return is_valid return is_valid
def _actionShortcuts(self, action): def _action_shortcuts(self, action):
""" """
This returns the shortcuts for the given ``action``, which also includes those shortcuts which are not saved This returns the shortcuts for the given ``action``, which also includes those shortcuts which are not saved
yet but already assigned (as changes yre applied when closing the dialog). yet but already assigned (as changes yre applied when closing the dialog).
""" """
if action in self.changedActions: if action in self.changed_actions:
return self.changedActions[action] return self.changed_actions[action]
return action.shortcuts() return action.shortcuts()
def _currentItemAction(self, item=None): def _current_item_action(self, item=None):
""" """
Returns the action of the given ``item``. If no item is given, we return the action of the current item of Returns the action of the given ``item``. If no item is given, we return the action of the current item of
the ``treeWidget``. the ``tree_widget``.
""" """
if item is None: if item is None:
item = self.treeWidget.currentItem() item = self.tree_widget.currentItem()
if item is None: if item is None:
return return
return item.data(0, QtCore.Qt.UserRole) return item.data(0, QtCore.Qt.UserRole)
def _adjustButton(self, button, checked=None, enabled=None, text=None): def _adjust_button(self, button, checked=None, enabled=None, text=None):
""" """
Can be called to adjust more properties of the given ``button`` at once. Can be called to adjust more properties of the given ``button`` at once.
""" """

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -45,73 +45,73 @@ class Ui_StartTimeDialog(object):
""" """
StartTimeDialog.setObjectName('StartTimeDialog') StartTimeDialog.setObjectName('StartTimeDialog')
StartTimeDialog.resize(350, 10) StartTimeDialog.resize(350, 10)
self.dialogLayout = QtGui.QGridLayout(StartTimeDialog) self.dialog_layout = QtGui.QGridLayout(StartTimeDialog)
self.dialogLayout.setObjectName('dialog_layout') self.dialog_layout.setObjectName('dialog_layout')
self.startLabel = QtGui.QLabel(StartTimeDialog) self.start_label = QtGui.QLabel(StartTimeDialog)
self.startLabel.setObjectName('startLabel') self.start_label.setObjectName('start_label')
self.startLabel.setAlignment(QtCore.Qt.AlignHCenter) self.start_label.setAlignment(QtCore.Qt.AlignHCenter)
self.dialogLayout.addWidget(self.startLabel, 0, 1, 1, 1) self.dialog_layout.addWidget(self.start_label, 0, 1, 1, 1)
self.finishLabel = QtGui.QLabel(StartTimeDialog) self.finish_label = QtGui.QLabel(StartTimeDialog)
self.finishLabel.setObjectName('finishLabel') self.finish_label.setObjectName('finish_label')
self.finishLabel.setAlignment(QtCore.Qt.AlignHCenter) self.finish_label.setAlignment(QtCore.Qt.AlignHCenter)
self.dialogLayout.addWidget(self.finishLabel, 0, 2, 1, 1) self.dialog_layout.addWidget(self.finish_label, 0, 2, 1, 1)
self.lengthLabel = QtGui.QLabel(StartTimeDialog) self.length_label = QtGui.QLabel(StartTimeDialog)
self.lengthLabel.setObjectName('startLabel') self.length_label.setObjectName('start_label')
self.lengthLabel.setAlignment(QtCore.Qt.AlignHCenter) self.length_label.setAlignment(QtCore.Qt.AlignHCenter)
self.dialogLayout.addWidget(self.lengthLabel, 0, 3, 1, 1) self.dialog_layout.addWidget(self.length_label, 0, 3, 1, 1)
self.hourLabel = QtGui.QLabel(StartTimeDialog) self.hour_label = QtGui.QLabel(StartTimeDialog)
self.hourLabel.setObjectName('hourLabel') self.hour_label.setObjectName('hour_label')
self.dialogLayout.addWidget(self.hourLabel, 1, 0, 1, 1) self.dialog_layout.addWidget(self.hour_label, 1, 0, 1, 1)
self.hourSpinBox = QtGui.QSpinBox(StartTimeDialog) self.hour_spin_box = QtGui.QSpinBox(StartTimeDialog)
self.hourSpinBox.setObjectName('hourSpinBox') self.hour_spin_box.setObjectName('hour_spin_box')
self.hourSpinBox.setMinimum(0) self.hour_spin_box.setMinimum(0)
self.hourSpinBox.setMaximum(4) self.hour_spin_box.setMaximum(4)
self.dialogLayout.addWidget(self.hourSpinBox, 1, 1, 1, 1) self.dialog_layout.addWidget(self.hour_spin_box, 1, 1, 1, 1)
self.hourFinishSpinBox = QtGui.QSpinBox(StartTimeDialog) self.hour_finish_spin_box = QtGui.QSpinBox(StartTimeDialog)
self.hourFinishSpinBox.setObjectName('hourFinishSpinBox') self.hour_finish_spin_box.setObjectName('hour_finish_spin_box')
self.hourFinishSpinBox.setMinimum(0) self.hour_finish_spin_box.setMinimum(0)
self.hourFinishSpinBox.setMaximum(4) self.hour_finish_spin_box.setMaximum(4)
self.dialogLayout.addWidget(self.hourFinishSpinBox, 1, 2, 1, 1) self.dialog_layout.addWidget(self.hour_finish_spin_box, 1, 2, 1, 1)
self.hourFinishLabel = QtGui.QLabel(StartTimeDialog) self.hour_finish_label = QtGui.QLabel(StartTimeDialog)
self.hourFinishLabel.setObjectName('hourLabel') self.hour_finish_label.setObjectName('hour_label')
self.hourFinishLabel.setAlignment(QtCore.Qt.AlignRight) self.hour_finish_label.setAlignment(QtCore.Qt.AlignRight)
self.dialogLayout.addWidget(self.hourFinishLabel, 1, 3, 1, 1) self.dialog_layout.addWidget(self.hour_finish_label, 1, 3, 1, 1)
self.minuteLabel = QtGui.QLabel(StartTimeDialog) self.minute_label = QtGui.QLabel(StartTimeDialog)
self.minuteLabel.setObjectName('minuteLabel') self.minute_label.setObjectName('minute_label')
self.dialogLayout.addWidget(self.minuteLabel, 2, 0, 1, 1) self.dialog_layout.addWidget(self.minute_label, 2, 0, 1, 1)
self.minuteSpinBox = QtGui.QSpinBox(StartTimeDialog) self.minute_spin_box = QtGui.QSpinBox(StartTimeDialog)
self.minuteSpinBox.setObjectName('minuteSpinBox') self.minute_spin_box.setObjectName('minute_spin_box')
self.minuteSpinBox.setMinimum(0) self.minute_spin_box.setMinimum(0)
self.minuteSpinBox.setMaximum(59) self.minute_spin_box.setMaximum(59)
self.dialogLayout.addWidget(self.minuteSpinBox, 2, 1, 1, 1) self.dialog_layout.addWidget(self.minute_spin_box, 2, 1, 1, 1)
self.minuteFinishSpinBox = QtGui.QSpinBox(StartTimeDialog) self.minute_finish_spin_box = QtGui.QSpinBox(StartTimeDialog)
self.minuteFinishSpinBox.setObjectName('minuteFinishSpinBox') self.minute_finish_spin_box.setObjectName('minute_finish_spin_box')
self.minuteFinishSpinBox.setMinimum(0) self.minute_finish_spin_box.setMinimum(0)
self.minuteFinishSpinBox.setMaximum(59) self.minute_finish_spin_box.setMaximum(59)
self.dialogLayout.addWidget(self.minuteFinishSpinBox, 2, 2, 1, 1) self.dialog_layout.addWidget(self.minute_finish_spin_box, 2, 2, 1, 1)
self.minuteFinishLabel = QtGui.QLabel(StartTimeDialog) self.minute_finish_label = QtGui.QLabel(StartTimeDialog)
self.minuteFinishLabel.setObjectName('minuteLabel') self.minute_finish_label.setObjectName('minute_label')
self.minuteFinishLabel.setAlignment(QtCore.Qt.AlignRight) self.minute_finish_label.setAlignment(QtCore.Qt.AlignRight)
self.dialogLayout.addWidget(self.minuteFinishLabel, 2, 3, 1, 1) self.dialog_layout.addWidget(self.minute_finish_label, 2, 3, 1, 1)
self.secondLabel = QtGui.QLabel(StartTimeDialog) self.second_label = QtGui.QLabel(StartTimeDialog)
self.secondLabel.setObjectName('secondLabel') self.second_label.setObjectName('second_label')
self.dialogLayout.addWidget(self.secondLabel, 3, 0, 1, 1) self.dialog_layout.addWidget(self.second_label, 3, 0, 1, 1)
self.secondSpinBox = QtGui.QSpinBox(StartTimeDialog) self.second_spin_box = QtGui.QSpinBox(StartTimeDialog)
self.secondSpinBox.setObjectName('secondSpinBox') self.second_spin_box.setObjectName('second_spin_box')
self.secondSpinBox.setMinimum(0) self.second_spin_box.setMinimum(0)
self.secondSpinBox.setMaximum(59) self.second_spin_box.setMaximum(59)
self.secondFinishSpinBox = QtGui.QSpinBox(StartTimeDialog) self.second_finish_spin_box = QtGui.QSpinBox(StartTimeDialog)
self.secondFinishSpinBox.setObjectName('secondFinishSpinBox') self.second_finish_spin_box.setObjectName('second_finish_spin_box')
self.secondFinishSpinBox.setMinimum(0) self.second_finish_spin_box.setMinimum(0)
self.secondFinishSpinBox.setMaximum(59) self.second_finish_spin_box.setMaximum(59)
self.dialogLayout.addWidget(self.secondFinishSpinBox, 3, 2, 1, 1) self.dialog_layout.addWidget(self.second_finish_spin_box, 3, 2, 1, 1)
self.secondFinishLabel = QtGui.QLabel(StartTimeDialog) self.second_finish_label = QtGui.QLabel(StartTimeDialog)
self.secondFinishLabel.setObjectName('secondLabel') self.second_finish_label.setObjectName('second_label')
self.secondFinishLabel.setAlignment(QtCore.Qt.AlignRight) self.second_finish_label.setAlignment(QtCore.Qt.AlignRight)
self.dialogLayout.addWidget(self.secondFinishLabel, 3, 3, 1, 1) self.dialog_layout.addWidget(self.second_finish_label, 3, 3, 1, 1)
self.dialogLayout.addWidget(self.secondSpinBox, 3, 1, 1, 1) self.dialog_layout.addWidget(self.second_spin_box, 3, 1, 1, 1)
self.button_box = create_button_box(StartTimeDialog, 'button_box', ['cancel', 'ok']) self.button_box = create_button_box(StartTimeDialog, 'button_box', ['cancel', 'ok'])
self.dialogLayout.addWidget(self.button_box, 5, 2, 1, 2) self.dialog_layout.addWidget(self.button_box, 5, 2, 1, 2)
self.retranslateUi(StartTimeDialog) self.retranslateUi(StartTimeDialog)
self.setMaximumHeight(self.sizeHint().height()) self.setMaximumHeight(self.sizeHint().height())
@ -119,16 +119,16 @@ class Ui_StartTimeDialog(object):
""" """
Update the translations on the fly Update the translations on the fly
""" """
self.setWindowTitle(translate('OpenLP.StartTimeForm', 'Item Start and Finish Time')) self.setWindowTitle(translate('OpenLP.StartTime_form', 'Item Start and Finish Time'))
self.hourSpinBox.setSuffix(UiStrings().Hours) self.hour_spin_box.setSuffix(UiStrings().Hours)
self.minuteSpinBox.setSuffix(UiStrings().Minutes) self.minute_spin_box.setSuffix(UiStrings().Minutes)
self.secondSpinBox.setSuffix(UiStrings().Seconds) self.second_spin_box.setSuffix(UiStrings().Seconds)
self.hourFinishSpinBox.setSuffix(UiStrings().Hours) self.hour_finish_spin_box.setSuffix(UiStrings().Hours)
self.minuteFinishSpinBox.setSuffix(UiStrings().Minutes) self.minute_finish_spin_box.setSuffix(UiStrings().Minutes)
self.secondFinishSpinBox.setSuffix(UiStrings().Seconds) self.second_finish_spin_box.setSuffix(UiStrings().Seconds)
self.hourLabel.setText(translate('OpenLP.StartTimeForm', 'Hours:')) self.hour_label.setText(translate('OpenLP.StartTime_form', 'Hours:'))
self.minuteLabel.setText(translate('OpenLP.StartTimeForm', 'Minutes:')) self.minute_label.setText(translate('OpenLP.StartTime_form', 'Minutes:'))
self.secondLabel.setText(translate('OpenLP.StartTimeForm', 'Seconds:')) self.second_label.setText(translate('OpenLP.StartTime_form', 'Seconds:'))
self.startLabel.setText(translate('OpenLP.StartTimeForm', 'Start')) self.start_label.setText(translate('OpenLP.StartTime_form', 'Start'))
self.finishLabel.setText(translate('OpenLP.StartTimeForm', 'Finish')) self.finish_label.setText(translate('OpenLP.StartTime_form', 'Finish'))
self.lengthLabel.setText(translate('OpenLP.StartTimeForm', 'Length')) self.length_label.setText(translate('OpenLP.StartTime_form', 'Length'))

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -54,32 +54,34 @@ class StartTimeForm(QtGui.QDialog, Ui_StartTimeDialog):
Run the Dialog with correct heading. Run the Dialog with correct heading.
""" """
hour, minutes, seconds = self._time_split(self.item['service_item'].start_time) hour, minutes, seconds = self._time_split(self.item['service_item'].start_time)
self.hourSpinBox.setValue(hour) self.hour_spin_box.setValue(hour)
self.minuteSpinBox.setValue(minutes) self.minute_spin_box.setValue(minutes)
self.secondSpinBox.setValue(seconds) 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'].media_length)
self.hourFinishSpinBox.setValue(hours) self.hour_finish_spin_box.setValue(hours)
self.minuteFinishSpinBox.setValue(minutes) self.minute_finish_spin_box.setValue(minutes)
self.secondFinishSpinBox.setValue(seconds) self.second_finish_spin_box.setValue(seconds)
self.hourFinishLabel.setText('%s%s' % (str(hour), UiStrings().Hours)) self.hour_finish_label.setText('%s%s' % (str(hour), UiStrings().Hours))
self.minuteFinishLabel.setText('%s%s' % (str(minutes), UiStrings().Minutes)) self.minute_finish_label.setText('%s%s' % (str(minutes), UiStrings().Minutes))
self.secondFinishLabel.setText('%s%s' % (str(seconds), UiStrings().Seconds)) self.second_finish_label.setText('%s%s' % (str(seconds), UiStrings().Seconds))
return QtGui.QDialog.exec_(self) return QtGui.QDialog.exec_(self)
def accept(self): def accept(self):
""" """
When the dialog succeeds, this is run When the dialog succeeds, this is run
""" """
start = self.hourSpinBox.value() * 3600 + self.minuteSpinBox.value() * 60 + self.secondSpinBox.value() start = self.hour_spin_box.value() * 3600 + self.minute_spin_box.value() * 60 + self.second_spin_box.value()
end = self.hourFinishSpinBox.value() * 3600 + \ end = self.hour_finish_spin_box.value() * 3600 + \
self.minuteFinishSpinBox.value() * 60 + self.secondFinishSpinBox.value() self.minute_finish_spin_box.value() * 60 + self.second_finish_spin_box.value()
if end > self.item['service_item'].media_length: if end > self.item['service_item'].media_length:
critical_error_message_box(title=translate('OpenLP.StartTimeForm', 'Time Validation Error'), critical_error_message_box(title=translate('OpenLP.StartTime_form', 'Time Validation Error'),
message=translate('OpenLP.StartTimeForm', 'Finish time is set after the end of the media item')) message=translate('OpenLP.StartTime_form',
'Finish time is set after the end of the media item'))
return return
elif start > end: elif start > end:
critical_error_message_box(title=translate('OpenLP.StartTimeForm', 'Time Validation Error'), critical_error_message_box(title=translate('OpenLP.StartTime_form', 'Time Validation Error'),
message=translate('OpenLP.StartTimeForm', 'Start time is after the finish time of the media item')) message=translate('OpenLP.StartTime_form',
'Start time is after the finish time of the media item'))
return return
self.item['service_item'].start_time = start self.item['service_item'].start_time = start
self.item['service_item'].end_time = end self.item['service_item'].end_time = end

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -18,11 +18,11 @@
# Software Foundation; version 2 of the License. # # Software Foundation; version 2 of the License. #
# # # #
# This program is distributed in the hope that it will be useful, but WITHOUT # # This program is distributed in the hope that it will be useful, but WITHOUT #
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # # AN_y WARRANT_y; without even the implied warranty of MERCHANTABILIT_y or #
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
# more details. # # more details. #
# # # #
# You should have received a copy of the GNU General Public License along # # _you should have received a copy of the GNU General Public License along #
# with this program; if not, write to the Free Software Foundation, Inc., 59 # # with this program; if not, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Temple Place, Suite 330, Boston, MA 02111-1307 USA #
############################################################################### ###############################################################################
@ -62,97 +62,97 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
super(ThemeForm, self).__init__(parent) super(ThemeForm, self).__init__(parent)
self.setupUi(self) self.setupUi(self)
self.registerFields() self.registerFields()
self.updateThemeAllowed = True self.update_theme_allowed = True
self.temp_background_filename = '' self.temp_background_filename = ''
self.themeLayoutForm = ThemeLayoutForm(self) self.theme_layout_form = ThemeLayoutForm(self)
self.backgroundComboBox.currentIndexChanged.connect(self.onBackgroundComboBoxCurrentIndexChanged) self.background_combo_box.currentIndexChanged.connect(self.on_background_combo_box_current_index_changed)
self.gradientComboBox.currentIndexChanged.connect(self.onGradientComboBoxCurrentIndexChanged) self.gradient_combo_box.currentIndexChanged.connect(self.on_gradient_combo_box_current_index_changed)
self.colorButton.clicked.connect(self.onColorButtonClicked) self.color_button.clicked.connect(self.on_color_button_clicked)
self.imageColorButton.clicked.connect(self.onImageColorButtonClicked) self.image_color_button.clicked.connect(self.on_image_color_button_clicked)
self.gradientStartButton.clicked.connect(self.onGradientStartButtonClicked) self.gradient_start_button.clicked.connect(self.on_gradient_start_button_clicked)
self.gradientEndButton.clicked.connect(self.onGradientEndButtonClicked) self.gradient_end_button.clicked.connect(self.on_gradient_end_button_clicked)
self.imageBrowseButton.clicked.connect(self.onImageBrowseButtonClicked) self.image_browse_button.clicked.connect(self.on_image_browse_button_clicked)
self.imageFileEdit.editingFinished.connect(self.onImageFileEditEditingFinished) self.image_file_edit.editingFinished.connect(self.on_image_file_edit_editing_finished)
self.mainColorButton.clicked.connect(self.onMainColorButtonClicked) self.main_color_button.clicked.connect(self.on_main_color_button_clicked)
self.outlineColorButton.clicked.connect(self.onOutlineColorButtonClicked) self.outline_color_button.clicked.connect(self.on_outline_color_button_clicked)
self.shadowColorButton.clicked.connect(self.onShadowColorButtonClicked) self.shadow_color_button.clicked.connect(self.on_shadow_color_button_clicked)
self.outlineCheckBox.stateChanged.connect(self.onOutlineCheckCheckBoxStateChanged) self.outline_check_box.stateChanged.connect(self.on_outline_check_check_box_state_changed)
self.shadowCheckBox.stateChanged.connect(self.onShadowCheckCheckBoxStateChanged) self.shadow_check_box.stateChanged.connect(self.on_shadow_check_check_box_state_changed)
self.footerColorButton.clicked.connect(self.onFooterColorButtonClicked) self.footer_color_button.clicked.connect(self.on_footer_color_button_clicked)
self.customButtonClicked.connect(self.onCustom1ButtonClicked) self.customButtonClicked.connect(self.on_custom_1_button_clicked)
self.mainPositionCheckBox.stateChanged.connect(self.onMainPositionCheckBoxStateChanged) self.main_position_check_box.stateChanged.connect(self.on_main_position_check_box_state_changed)
self.footerPositionCheckBox.stateChanged.connect(self.onFooterPositionCheckBoxStateChanged) self.footer_position_check_box.stateChanged.connect(self.on_footer_position_check_box_state_changed)
self.currentIdChanged.connect(self.onCurrentIdChanged) self.currentIdChanged.connect(self.on_current_id_changed)
Registry().register_function('theme_line_count', self.updateLinesText) Registry().register_function('theme_line_count', self.update_lines_text)
self.mainSizeSpinBox.valueChanged.connect(self.calculateLines) self.main_size_spin_box.valueChanged.connect(self.calculate_lines)
self.lineSpacingSpinBox.valueChanged.connect(self.calculateLines) self.line_spacing_spin_box.valueChanged.connect(self.calculate_lines)
self.outlineSizeSpinBox.valueChanged.connect(self.calculateLines) self.outline_size_spin_box.valueChanged.connect(self.calculate_lines)
self.shadowSizeSpinBox.valueChanged.connect(self.calculateLines) self.shadow_size_spin_box.valueChanged.connect(self.calculate_lines)
self.mainFontComboBox.activated.connect(self.calculateLines) self.main_font_combo_box.activated.connect(self.calculate_lines)
self.footerFontComboBox.activated.connect(self.updateTheme) self.footer_font_combo_box.activated.connect(self.update_theme)
self.footerSizeSpinBox.valueChanged.connect(self.updateTheme) self.footer_size_spin_box.valueChanged.connect(self.update_theme)
def setDefaults(self): def setDefaults(self):
""" """
Set up display at start of theme edit. Set up display at start of theme edit.
""" """
self.restart() self.restart()
self.setBackgroundPageValues() self.set_background_page_values()
self.setMainAreaPageValues() self.set_main_area_page_values()
self.setFooterAreaPageValues() self.set_footer_area_page_values()
self.setAlignmentPageValues() self.set_alignment_page_values()
self.setPositionPageValues() self.set_position_page_values()
self.setPreviewPageValues() self.set_preview_page_values()
def registerFields(self): def registerFields(self):
""" """
Map field names to screen names, Map field names to screen names,
""" """
self.backgroundPage.registerField('background_type', self.backgroundComboBox) self.background_page.registerField('background_type', self.background_combo_box)
self.backgroundPage.registerField('color', self.colorButton) self.background_page.registerField('color', self.color_button)
self.backgroundPage.registerField('grandient_start', self.gradientStartButton) self.background_page.registerField('gradient_start', self.gradient_start_button)
self.backgroundPage.registerField('grandient_end', self.gradientEndButton) self.background_page.registerField('gradient_end', self.gradient_end_button)
self.backgroundPage.registerField('background_image', self.imageFileEdit) self.background_page.registerField('background_image', self.image_file_edit)
self.backgroundPage.registerField('gradient', self.gradientComboBox) self.background_page.registerField('gradient', self.gradient_combo_box)
self.mainAreaPage.registerField('mainColorButton', self.mainColorButton) self.main_area_page.registerField('main_color_button', self.main_color_button)
self.mainAreaPage.registerField('mainSizeSpinBox', self.mainSizeSpinBox) self.main_area_page.registerField('main_size_spin_box', self.main_size_spin_box)
self.mainAreaPage.registerField('lineSpacingSpinBox', self.lineSpacingSpinBox) self.main_area_page.registerField('line_spacing_spin_box', self.line_spacing_spin_box)
self.mainAreaPage.registerField('outlineCheckBox', self.outlineCheckBox) self.main_area_page.registerField('outline_check_box', self.outline_check_box)
self.mainAreaPage.registerField('outlineColorButton', self.outlineColorButton) self.main_area_page.registerField('outline_color_button', self.outline_color_button)
self.mainAreaPage.registerField('outlineSizeSpinBox', self.outlineSizeSpinBox) self.main_area_page.registerField('outline_size_spin_box', self.outline_size_spin_box)
self.mainAreaPage.registerField('shadowCheckBox', self.shadowCheckBox) self.main_area_page.registerField('shadow_check_box', self.shadow_check_box)
self.mainAreaPage.registerField('mainBoldCheckBox', self.mainBoldCheckBox) self.main_area_page.registerField('main_bold_check_box', self.main_bold_check_box)
self.mainAreaPage.registerField('mainItalicsCheckBox', self.mainItalicsCheckBox) self.main_area_page.registerField('main_italics_check_box', self.main_italics_check_box)
self.mainAreaPage.registerField('shadowColorButton', self.shadowColorButton) self.main_area_page.registerField('shadow_color_button', self.shadow_color_button)
self.mainAreaPage.registerField('shadowSizeSpinBox', self.shadowSizeSpinBox) self.main_area_page.registerField('shadow_size_spin_box', self.shadow_size_spin_box)
self.mainAreaPage.registerField('footerSizeSpinBox', self.footerSizeSpinBox) self.main_area_page.registerField('footer_size_spin_box', self.footer_size_spin_box)
self.areaPositionPage.registerField('mainPositionX', self.mainXSpinBox) self.area_position_page.registerField('main_position_x', self.main_x_spin_box)
self.areaPositionPage.registerField('mainPositionY', self.mainYSpinBox) self.area_position_page.registerField('main_position_y', self.main_y_spin_box)
self.areaPositionPage.registerField('mainPositionWidth', self.mainWidthSpinBox) self.area_position_page.registerField('main_position_width', self.main_width_spin_box)
self.areaPositionPage.registerField('mainPositionHeight', self.mainHeightSpinBox) self.area_position_page.registerField('main_position_height', self.main_height_spin_box)
self.areaPositionPage.registerField('footerPositionX', self.footerXSpinBox) self.area_position_page.registerField('footer_position_x', self.footer_x_spin_box)
self.areaPositionPage.registerField('footerPositionY', self.footerYSpinBox) self.area_position_page.registerField('footer_position_y', self.footer_y_spin_box)
self.areaPositionPage.registerField('footerPositionWidth', self.footerWidthSpinBox) self.area_position_page.registerField('footer_position_width', self.footer_width_spin_box)
self.areaPositionPage.registerField('footerPositionHeight', self.footerHeightSpinBox) self.area_position_page.registerField('footer_position_height', self.footer_height_spin_box)
self.backgroundPage.registerField('horizontal', self.horizontalComboBox) self.background_page.registerField('horizontal', self.horizontal_combo_box)
self.backgroundPage.registerField('vertical', self.verticalComboBox) self.background_page.registerField('vertical', self.vertical_combo_box)
self.backgroundPage.registerField('slideTransition', self.transitionsCheckBox) self.background_page.registerField('slide_transition', self.transitions_check_box)
self.backgroundPage.registerField('name', self.themeNameEdit) self.background_page.registerField('name', self.theme_name_edit)
def calculateLines(self): def calculate_lines(self):
""" """
Calculate the number of lines on a page by rendering text Calculate the number of lines on a page by rendering text
""" """
# Do not trigger on start up # Do not trigger on start up
if self.currentPage != self.welcome_page: if self.currentPage != self.welcome_page:
self.updateTheme() self.update_theme()
self.theme_manager.generate_image(self.theme, True) self.theme_manager.generate_image(self.theme, True)
def updateLinesText(self, lines): def update_lines_text(self, lines):
""" """
Updates the lines on a page on the wizard Updates the lines on a page on the wizard
""" """
self.mainLineCountLabel.setText( self.main_line_count_label.setText(
translate('OpenLP.ThemeForm', '(approximately %d lines per slide)') % int(lines)) translate('OpenLP.ThemeForm', '(approximately %d lines per slide)') % int(lines))
def resizeEvent(self, event=None): def resizeEvent(self, event=None):
@ -162,50 +162,49 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
if not event: if not event:
event = QtGui.QResizeEvent(self.size(), self.size()) event = QtGui.QResizeEvent(self.size(), self.size())
QtGui.QWizard.resizeEvent(self, event) QtGui.QWizard.resizeEvent(self, event)
if self.currentPage() == self.previewPage: if self.currentPage() == self.preview_page:
frameWidth = self.previewBoxLabel.lineWidth() frame_width = self.preview_box_label.lineWidth()
pixmapWidth = self.previewArea.width() - 2 * frameWidth pixmap_width = self.preview_area.width() - 2 * frame_width
pixmapHeight = self.previewArea.height() - 2 * frameWidth pixmap_height = self.preview_area.height() - 2 * frame_width
aspectRatio = float(pixmapWidth) / pixmapHeight aspect_ratio = float(pixmap_width) / pixmap_height
if aspectRatio < self.displayAspectRatio: if aspect_ratio < self.display_aspect_ratio:
pixmapHeight = int(pixmapWidth / self.displayAspectRatio + 0.5) pixmap_height = int(pixmap_width / self.display_aspect_ratio + 0.5)
else: else:
pixmapWidth = int(pixmapHeight * self.displayAspectRatio + 0.5) pixmap_width = int(pixmap_height * self.display_aspect_ratio + 0.5)
self.previewBoxLabel.setFixedSize(pixmapWidth + 2 * frameWidth, self.preview_box_label.setFixedSize(pixmap_width + 2 * frame_width, pixmap_height + 2 * frame_width)
pixmapHeight + 2 * frameWidth)
def validateCurrentPage(self): def validateCurrentPage(self):
""" """
Validate the current page Validate the current page
""" """
background_image = BackgroundType.to_string(BackgroundType.Image) background_image = BackgroundType.to_string(BackgroundType.Image)
if self.page(self.currentId()) == self.backgroundPage and \ if self.page(self.currentId()) == self.background_page and \
self.theme.background_type == background_image and is_not_image_file(self.theme.background_filename): self.theme.background_type == background_image and is_not_image_file(self.theme.background_filename):
QtGui.QMessageBox.critical(self, translate('OpenLP.ThemeWizard', 'Background Image Empty'), QtGui.QMessageBox.critical(self, translate('OpenLP.ThemeWizard', 'Background Image Empty'),
translate('OpenLP.ThemeWizard', 'You have not selected a ' translate('OpenLP.ThemeWizard', '_you have not selected a '
'background image. Please select one before continuing.')) 'background image. Please select one before continuing.'))
return False return False
else: else:
return True return True
def onCurrentIdChanged(self, pageId): def on_current_id_changed(self, page_id):
""" """
Detects Page changes and updates as appropriate. Detects Page changes and updates as appropriate.
""" """
enabled = self.page(pageId) == self.areaPositionPage enabled = self.page(page_id) == self.area_position_page
self.setOption(QtGui.QWizard.HaveCustomButton1, enabled) self.setOption(QtGui.QWizard.HaveCustomButton1, enabled)
if self.page(pageId) == self.previewPage: if self.page(page_id) == self.preview_page:
self.updateTheme() self.update_theme()
frame = self.theme_manager.generate_image(self.theme) frame = self.theme_manager.generate_image(self.theme)
self.previewBoxLabel.setPixmap(frame) self.preview_box_label.setPixmap(frame)
self.displayAspectRatio = float(frame.width()) / frame.height() self.display_aspect_ratio = float(frame.width()) / frame.height()
self.resizeEvent() self.resizeEvent()
def onCustom1ButtonClicked(self, number): def on_custom_1_button_clicked(self, number):
""" """
Generate layout preview and display the form. Generate layout preview and display the form.
""" """
self.updateTheme() self.update_theme()
width = self.renderer.width width = self.renderer.width
height = self.renderer.height height = self.renderer.height
pixmap = QtGui.QPixmap(width, height) pixmap = QtGui.QPixmap(width, height)
@ -216,45 +215,45 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
paint.setPen(QtGui.QPen(QtCore.Qt.red, 2)) paint.setPen(QtGui.QPen(QtCore.Qt.red, 2))
paint.drawRect(self.renderer.get_footer_rectangle(self.theme)) paint.drawRect(self.renderer.get_footer_rectangle(self.theme))
paint.end() paint.end()
self.themeLayoutForm.exec_(pixmap) self.theme_layout_form.exec_(pixmap)
def onOutlineCheckCheckBoxStateChanged(self, state): def on_outline_check_check_box_state_changed(self, state):
""" """
Change state as Outline check box changed Change state as Outline check box changed
""" """
if self.updateThemeAllowed: if self.update_theme_allowed:
self.theme.font_main_outline = state == QtCore.Qt.Checked self.theme.font_main_outline = state == QtCore.Qt.Checked
self.outlineColorButton.setEnabled(self.theme.font_main_outline) self.outline_color_button.setEnabled(self.theme.font_main_outline)
self.outlineSizeSpinBox.setEnabled(self.theme.font_main_outline) self.outline_size_spin_box.setEnabled(self.theme.font_main_outline)
self.calculateLines() self.calculate_lines()
def onShadowCheckCheckBoxStateChanged(self, state): def on_shadow_check_check_box_state_changed(self, state):
""" """
Change state as Shadow check box changed Change state as Shadow check box changed
""" """
if self.updateThemeAllowed: if self.update_theme_allowed:
if state == QtCore.Qt.Checked: if state == QtCore.Qt.Checked:
self.theme.font_main_shadow = True self.theme.font_main_shadow = True
else: else:
self.theme.font_main_shadow = False self.theme.font_main_shadow = False
self.shadowColorButton.setEnabled(self.theme.font_main_shadow) self.shadow_color_button.setEnabled(self.theme.font_main_shadow)
self.shadowSizeSpinBox.setEnabled(self.theme.font_main_shadow) self.shadow_size_spin_box.setEnabled(self.theme.font_main_shadow)
self.calculateLines() self.calculate_lines()
def onMainPositionCheckBoxStateChanged(self, value): def on_main_position_check_box_state_changed(self, value):
""" """
Change state as Main Area Position check box changed Change state as Main Area _position check box changed
NOTE the font_main_override is the inverse of the check box value NOTE the font_main_override is the inverse of the check box value
""" """
if self.updateThemeAllowed: if self.update_theme_allowed:
self.theme.font_main_override = not (value == QtCore.Qt.Checked) self.theme.font_main_override = not (value == QtCore.Qt.Checked)
def onFooterPositionCheckBoxStateChanged(self, value): def on_footer_position_check_box_state_changed(self, value):
""" """
Change state as Footer Area Position check box changed Change state as Footer Area _position check box changed
NOTE the font_footer_override is the inverse of the check box value NOTE the font_footer_override is the inverse of the check box value
""" """
if self.updateThemeAllowed: if self.update_theme_allowed:
self.theme.font_footer_override = not (value == QtCore.Qt.Checked) self.theme.font_footer_override = not (value == QtCore.Qt.Checked)
def exec_(self, edit=False): def exec_(self, edit=False):
@ -263,11 +262,11 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
""" """
log.debug('Editing theme %s' % self.theme.theme_name) log.debug('Editing theme %s' % self.theme.theme_name)
self.temp_background_filename = '' self.temp_background_filename = ''
self.updateThemeAllowed = False self.update_theme_allowed = False
self.setDefaults() self.setDefaults()
self.updateThemeAllowed = True self.update_theme_allowed = True
self.themeNameLabel.setVisible(not edit) self.theme_name_label.setVisible(not edit)
self.themeNameEdit.setVisible(not edit) self.theme_name_edit.setVisible(not edit)
self.edit_mode = edit self.edit_mode = edit
if edit: if edit:
self.setWindowTitle(translate('OpenLP.ThemeWizard', 'Edit Theme - %s') % self.theme.theme_name) self.setWindowTitle(translate('OpenLP.ThemeWizard', 'Edit Theme - %s') % self.theme.theme_name)
@ -281,33 +280,32 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
Set up the pages for Initial run through dialog Set up the pages for Initial run through dialog
""" """
log.debug('initializePage %s' % page_id) log.debug('initializePage %s' % page_id)
wizardPage = self.page(page_id) wizard_page = self.page(page_id)
if wizardPage == self.backgroundPage: if wizard_page == self.background_page:
self.setBackgroundPageValues() self.set_background_page_values()
elif wizardPage == self.mainAreaPage: elif wizard_page == self.main_area_page:
self.setMainAreaPageValues() self.set_main_area_page_values()
elif wizardPage == self.footerAreaPage: elif wizard_page == self.footer_area_page:
self.setFooterAreaPageValues() self.set_footer_area_page_values()
elif wizardPage == self.alignmentPage: elif wizard_page == self.alignment_page:
self.setAlignmentPageValues() self.set_alignment_page_values()
elif wizardPage == self.areaPositionPage: elif wizard_page == self.area_position_page:
self.setPositionPageValues() self.set_position_page_values()
def setBackgroundPageValues(self): def set_background_page_values(self):
""" """
Handle the display and state of the Background page. Handle the display and state of the Background page.
""" """
if self.theme.background_type == \ if self.theme.background_type == BackgroundType.to_string(BackgroundType.Solid):
BackgroundType.to_string(BackgroundType.Solid): self.color_button.setStyleSheet('background-color: %s' % self.theme.background_color)
self.colorButton.setStyleSheet('background-color: %s' % self.theme.background_color)
self.setField('background_type', 0) self.setField('background_type', 0)
elif self.theme.background_type == BackgroundType.to_string(BackgroundType.Gradient): elif self.theme.background_type == BackgroundType.to_string(BackgroundType.Gradient):
self.gradientStartButton.setStyleSheet('background-color: %s' % self.theme.background_start_color) self.gradient_start_button.setStyleSheet('background-color: %s' % self.theme.background_start_color)
self.gradientEndButton.setStyleSheet('background-color: %s' % self.theme.background_end_color) self.gradient_end_button.setStyleSheet('background-color: %s' % self.theme.background_end_color)
self.setField('background_type', 1) self.setField('background_type', 1)
elif self.theme.background_type == BackgroundType.to_string(BackgroundType.Image): elif self.theme.background_type == BackgroundType.to_string(BackgroundType.Image):
self.imageColorButton.setStyleSheet('background-color: %s' % self.theme.background_border_color) self.image_color_button.setStyleSheet('background-color: %s' % self.theme.background_border_color)
self.imageFileEdit.setText(self.theme.background_filename) self.image_file_edit.setText(self.theme.background_filename)
self.setField('background_type', 2) self.setField('background_type', 2)
elif self.theme.background_type == BackgroundType.to_string(BackgroundType.Transparent): elif self.theme.background_type == BackgroundType.to_string(BackgroundType.Transparent):
self.setField('background_type', 3) self.setField('background_type', 3)
@ -322,68 +320,68 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
else: else:
self.setField('gradient', 4) self.setField('gradient', 4)
def setMainAreaPageValues(self): def set_main_area_page_values(self):
""" """
Handle the display and state of the Main Area page. Handle the display and state of the Main Area page.
""" """
self.mainFontComboBox.setCurrentFont(QtGui.QFont(self.theme.font_main_name)) self.main_font_combo_box.setCurrentFont(QtGui.QFont(self.theme.font_main_name))
self.mainColorButton.setStyleSheet('background-color: %s' % self.theme.font_main_color) self.main_color_button.setStyleSheet('background-color: %s' % self.theme.font_main_color)
self.setField('mainSizeSpinBox', self.theme.font_main_size) self.setField('main_size_spin_box', self.theme.font_main_size)
self.setField('lineSpacingSpinBox', self.theme.font_main_line_adjustment) self.setField('line_spacing_spin_box', self.theme.font_main_line_adjustment)
self.setField('outlineCheckBox', self.theme.font_main_outline) self.setField('outline_check_box', self.theme.font_main_outline)
self.outlineColorButton.setStyleSheet('background-color: %s' % self.theme.font_main_outline_color) self.outline_color_button.setStyleSheet('background-color: %s' % self.theme.font_main_outline_color)
self.setField('outlineSizeSpinBox', self.theme.font_main_outline_size) self.setField('outline_size_spin_box', self.theme.font_main_outline_size)
self.setField('shadowCheckBox', self.theme.font_main_shadow) self.setField('shadow_check_box', self.theme.font_main_shadow)
self.shadowColorButton.setStyleSheet('background-color: %s' % self.theme.font_main_shadow_color) self.shadow_color_button.setStyleSheet('background-color: %s' % self.theme.font_main_shadow_color)
self.setField('shadowSizeSpinBox', self.theme.font_main_shadow_size) self.setField('shadow_size_spin_box', self.theme.font_main_shadow_size)
self.setField('mainBoldCheckBox', self.theme.font_main_bold) self.setField('main_bold_check_box', self.theme.font_main_bold)
self.setField('mainItalicsCheckBox', self.theme.font_main_italics) self.setField('main_italics_check_box', self.theme.font_main_italics)
def setFooterAreaPageValues(self): def set_footer_area_page_values(self):
""" """
Handle the display and state of the Footer Area page. Handle the display and state of the Footer Area page.
""" """
self.footerFontComboBox.setCurrentFont(QtGui.QFont(self.theme.font_footer_name)) self.footer_font_combo_box.setCurrentFont(QtGui.QFont(self.theme.font_footer_name))
self.footerColorButton.setStyleSheet('background-color: %s' % self.theme.font_footer_color) self.footer_color_button.setStyleSheet('background-color: %s' % self.theme.font_footer_color)
self.setField('footerSizeSpinBox', self.theme.font_footer_size) self.setField('footer_size_spin_box', self.theme.font_footer_size)
def setPositionPageValues(self): def set_position_page_values(self):
""" """
Handle the display and state of the Position page. Handle the display and state of the _position page.
""" """
# Main Area # Main Area
self.mainPositionCheckBox.setChecked(not self.theme.font_main_override) self.main_position_check_box.setChecked(not self.theme.font_main_override)
self.setField('mainPositionX', self.theme.font_main_x) self.setField('main_position_x', self.theme.font_main_x)
self.setField('mainPositionY', self.theme.font_main_y) self.setField('main_position_y', self.theme.font_main_y)
self.setField('mainPositionHeight', self.theme.font_main_height) self.setField('main_position_height', self.theme.font_main_height)
self.setField('mainPositionWidth', self.theme.font_main_width) self.setField('main_position_width', self.theme.font_main_width)
# Footer # Footer
self.footerPositionCheckBox.setChecked(not self.theme.font_footer_override) self.footer_position_check_box.setChecked(not self.theme.font_footer_override)
self.setField('footerPositionX', self.theme.font_footer_x) self.setField('footer_position_x', self.theme.font_footer_x)
self.setField('footerPositionY', self.theme.font_footer_y) self.setField('footer_position_y', self.theme.font_footer_y)
self.setField('footerPositionHeight', self.theme.font_footer_height) self.setField('footer_position_height', self.theme.font_footer_height)
self.setField('footerPositionWidth', self.theme.font_footer_width) self.setField('footer_position_width', self.theme.font_footer_width)
def setAlignmentPageValues(self): def set_alignment_page_values(self):
""" """
Handle the display and state of the Alignments page. Handle the display and state of the Alignments page.
""" """
self.setField('horizontal', self.theme.display_horizontal_align) self.setField('horizontal', self.theme.display_horizontal_align)
self.setField('vertical', self.theme.display_vertical_align) self.setField('vertical', self.theme.display_vertical_align)
self.setField('slideTransition', self.theme.display_slide_transition) self.setField('slide_transition', self.theme.display_slide_transition)
def setPreviewPageValues(self): def set_preview_page_values(self):
""" """
Handle the display and state of the Preview page. Handle the display and state of the Preview page.
""" """
self.setField('name', self.theme.theme_name) self.setField('name', self.theme.theme_name)
def onBackgroundComboBoxCurrentIndexChanged(self, index): def on_background_combo_box_current_index_changed(self, index):
""" """
Background style Combo box has changed. Background style Combo box has changed.
""" """
# do not allow updates when screen is building for the first time. # do not allow updates when screen is building for the first time.
if self.updateThemeAllowed: if self.update_theme_allowed:
self.theme.background_type = BackgroundType.to_string(index) self.theme.background_type = BackgroundType.to_string(index)
if self.theme.background_type != BackgroundType.to_string(BackgroundType.Image) and \ if self.theme.background_type != BackgroundType.to_string(BackgroundType.Image) and \
self.temp_background_filename == '': self.temp_background_filename == '':
@ -393,122 +391,122 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
self.temp_background_filename != '': self.temp_background_filename != '':
self.theme.background_filename = self.temp_background_filename self.theme.background_filename = self.temp_background_filename
self.temp_background_filename = '' self.temp_background_filename = ''
self.setBackgroundPageValues() self.set_background_page_values()
def onGradientComboBoxCurrentIndexChanged(self, index): def on_gradient_combo_box_current_index_changed(self, index):
""" """
Background gradient Combo box has changed. Background gradient Combo box has changed.
""" """
if self.updateThemeAllowed: if self.update_theme_allowed:
self.theme.background_direction = BackgroundGradientType.to_string(index) self.theme.background_direction = BackgroundGradientType.to_string(index)
self.setBackgroundPageValues() self.set_background_page_values()
def onColorButtonClicked(self): def on_color_button_clicked(self):
""" """
Background / Gradient 1 Color button pushed. Background / Gradient 1 _color button pushed.
""" """
self.theme.background_color = self._colorButton(self.theme.background_color) self.theme.background_color = self._color_button(self.theme.background_color)
self.setBackgroundPageValues() self.set_background_page_values()
def onImageColorButtonClicked(self): def on_image_color_button_clicked(self):
""" """
Background / Gradient 1 Color button pushed. Background / Gradient 1 _color button pushed.
""" """
self.theme.background_border_color = self._colorButton(self.theme.background_border_color) self.theme.background_border_color = self._color_button(self.theme.background_border_color)
self.setBackgroundPageValues() self.set_background_page_values()
def onGradientStartButtonClicked(self): def on_gradient_start_button_clicked(self):
""" """
Gradient 2 Color button pushed. Gradient 2 _color button pushed.
""" """
self.theme.background_start_color = self._colorButton(self.theme.background_start_color) self.theme.background_start_color = self._color_button(self.theme.background_start_color)
self.setBackgroundPageValues() self.set_background_page_values()
def onGradientEndButtonClicked(self): def on_gradient_end_button_clicked(self):
""" """
Gradient 2 Color button pushed. Gradient 2 _color button pushed.
""" """
self.theme.background_end_color = self._colorButton(self.theme.background_end_color) self.theme.background_end_color = self._color_button(self.theme.background_end_color)
self.setBackgroundPageValues() self.set_background_page_values()
def onImageBrowseButtonClicked(self): def on_image_browse_button_clicked(self):
""" """
Background Image button pushed. Background Image button pushed.
""" """
images_filter = get_images_filter() images_filter = get_images_filter()
images_filter = '%s;;%s (*.*) (*)' % (images_filter, UiStrings().AllFiles) images_filter = '%s;;%s (*.*) (*)' % (images_filter, UiStrings().AllFiles)
filename = QtGui.QFileDialog.getOpenFileName(self, filename = QtGui.QFileDialog.getOpenFileName(self, translate('OpenLP.ThemeWizard', 'Select Image'), '',
translate('OpenLP.ThemeWizard', 'Select Image'), '', images_filter) images_filter)
if filename: if filename:
self.theme.background_filename = str(filename) self.theme.background_filename = str(filename)
self.setBackgroundPageValues() self.set_background_page_values()
def onImageFileEditEditingFinished(self): def on_image_file_edit_editing_finished(self):
""" """
Background image path edited Background image path edited
""" """
self.theme.background_filename = str(self.imageFileEdit.text()) self.theme.background_filename = str(self.image_file_edit.text())
def onMainColorButtonClicked(self): def on_main_color_button_clicked(self):
""" """
Set the main colour value Set the main colour value
""" """
self.theme.font_main_color = self._colorButton(self.theme.font_main_color) self.theme.font_main_color = self._color_button(self.theme.font_main_color)
self.setMainAreaPageValues() self.set_main_area_page_values()
def onOutlineColorButtonClicked(self): def on_outline_color_button_clicked(self):
""" """
Set the outline colour value Set the outline colour value
""" """
self.theme.font_main_outline_color = self._colorButton(self.theme.font_main_outline_color) self.theme.font_main_outline_color = self._color_button(self.theme.font_main_outline_color)
self.setMainAreaPageValues() self.set_main_area_page_values()
def onShadowColorButtonClicked(self): def on_shadow_color_button_clicked(self):
""" """
Set the shadow colour value Set the shadow colour value
""" """
self.theme.font_main_shadow_color = self._colorButton(self.theme.font_main_shadow_color) self.theme.font_main_shadow_color = self._color_button(self.theme.font_main_shadow_color)
self.setMainAreaPageValues() self.set_main_area_page_values()
def onFooterColorButtonClicked(self): def on_footer_color_button_clicked(self):
""" """
Set the footer colour value Set the footer colour value
""" """
self.theme.font_footer_color = self._colorButton(self.theme.font_footer_color) self.theme.font_footer_color = self._color_button(self.theme.font_footer_color)
self.setFooterAreaPageValues() self.set_footer_area_page_values()
def updateTheme(self): def update_theme(self):
""" """
Update the theme object from the UI for fields not already updated Update the theme object from the UI for fields not already updated
when the are changed. when the are changed.
""" """
if not self.updateThemeAllowed: if not self.update_theme_allowed:
return return
log.debug('updateTheme') log.debug('update_theme')
# main page # main page
self.theme.font_main_name = self.mainFontComboBox.currentFont().family() self.theme.font_main_name = self.main_font_combo_box.currentFont().family()
self.theme.font_main_size = self.field('mainSizeSpinBox') self.theme.font_main_size = self.field('main_size_spin_box')
self.theme.font_main_line_adjustment = self.field('lineSpacingSpinBox') self.theme.font_main_line_adjustment = self.field('line_spacing_spin_box')
self.theme.font_main_outline_size = self.field('outlineSizeSpinBox') self.theme.font_main_outline_size = self.field('outline_size_spin_box')
self.theme.font_main_shadow_size = self.field('shadowSizeSpinBox') self.theme.font_main_shadow_size = self.field('shadow_size_spin_box')
self.theme.font_main_bold = self.field('mainBoldCheckBox') self.theme.font_main_bold = self.field('main_bold_check_box')
self.theme.font_main_italics = self.field('mainItalicsCheckBox') self.theme.font_main_italics = self.field('main_italics_check_box')
# footer page # footer page
self.theme.font_footer_name = self.footerFontComboBox.currentFont().family() self.theme.font_footer_name = self.footer_font_combo_box.currentFont().family()
self.theme.font_footer_size = self.field('footerSizeSpinBox') self.theme.font_footer_size = self.field('footer_size_spin_box')
# position page # position page
self.theme.font_main_x = self.field('mainPositionX') self.theme.font_main_x = self.field('main_position_x')
self.theme.font_main_y = self.field('mainPositionY') self.theme.font_main_y = self.field('main_position_y')
self.theme.font_main_height = self.field('mainPositionHeight') self.theme.font_main_height = self.field('main_position_height')
self.theme.font_main_width = self.field('mainPositionWidth') self.theme.font_main_width = self.field('main_position_width')
self.theme.font_footer_x = self.field('footerPositionX') self.theme.font_footer_x = self.field('footer_position_x')
self.theme.font_footer_y = self.field('footerPositionY') self.theme.font_footer_y = self.field('footer_position_y')
self.theme.font_footer_height = self.field('footerPositionHeight') self.theme.font_footer_height = self.field('footer_position_height')
self.theme.font_footer_width = self.field('footerPositionWidth') self.theme.font_footer_width = self.field('footer_position_width')
# position page # position page
self.theme.display_horizontal_align = self.horizontalComboBox.currentIndex() self.theme.display_horizontal_align = self.horizontal_combo_box.currentIndex()
self.theme.display_vertical_align = self.verticalComboBox.currentIndex() self.theme.display_vertical_align = self.vertical_combo_box.currentIndex()
self.theme.display_slide_transition = self.field('slideTransition') self.theme.display_slide_transition = self.field('slide_transition')
def accept(self): def accept(self):
""" """
@ -526,20 +524,20 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
translate('OpenLP.ThemeWizard', 'Theme Name Invalid'), translate('OpenLP.ThemeWizard', 'Theme Name Invalid'),
translate('OpenLP.ThemeWizard', 'Invalid theme name. Please enter one.')) translate('OpenLP.ThemeWizard', 'Invalid theme name. Please enter one.'))
return return
saveFrom = None save_from = None
saveTo = None save_to = None
if self.theme.background_type == BackgroundType.to_string(BackgroundType.Image): if self.theme.background_type == BackgroundType.to_string(BackgroundType.Image):
filename = os.path.split(str(self.theme.background_filename))[1] filename = os.path.split(str(self.theme.background_filename))[1]
saveTo = os.path.join(self.path, self.theme.theme_name, filename) save_to = os.path.join(self.path, self.theme.theme_name, filename)
saveFrom = self.theme.background_filename save_from = self.theme.background_filename
if not self.edit_mode and not self.theme_manager.check_if_theme_exists(self.theme.theme_name): if not self.edit_mode and not self.theme_manager.check_if_theme_exists(self.theme.theme_name):
return return
self.theme_manager.save_theme(self.theme, saveFrom, saveTo) self.theme_manager.save_theme(self.theme, save_from, save_to)
return QtGui.QDialog.accept(self) return QtGui.QDialog.accept(self)
def _colorButton(self, field): def _color_button(self, field):
""" """
Handle Color buttons Handle _color buttons
""" """
new_color = QtGui.QColorDialog.getColor(QtGui.QColor(field), self) new_color = QtGui.QColorDialog.getColor(QtGui.QColor(field), self)
if new_color.isValid(): if new_color.isValid():

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -45,29 +45,29 @@ class Ui_ThemeLayoutDialog(object):
""" """
themeLayoutDialog.setObjectName('themeLayoutDialogDialog') themeLayoutDialog.setObjectName('themeLayoutDialogDialog')
#themeLayoutDialog.resize(300, 200) #themeLayoutDialog.resize(300, 200)
self.previewLayout = QtGui.QVBoxLayout(themeLayoutDialog) self.preview_layout = QtGui.QVBoxLayout(themeLayoutDialog)
self.previewLayout.setObjectName('previewLayout') self.preview_layout.setObjectName('preview_layout')
self.previewArea = QtGui.QWidget(themeLayoutDialog) self.preview_area = QtGui.QWidget(themeLayoutDialog)
self.previewArea.setObjectName('previewArea') self.preview_area.setObjectName('preview_area')
self.previewAreaLayout = QtGui.QGridLayout(self.previewArea) self.preview_area_layout = QtGui.QGridLayout(self.preview_area)
self.previewAreaLayout.setMargin(0) self.preview_area_layout.setMargin(0)
self.previewAreaLayout.setColumnStretch(0, 1) self.preview_area_layout.setColumnStretch(0, 1)
self.previewAreaLayout.setRowStretch(0, 1) self.preview_area_layout.setRowStretch(0, 1)
self.previewAreaLayout.setObjectName('previewAreaLayout') self.preview_area_layout.setObjectName('preview_area_layout')
self.themeDisplayLabel = QtGui.QLabel(self.previewArea) self.theme_display_label = QtGui.QLabel(self.preview_area)
self.themeDisplayLabel.setFrameShape(QtGui.QFrame.Box) self.theme_display_label.setFrameShape(QtGui.QFrame.Box)
self.themeDisplayLabel.setScaledContents(True) self.theme_display_label.setScaledContents(True)
self.themeDisplayLabel.setObjectName('themeDisplayLabel') self.theme_display_label.setObjectName('theme_display_label')
self.previewAreaLayout.addWidget(self.themeDisplayLabel) self.preview_area_layout.addWidget(self.theme_display_label)
self.previewLayout.addWidget(self.previewArea) self.preview_layout.addWidget(self.preview_area)
self.mainColourLabel = QtGui.QLabel(self.previewArea) self.main_colour_label = QtGui.QLabel(self.preview_area)
self.mainColourLabel.setObjectName('mainColourLabel') self.main_colour_label.setObjectName('main_colour_label')
self.previewLayout.addWidget(self.mainColourLabel) self.preview_layout.addWidget(self.main_colour_label)
self.footerColourLabel = QtGui.QLabel(self.previewArea) self.footer_colour_label = QtGui.QLabel(self.preview_area)
self.footerColourLabel.setObjectName('footerColourLabel') self.footer_colour_label.setObjectName('footer_colour_label')
self.previewLayout.addWidget(self.footerColourLabel) self.preview_layout.addWidget(self.footer_colour_label)
self.button_box = create_button_box(themeLayoutDialog, 'button_box', ['ok']) self.button_box = create_button_box(themeLayoutDialog, 'button_box', ['ok'])
self.previewLayout.addWidget(self.button_box) self.preview_layout.addWidget(self.button_box)
self.retranslateUi(themeLayoutDialog) self.retranslateUi(themeLayoutDialog)
def retranslateUi(self, themeLayoutDialog): def retranslateUi(self, themeLayoutDialog):
@ -75,5 +75,5 @@ class Ui_ThemeLayoutDialog(object):
Translate the UI on the fly Translate the UI on the fly
""" """
themeLayoutDialog.setWindowTitle(translate('OpenLP.StartTimeForm', 'Theme Layout')) themeLayoutDialog.setWindowTitle(translate('OpenLP.StartTimeForm', 'Theme Layout'))
self.mainColourLabel.setText(translate('OpenLP.StartTimeForm', 'The blue box shows the main area.')) self.main_colour_label.setText(translate('OpenLP.StartTimeForm', 'The blue box shows the main area.'))
self.footerColourLabel.setText(translate('OpenLP.StartTimeForm', 'The red box shows the footer.')) self.footer_colour_label.setText(translate('OpenLP.StartTimeForm', 'The red box shows the footer.'))

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -50,7 +50,7 @@ class ThemeLayoutForm(QtGui.QDialog, Ui_ThemeLayoutDialog):
Run the Dialog with correct heading. Run the Dialog with correct heading.
""" """
pixmap = image.scaledToHeight(400, QtCore.Qt.SmoothTransformation) pixmap = image.scaledToHeight(400, QtCore.Qt.SmoothTransformation)
self.themeDisplayLabel.setPixmap(pixmap) self.theme_display_label.setPixmap(pixmap)
displayAspectRatio = float(image.width()) / image.height() display_aspect_ratio = float(image.width()) / image.height()
self.themeDisplayLabel.setFixedSize(400, 400 / displayAspectRatio) self.theme_display_label.setFixedSize(400, 400 / display_aspect_ratio)
return QtGui.QDialog.exec_(self) return QtGui.QDialog.exec_(self)

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
@ -54,340 +54,340 @@ class Ui_ThemeWizard(object):
# Welcome Page # Welcome Page
add_welcome_page(themeWizard, ':/wizards/wizard_createtheme.bmp') add_welcome_page(themeWizard, ':/wizards/wizard_createtheme.bmp')
# Background Page # Background Page
self.backgroundPage = QtGui.QWizardPage() self.background_page = QtGui.QWizardPage()
self.backgroundPage.setObjectName('BackgroundPage') self.background_page.setObjectName('background_page')
self.backgroundLayout = QtGui.QVBoxLayout(self.backgroundPage) self.background_layout = QtGui.QVBoxLayout(self.background_page)
self.backgroundLayout.setObjectName('BackgroundLayout') self.background_layout.setObjectName('background_layout')
self.backgroundTypeLayout = QtGui.QFormLayout() self.background_type_layout = QtGui.QFormLayout()
self.backgroundTypeLayout.setObjectName('BackgroundTypeLayout') self.background_type_layout.setObjectName('background_type_layout')
self.backgroundLabel = QtGui.QLabel(self.backgroundPage) self.background_label = QtGui.QLabel(self.background_page)
self.backgroundLabel.setObjectName('BackgroundLabel') self.background_label.setObjectName('background_label')
self.backgroundComboBox = QtGui.QComboBox(self.backgroundPage) self.background_combo_box = QtGui.QComboBox(self.background_page)
self.backgroundComboBox.addItems(['', '', '', '']) self.background_combo_box.addItems(['', '', '', ''])
self.backgroundComboBox.setObjectName('BackgroundComboBox') self.background_combo_box.setObjectName('background_combo_box')
self.backgroundTypeLayout.addRow(self.backgroundLabel, self.backgroundComboBox) self.background_type_layout.addRow(self.background_label, self.background_combo_box)
self.backgroundTypeLayout.setItem(1, QtGui.QFormLayout.LabelRole, self.spacer) self.background_type_layout.setItem(1, QtGui.QFormLayout.LabelRole, self.spacer)
self.backgroundLayout.addLayout(self.backgroundTypeLayout) self.background_layout.addLayout(self.background_type_layout)
self.backgroundStack = QtGui.QStackedLayout() self.background_stack = QtGui.QStackedLayout()
self.backgroundStack.setObjectName('BackgroundStack') self.background_stack.setObjectName('background_stack')
self.colorWidget = QtGui.QWidget(self.backgroundPage) self.color_widget = QtGui.QWidget(self.background_page)
self.colorWidget.setObjectName('ColorWidget') self.color_widget.setObjectName('color_widget')
self.colorLayout = QtGui.QFormLayout(self.colorWidget) self.color_layout = QtGui.QFormLayout(self.color_widget)
self.colorLayout.setMargin(0) self.color_layout.setMargin(0)
self.colorLayout.setObjectName('ColorLayout') self.color_layout.setObjectName('color_layout')
self.colorLabel = QtGui.QLabel(self.colorWidget) self.color_label = QtGui.QLabel(self.color_widget)
self.colorLabel.setObjectName('ColorLabel') self.color_label.setObjectName('color_label')
self.colorButton = QtGui.QPushButton(self.colorWidget) self.color_button = QtGui.QPushButton(self.color_widget)
self.colorButton.setObjectName('ColorButton') self.color_button.setObjectName('color_button')
self.colorLayout.addRow(self.colorLabel, self.colorButton) self.color_layout.addRow(self.color_label, self.color_button)
self.colorLayout.setItem(1, QtGui.QFormLayout.LabelRole, self.spacer) self.color_layout.setItem(1, QtGui.QFormLayout.LabelRole, self.spacer)
self.backgroundStack.addWidget(self.colorWidget) self.background_stack.addWidget(self.color_widget)
self.gradientWidget = QtGui.QWidget(self.backgroundPage) self.gradient_widget = QtGui.QWidget(self.background_page)
self.gradientWidget.setObjectName('GradientWidget') self.gradient_widget.setObjectName('Gradient_widget')
self.gradientLayout = QtGui.QFormLayout(self.gradientWidget) self.gradient_layout = QtGui.QFormLayout(self.gradient_widget)
self.gradientLayout.setMargin(0) self.gradient_layout.setMargin(0)
self.gradientLayout.setObjectName('GradientLayout') self.gradient_layout.setObjectName('gradient_layout')
self.gradientStartLabel = QtGui.QLabel(self.gradientWidget) self.gradient_start_label = QtGui.QLabel(self.gradient_widget)
self.gradientStartLabel.setObjectName('GradientStartLabel') self.gradient_start_label.setObjectName('gradient_start_label')
self.gradientStartButton = QtGui.QPushButton(self.gradientWidget) self.gradient_start_button = QtGui.QPushButton(self.gradient_widget)
self.gradientStartButton.setObjectName('GradientStartButton') self.gradient_start_button.setObjectName('gradient_start_button')
self.gradientLayout.addRow(self.gradientStartLabel, self.gradientStartButton) self.gradient_layout.addRow(self.gradient_start_label, self.gradient_start_button)
self.gradientEndLabel = QtGui.QLabel(self.gradientWidget) self.gradient_end_label = QtGui.QLabel(self.gradient_widget)
self.gradientEndLabel.setObjectName('GradientEndLabel') self.gradient_end_label.setObjectName('gradient_end_label')
self.gradientEndButton = QtGui.QPushButton(self.gradientWidget) self.gradient_end_button = QtGui.QPushButton(self.gradient_widget)
self.gradientEndButton.setObjectName('GradientEndButton') self.gradient_end_button.setObjectName('gradient_end_button')
self.gradientLayout.addRow(self.gradientEndLabel, self.gradientEndButton) self.gradient_layout.addRow(self.gradient_end_label, self.gradient_end_button)
self.gradientTypeLabel = QtGui.QLabel(self.gradientWidget) self.gradient_type_label = QtGui.QLabel(self.gradient_widget)
self.gradientTypeLabel.setObjectName('GradientTypeLabel') self.gradient_type_label.setObjectName('Gradient_type_label')
self.gradientComboBox = QtGui.QComboBox(self.gradientWidget) self.gradient_combo_box = QtGui.QComboBox(self.gradient_widget)
self.gradientComboBox.setObjectName('GradientComboBox') self.gradient_combo_box.setObjectName('gradient_combo_box')
self.gradientComboBox.addItems(['', '', '', '', '']) self.gradient_combo_box.addItems(['', '', '', '', ''])
self.gradientLayout.addRow(self.gradientTypeLabel, self.gradientComboBox) self.gradient_layout.addRow(self.gradient_type_label, self.gradient_combo_box)
self.gradientLayout.setItem(3, QtGui.QFormLayout.LabelRole, self.spacer) self.gradient_layout.setItem(3, QtGui.QFormLayout.LabelRole, self.spacer)
self.backgroundStack.addWidget(self.gradientWidget) self.background_stack.addWidget(self.gradient_widget)
self.imageWidget = QtGui.QWidget(self.backgroundPage) self.image_widget = QtGui.QWidget(self.background_page)
self.imageWidget.setObjectName('ImageWidget') self.image_widget.setObjectName('image_widget')
self.imageLayout = QtGui.QFormLayout(self.imageWidget) self.image_layout = QtGui.QFormLayout(self.image_widget)
self.imageLayout.setMargin(0) self.image_layout.setMargin(0)
self.imageLayout.setObjectName('ImageLayout') self.image_layout.setObjectName('image_layout')
self.imageColorLabel = QtGui.QLabel(self.colorWidget) self.image_color_label = QtGui.QLabel(self.color_widget)
self.imageColorLabel.setObjectName('ImageColorLabel') self.image_color_label.setObjectName('image_color_label')
self.imageColorButton = QtGui.QPushButton(self.colorWidget) self.image_color_button = QtGui.QPushButton(self.color_widget)
self.imageColorButton.setObjectName('ImageColorButton') self.image_color_button.setObjectName('image_color_button')
self.imageLayout.addRow(self.imageColorLabel, self.imageColorButton) self.image_layout.addRow(self.image_color_label, self.image_color_button)
self.imageLabel = QtGui.QLabel(self.imageWidget) self.image_label = QtGui.QLabel(self.image_widget)
self.imageLabel.setObjectName('ImageLabel') self.image_label.setObjectName('image_label')
self.imageFileLayout = QtGui.QHBoxLayout() self.image_file_layout = QtGui.QHBoxLayout()
self.imageFileLayout.setObjectName('ImageFileLayout') self.image_file_layout.setObjectName('image_file_layout')
self.imageFileEdit = QtGui.QLineEdit(self.imageWidget) self.image_file_edit = QtGui.QLineEdit(self.image_widget)
self.imageFileEdit.setObjectName('ImageFileEdit') self.image_file_edit.setObjectName('image_file_edit')
self.imageFileLayout.addWidget(self.imageFileEdit) self.image_file_layout.addWidget(self.image_file_edit)
self.imageBrowseButton = QtGui.QToolButton(self.imageWidget) self.image_browse_button = QtGui.QToolButton(self.image_widget)
self.imageBrowseButton.setObjectName('ImageBrowseButton') self.image_browse_button.setObjectName('image_browse_button')
self.imageBrowseButton.setIcon(build_icon(':/general/general_open.png')) self.image_browse_button.setIcon(build_icon(':/general/general_open.png'))
self.imageFileLayout.addWidget(self.imageBrowseButton) self.image_file_layout.addWidget(self.image_browse_button)
self.imageLayout.addRow(self.imageLabel, self.imageFileLayout) self.image_layout.addRow(self.image_label, self.image_file_layout)
self.imageLayout.setItem(2, QtGui.QFormLayout.LabelRole, self.spacer) self.image_layout.setItem(2, QtGui.QFormLayout.LabelRole, self.spacer)
self.backgroundStack.addWidget(self.imageWidget) self.background_stack.addWidget(self.image_widget)
self.transparentWidget = QtGui.QWidget(self.backgroundPage) self.transparent_widget = QtGui.QWidget(self.background_page)
self.transparentWidget.setObjectName('TransparentWidget') self.transparent_widget.setObjectName('TransparentWidget')
self.transparentLayout = QtGui.QFormLayout(self.transparentWidget) self.transparent_layout = QtGui.QFormLayout(self.transparent_widget)
self.transparentLayout.setMargin(0) self.transparent_layout.setMargin(0)
self.transparentLayout.setObjectName('TransparentLayout') self.transparent_layout.setObjectName('Transparent_layout')
self.backgroundStack.addWidget(self.transparentWidget) self.background_stack.addWidget(self.transparent_widget)
self.backgroundLayout.addLayout(self.backgroundStack) self.background_layout.addLayout(self.background_stack)
themeWizard.addPage(self.backgroundPage) themeWizard.addPage(self.background_page)
# Main Area Page # Main Area Page
self.mainAreaPage = QtGui.QWizardPage() self.main_area_page = QtGui.QWizardPage()
self.mainAreaPage.setObjectName('MainAreaPage') self.main_area_page.setObjectName('main_area_page')
self.mainAreaLayout = QtGui.QFormLayout(self.mainAreaPage) self.main_area_layout = QtGui.QFormLayout(self.main_area_page)
self.mainAreaLayout.setObjectName('MainAreaLayout') self.main_area_layout.setObjectName('main_area_layout')
self.mainFontLabel = QtGui.QLabel(self.mainAreaPage) self.main_font_label = QtGui.QLabel(self.main_area_page)
self.mainFontLabel.setObjectName('MainFontLabel') self.main_font_label.setObjectName('main_font_label')
self.mainFontComboBox = QtGui.QFontComboBox(self.mainAreaPage) self.main_font_combo_box = QtGui.QFontComboBox(self.main_area_page)
self.mainFontComboBox.setObjectName('MainFontComboBox') self.main_font_combo_box.setObjectName('main_font_combo_box')
self.mainAreaLayout.addRow(self.mainFontLabel, self.mainFontComboBox) self.main_area_layout.addRow(self.main_font_label, self.main_font_combo_box)
self.mainColorLabel = QtGui.QLabel(self.mainAreaPage) self.main_color_label = QtGui.QLabel(self.main_area_page)
self.mainColorLabel.setObjectName('MainColorLabel') self.main_color_label.setObjectName('main_color_label')
self.mainPropertiesLayout = QtGui.QHBoxLayout() self.main_properties_layout = QtGui.QHBoxLayout()
self.mainPropertiesLayout.setObjectName('MainPropertiesLayout') self.main_properties_layout.setObjectName('main_properties_layout')
self.mainColorButton = QtGui.QPushButton(self.mainAreaPage) self.main_color_button = QtGui.QPushButton(self.main_area_page)
self.mainColorButton.setObjectName('MainColorButton') self.main_color_button.setObjectName('main_color_button')
self.mainPropertiesLayout.addWidget(self.mainColorButton) self.main_properties_layout.addWidget(self.main_color_button)
self.mainPropertiesLayout.addSpacing(20) self.main_properties_layout.addSpacing(20)
self.mainBoldCheckBox = QtGui.QCheckBox(self.mainAreaPage) self.main_bold_check_box = QtGui.QCheckBox(self.main_area_page)
self.mainBoldCheckBox.setObjectName('MainBoldCheckBox') self.main_bold_check_box.setObjectName('main_bold_check_box')
self.mainPropertiesLayout.addWidget(self.mainBoldCheckBox) self.main_properties_layout.addWidget(self.main_bold_check_box)
self.mainPropertiesLayout.addSpacing(20) self.main_properties_layout.addSpacing(20)
self.mainItalicsCheckBox = QtGui.QCheckBox(self.mainAreaPage) self.main_italics_check_box = QtGui.QCheckBox(self.main_area_page)
self.mainItalicsCheckBox.setObjectName('MainItalicsCheckBox') self.main_italics_check_box.setObjectName('MainItalicsCheckBox')
self.mainPropertiesLayout.addWidget(self.mainItalicsCheckBox) self.main_properties_layout.addWidget(self.main_italics_check_box)
self.mainAreaLayout.addRow(self.mainColorLabel, self.mainPropertiesLayout) self.main_area_layout.addRow(self.main_color_label, self.main_properties_layout)
self.mainSizeLabel = QtGui.QLabel(self.mainAreaPage) self.main_size_label = QtGui.QLabel(self.main_area_page)
self.mainSizeLabel.setObjectName('MainSizeLabel') self.main_size_label.setObjectName('main_size_label')
self.mainSizeLayout = QtGui.QHBoxLayout() self.main_size_layout = QtGui.QHBoxLayout()
self.mainSizeLayout.setObjectName('MainSizeLayout') self.main_size_layout.setObjectName('main_size_layout')
self.mainSizeSpinBox = QtGui.QSpinBox(self.mainAreaPage) self.main_size_spin_box = QtGui.QSpinBox(self.main_area_page)
self.mainSizeSpinBox.setMaximum(999) self.main_size_spin_box.setMaximum(999)
self.mainSizeSpinBox.setValue(16) self.main_size_spin_box.setValue(16)
self.mainSizeSpinBox.setObjectName('MainSizeSpinBox') self.main_size_spin_box.setObjectName('main_size_spin_box')
self.mainSizeLayout.addWidget(self.mainSizeSpinBox) self.main_size_layout.addWidget(self.main_size_spin_box)
self.mainLineCountLabel = QtGui.QLabel(self.mainAreaPage) self.main_line_count_label = QtGui.QLabel(self.main_area_page)
self.mainLineCountLabel.setObjectName('MainLineCountLabel') self.main_line_count_label.setObjectName('main_line_count_label')
self.mainSizeLayout.addWidget(self.mainLineCountLabel) self.main_size_layout.addWidget(self.main_line_count_label)
self.mainAreaLayout.addRow(self.mainSizeLabel, self.mainSizeLayout) self.main_area_layout.addRow(self.main_size_label, self.main_size_layout)
self.lineSpacingLabel = QtGui.QLabel(self.mainAreaPage) self.line_spacing_label = QtGui.QLabel(self.main_area_page)
self.lineSpacingLabel.setObjectName('LineSpacingLabel') self.line_spacing_label.setObjectName('line_spacing_label')
self.lineSpacingSpinBox = QtGui.QSpinBox(self.mainAreaPage) self.line_spacing_spin_box = QtGui.QSpinBox(self.main_area_page)
self.lineSpacingSpinBox.setMinimum(-250) self.line_spacing_spin_box.setMinimum(-250)
self.lineSpacingSpinBox.setMaximum(250) self.line_spacing_spin_box.setMaximum(250)
self.lineSpacingSpinBox.setObjectName('LineSpacingSpinBox') self.line_spacing_spin_box.setObjectName('line_spacing_spin_box')
self.mainAreaLayout.addRow(self.lineSpacingLabel, self.lineSpacingSpinBox) self.main_area_layout.addRow(self.line_spacing_label, self.line_spacing_spin_box)
self.outlineCheckBox = QtGui.QCheckBox(self.mainAreaPage) self.outline_check_box = QtGui.QCheckBox(self.main_area_page)
self.outlineCheckBox.setObjectName('OutlineCheckBox') self.outline_check_box.setObjectName('outline_check_box')
self.outlineLayout = QtGui.QHBoxLayout() self.outline_layout = QtGui.QHBoxLayout()
self.outlineLayout.setObjectName('OutlineLayout') self.outline_layout.setObjectName('outline_layout')
self.outlineColorButton = QtGui.QPushButton(self.mainAreaPage) self.outline_color_button = QtGui.QPushButton(self.main_area_page)
self.outlineColorButton.setEnabled(False) self.outline_color_button.setEnabled(False)
self.outlineColorButton.setObjectName('OutlineColorButton') self.outline_color_button.setObjectName('Outline_color_button')
self.outlineLayout.addWidget(self.outlineColorButton) self.outline_layout.addWidget(self.outline_color_button)
self.outlineLayout.addSpacing(20) self.outline_layout.addSpacing(20)
self.outlineSizeLabel = QtGui.QLabel(self.mainAreaPage) self.outline_size_label = QtGui.QLabel(self.main_area_page)
self.outlineSizeLabel.setObjectName('OutlineSizeLabel') self.outline_size_label.setObjectName('outline_size_label')
self.outlineLayout.addWidget(self.outlineSizeLabel) self.outline_layout.addWidget(self.outline_size_label)
self.outlineSizeSpinBox = QtGui.QSpinBox(self.mainAreaPage) self.outline_size_spin_box = QtGui.QSpinBox(self.main_area_page)
self.outlineSizeSpinBox.setEnabled(False) self.outline_size_spin_box.setEnabled(False)
self.outlineSizeSpinBox.setObjectName('OutlineSizeSpinBox') self.outline_size_spin_box.setObjectName('outline_size_spin_box')
self.outlineLayout.addWidget(self.outlineSizeSpinBox) self.outline_layout.addWidget(self.outline_size_spin_box)
self.mainAreaLayout.addRow(self.outlineCheckBox, self.outlineLayout) self.main_area_layout.addRow(self.outline_check_box, self.outline_layout)
self.shadowCheckBox = QtGui.QCheckBox(self.mainAreaPage) self.shadow_check_box = QtGui.QCheckBox(self.main_area_page)
self.shadowCheckBox.setObjectName('ShadowCheckBox') self.shadow_check_box.setObjectName('shadow_check_box')
self.shadowLayout = QtGui.QHBoxLayout() self.shadow_layout = QtGui.QHBoxLayout()
self.shadowLayout.setObjectName('ShadowLayout') self.shadow_layout.setObjectName('shadow_layout')
self.shadowColorButton = QtGui.QPushButton(self.mainAreaPage) self.shadow_color_button = QtGui.QPushButton(self.main_area_page)
self.shadowColorButton.setEnabled(False) self.shadow_color_button.setEnabled(False)
self.shadowColorButton.setObjectName('shadowColorButton') self.shadow_color_button.setObjectName('shadow_color_button')
self.shadowLayout.addWidget(self.shadowColorButton) self.shadow_layout.addWidget(self.shadow_color_button)
self.shadowLayout.addSpacing(20) self.shadow_layout.addSpacing(20)
self.shadowSizeLabel = QtGui.QLabel(self.mainAreaPage) self.shadow_size_label = QtGui.QLabel(self.main_area_page)
self.shadowSizeLabel.setObjectName('ShadowSizeLabel') self.shadow_size_label.setObjectName('shadow_size_label')
self.shadowLayout.addWidget(self.shadowSizeLabel) self.shadow_layout.addWidget(self.shadow_size_label)
self.shadowSizeSpinBox = QtGui.QSpinBox(self.mainAreaPage) self.shadow_size_spin_box = QtGui.QSpinBox(self.main_area_page)
self.shadowSizeSpinBox.setEnabled(False) self.shadow_size_spin_box.setEnabled(False)
self.shadowSizeSpinBox.setObjectName('ShadowSizeSpinBox') self.shadow_size_spin_box.setObjectName('shadow_size_spin_box')
self.shadowLayout.addWidget(self.shadowSizeSpinBox) self.shadow_layout.addWidget(self.shadow_size_spin_box)
self.mainAreaLayout.addRow(self.shadowCheckBox, self.shadowLayout) self.main_area_layout.addRow(self.shadow_check_box, self.shadow_layout)
themeWizard.addPage(self.mainAreaPage) themeWizard.addPage(self.main_area_page)
# Footer Area Page # Footer Area Page
self.footerAreaPage = QtGui.QWizardPage() self.footer_area_page = QtGui.QWizardPage()
self.footerAreaPage.setObjectName('FooterAreaPage') self.footer_area_page.setObjectName('footer_area_page')
self.footerAreaLayout = QtGui.QFormLayout(self.footerAreaPage) self.footer_area_layout = QtGui.QFormLayout(self.footer_area_page)
self.footerAreaLayout.setObjectName('FooterAreaLayout') self.footer_area_layout.setObjectName('footer_area_layout')
self.footerFontLabel = QtGui.QLabel(self.footerAreaPage) self.footer_font_label = QtGui.QLabel(self.footer_area_page)
self.footerFontLabel.setObjectName('FooterFontLabel') self.footer_font_label.setObjectName('FooterFontLabel')
self.footerFontComboBox = QtGui.QFontComboBox(self.footerAreaPage) self.footer_font_combo_box = QtGui.QFontComboBox(self.footer_area_page)
self.footerFontComboBox.setObjectName('footerFontComboBox') self.footer_font_combo_box.setObjectName('footer_font_combo_box')
self.footerAreaLayout.addRow(self.footerFontLabel, self.footerFontComboBox) self.footer_area_layout.addRow(self.footer_font_label, self.footer_font_combo_box)
self.footerColorLabel = QtGui.QLabel(self.footerAreaPage) self.footer_color_label = QtGui.QLabel(self.footer_area_page)
self.footerColorLabel.setObjectName('FooterColorLabel') self.footer_color_label.setObjectName('footer_color_label')
self.footerColorButton = QtGui.QPushButton(self.footerAreaPage) self.footer_color_button = QtGui.QPushButton(self.footer_area_page)
self.footerColorButton.setObjectName('footerColorButton') self.footer_color_button.setObjectName('footer_color_button')
self.footerAreaLayout.addRow(self.footerColorLabel, self.footerColorButton) self.footer_area_layout.addRow(self.footer_color_label, self.footer_color_button)
self.footerSizeLabel = QtGui.QLabel(self.footerAreaPage) self.footer_size_label = QtGui.QLabel(self.footer_area_page)
self.footerSizeLabel.setObjectName('FooterSizeLabel') self.footer_size_label.setObjectName('footer_size_label')
self.footerSizeSpinBox = QtGui.QSpinBox(self.footerAreaPage) self.footer_size_spin_box = QtGui.QSpinBox(self.footer_area_page)
self.footerSizeSpinBox.setMaximum(999) self.footer_size_spin_box.setMaximum(999)
self.footerSizeSpinBox.setValue(10) self.footer_size_spin_box.setValue(10)
self.footerSizeSpinBox.setObjectName('FooterSizeSpinBox') self.footer_size_spin_box.setObjectName('FooterSizeSpinBox')
self.footerAreaLayout.addRow(self.footerSizeLabel, self.footerSizeSpinBox) self.footer_area_layout.addRow(self.footer_size_label, self.footer_size_spin_box)
self.footerAreaLayout.setItem(3, QtGui.QFormLayout.LabelRole, self.spacer) self.footer_area_layout.setItem(3, QtGui.QFormLayout.LabelRole, self.spacer)
themeWizard.addPage(self.footerAreaPage) themeWizard.addPage(self.footer_area_page)
# Alignment Page # Alignment Page
self.alignmentPage = QtGui.QWizardPage() self.alignment_page = QtGui.QWizardPage()
self.alignmentPage.setObjectName('AlignmentPage') self.alignment_page.setObjectName('alignment_page')
self.alignmentLayout = QtGui.QFormLayout(self.alignmentPage) self.alignment_layout = QtGui.QFormLayout(self.alignment_page)
self.alignmentLayout.setObjectName('AlignmentLayout') self.alignment_layout.setObjectName('alignment_layout')
self.horizontalLabel = QtGui.QLabel(self.alignmentPage) self.horizontal_label = QtGui.QLabel(self.alignment_page)
self.horizontalLabel.setObjectName('HorizontalLabel') self.horizontal_label.setObjectName('horizontal_label')
self.horizontalComboBox = QtGui.QComboBox(self.alignmentPage) self.horizontal_combo_box = QtGui.QComboBox(self.alignment_page)
self.horizontalComboBox.addItems(['', '', '', '']) self.horizontal_combo_box.addItems(['', '', '', ''])
self.horizontalComboBox.setObjectName('HorizontalComboBox') self.horizontal_combo_box.setObjectName('horizontal_combo_box')
self.alignmentLayout.addRow(self.horizontalLabel, self.horizontalComboBox) self.alignment_layout.addRow(self.horizontal_label, self.horizontal_combo_box)
self.verticalLabel, self.verticalComboBox = create_valign_selection_widgets(self.alignmentPage) self.vertical_label, self.vertical_combo_box = create_valign_selection_widgets(self.alignment_page)
self.verticalLabel.setObjectName('verticalLabel') self.vertical_label.setObjectName('vertical_label')
self.verticalComboBox.setObjectName('verticalComboBox') self.vertical_combo_box.setObjectName('vertical_combo_box')
self.alignmentLayout.addRow(self.verticalLabel, self.verticalComboBox) self.alignment_layout.addRow(self.vertical_label, self.vertical_combo_box)
self.transitionsLabel = QtGui.QLabel(self.alignmentPage) self.transitions_label = QtGui.QLabel(self.alignment_page)
self.transitionsLabel.setObjectName('TransitionsLabel') self.transitions_label.setObjectName('transitions_label')
self.transitionsCheckBox = QtGui.QCheckBox(self.alignmentPage) self.transitions_check_box = QtGui.QCheckBox(self.alignment_page)
self.transitionsCheckBox.setObjectName('TransitionsCheckBox') self.transitions_check_box.setObjectName('transitions_check_box')
self.alignmentLayout.addRow(self.transitionsLabel, self.transitionsCheckBox) self.alignment_layout.addRow(self.transitions_label, self.transitions_check_box)
self.alignmentLayout.setItem(3, QtGui.QFormLayout.LabelRole, self.spacer) self.alignment_layout.setItem(3, QtGui.QFormLayout.LabelRole, self.spacer)
themeWizard.addPage(self.alignmentPage) themeWizard.addPage(self.alignment_page)
# Area Position Page # Area Position Page
self.areaPositionPage = QtGui.QWizardPage() self.area_position_page = QtGui.QWizardPage()
self.areaPositionPage.setObjectName('AreaPositionPage') self.area_position_page.setObjectName('area_position_page')
self.areaPositionLayout = QtGui.QHBoxLayout(self.areaPositionPage) self.area_position_layout = QtGui.QHBoxLayout(self.area_position_page)
self.areaPositionLayout.setObjectName('AreaPositionLayout') self.area_position_layout.setObjectName('area_position_layout')
self.mainPositionGroupBox = QtGui.QGroupBox(self.areaPositionPage) self.main_position_group_box = QtGui.QGroupBox(self.area_position_page)
self.mainPositionGroupBox.setObjectName('MainPositionGroupBox') self.main_position_group_box.setObjectName('main_position_group_box')
self.mainPositionLayout = QtGui.QFormLayout(self.mainPositionGroupBox) self.main_position_layout = QtGui.QFormLayout(self.main_position_group_box)
self.mainPositionLayout.setObjectName('MainPositionLayout') self.main_position_layout.setObjectName('main_position_layout')
self.mainPositionCheckBox = QtGui.QCheckBox(self.mainPositionGroupBox) self.main_position_check_box = QtGui.QCheckBox(self.main_position_group_box)
self.mainPositionCheckBox.setObjectName('MainPositionCheckBox') self.main_position_check_box.setObjectName('main_position_check_box')
self.mainPositionLayout.addRow(self.mainPositionCheckBox) self.main_position_layout.addRow(self.main_position_check_box)
self.mainXLabel = QtGui.QLabel(self.mainPositionGroupBox) self.main_x_label = QtGui.QLabel(self.main_position_group_box)
self.mainXLabel.setObjectName('MainXLabel') self.main_x_label.setObjectName('main_x_label')
self.mainXSpinBox = QtGui.QSpinBox(self.mainPositionGroupBox) self.main_x_spin_box = QtGui.QSpinBox(self.main_position_group_box)
self.mainXSpinBox.setMaximum(9999) self.main_x_spin_box.setMaximum(9999)
self.mainXSpinBox.setObjectName('MainXSpinBox') self.main_x_spin_box.setObjectName('main_x_spin_box')
self.mainPositionLayout.addRow(self.mainXLabel, self.mainXSpinBox) self.main_position_layout.addRow(self.main_x_label, self.main_x_spin_box)
self.mainYLabel = QtGui.QLabel(self.mainPositionGroupBox) self.main_y_label = QtGui.QLabel(self.main_position_group_box)
self.mainYLabel.setObjectName('MainYLabel') self.main_y_label.setObjectName('main_y_label')
self.mainYSpinBox = QtGui.QSpinBox(self.mainPositionGroupBox) self.main_y_spin_box = QtGui.QSpinBox(self.main_position_group_box)
self.mainYSpinBox.setMaximum(9999) self.main_y_spin_box.setMaximum(9999)
self.mainYSpinBox.setObjectName('MainYSpinBox') self.main_y_spin_box.setObjectName('main_y_spin_box')
self.mainPositionLayout.addRow(self.mainYLabel, self.mainYSpinBox) self.main_position_layout.addRow(self.main_y_label, self.main_y_spin_box)
self.mainWidthLabel = QtGui.QLabel(self.mainPositionGroupBox) self.main_width_label = QtGui.QLabel(self.main_position_group_box)
self.mainWidthLabel.setObjectName('MainWidthLabel') self.main_width_label.setObjectName('main_width_label')
self.mainWidthSpinBox = QtGui.QSpinBox(self.mainPositionGroupBox) self.main_width_spin_box = QtGui.QSpinBox(self.main_position_group_box)
self.mainWidthSpinBox.setMaximum(9999) self.main_width_spin_box.setMaximum(9999)
self.mainWidthSpinBox.setObjectName('MainWidthSpinBox') self.main_width_spin_box.setObjectName('main_width_spin_box')
self.mainPositionLayout.addRow(self.mainWidthLabel, self.mainWidthSpinBox) self.main_position_layout.addRow(self.main_width_label, self.main_width_spin_box)
self.mainHeightLabel = QtGui.QLabel(self.mainPositionGroupBox) self.main_height_label = QtGui.QLabel(self.main_position_group_box)
self.mainHeightLabel.setObjectName('MainHeightLabel') self.main_height_label.setObjectName('main_height_label')
self.mainHeightSpinBox = QtGui.QSpinBox(self.mainPositionGroupBox) self.main_height_spin_box = QtGui.QSpinBox(self.main_position_group_box)
self.mainHeightSpinBox.setMaximum(9999) self.main_height_spin_box.setMaximum(9999)
self.mainHeightSpinBox.setObjectName('MainHeightSpinBox') self.main_height_spin_box.setObjectName('main_height_spin_box')
self.mainPositionLayout.addRow(self.mainHeightLabel, self.mainHeightSpinBox) self.main_position_layout.addRow(self.main_height_label, self.main_height_spin_box)
self.areaPositionLayout.addWidget(self.mainPositionGroupBox) self.area_position_layout.addWidget(self.main_position_group_box)
self.footerPositionGroupBox = QtGui.QGroupBox(self.areaPositionPage) self.footer_position_group_box = QtGui.QGroupBox(self.area_position_page)
self.footerPositionGroupBox.setObjectName('FooterPositionGroupBox') self.footer_position_group_box.setObjectName('footer_position_group_box')
self.footerPositionLayout = QtGui.QFormLayout(self.footerPositionGroupBox) self.footer_position_layout = QtGui.QFormLayout(self.footer_position_group_box)
self.footerPositionLayout.setObjectName('FooterPositionLayout') self.footer_position_layout.setObjectName('footer_position_layout')
self.footerPositionCheckBox = QtGui.QCheckBox(self.footerPositionGroupBox) self.footer_position_check_box = QtGui.QCheckBox(self.footer_position_group_box)
self.footerPositionCheckBox.setObjectName('FooterPositionCheckBox') self.footer_position_check_box.setObjectName('footer_position_check_box')
self.footerPositionLayout.addRow(self.footerPositionCheckBox) self.footer_position_layout.addRow(self.footer_position_check_box)
self.footerXLabel = QtGui.QLabel(self.footerPositionGroupBox) self.footer_x_label = QtGui.QLabel(self.footer_position_group_box)
self.footerXLabel.setObjectName('FooterXLabel') self.footer_x_label.setObjectName('footer_x_label')
self.footerXSpinBox = QtGui.QSpinBox(self.footerPositionGroupBox) self.footer_x_spin_box = QtGui.QSpinBox(self.footer_position_group_box)
self.footerXSpinBox.setMaximum(9999) self.footer_x_spin_box.setMaximum(9999)
self.footerXSpinBox.setObjectName('FooterXSpinBox') self.footer_x_spin_box.setObjectName('footer_x_spin_box')
self.footerPositionLayout.addRow(self.footerXLabel, self.footerXSpinBox) self.footer_position_layout.addRow(self.footer_x_label, self.footer_x_spin_box)
self.footerYLabel = QtGui.QLabel(self.footerPositionGroupBox) self.footer_y_label = QtGui.QLabel(self.footer_position_group_box)
self.footerYLabel.setObjectName('FooterYLabel') self.footer_y_label.setObjectName('footer_y_label')
self.footerYSpinBox = QtGui.QSpinBox(self.footerPositionGroupBox) self.footer_y_spin_box = QtGui.QSpinBox(self.footer_position_group_box)
self.footerYSpinBox.setMaximum(9999) self.footer_y_spin_box.setMaximum(9999)
self.footerYSpinBox.setObjectName('FooterYSpinBox') self.footer_y_spin_box.setObjectName('footer_y_spin_box')
self.footerPositionLayout.addRow(self.footerYLabel, self.footerYSpinBox) self.footer_position_layout.addRow(self.footer_y_label, self.footer_y_spin_box)
self.footerWidthLabel = QtGui.QLabel(self.footerPositionGroupBox) self.footer_width_label = QtGui.QLabel(self.footer_position_group_box)
self.footerWidthLabel.setObjectName('FooterWidthLabel') self.footer_width_label.setObjectName('footer_width_label')
self.footerWidthSpinBox = QtGui.QSpinBox(self.footerPositionGroupBox) self.footer_width_spin_box = QtGui.QSpinBox(self.footer_position_group_box)
self.footerWidthSpinBox.setMaximum(9999) self.footer_width_spin_box.setMaximum(9999)
self.footerWidthSpinBox.setObjectName('FooterWidthSpinBox') self.footer_width_spin_box.setObjectName('footer_width_spin_box')
self.footerPositionLayout.addRow(self.footerWidthLabel, self.footerWidthSpinBox) self.footer_position_layout.addRow(self.footer_width_label, self.footer_width_spin_box)
self.footerHeightLabel = QtGui.QLabel(self.footerPositionGroupBox) self.footer_height_label = QtGui.QLabel(self.footer_position_group_box)
self.footerHeightLabel.setObjectName('FooterHeightLabel') self.footer_height_label.setObjectName('footer_height_label')
self.footerHeightSpinBox = QtGui.QSpinBox(self.footerPositionGroupBox) self.footer_height_spin_box = QtGui.QSpinBox(self.footer_position_group_box)
self.footerHeightSpinBox.setMaximum(9999) self.footer_height_spin_box.setMaximum(9999)
self.footerHeightSpinBox.setObjectName('FooterHeightSpinBox') self.footer_height_spin_box.setObjectName('footer_height_spin_box')
self.footerPositionLayout.addRow(self.footerHeightLabel, self.footerHeightSpinBox) self.footer_position_layout.addRow(self.footer_height_label, self.footer_height_spin_box)
self.areaPositionLayout.addWidget(self.footerPositionGroupBox) self.area_position_layout.addWidget(self.footer_position_group_box)
themeWizard.addPage(self.areaPositionPage) themeWizard.addPage(self.area_position_page)
# Preview Page # Preview Page
self.previewPage = QtGui.QWizardPage() self.preview_page = QtGui.QWizardPage()
self.previewPage.setObjectName('PreviewPage') self.preview_page.setObjectName('preview_page')
self.previewLayout = QtGui.QVBoxLayout(self.previewPage) self.preview_layout = QtGui.QVBoxLayout(self.preview_page)
self.previewLayout.setObjectName('PreviewLayout') self.preview_layout.setObjectName('preview_layout')
self.themeNameLayout = QtGui.QFormLayout() self.theme_name_layout = QtGui.QFormLayout()
self.themeNameLayout.setObjectName('ThemeNameLayout') self.theme_name_layout.setObjectName('theme_name_layout')
self.themeNameLabel = QtGui.QLabel(self.previewPage) self.theme_name_label = QtGui.QLabel(self.preview_page)
self.themeNameLabel.setObjectName('ThemeNameLabel') self.theme_name_label.setObjectName('theme_name_label')
self.themeNameEdit = QtGui.QLineEdit(self.previewPage) self.theme_name_edit = QtGui.QLineEdit(self.preview_page)
self.themeNameEdit.setValidator(QtGui.QRegExpValidator(QtCore.QRegExp(r'[^/\\?*|<>\[\]":<>+%]+'), self)) self.theme_name_edit.setValidator(QtGui.QRegExpValidator(QtCore.QRegExp(r'[^/\\?*|<>\[\]":<>+%]+'), self))
self.themeNameEdit.setObjectName('ThemeNameEdit') self.theme_name_edit.setObjectName('ThemeNameEdit')
self.themeNameLayout.addRow(self.themeNameLabel, self.themeNameEdit) self.theme_name_layout.addRow(self.theme_name_label, self.theme_name_edit)
self.previewLayout.addLayout(self.themeNameLayout) self.preview_layout.addLayout(self.theme_name_layout)
self.previewArea = QtGui.QWidget(self.previewPage) self.preview_area = QtGui.QWidget(self.preview_page)
self.previewArea.setObjectName('PreviewArea') self.preview_area.setObjectName('PreviewArea')
self.previewAreaLayout = QtGui.QGridLayout(self.previewArea) self.preview_area_layout = QtGui.QGridLayout(self.preview_area)
self.previewAreaLayout.setMargin(0) self.preview_area_layout.setMargin(0)
self.previewAreaLayout.setColumnStretch(0, 1) self.preview_area_layout.setColumnStretch(0, 1)
self.previewAreaLayout.setRowStretch(0, 1) self.preview_area_layout.setRowStretch(0, 1)
self.previewAreaLayout.setObjectName('PreviewAreaLayout') self.preview_area_layout.setObjectName('preview_area_layout')
self.previewBoxLabel = QtGui.QLabel(self.previewArea) self.preview_box_label = QtGui.QLabel(self.preview_area)
self.previewBoxLabel.setFrameShape(QtGui.QFrame.Box) self.preview_box_label.setFrameShape(QtGui.QFrame.Box)
self.previewBoxLabel.setScaledContents(True) self.preview_box_label.setScaledContents(True)
self.previewBoxLabel.setObjectName('PreviewBoxLabel') self.preview_box_label.setObjectName('preview_box_label')
self.previewAreaLayout.addWidget(self.previewBoxLabel) self.preview_area_layout.addWidget(self.preview_box_label)
self.previewLayout.addWidget(self.previewArea) self.preview_layout.addWidget(self.preview_area)
themeWizard.addPage(self.previewPage) themeWizard.addPage(self.preview_page)
self.retranslateUi(themeWizard) self.retranslateUi(themeWizard)
QtCore.QObject.connect(self.backgroundComboBox, QtCore.SIGNAL('currentIndexChanged(int)'), QtCore.QObject.connect(self.background_combo_box, QtCore.SIGNAL('currentIndexChanged(int)'),
self.backgroundStack, QtCore.SLOT('setCurrentIndex(int)')) self.background_stack, QtCore.SLOT('setCurrentIndex(int)'))
QtCore.QObject.connect(self.outlineCheckBox, QtCore.SIGNAL('toggled(bool)'), self.outlineColorButton, QtCore.QObject.connect(self.outline_check_box, QtCore.SIGNAL('toggled(bool)'), self.outline_color_button,
QtCore.SLOT('setEnabled(bool)')) QtCore.SLOT('setEnabled(bool)'))
QtCore.QObject.connect(self.outlineCheckBox, QtCore.SIGNAL('toggled(bool)'), self.outlineSizeSpinBox, QtCore.QObject.connect(self.outline_check_box, QtCore.SIGNAL('toggled(bool)'), self.outline_size_spin_box,
QtCore.SLOT('setEnabled(bool)')) QtCore.SLOT('setEnabled(bool)'))
QtCore.QObject.connect(self.shadowCheckBox, QtCore.SIGNAL('toggled(bool)'), self.shadowColorButton, QtCore.QObject.connect(self.shadow_check_box, QtCore.SIGNAL('toggled(bool)'), self.shadow_color_button,
QtCore.SLOT('setEnabled(bool)')) QtCore.SLOT('setEnabled(bool)'))
QtCore.QObject.connect(self.shadowCheckBox, QtCore.SIGNAL('toggled(bool)'), self.shadowSizeSpinBox, QtCore.QObject.connect(self.shadow_check_box, QtCore.SIGNAL('toggled(bool)'), self.shadow_size_spin_box,
QtCore.SLOT('setEnabled(bool)')) QtCore.SLOT('setEnabled(bool)'))
QtCore.QObject.connect(self.mainPositionCheckBox, QtCore.SIGNAL('toggled(bool)'), self.mainXSpinBox, QtCore.QObject.connect(self.main_position_check_box, QtCore.SIGNAL('toggled(bool)'), self.main_x_spin_box,
QtCore.SLOT('setDisabled(bool)')) QtCore.SLOT('setDisabled(bool)'))
QtCore.QObject.connect(self.mainPositionCheckBox, QtCore.SIGNAL('toggled(bool)'), self.mainYSpinBox, QtCore.QObject.connect(self.main_position_check_box, QtCore.SIGNAL('toggled(bool)'), self.main_y_spin_box,
QtCore.SLOT('setDisabled(bool)')) QtCore.SLOT('setDisabled(bool)'))
QtCore.QObject.connect(self.mainPositionCheckBox, QtCore.SIGNAL('toggled(bool)'), self.mainWidthSpinBox, QtCore.QObject.connect(self.main_position_check_box, QtCore.SIGNAL('toggled(bool)'), self.main_width_spin_box,
QtCore.SLOT('setDisabled(bool)')) QtCore.SLOT('setDisabled(bool)'))
QtCore.QObject.connect(self.mainPositionCheckBox, QtCore.SIGNAL('toggled(bool)'), self.mainHeightSpinBox, QtCore.QObject.connect(self.main_position_check_box, QtCore.SIGNAL('toggled(bool)'), self.main_height_spin_box,
QtCore.SLOT('setDisabled(bool)')) QtCore.SLOT('setDisabled(bool)'))
QtCore.QObject.connect(self.footerPositionCheckBox, QtCore.SIGNAL('toggled(bool)'), self.footerXSpinBox, QtCore.QObject.connect(self.footer_position_check_box, QtCore.SIGNAL('toggled(bool)'), self.footer_x_spin_box,
QtCore.SLOT('setDisabled(bool)')) QtCore.SLOT('setDisabled(bool)'))
QtCore.QObject.connect(self.footerPositionCheckBox, QtCore.SIGNAL('toggled(bool)'), self.footerYSpinBox, QtCore.QObject.connect(self.footer_position_check_box, QtCore.SIGNAL('toggled(bool)'), self.footer_y_spin_box,
QtCore.SLOT('setDisabled(bool)')) QtCore.SLOT('setDisabled(bool)'))
QtCore.QObject.connect(self.footerPositionCheckBox, QtCore.SIGNAL('toggled(bool)'), self.footerWidthSpinBox, QtCore.QObject.connect(self.footer_position_check_box, QtCore.SIGNAL('toggled(bool)'), self.footer_width_spin_box,
QtCore.SLOT('setDisabled(bool)')) QtCore.SLOT('setDisabled(bool)'))
QtCore.QObject.connect(self.footerPositionCheckBox, QtCore.SIGNAL('toggled(bool)'), self.footerHeightSpinBox, QtCore.QObject.connect(self.footer_position_check_box, QtCore.SIGNAL('toggled(bool)'), self.footer_height_spin_box,
QtCore.SLOT('setDisabled(bool)')) QtCore.SLOT('setDisabled(bool)'))
def retranslateUi(self, themeWizard): def retranslateUi(self, themeWizard):
@ -400,91 +400,92 @@ class Ui_ThemeWizard(object):
self.information_label.setText( self.information_label.setText(
translate('OpenLP.ThemeWizard', 'This wizard will help you to create and edit your themes. Click the next ' translate('OpenLP.ThemeWizard', 'This wizard will help you to create and edit your themes. Click the next '
'button below to start the process by setting up your background.')) 'button below to start the process by setting up your background.'))
self.backgroundPage.setTitle(translate('OpenLP.ThemeWizard', 'Set Up Background')) self.background_page.setTitle(translate('OpenLP.ThemeWizard', 'Set Up Background'))
self.backgroundPage.setSubTitle(translate('OpenLP.ThemeWizard', 'Set up your theme\'s background ' self.background_page.setSubTitle(translate('OpenLP.ThemeWizard', 'Set up your theme\'s background '
'according to the parameters below.')) 'according to the parameters below.'))
self.backgroundLabel.setText(translate('OpenLP.ThemeWizard', 'Background type:')) self.background_label.setText(translate('OpenLP.ThemeWizard', 'Background type:'))
self.backgroundComboBox.setItemText(BackgroundType.Solid, self.background_combo_box.setItemText(BackgroundType.Solid,
translate('OpenLP.ThemeWizard', 'Solid Color')) translate('OpenLP.ThemeWizard', 'Solid color'))
self.backgroundComboBox.setItemText(BackgroundType.Gradient, self.background_combo_box.setItemText(BackgroundType.Gradient,
translate('OpenLP.ThemeWizard', 'Gradient')) translate('OpenLP.ThemeWizard', 'Gradient'))
self.backgroundComboBox.setItemText(BackgroundType.Image, UiStrings().Image) self.background_combo_box.setItemText(BackgroundType.Image, UiStrings().Image)
self.backgroundComboBox.setItemText(BackgroundType.Transparent, translate('OpenLP.ThemeWizard', 'Transparent')) self.background_combo_box.setItemText(BackgroundType.Transparent, translate('OpenLP.ThemeWizard', 'Transparent'))
self.colorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:')) self.color_label.setText(translate('OpenLP.ThemeWizard', 'color:'))
self.gradientStartLabel.setText(translate('OpenLP.ThemeWizard', 'Starting color:')) self.gradient_start_label.setText(translate('OpenLP.ThemeWizard', 'Starting color:'))
self.gradientEndLabel.setText(translate('OpenLP.ThemeWizard', 'Ending color:')) self.gradient_end_label.setText(translate('OpenLP.ThemeWizard', 'Ending color:'))
self.gradientTypeLabel.setText(translate('OpenLP.ThemeWizard', 'Gradient:')) self.gradient_type_label.setText(translate('OpenLP.ThemeWizard', 'Gradient:'))
self.gradientComboBox.setItemText(BackgroundGradientType.Horizontal, self.gradient_combo_box.setItemText(BackgroundGradientType.Horizontal,
translate('OpenLP.ThemeWizard', 'Horizontal')) translate('OpenLP.ThemeWizard', 'Horizontal'))
self.gradientComboBox.setItemText(BackgroundGradientType.Vertical, translate('OpenLP.ThemeWizard', 'Vertical')) self.gradient_combo_box.setItemText(BackgroundGradientType.Vertical, translate('OpenLP.ThemeWizard', 'Vertical'))
self.gradientComboBox.setItemText(BackgroundGradientType.Circular, translate('OpenLP.ThemeWizard', 'Circular')) self.gradient_combo_box.setItemText(BackgroundGradientType.Circular, translate('OpenLP.ThemeWizard', 'Circular'))
self.gradientComboBox.setItemText(BackgroundGradientType.LeftTop, self.gradient_combo_box.setItemText(BackgroundGradientType.LeftTop,
translate('OpenLP.ThemeWizard', 'Top Left - Bottom Right')) translate('OpenLP.ThemeWizard', 'Top Left - Bottom Right'))
self.gradientComboBox.setItemText(BackgroundGradientType.LeftBottom, self.gradient_combo_box.setItemText(BackgroundGradientType.LeftBottom,
translate('OpenLP.ThemeWizard', 'Bottom Left - Top Right')) translate('OpenLP.ThemeWizard', 'Bottom Left - Top Right'))
self.imageColorLabel.setText(translate('OpenLP.ThemeWizard', 'Background color:')) self.image_color_label.setText(translate('OpenLP.ThemeWizard', 'Background color:'))
self.imageLabel.setText('%s:' % UiStrings().Image) self.image_label.setText('%s:' % UiStrings().Image)
self.mainAreaPage.setTitle(translate('OpenLP.ThemeWizard', 'Main Area Font Details')) self.main_area_page.setTitle(translate('OpenLP.ThemeWizard', 'Main Area Font Details'))
self.mainAreaPage.setSubTitle(translate('OpenLP.ThemeWizard', 'Define the font and display ' self.main_area_page.setSubTitle(translate('OpenLP.ThemeWizard', 'Define the font and display '
'characteristics for the Display text')) 'characteristics for the Display text'))
self.mainFontLabel.setText(translate('OpenLP.ThemeWizard', 'Font:')) self.main_font_label.setText(translate('OpenLP.ThemeWizard', 'Font:'))
self.mainColorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:')) self.main_color_label.setText(translate('OpenLP.ThemeWizard', 'color:'))
self.mainSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:')) self.main_size_label.setText(translate('OpenLP.ThemeWizard', 'Size:'))
self.mainSizeSpinBox.setSuffix(UiStrings().FontSizePtUnit) self.main_size_spin_box.setSuffix(UiStrings().FontSizePtUnit)
self.lineSpacingLabel.setText(translate('OpenLP.ThemeWizard', 'Line Spacing:')) self.line_spacing_label.setText(translate('OpenLP.ThemeWizard', 'Line Spacing:'))
self.lineSpacingSpinBox.setSuffix(UiStrings().FontSizePtUnit) self.line_spacing_spin_box.setSuffix(UiStrings().FontSizePtUnit)
self.outlineCheckBox.setText(translate('OpenLP.ThemeWizard', '&Outline:')) self.outline_check_box.setText(translate('OpenLP.ThemeWizard', '&Outline:'))
self.outlineSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:')) self.outline_size_label.setText(translate('OpenLP.ThemeWizard', 'Size:'))
self.outlineSizeSpinBox.setSuffix(UiStrings().FontSizePtUnit) self.outline_size_spin_box.setSuffix(UiStrings().FontSizePtUnit)
self.shadowCheckBox.setText(translate('OpenLP.ThemeWizard', '&Shadow:')) self.shadow_check_box.setText(translate('OpenLP.ThemeWizard', '&Shadow:'))
self.shadowSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:')) self.shadow_size_label.setText(translate('OpenLP.ThemeWizard', 'Size:'))
self.shadowSizeSpinBox.setSuffix(UiStrings().FontSizePtUnit) self.shadow_size_spin_box.setSuffix(UiStrings().FontSizePtUnit)
self.mainBoldCheckBox.setText(translate('OpenLP.ThemeWizard', 'Bold')) self.main_bold_check_box.setText(translate('OpenLP.ThemeWizard', 'Bold'))
self.mainItalicsCheckBox.setText(translate('OpenLP.ThemeWizard', 'Italic')) self.main_italics_check_box.setText(translate('OpenLP.ThemeWizard', 'Italic'))
self.footerAreaPage.setTitle(translate('OpenLP.ThemeWizard', 'Footer Area Font Details')) self.footer_area_page.setTitle(translate('OpenLP.ThemeWizard', 'Footer Area Font Details'))
self.footerAreaPage.setSubTitle(translate('OpenLP.ThemeWizard', 'Define the font and display ' self.footer_area_page.setSubTitle(translate('OpenLP.ThemeWizard', 'Define the font and display '
'characteristics for the Footer text')) 'characteristics for the Footer text'))
self.footerFontLabel.setText(translate('OpenLP.ThemeWizard', 'Font:')) self.footer_font_label.setText(translate('OpenLP.ThemeWizard', 'Font:'))
self.footerColorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:')) self.footer_color_label.setText(translate('OpenLP.ThemeWizard', 'color:'))
self.footerSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:')) self.footer_size_label.setText(translate('OpenLP.ThemeWizard', 'Size:'))
self.footerSizeSpinBox.setSuffix(UiStrings().FontSizePtUnit) self.footer_size_spin_box.setSuffix(UiStrings().FontSizePtUnit)
self.alignmentPage.setTitle(translate('OpenLP.ThemeWizard', 'Text Formatting Details')) self.alignment_page.setTitle(translate('OpenLP.ThemeWizard', 'Text Formatting Details'))
self.alignmentPage.setSubTitle(translate('OpenLP.ThemeWizard', 'Allows additional display ' self.alignment_page.setSubTitle(translate('OpenLP.ThemeWizard', 'Allows additional display '
'formatting information to be defined')) 'formatting information to be defined'))
self.horizontalLabel.setText(translate('OpenLP.ThemeWizard', 'Horizontal Align:')) self.horizontal_label.setText(translate('OpenLP.ThemeWizard', 'Horizontal Align:'))
self.horizontalComboBox.setItemText(HorizontalType.Left, translate('OpenLP.ThemeWizard', 'Left')) self.horizontal_combo_box.setItemText(HorizontalType.Left, translate('OpenLP.ThemeWizard', 'Left'))
self.horizontalComboBox.setItemText(HorizontalType.Right, translate('OpenLP.ThemeWizard', 'Right')) self.horizontal_combo_box.setItemText(HorizontalType.Right, translate('OpenLP.ThemeWizard', 'Right'))
self.horizontalComboBox.setItemText(HorizontalType.Center, translate('OpenLP.ThemeWizard', 'Center')) self.horizontal_combo_box.setItemText(HorizontalType.Center, translate('OpenLP.ThemeWizard', 'Center'))
self.horizontalComboBox.setItemText(HorizontalType.Justify, translate('OpenLP.ThemeWizard', 'Justify')) self.horizontal_combo_box.setItemText(HorizontalType.Justify, translate('OpenLP.ThemeWizard', 'Justify'))
self.transitionsLabel.setText(translate('OpenLP.ThemeWizard', 'Transitions:')) self.transitions_label.setText(translate('OpenLP.ThemeWizard', 'Transitions:'))
self.areaPositionPage.setTitle(translate('OpenLP.ThemeWizard', 'Output Area Locations')) self.area_position_page.setTitle(translate('OpenLP.ThemeWizard', 'Output Area Locations'))
self.areaPositionPage.setSubTitle(translate('OpenLP.ThemeWizard', 'Allows you to change and move the' self.area_position_page.setSubTitle(translate('OpenLP.ThemeWizard', 'Allows you to change and move the'
' main and footer areas.')) ' Main and Footer areas.'))
self.mainPositionGroupBox.setTitle(translate('OpenLP.ThemeWizard', '&Main Area')) self.main_position_group_box.setTitle(translate('OpenLP.ThemeWizard', '&Main Area'))
self.mainPositionCheckBox.setText(translate('OpenLP.ThemeWizard', '&Use default location')) self.main_position_check_box.setText(translate('OpenLP.ThemeWizard', '&Use default location'))
self.mainXLabel.setText(translate('OpenLP.ThemeWizard', 'X position:')) self.main_x_label.setText(translate('OpenLP.ThemeWizard', 'X position:'))
self.mainXSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'px')) self.main_x_spin_box.setSuffix(translate('OpenLP.ThemeWizard', 'px'))
self.mainYSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'px')) self.main_y_spin_box.setSuffix(translate('OpenLP.ThemeWizard', 'px'))
self.mainYLabel.setText(translate('OpenLP.ThemeWizard', 'Y position:')) self.main_y_label.setText(translate('OpenLP.ThemeWizard', 'Y position:'))
self.mainWidthSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'px')) self.main_width_spin_box.setSuffix(translate('OpenLP.ThemeWizard', 'px'))
self.mainWidthLabel.setText(translate('OpenLP.ThemeWizard', 'Width:')) self.main_width_label.setText(translate('OpenLP.ThemeWizard', 'Width:'))
self.mainHeightSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'px')) self.main_height_spin_box.setSuffix(translate('OpenLP.ThemeWizard', 'px'))
self.mainHeightLabel.setText(translate('OpenLP.ThemeWizard', 'Height:')) self.main_height_label.setText(translate('OpenLP.ThemeWizard', 'Height:'))
self.footerPositionGroupBox.setTitle(translate('OpenLP.ThemeWizard', '&Footer Area')) self.footer_position_group_box.setTitle(translate('OpenLP.ThemeWizard', '&Footer Area'))
self.footerXLabel.setText(translate('OpenLP.ThemeWizard', 'X position:')) self.footer_x_label.setText(translate('OpenLP.ThemeWizard', 'X position:'))
self.footerXSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'px')) self.footer_x_spin_box.setSuffix(translate('OpenLP.ThemeWizard', 'px'))
self.footerYLabel.setText(translate('OpenLP.ThemeWizard', 'Y position:')) self.footer_y_label.setText(translate('OpenLP.ThemeWizard', 'Y position:'))
self.footerYSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'px')) self.footer_y_spin_box.setSuffix(translate('OpenLP.ThemeWizard', 'px'))
self.footerWidthLabel.setText(translate('OpenLP.ThemeWizard', 'Width:')) self.footer_width_label.setText(translate('OpenLP.ThemeWizard', 'Width:'))
self.footerWidthSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'px')) self.footer_width_spin_box.setSuffix(translate('OpenLP.ThemeWizard', 'px'))
self.footerHeightLabel.setText(translate('OpenLP.ThemeWizard', 'Height:')) self.footer_height_label.setText(translate('OpenLP.ThemeWizard', 'Height:'))
self.footerHeightSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'px')) self.footer_height_spin_box.setSuffix(translate('OpenLP.ThemeWizard', 'px'))
self.footerPositionCheckBox.setText(translate('OpenLP.ThemeWizard', 'Use default location')) self.footer_position_check_box.setText(translate('OpenLP.ThemeWizard', 'Use default location'))
themeWizard.setOption(QtGui.QWizard.HaveCustomButton1, False) themeWizard.setOption(QtGui.QWizard.HaveCustomButton1, False)
themeWizard.setButtonText(QtGui.QWizard.CustomButton1, translate('OpenLP.ThemeWizard', 'Layout Preview')) themeWizard.setButtonText(QtGui.QWizard.CustomButton1, translate('OpenLP.ThemeWizard', 'Layout Preview'))
self.previewPage.setTitle(translate('OpenLP.ThemeWizard', 'Preview and Save')) self.preview_page.setTitle(translate('OpenLP.ThemeWizard', 'Preview and Save'))
self.previewPage.setSubTitle(translate('OpenLP.ThemeWizard', 'Preview the theme and save it.')) self.preview_page.setSubTitle(translate('OpenLP.ThemeWizard', 'Preview the theme and save it.'))
self.themeNameLabel.setText(translate('OpenLP.ThemeWizard', 'Theme name:')) self.theme_name_label.setText(translate('OpenLP.ThemeWizard', 'Theme name:'))
# Align all QFormLayouts towards each other. # Align all QFormLayouts towards each other.
labelWidth = max(self.backgroundLabel.minimumSizeHint().width(), self.horizontalLabel.minimumSizeHint().width()) label_width = max(self.background_label.minimumSizeHint().width(),
self.spacer.changeSize(labelWidth, 0, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) self.horizontal_label.minimumSizeHint().width())
self.spacer.changeSize(label_width, 0, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #

View File

@ -4,8 +4,8 @@
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman # # Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan # # Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # # Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. # # Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, # # 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