forked from openlp/openlp
Merged with trunk.
This commit is contained in:
commit
84334a039e
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -5,8 +5,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Edwin Lunando, Joshua Miller, Stevan Pettit, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -222,8 +222,7 @@ class Settings(QtCore.QSettings):
|
||||
'shortcuts/moveBottom': [QtGui.QKeySequence(QtCore.Qt.Key_End)],
|
||||
'shortcuts/moveDown': [QtGui.QKeySequence(QtCore.Qt.Key_PageDown)],
|
||||
'shortcuts/nextTrackItem': [],
|
||||
'shortcuts/nextItem_live': [QtGui.QKeySequence(QtCore.Qt.Key_Down),
|
||||
QtGui.QKeySequence(QtCore.Qt.Key_PageDown)],
|
||||
'shortcuts/nextItem_live': [QtGui.QKeySequence(QtCore.Qt.Key_Down), QtGui.QKeySequence(QtCore.Qt.Key_PageDown)],
|
||||
'shortcuts/nextItem_preview': [],
|
||||
'shortcuts/nextService': [QtGui.QKeySequence(QtCore.Qt.Key_Right)],
|
||||
'shortcuts/newService': [],
|
||||
@ -231,8 +230,7 @@ class Settings(QtCore.QSettings):
|
||||
'shortcuts/onlineHelpItem': [QtGui.QKeySequence('Alt+F1')],
|
||||
'shortcuts/openService': [],
|
||||
'shortcuts/saveService': [],
|
||||
'shortcuts/previousItem_live': [QtGui.QKeySequence(QtCore.Qt.Key_Up),
|
||||
QtGui.QKeySequence(QtCore.Qt.Key_PageUp)],
|
||||
'shortcuts/previousItem_live': [QtGui.QKeySequence(QtCore.Qt.Key_Up), QtGui.QKeySequence(QtCore.Qt.Key_PageUp)],
|
||||
'shortcuts/playbackPause': [],
|
||||
'shortcuts/playbackPlay': [],
|
||||
'shortcuts/playbackStop': [],
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -199,8 +199,7 @@ class Manager(object):
|
||||
else:
|
||||
self.db_url = 'sqlite:///%s/%s.sqlite' % (AppLocation.get_section_data_path(plugin_name), plugin_name)
|
||||
else:
|
||||
self.db_url = '%s://%s:%s@%s/%s' % (db_type,
|
||||
urlquote(settings.value('db username')),
|
||||
self.db_url = '%s://%s:%s@%s/%s' % (db_type, urlquote(settings.value('db username')),
|
||||
urlquote(settings.value('db password')),
|
||||
urlquote(settings.value('db hostname')),
|
||||
urlquote(settings.value('db database')))
|
||||
@ -214,18 +213,17 @@ class Manager(object):
|
||||
critical_error_message_box(
|
||||
translate('OpenLP.Manager', 'Database Error'),
|
||||
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 '
|
||||
'be loaded.\n\nDatabase: %s') % (db_ver, up_ver, self.db_url)
|
||||
'OpenLP. The database is version %d, while OpenLP expects version %d. The database will '
|
||||
'not be loaded.\n\nDatabase: %s') % (db_ver, up_ver, self.db_url)
|
||||
)
|
||||
return
|
||||
try:
|
||||
self.session = init_schema(self.db_url)
|
||||
except (SQLAlchemyError, DBAPIError):
|
||||
log.exception('Error loading database: %s', self.db_url)
|
||||
critical_error_message_box(
|
||||
translate('OpenLP.Manager', 'Database Error'),
|
||||
translate('OpenLP.Manager', 'OpenLP cannot load your database.\n\nDatabase: %s') % self.db_url
|
||||
)
|
||||
critical_error_message_box(translate('OpenLP.Manager', 'Database Error'),
|
||||
translate('OpenLP.Manager', 'OpenLP cannot load your database.\n\nDatabase: %s')
|
||||
% self.db_url)
|
||||
|
||||
def save_object(self, object_instance, commit=True):
|
||||
"""
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -40,6 +40,7 @@ from openlp.core.common import UiStrings
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class FileDialog(QtGui.QFileDialog):
|
||||
"""
|
||||
Subclass QFileDialog to work round a bug
|
||||
@ -54,13 +55,12 @@ class FileDialog(QtGui.QFileDialog):
|
||||
file_list = []
|
||||
for file in files:
|
||||
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)
|
||||
if not os.path.exists(file):
|
||||
log.error('File %s not found.' % file)
|
||||
QtGui.QMessageBox.information(parent, UiStrings().FileNotFound,
|
||||
UiStrings().FileNotFoundMessage % file)
|
||||
continue
|
||||
log.info('File %s found.')
|
||||
file_list.append(file)
|
||||
return file_list
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -68,47 +68,56 @@ class FormattingTags(object):
|
||||
FormattingTags.html_expands = []
|
||||
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 html': '<span style="-webkit-text-fill-color:red">',
|
||||
'end tag': '{/r}', 'end html': '</span>', 'protected': True,
|
||||
'temporary': False})
|
||||
base_tags.append({'desc': translate('OpenLP.FormattingTags', 'Black'),
|
||||
base_tags.append({
|
||||
'desc': translate('OpenLP.FormattingTags', 'Black'),
|
||||
'start tag': '{b}',
|
||||
'start html': '<span style="-webkit-text-fill-color:black">',
|
||||
'end tag': '{/b}', 'end html': '</span>', 'protected': True,
|
||||
'temporary': False})
|
||||
base_tags.append({'desc': translate('OpenLP.FormattingTags', 'Blue'),
|
||||
base_tags.append({
|
||||
'desc': translate('OpenLP.FormattingTags', 'Blue'),
|
||||
'start tag': '{bl}',
|
||||
'start html': '<span style="-webkit-text-fill-color:blue">',
|
||||
'end tag': '{/bl}', 'end html': '</span>', 'protected': True,
|
||||
'temporary': False})
|
||||
base_tags.append({'desc': translate('OpenLP.FormattingTags', 'Yellow'),
|
||||
base_tags.append({
|
||||
'desc': translate('OpenLP.FormattingTags', 'Yellow'),
|
||||
'start tag': '{y}',
|
||||
'start html': '<span style="-webkit-text-fill-color:yellow">',
|
||||
'end tag': '{/y}', 'end html': '</span>', 'protected': True,
|
||||
'temporary': False})
|
||||
base_tags.append({'desc': translate('OpenLP.FormattingTags', 'Green'),
|
||||
base_tags.append({
|
||||
'desc': translate('OpenLP.FormattingTags', 'Green'),
|
||||
'start tag': '{g}',
|
||||
'start html': '<span style="-webkit-text-fill-color:green">',
|
||||
'end tag': '{/g}', 'end html': '</span>', 'protected': True,
|
||||
'temporary': False})
|
||||
base_tags.append({'desc': translate('OpenLP.FormattingTags', 'Pink'),
|
||||
base_tags.append({
|
||||
'desc': translate('OpenLP.FormattingTags', 'Pink'),
|
||||
'start tag': '{pk}',
|
||||
'start html': '<span style="-webkit-text-fill-color:#FFC0CB">',
|
||||
'end tag': '{/pk}', 'end html': '</span>', 'protected': True,
|
||||
'temporary': False})
|
||||
base_tags.append({'desc': translate('OpenLP.FormattingTags', 'Orange'),
|
||||
base_tags.append({
|
||||
'desc': translate('OpenLP.FormattingTags', 'Orange'),
|
||||
'start tag': '{o}',
|
||||
'start html': '<span style="-webkit-text-fill-color:#FFA500">',
|
||||
'end tag': '{/o}', 'end html': '</span>', 'protected': True,
|
||||
'temporary': False})
|
||||
base_tags.append({'desc': translate('OpenLP.FormattingTags', 'Purple'),
|
||||
base_tags.append({
|
||||
'desc': translate('OpenLP.FormattingTags', 'Purple'),
|
||||
'start tag': '{pp}',
|
||||
'start html': '<span style="-webkit-text-fill-color:#800080">',
|
||||
'end tag': '{/pp}', 'end html': '</span>', 'protected': True,
|
||||
'temporary': False})
|
||||
base_tags.append({'desc': translate('OpenLP.FormattingTags', 'White'),
|
||||
base_tags.append({
|
||||
'desc': translate('OpenLP.FormattingTags', 'White'),
|
||||
'start tag': '{w}',
|
||||
'start html': '<span style="-webkit-text-fill-color:white">',
|
||||
'end tag': '{/w}', 'end html': '</span>', 'protected': True,
|
||||
@ -128,7 +137,8 @@ class FormattingTags(object):
|
||||
'start tag': '{p}', 'start html': '<p>', 'end tag': '{/p}',
|
||||
'end html': '</p>', 'protected': True,
|
||||
'temporary': False})
|
||||
base_tags.append({'desc': translate('OpenLP.FormattingTags', 'Bold'),
|
||||
base_tags.append({
|
||||
'desc': translate('OpenLP.FormattingTags', 'Bold'),
|
||||
'start tag': '{st}', 'start html': '<strong>',
|
||||
'end tag': '{/st}', 'end html': '</strong>',
|
||||
'protected': True, 'temporary': False})
|
||||
@ -142,9 +152,11 @@ class FormattingTags(object):
|
||||
'start html': '<span style="text-decoration: underline;">',
|
||||
'end tag': '{/u}', 'end html': '</span>', 'protected': True,
|
||||
'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': '',
|
||||
'end html': '', 'protected': True, 'temporary': False})
|
||||
'end html': '', 'protected': True,
|
||||
'temporary': False})
|
||||
FormattingTags.add_html_tags(base_tags)
|
||||
FormattingTags.add_html_tags(temporary_tags)
|
||||
user_expands_string = str(Settings().value('formattingTags/html_tags'))
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -576,7 +576,7 @@ def build_html(item, screen, is_live, background, image=None, plugins=None):
|
||||
"""
|
||||
width = screen['size'].width()
|
||||
height = screen['size'].height()
|
||||
theme_data = item.themedata
|
||||
theme_data = item.theme_data
|
||||
# Image generated and poked in
|
||||
if 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
|
||||
"""
|
||||
width = int(width) // 2
|
||||
theme = item.themedata
|
||||
theme = item.theme_data
|
||||
background = 'background-color: black'
|
||||
if theme:
|
||||
if theme.background_type == BackgroundType.to_string(BackgroundType.Transparent):
|
||||
@ -681,7 +681,7 @@ def build_lyrics_css(item):
|
||||
%s
|
||||
}
|
||||
"""
|
||||
theme_data = item.themedata
|
||||
theme_data = item.theme_data
|
||||
lyricstable = ''
|
||||
lyrics = ''
|
||||
lyricsmain = ''
|
||||
@ -769,7 +769,7 @@ def build_footer_css(item, height):
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
"""
|
||||
theme = item.themedata
|
||||
theme = item.theme_data
|
||||
if not theme or not item.footer:
|
||||
return ''
|
||||
bottom = height - int(item.footer.y()) - int(item.footer.height())
|
||||
|
@ -5,8 +5,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -45,8 +45,7 @@ class ListWidgetWithDnD(QtGui.QListWidget):
|
||||
Initialise the list widget
|
||||
"""
|
||||
super(ListWidgetWithDnD, self).__init__(parent)
|
||||
self.mimeDataText = name
|
||||
assert(self.mimeDataText)
|
||||
self.mime_data_text = name
|
||||
|
||||
def activateDnD(self):
|
||||
"""
|
||||
@ -54,7 +53,7 @@ class ListWidgetWithDnD(QtGui.QListWidget):
|
||||
"""
|
||||
self.setAcceptDrops(True)
|
||||
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):
|
||||
"""
|
||||
@ -68,9 +67,9 @@ class ListWidgetWithDnD(QtGui.QListWidget):
|
||||
event.ignore()
|
||||
return
|
||||
drag = QtGui.QDrag(self)
|
||||
mimeData = QtCore.QMimeData()
|
||||
drag.setMimeData(mimeData)
|
||||
mimeData.setText(self.mimeDataText)
|
||||
mime_data = QtCore.QMimeData()
|
||||
drag.setMimeData(mime_data)
|
||||
mime_data.setText(self.mime_data_text)
|
||||
drag.start(QtCore.Qt.CopyAction)
|
||||
|
||||
def dragEnterEvent(self, event):
|
||||
@ -104,13 +103,13 @@ class ListWidgetWithDnD(QtGui.QListWidget):
|
||||
event.accept()
|
||||
files = []
|
||||
for url in event.mimeData().urls():
|
||||
localFile = url.toLocalFile()
|
||||
if os.path.isfile(localFile):
|
||||
files.append(localFile)
|
||||
elif os.path.isdir(localFile):
|
||||
listing = os.listdir(localFile)
|
||||
local_file = url.toLocalFile()
|
||||
if os.path.isfile(local_file):
|
||||
files.append(local_file)
|
||||
elif os.path.isdir(local_file):
|
||||
listing = os.listdir(local_file)
|
||||
for file in listing:
|
||||
files.append(os.path.join(localFile, file))
|
||||
Registry().execute('%s_dnd' % self.mimeDataText, files)
|
||||
files.append(os.path.join(local_file, file))
|
||||
Registry().execute('%s_dnd' % self.mime_data_text, files)
|
||||
else:
|
||||
event.ignore()
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -291,15 +291,15 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
|
||||
def add_custom_context_actions(self):
|
||||
"""
|
||||
Implement this method in your descendent media manager item to
|
||||
add any context menu items. This method is called automatically.
|
||||
Implement this method in your descendant media manager item to add any context menu items.
|
||||
This method is called automatically.
|
||||
"""
|
||||
pass
|
||||
|
||||
def initialise(self):
|
||||
"""
|
||||
Implement this method in your descendent media manager item to
|
||||
do any UI or other initialisation. This method is called automatically.
|
||||
Implement this method in your descendant media manager item to do any UI or other initialisation.
|
||||
This method is called automatically.
|
||||
"""
|
||||
pass
|
||||
|
||||
@ -320,8 +320,9 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
Add a file to the list widget to make it available for showing
|
||||
"""
|
||||
files = FileDialog.getOpenFileNames(self, self.on_new_prompt,
|
||||
Settings().value(self.settings_section + '/last directory'), self.on_new_file_masks)
|
||||
log.info('New files(s) %s', files)
|
||||
Settings().value(self.settings_section + '/last directory'),
|
||||
self.on_new_file_masks)
|
||||
log.info('New files(s) %s' % files)
|
||||
if files:
|
||||
self.application.set_busy_cursor()
|
||||
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 not error_shown:
|
||||
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
|
||||
else:
|
||||
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())
|
||||
if duplicates_found:
|
||||
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):
|
||||
"""
|
||||
@ -411,12 +414,12 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
"""
|
||||
file_list = []
|
||||
for index in range(self.list_view.count()):
|
||||
bitem = self.list_view.item(index)
|
||||
filename = bitem.data(QtCore.Qt.UserRole)
|
||||
list_item = self.list_view.item(index)
|
||||
filename = list_item.data(QtCore.Qt.UserRole)
|
||||
file_list.append(filename)
|
||||
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.
|
||||
"""
|
||||
@ -477,9 +480,10 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
"""
|
||||
if not self.list_view.selectedIndexes() and not self.remote_triggered:
|
||||
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:
|
||||
log.debug('%s Preview requested', self.plugin.name)
|
||||
log.debug('%s Preview requested' % self.plugin.name)
|
||||
service_item = self.build_service_item()
|
||||
if service_item:
|
||||
service_item.from_plugin = True
|
||||
@ -493,7 +497,8 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
"""
|
||||
if not self.list_view.selectedIndexes():
|
||||
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:
|
||||
self.go_live()
|
||||
|
||||
@ -536,7 +541,8 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
"""
|
||||
if not self.list_view.selectedIndexes():
|
||||
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:
|
||||
# Is it possible to process multiple list items to generate
|
||||
# multiple service items?
|
||||
@ -578,14 +584,16 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
service_item = self.service_manager.get_service_item()
|
||||
if not service_item:
|
||||
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:
|
||||
self.generate_slide_data(service_item)
|
||||
self.service_manager.add_service_item(service_item, replace=True)
|
||||
else:
|
||||
# Turn off the remote edit update message indicator
|
||||
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):
|
||||
"""
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -227,29 +227,29 @@ class Plugin(QtCore.QObject):
|
||||
"""
|
||||
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.
|
||||
|
||||
``importMenu``
|
||||
``import_menu``
|
||||
The Import menu.
|
||||
"""
|
||||
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.
|
||||
|
||||
``exportMenu``
|
||||
``export_menu``
|
||||
The Export menu
|
||||
"""
|
||||
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.
|
||||
|
||||
``toolsMenu``
|
||||
``tools_menu``
|
||||
The Tools menu
|
||||
"""
|
||||
pass
|
||||
@ -261,7 +261,8 @@ class Plugin(QtCore.QObject):
|
||||
"""
|
||||
if self.settings_tab_class:
|
||||
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):
|
||||
"""
|
||||
@ -324,14 +325,14 @@ class Plugin(QtCore.QObject):
|
||||
"""
|
||||
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.
|
||||
|
||||
``oldTheme``
|
||||
``old_theme``
|
||||
The name of the theme the plugin should stop using.
|
||||
|
||||
``newTheme``
|
||||
``new_theme``
|
||||
The new name the plugin should now use.
|
||||
"""
|
||||
pass
|
||||
@ -365,9 +366,8 @@ class Plugin(QtCore.QObject):
|
||||
|
||||
def __set_name_text_string(self, name, title, tooltip):
|
||||
"""
|
||||
Utility method for creating a plugin's text_strings. This method makes
|
||||
use of the singular name of the plugin object so must only be called
|
||||
after this has been set.
|
||||
Utility method for creating a plugin's text_strings. This method makes use of the singular name of the
|
||||
plugin object so must only be called after this has been set.
|
||||
"""
|
||||
self.text_strings[name] = {'title': title, 'tooltip': tooltip}
|
||||
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -229,7 +229,7 @@ class Renderer(object):
|
||||
self.image_manager.add_image(
|
||||
theme_data.background_filename, ImageSource.Theme, QtGui.QColor(theme_data.background_border_color))
|
||||
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.footer = footer
|
||||
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)
|
||||
else:
|
||||
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):
|
||||
"""
|
||||
@ -400,8 +401,8 @@ class Renderer(object):
|
||||
</script><style>*{margin: 0; padding: 0; border: 0;}
|
||||
#main {position: absolute; top: 0px; %s %s}</style></head><body>
|
||||
<div id="main"></div></body></html>""" % \
|
||||
(build_lyrics_format_css(theme_data, self.page_width,
|
||||
self.page_height), build_lyrics_outline_css(theme_data))
|
||||
(build_lyrics_format_css(theme_data, self.page_width, self.page_height),
|
||||
build_lyrics_outline_css(theme_data))
|
||||
self.web.setHtml(html)
|
||||
self.empty_height = self.web_frame.contentsSize().height()
|
||||
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -90,17 +90,17 @@ class ScreenList(object):
|
||||
log.info('screen_resolution_changed %d' % number)
|
||||
for screen in self.screen_list:
|
||||
if number == screen['number']:
|
||||
newScreen = {
|
||||
new_screen = {
|
||||
'number': number,
|
||||
'size': self.desktop.screenGeometry(number),
|
||||
'primary': self.desktop.primaryScreen() == 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
|
||||
# update the override screen.
|
||||
if screen == self.override:
|
||||
self.override = copy.deepcopy(newScreen)
|
||||
self.override = copy.deepcopy(new_screen)
|
||||
self.set_override_display()
|
||||
Registry().execute('config_screen_changed')
|
||||
break
|
||||
@ -160,7 +160,7 @@ class ScreenList(object):
|
||||
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']:
|
||||
self.current = screen
|
||||
self.override = copy.deepcopy(self.current)
|
||||
@ -200,7 +200,7 @@ class ScreenList(object):
|
||||
``number``
|
||||
The screen number (int).
|
||||
"""
|
||||
log.debug('set_current_display %s', number)
|
||||
log.debug('set_current_display %s' % number)
|
||||
if number + 1 > self.display_count:
|
||||
self.current = self.screen_list[0]
|
||||
else:
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -161,7 +161,7 @@ class ServiceItem(object):
|
||||
self.capabilities = []
|
||||
self.is_valid = True
|
||||
self.icon = None
|
||||
self.themedata = None
|
||||
self.theme_data = None
|
||||
self.main = None
|
||||
self.footer = None
|
||||
self.bg_image_bytes = None
|
||||
@ -238,7 +238,7 @@ class ServiceItem(object):
|
||||
self.bg_image_bytes = None
|
||||
if not provides_own_theme_data:
|
||||
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:
|
||||
log.debug('Formatting slides: %s' % self.title)
|
||||
# Save rendered pages to this dict. In the case that a slide is used
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -125,7 +125,7 @@ class SettingsTab(QtGui.QWidget):
|
||||
"""
|
||||
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
|
||||
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -133,7 +133,7 @@ class SpellTextEdit(QtGui.QPlainTextEdit):
|
||||
"""
|
||||
self.dictionary = enchant.Dict(action.text())
|
||||
self.highlighter.spelling_dictionary = self.dictionary
|
||||
self.highlighter.highlightBlock(self.toPlainText())
|
||||
self.highlighter.highlight_block(self.toPlainText())
|
||||
self.highlighter.rehighlight()
|
||||
|
||||
def correct_word(self, word):
|
||||
@ -180,7 +180,7 @@ class Highlighter(QtGui.QSyntaxHighlighter):
|
||||
super(Highlighter, self).__init__(*args)
|
||||
self.spelling_dictionary = None
|
||||
|
||||
def highlightBlock(self, text):
|
||||
def highlight_block(self, text):
|
||||
"""
|
||||
Highlight misspelt words in a block of text.
|
||||
"""
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -260,7 +260,7 @@ class ThemeXML(object):
|
||||
# Create direction element
|
||||
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.
|
||||
|
||||
@ -273,7 +273,7 @@ class ThemeXML(object):
|
||||
# Create Filename element
|
||||
self.child_element(background, 'filename', filename)
|
||||
# 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',
|
||||
line_adjustment=0, xpos=0, ypos=0, width=0, height=0, outline='False', outline_color='#ffffff',
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -72,7 +72,7 @@ class OpenLPToolbar(QtGui.QToolBar):
|
||||
|
||||
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``
|
||||
A list of string with widget object names.
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -45,13 +45,12 @@ class TreeWidgetWithDnD(QtGui.QTreeWidget):
|
||||
Initialise the tree widget
|
||||
"""
|
||||
super(TreeWidgetWithDnD, self).__init__(parent)
|
||||
self.mimeDataText = name
|
||||
self.mime_data_text = name
|
||||
self.allow_internal_dnd = False
|
||||
self.header().close()
|
||||
self.default_indentation = self.indentation()
|
||||
self.setIndentation(0)
|
||||
self.setAnimated(True)
|
||||
assert(self.mimeDataText)
|
||||
|
||||
def activateDnD(self):
|
||||
"""
|
||||
@ -59,8 +58,8 @@ class TreeWidgetWithDnD(QtGui.QTreeWidget):
|
||||
"""
|
||||
self.setAcceptDrops(True)
|
||||
self.setDragDropMode(QtGui.QAbstractItemView.DragDrop)
|
||||
Registry().register_function(('%s_dnd' % self.mimeDataText), self.parent().load_file)
|
||||
Registry().register_function(('%s_dnd_internal' % self.mimeDataText), self.parent().dnd_move_internal)
|
||||
Registry().register_function(('%s_dnd' % self.mime_data_text), self.parent().load_file)
|
||||
Registry().register_function(('%s_dnd_internal' % self.mime_data_text), self.parent().dnd_move_internal)
|
||||
|
||||
def mouseMoveEvent(self, event):
|
||||
"""
|
||||
@ -77,9 +76,9 @@ class TreeWidgetWithDnD(QtGui.QTreeWidget):
|
||||
event.ignore()
|
||||
return
|
||||
drag = QtGui.QDrag(self)
|
||||
mimeData = QtCore.QMimeData()
|
||||
drag.setMimeData(mimeData)
|
||||
mimeData.setText(self.mimeDataText)
|
||||
mime_data = QtCore.QMimeData()
|
||||
drag.setMimeData(mime_data)
|
||||
mime_data.setText(self.mime_data_text)
|
||||
drag.start(QtCore.Qt.CopyAction)
|
||||
|
||||
def dragEnterEvent(self, event):
|
||||
@ -132,11 +131,11 @@ class TreeWidgetWithDnD(QtGui.QTreeWidget):
|
||||
listing = os.listdir(local_file)
|
||||
for file_name in listing:
|
||||
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:
|
||||
event.setDropAction(QtCore.Qt.CopyAction)
|
||||
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:
|
||||
event.ignore()
|
||||
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -131,7 +131,8 @@ def critical_error_message_box(title=None, message=None, parent=None, question=F
|
||||
"""
|
||||
if question:
|
||||
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)
|
||||
|
||||
|
||||
@ -293,9 +294,8 @@ def create_action(parent, name, **kwargs):
|
||||
if kwargs.get('triggers'):
|
||||
action.triggered.connect(kwargs.pop('triggers'))
|
||||
for key in list(kwargs.keys()):
|
||||
if key not in ['text', 'icon', 'tooltip', 'statustip', 'checked', 'can_shortcuts',
|
||||
'category', 'triggers']:
|
||||
log.warn('Parameter %s was not consumed in create_action().', key)
|
||||
if key not in ['text', 'icon', 'tooltip', 'statustip', 'checked', 'can_shortcuts', 'category', 'triggers']:
|
||||
log.warn('Parameter %s was not consumed in create_action().' % key)
|
||||
return action
|
||||
|
||||
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -272,8 +272,8 @@ class Ui_AboutDialog(object):
|
||||
self.about_notebook.setTabText(self.about_notebook.indexOf(self.credits_tab),
|
||||
translate('OpenLP.AboutForm', 'Credits'))
|
||||
copyright_note = translate('OpenLP.AboutForm',
|
||||
'Copyright \xa9 2004-2013 %s\n'
|
||||
'Portions copyright \xa9 2004-2013 %s') % ('Raoul Snyman',
|
||||
'Copyright \xa9 2004-2014 %s\n'
|
||||
'Portions copyright \xa9 2004-2014 %s') % ('Raoul Snyman',
|
||||
'Tim Bentley, Gerald Britton, Jonathan Corwin, Samuel Findlay, '
|
||||
'Michael Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, '
|
||||
'Armin K\xf6hler, Erik Lundin, Edwin Lunando, Joshua Miller, '
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -375,8 +375,7 @@ class AdvancedTab(SettingsTab):
|
||||
self.current_data_path = AppLocation.get_data_path()
|
||||
if not os.path.exists(self.current_data_path):
|
||||
log.error('Data path not found %s' % self.current_data_path)
|
||||
answer = QtGui.QMessageBox.critical(self,
|
||||
translate('OpenLP.AdvancedTab', 'Data Directory Error'),
|
||||
answer = QtGui.QMessageBox.critical(self, translate('OpenLP.AdvancedTab', 'Data Directory Error'),
|
||||
translate('OpenLP.AdvancedTab', 'OpenLP data directory was not found\n\n%s\n\n'
|
||||
'This data directory was previously changed from the OpenLP '
|
||||
'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())
|
||||
# Get the new directory location.
|
||||
new_data_path = QtGui.QFileDialog.getExistingDirectory(
|
||||
self, translate('OpenLP.AdvancedTab', 'Select Data Directory Location'), old_root_path,
|
||||
options=QtGui.QFileDialog.ShowDirsOnly)
|
||||
new_data_path = QtGui.QFileDialog.getExistingDirectory(self, translate('OpenLP.AdvancedTab',
|
||||
'Select Data Directory Location'),
|
||||
old_root_path, options=QtGui.QFileDialog.ShowDirsOnly)
|
||||
# Set the new data path.
|
||||
if new_data_path:
|
||||
new_data_path = os.path.normpath(new_data_path)
|
||||
@ -536,12 +535,13 @@ class AdvancedTab(SettingsTab):
|
||||
else:
|
||||
return
|
||||
# Make sure they want to change the data.
|
||||
answer = QtGui.QMessageBox.question(self,
|
||||
translate('OpenLP.AdvancedTab', 'Confirm Data Directory Change'),
|
||||
translate('OpenLP.AdvancedTab', 'Are you sure you want to change the location of the OpenLP '
|
||||
'data directory to:\n\n%s\n\n '
|
||||
'The data directory will be changed when OpenLP is closed.').replace('%s', new_data_path),
|
||||
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes | QtGui.QMessageBox.No), QtGui.QMessageBox.No)
|
||||
answer = QtGui.QMessageBox.question(self, translate('OpenLP.AdvancedTab', 'Confirm Data Directory Change'),
|
||||
translate('OpenLP.AdvancedTab', 'Are you sure you want to change the '
|
||||
'location of the OpenLP data directory to:\n\n%s\n\nThe data directory '
|
||||
'will be changed when OpenLP is closed.').replace('%s', new_data_path),
|
||||
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes |
|
||||
QtGui.QMessageBox.No),
|
||||
QtGui.QMessageBox.No)
|
||||
if answer != QtGui.QMessageBox.Yes:
|
||||
return
|
||||
# Check if data already exists here.
|
||||
@ -559,11 +559,13 @@ class AdvancedTab(SettingsTab):
|
||||
if self.current_data_path.lower() != new_data_path.lower():
|
||||
# Make sure they want to change the data location back to the
|
||||
# default.
|
||||
answer = QtGui.QMessageBox.question(self,
|
||||
translate('OpenLP.AdvancedTab', 'Reset Data Directory'),
|
||||
translate('OpenLP.AdvancedTab', 'Are you sure you want to change the location of the OpenLP '
|
||||
'data directory to the default location?\n\nThis location will be used after OpenLP is closed.'),
|
||||
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes | QtGui.QMessageBox.No), QtGui.QMessageBox.No)
|
||||
answer = QtGui.QMessageBox.question(self, translate('OpenLP.AdvancedTab', 'Reset Data Directory'),
|
||||
translate('OpenLP.AdvancedTab', 'Are you sure you want to change the '
|
||||
'location of the OpenLP data directory to the default location?\n\nThis'
|
||||
' location will be used after OpenLP is closed.'),
|
||||
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes |
|
||||
QtGui.QMessageBox.No),
|
||||
QtGui.QMessageBox.No)
|
||||
if answer != QtGui.QMessageBox.Yes:
|
||||
return
|
||||
self.check_data_overwrite(new_data_path)
|
||||
@ -597,10 +599,14 @@ class AdvancedTab(SettingsTab):
|
||||
# Check is they want to replace existing data.
|
||||
answer = QtGui.QMessageBox.warning(self,
|
||||
translate('OpenLP.AdvancedTab', 'Overwrite Existing Data'),
|
||||
translate('OpenLP.AdvancedTab', 'WARNING: \n\nThe location you have selected \n\n%s\n\n'
|
||||
'appears to contain OpenLP data files. Do you wish to 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)
|
||||
translate('OpenLP.AdvancedTab',
|
||||
'WARNING: \n\nThe location you have selected \n\n%s\n\n'
|
||||
'appears to contain OpenLP data files. Do you wish to '
|
||||
'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:
|
||||
self.data_directory_copy_check_box.setChecked(True)
|
||||
self.new_data_directory_has_files_label.show()
|
||||
@ -638,9 +644,9 @@ class AdvancedTab(SettingsTab):
|
||||
``checked``
|
||||
The state of the check box (boolean).
|
||||
"""
|
||||
QtGui.QMessageBox.information(self,
|
||||
translate('OpenLP.AdvancedTab', 'Restart Required'),
|
||||
translate('OpenLP.AdvancedTab', 'This change will only take effect once OpenLP has been restarted.'))
|
||||
QtGui.QMessageBox.information(self, translate('OpenLP.AdvancedTab', 'Restart Required'),
|
||||
translate('OpenLP.AdvancedTab', 'This change will only take effect once OpenLP '
|
||||
'has been restarted.'))
|
||||
|
||||
def on_end_slide_button_clicked(self):
|
||||
"""
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -75,13 +75,17 @@ class Ui_ExceptionDialog(object):
|
||||
self.exception_text_edit.setObjectName('exception_text_edit')
|
||||
self.exception_layout.addWidget(self.exception_text_edit)
|
||||
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',
|
||||
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',
|
||||
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',
|
||||
['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.retranslateUi(exception_dialog)
|
||||
@ -93,8 +97,8 @@ class Ui_ExceptionDialog(object):
|
||||
"""
|
||||
exception_dialog.setWindowTitle(translate('OpenLP.ExceptionDialog', 'Error Occurred'))
|
||||
self.description_explanation.setText(translate('OpenLP.ExceptionDialog',
|
||||
'Please enter a description of what you were doing to cause this '
|
||||
'error \n(Minimum 20 characters)'))
|
||||
'Please enter a description of what you were doing to cause this error '
|
||||
'\n(Minimum 20 characters)'))
|
||||
self.message_label.setText(translate('OpenLP.ExceptionDialog', 'Oops! '
|
||||
'OpenLP hit a problem, and couldn\'t recover. The text in the box '
|
||||
'below contains information that might be helpful to the OpenLP '
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -144,7 +144,7 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog):
|
||||
system += 'Desktop: GNOME\n'
|
||||
elif os.environ.get('DESKTOP_SESSION') == 'xfce':
|
||||
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):
|
||||
"""
|
||||
@ -202,12 +202,12 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog):
|
||||
if ':' in line:
|
||||
exception = line.split('\n')[-1].split(':')[0]
|
||||
subject = 'Bug report: %s in %s' % (exception, source)
|
||||
mailto_url = QtCore.QUrl('mailto:bugs@openlp.org')
|
||||
mailto_url.addQueryItem('subject', subject)
|
||||
mailto_url.addQueryItem('body', body % content)
|
||||
mail_to_url = QtCore.QUrl('mailto:bugs@openlp.org')
|
||||
mail_to_url.addQueryItem('subject', subject)
|
||||
mail_to_url.addQueryItem('body', body % content)
|
||||
if self.file_attachment:
|
||||
mailto_url.addQueryItem('attach', self.file_attachment)
|
||||
QtGui.QDesktopServices.openUrl(mailto_url)
|
||||
mail_to_url.addQueryItem('attach', self.file_attachment)
|
||||
QtGui.QDesktopServices.openUrl(mail_to_url)
|
||||
|
||||
def on_description_updated(self):
|
||||
"""
|
||||
@ -226,9 +226,9 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog):
|
||||
"""
|
||||
Attache files to the bug report e-mail.
|
||||
"""
|
||||
files = QtGui.QFileDialog.getOpenFileName(
|
||||
self, translate('ImagePlugin.ExceptionDialog', 'Select Attachment'),
|
||||
Settings().value(self.settings_section + '/last directory'), '%s (*.*) (*)' % UiStrings().AllFiles)
|
||||
files = QtGui.QFileDialog.getOpenFileName(self, translate('ImagePlugin.ExceptionDialog', 'Select Attachment'),
|
||||
Settings().value(self.settings_section + '/last directory'),
|
||||
'%s (*.*) (*)' % UiStrings().AllFiles)
|
||||
log.info('New files(s) %s', str(files))
|
||||
if files:
|
||||
self.file_attachment = str(files)
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -137,13 +137,13 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
|
||||
bible_languages = bible_languages.split(',')
|
||||
for lang in bible_languages:
|
||||
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 = bibles.split(',')
|
||||
for bible in bibles:
|
||||
title = self.config.get('bible_%s' % bible, 'title')
|
||||
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.setCheckState(0, QtCore.Qt.Unchecked)
|
||||
item.setFlags(item.flags() | QtCore.Qt.ItemIsUserCheckable)
|
||||
@ -239,7 +239,8 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
|
||||
"""
|
||||
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()
|
||||
sys.exit()
|
||||
self.was_download_cancelled = True
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -46,9 +46,9 @@ class FirstTimeLanguageForm(QtGui.QDialog, Ui_FirstTimeLanguageDialog):
|
||||
"""
|
||||
super(FirstTimeLanguageForm, self).__init__(parent)
|
||||
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.addItems(sorted(self.qmList.keys()))
|
||||
self.language_combo_box.addItems(sorted(self.qm_list.keys()))
|
||||
|
||||
def exec_(self):
|
||||
"""
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -212,7 +212,8 @@ class Ui_FirstTimeWizard(object):
|
||||
self.title_label.setText('<span style="font-size:14pt; font-weight:600;">%s</span>' %
|
||||
translate('OpenLP.FirstTimeWizard', 'Welcome to the First Time Wizard'))
|
||||
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.setSubTitle(translate('OpenLP.FirstTimeWizard', 'Select the Plugins you wish to use. '))
|
||||
self.songs_check_box.setText(translate('OpenLP.FirstTimeWizard', 'Songs'))
|
||||
@ -231,13 +232,15 @@ class Ui_FirstTimeWizard(object):
|
||||
self.no_internet_page.setSubTitle(
|
||||
translate('OpenLP.FirstTimeWizard', 'Unable to detect an Internet connection.'))
|
||||
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 '
|
||||
'to download sample songs, Bibles and themes. Click the Finish button now to start OpenLP with initial '
|
||||
'settings and no sample data.\n\nTo re-run the First Time Wizard and import this sample data at a later '
|
||||
'time, check your Internet connection and re-run this wizard by selecting "Tools/Re-run First Time Wizard" '
|
||||
'from OpenLP.')
|
||||
'No Internet connection was found. The First Time Wizard needs an Internet '
|
||||
'connection in order to be able to download sample songs, Bibles and themes.'
|
||||
' Click the Finish button now to start OpenLP with initial settings and '
|
||||
'no sample data.\n\nTo re-run the First Time Wizard and import this sample '
|
||||
'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',
|
||||
'\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.setSubTitle(translate('OpenLP.FirstTimeWizard', 'Select and download public domain songs.'))
|
||||
self.bibles_page.setTitle(translate('OpenLP.FirstTimeWizard', 'Sample Bibles'))
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -45,7 +45,8 @@ class FormattingTagController(object):
|
||||
"""
|
||||
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<cdata>!\[CDATA\[(?:(?!\]\]>).)*\]\])'
|
||||
r'|(?P<procinst>\?(?:(?!\?>).)*\?)'
|
||||
@ -76,12 +77,12 @@ class FormattingTagController(object):
|
||||
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:
|
||||
return translate('OpenLP.FormattingTagForm', 'Tag %s already defined.') % tag
|
||||
if self._strip(html1['desc']) == desc:
|
||||
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:
|
||||
return translate('OpenLP.FormattingTagForm', 'Tag %s already defined.') % tag
|
||||
if self._strip(html1['desc']) == desc:
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -93,7 +93,8 @@ class FormattingTagForm(QtGui.QDialog, Ui_FormattingTagDialog, FormattingTagCont
|
||||
new_row = self.tag_table_widget.rowCount()
|
||||
self.tag_table_widget.insertRow(new_row)
|
||||
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, 2,
|
||||
QtGui.QTableWidgetItem(translate('OpenLP.FormattingTagForm', '<HTML here>')))
|
||||
@ -119,11 +120,12 @@ class FormattingTagForm(QtGui.QDialog, Ui_FormattingTagDialog, FormattingTagCont
|
||||
self.services.pre_save()
|
||||
while count < self.tag_table_widget.rowCount():
|
||||
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())
|
||||
if error:
|
||||
QtGui.QMessageBox.warning(self,
|
||||
translate('OpenLP.FormattingTagForm', 'Validation Error'), error, QtGui.QMessageBox.Ok)
|
||||
QtGui.QMessageBox.warning(self, translate('OpenLP.FormattingTagForm', 'Validation Error'), error,
|
||||
QtGui.QMessageBox.Ok)
|
||||
self.tag_table_widget.selectRow(count)
|
||||
return
|
||||
count += 1
|
||||
@ -141,7 +143,7 @@ class FormattingTagForm(QtGui.QDialog, Ui_FormattingTagDialog, FormattingTagCont
|
||||
self.tag_table_widget.setRowCount(0)
|
||||
self.new_button.setEnabled(True)
|
||||
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']:
|
||||
line = self.tag_table_widget_read.rowCount()
|
||||
self.tag_table_widget_read.setRowCount(line + 1)
|
||||
@ -198,8 +200,8 @@ class FormattingTagForm(QtGui.QDialog, Ui_FormattingTagDialog, FormattingTagCont
|
||||
if tag:
|
||||
self.tag_table_widget.setItem(pre_row, 3, QtGui.QTableWidgetItem(tag))
|
||||
if errors:
|
||||
QtGui.QMessageBox.warning(self,
|
||||
translate('OpenLP.FormattingTagForm', 'Validation Error'), errors, QtGui.QMessageBox.Ok)
|
||||
QtGui.QMessageBox.warning(self, translate('OpenLP.FormattingTagForm', 'Validation Error'), errors,
|
||||
QtGui.QMessageBox.Ok)
|
||||
#self.tag_table_widget.selectRow(pre_row - 1)
|
||||
self.tag_table_widget.resizeRowsToContents()
|
||||
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -248,8 +248,8 @@ class GeneralTab(SettingsTab):
|
||||
settings.beginGroup(self.settings_section)
|
||||
self.monitor_combo_box.clear()
|
||||
self.monitor_combo_box.addItems(self.screens.get_screen_list())
|
||||
monitorNumber = settings.value('monitor')
|
||||
self.monitor_combo_box.setCurrentIndex(monitorNumber)
|
||||
monitor_number = settings.value('monitor')
|
||||
self.monitor_combo_box.setCurrentIndex(monitor_number)
|
||||
self.number_edit.setText(settings.value('ccli number'))
|
||||
self.username_edit.setText(settings.value('songselect username'))
|
||||
self.password_edit.setText(settings.value('songselect password'))
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -75,9 +75,9 @@ class ListPreviewWidget(QtGui.QTableWidget):
|
||||
self.resizeRowsToContents()
|
||||
else:
|
||||
# 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
|
||||
self.setRowHeight(framenumber, height)
|
||||
self.setRowHeight(frame_number, height)
|
||||
|
||||
def screen_size_changed(self, screen_ratio):
|
||||
"""
|
||||
@ -87,7 +87,7 @@ class ListPreviewWidget(QtGui.QTableWidget):
|
||||
self.screen_ratio = screen_ratio
|
||||
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.
|
||||
Displays the given slide.
|
||||
@ -98,7 +98,7 @@ class ListPreviewWidget(QtGui.QTableWidget):
|
||||
self.setColumnWidth(0, width)
|
||||
row = 0
|
||||
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)
|
||||
item = QtGui.QTableWidgetItem()
|
||||
slide_height = 0
|
||||
@ -124,19 +124,19 @@ class ListPreviewWidget(QtGui.QTableWidget):
|
||||
else:
|
||||
image = self.image_manager.get_image(frame['path'], ImageSource.ImagePlugin)
|
||||
label.setPixmap(QtGui.QPixmap.fromImage(image))
|
||||
self.setCellWidget(framenumber, 0, label)
|
||||
self.setCellWidget(frame_number, 0, label)
|
||||
slide_height = width // self.screen_ratio
|
||||
row += 1
|
||||
text.append(str(row))
|
||||
self.setItem(framenumber, 0, item)
|
||||
self.setItem(frame_number, 0, item)
|
||||
if slide_height:
|
||||
self.setRowHeight(framenumber, slide_height)
|
||||
self.setRowHeight(frame_number, slide_height)
|
||||
self.setVerticalHeaderLabels(text)
|
||||
if self.service_item.is_text():
|
||||
self.resizeRowsToContents()
|
||||
self.setColumnWidth(0, self.viewport().width())
|
||||
self.setFocus()
|
||||
self.change_slide(slideNumber)
|
||||
self.change_slide(slide_number)
|
||||
|
||||
def change_slide(self, slide):
|
||||
"""
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -283,7 +283,7 @@ class MainDisplay(Display):
|
||||
if not hasattr(self, 'service_item'):
|
||||
return False
|
||||
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)
|
||||
# Update the preview frame.
|
||||
if self.is_live:
|
||||
@ -343,7 +343,7 @@ class MainDisplay(Display):
|
||||
if self.is_live and hasattr(self, 'service_item'):
|
||||
# Wait for the fade to finish before geting the preview.
|
||||
# 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()'):
|
||||
self.application.process_events()
|
||||
# Wait for the webview to update before getting the preview.
|
||||
@ -383,17 +383,17 @@ class MainDisplay(Display):
|
||||
Registry().execute('video_background_replaced')
|
||||
self.override = {}
|
||||
# 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')
|
||||
self.override = {}
|
||||
else:
|
||||
# replace the background
|
||||
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))
|
||||
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.themedata.background_filename, ImageSource.Theme
|
||||
self.service_item.theme_data.background_filename, ImageSource.Theme
|
||||
)
|
||||
if image_path:
|
||||
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')
|
||||
super(AudioPlayer, self).__init__(parent)
|
||||
self.currentIndex = -1
|
||||
self.current_index = -1
|
||||
self.playlist = []
|
||||
self.repeat = False
|
||||
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
|
||||
item in the playlist, if there is one.
|
||||
"""
|
||||
self.currentIndex += 1
|
||||
if len(self.playlist) > self.currentIndex:
|
||||
self.media_object.enqueue(self.playlist[self.currentIndex])
|
||||
self.current_index += 1
|
||||
if len(self.playlist) > self.current_index:
|
||||
self.media_object.enqueue(self.playlist[self.current_index])
|
||||
|
||||
def on_finished(self):
|
||||
"""
|
||||
@ -570,7 +570,7 @@ class AudioPlayer(QtCore.QObject):
|
||||
log.debug('Repeat is enabled... here we go again!')
|
||||
self.media_object.clearQueue()
|
||||
self.media_object.clear()
|
||||
self.currentIndex = -1
|
||||
self.current_index = -1
|
||||
self.play()
|
||||
|
||||
def connectVolumeSlider(self, slider):
|
||||
@ -583,7 +583,7 @@ class AudioPlayer(QtCore.QObject):
|
||||
"""
|
||||
Reset the audio player, clearing the playlist and the queue.
|
||||
"""
|
||||
self.currentIndex = -1
|
||||
self.current_index = -1
|
||||
self.playlist = []
|
||||
self.stop()
|
||||
self.media_object.clear()
|
||||
@ -593,7 +593,7 @@ class AudioPlayer(QtCore.QObject):
|
||||
We want to play the file so start it
|
||||
"""
|
||||
log.debug('AudioPlayer.play() called')
|
||||
if self.currentIndex == -1:
|
||||
if self.current_index == -1:
|
||||
self.on_about_to_finish()
|
||||
self.media_object.play()
|
||||
|
||||
@ -611,43 +611,43 @@ class AudioPlayer(QtCore.QObject):
|
||||
log.debug('AudioPlayer.stop() called')
|
||||
self.media_object.stop()
|
||||
|
||||
def add_to_playlist(self, filenames):
|
||||
def add_to_playlist(self, file_names):
|
||||
"""
|
||||
Add another file to the playlist.
|
||||
|
||||
``filenames``
|
||||
``file_names``
|
||||
A list with files to be added to the playlist.
|
||||
"""
|
||||
if not isinstance(filenames, list):
|
||||
filenames = [filenames]
|
||||
self.playlist.extend(list(map(Phonon.MediaSource, filenames)))
|
||||
if not isinstance(file_names, list):
|
||||
file_names = [file_names]
|
||||
self.playlist.extend(list(map(Phonon.MediaSource, file_names)))
|
||||
|
||||
def next(self):
|
||||
"""
|
||||
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
|
||||
isPlaying = self.media_object.state() == Phonon.PlayingState
|
||||
self.currentIndex += 1
|
||||
if self.repeat and self.currentIndex == len(self.playlist):
|
||||
self.currentIndex = 0
|
||||
is_playing = self.media_object.state() == Phonon.PlayingState
|
||||
self.current_index += 1
|
||||
if self.repeat and self.current_index == len(self.playlist):
|
||||
self.current_index = 0
|
||||
self.media_object.clearQueue()
|
||||
self.media_object.clear()
|
||||
self.media_object.enqueue(self.playlist[self.currentIndex])
|
||||
if isPlaying:
|
||||
self.media_object.enqueue(self.playlist[self.current_index])
|
||||
if is_playing:
|
||||
self.media_object.play()
|
||||
|
||||
def go_to(self, index):
|
||||
"""
|
||||
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.clear()
|
||||
self.currentIndex = index
|
||||
self.media_object.enqueue(self.playlist[self.currentIndex])
|
||||
if isPlaying:
|
||||
self.current_index = index
|
||||
self.media_object.enqueue(self.playlist[self.current_index])
|
||||
if is_playing:
|
||||
self.media_object.play()
|
||||
|
||||
def connectSlot(self, signal, slot):
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Eric Ludin, Edwin Lunando, Brian T. Meyer, #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
4
openlp/core/ui/media/vendor/__init__.py
vendored
4
openlp/core/ui/media/vendor/__init__.py
vendored
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Eric Ludin, Edwin Lunando, Brian T. Meyer, #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -45,38 +45,38 @@ class Ui_PluginViewDialog(object):
|
||||
"""
|
||||
pluginViewDialog.setObjectName('pluginViewDialog')
|
||||
pluginViewDialog.setWindowModality(QtCore.Qt.ApplicationModal)
|
||||
self.pluginLayout = QtGui.QVBoxLayout(pluginViewDialog)
|
||||
self.pluginLayout.setObjectName('pluginLayout')
|
||||
self.listLayout = QtGui.QHBoxLayout()
|
||||
self.listLayout.setObjectName('listLayout')
|
||||
self.pluginListWidget = QtGui.QListWidget(pluginViewDialog)
|
||||
self.pluginListWidget.setObjectName('pluginListWidget')
|
||||
self.listLayout.addWidget(self.pluginListWidget)
|
||||
self.pluginInfoGroupBox = QtGui.QGroupBox(pluginViewDialog)
|
||||
self.pluginInfoGroupBox.setObjectName('pluginInfoGroupBox')
|
||||
self.pluginInfoLayout = QtGui.QFormLayout(self.pluginInfoGroupBox)
|
||||
self.pluginInfoLayout.setObjectName('pluginInfoLayout')
|
||||
self.statusLabel = QtGui.QLabel(self.pluginInfoGroupBox)
|
||||
self.statusLabel.setObjectName('statusLabel')
|
||||
self.statusComboBox = QtGui.QComboBox(self.pluginInfoGroupBox)
|
||||
self.statusComboBox.addItems(('', ''))
|
||||
self.statusComboBox.setObjectName('statusComboBox')
|
||||
self.pluginInfoLayout.addRow(self.statusLabel, self.statusComboBox)
|
||||
self.versionLabel = QtGui.QLabel(self.pluginInfoGroupBox)
|
||||
self.versionLabel.setObjectName('versionLabel')
|
||||
self.versionNumberLabel = QtGui.QLabel(self.pluginInfoGroupBox)
|
||||
self.versionNumberLabel.setObjectName('versionNumberLabel')
|
||||
self.pluginInfoLayout.addRow(self.versionLabel, self.versionNumberLabel)
|
||||
self.aboutLabel = QtGui.QLabel(self.pluginInfoGroupBox)
|
||||
self.aboutLabel.setObjectName('aboutLabel')
|
||||
self.aboutTextBrowser = QtGui.QTextBrowser(self.pluginInfoGroupBox)
|
||||
self.aboutTextBrowser.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse)
|
||||
self.aboutTextBrowser.setObjectName('aboutTextBrowser')
|
||||
self.pluginInfoLayout.addRow(self.aboutLabel, self.aboutTextBrowser)
|
||||
self.listLayout.addWidget(self.pluginInfoGroupBox)
|
||||
self.pluginLayout.addLayout(self.listLayout)
|
||||
self.plugin_layout = QtGui.QVBoxLayout(pluginViewDialog)
|
||||
self.plugin_layout.setObjectName('plugin_layout')
|
||||
self.list_layout = QtGui.QHBoxLayout()
|
||||
self.list_layout.setObjectName('list_layout')
|
||||
self.plugin_list_widget = QtGui.QListWidget(pluginViewDialog)
|
||||
self.plugin_list_widget.setObjectName('plugin_list_widget')
|
||||
self.list_layout.addWidget(self.plugin_list_widget)
|
||||
self.plugin_info_group_box = QtGui.QGroupBox(pluginViewDialog)
|
||||
self.plugin_info_group_box.setObjectName('plugin_info_group_box')
|
||||
self.plugin_info_layout = QtGui.QFormLayout(self.plugin_info_group_box)
|
||||
self.plugin_info_layout.setObjectName('plugin_info_layout')
|
||||
self.status_label = QtGui.QLabel(self.plugin_info_group_box)
|
||||
self.status_label.setObjectName('status_label')
|
||||
self.status_combo_box = QtGui.QComboBox(self.plugin_info_group_box)
|
||||
self.status_combo_box.addItems(('', ''))
|
||||
self.status_combo_box.setObjectName('status_combo_box')
|
||||
self.plugin_info_layout.addRow(self.status_label, self.status_combo_box)
|
||||
self.version_label = QtGui.QLabel(self.plugin_info_group_box)
|
||||
self.version_label.setObjectName('version_label')
|
||||
self.version_number_label = QtGui.QLabel(self.plugin_info_group_box)
|
||||
self.version_number_label.setObjectName('version_number_label')
|
||||
self.plugin_info_layout.addRow(self.version_label, self.version_number_label)
|
||||
self.about_label = QtGui.QLabel(self.plugin_info_group_box)
|
||||
self.about_label.setObjectName('about_label')
|
||||
self.about_text_browser = QtGui.QTextBrowser(self.plugin_info_group_box)
|
||||
self.about_text_browser.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse)
|
||||
self.about_text_browser.setObjectName('aboutTextBrowser')
|
||||
self.plugin_info_layout.addRow(self.about_label, self.about_text_browser)
|
||||
self.list_layout.addWidget(self.plugin_info_group_box)
|
||||
self.plugin_layout.addLayout(self.list_layout)
|
||||
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)
|
||||
|
||||
def retranslateUi(self, pluginViewDialog):
|
||||
@ -84,9 +84,9 @@ class Ui_PluginViewDialog(object):
|
||||
Translate the UI on the fly
|
||||
"""
|
||||
pluginViewDialog.setWindowTitle(translate('OpenLP.PluginForm', 'Plugin List'))
|
||||
self.pluginInfoGroupBox.setTitle(translate('OpenLP.PluginForm', 'Plugin Details'))
|
||||
self.versionLabel.setText('%s:' % UiStrings().Version)
|
||||
self.aboutLabel.setText('%s:' % UiStrings().About)
|
||||
self.statusLabel.setText(translate('OpenLP.PluginForm', 'Status:'))
|
||||
self.statusComboBox.setItemText(0, translate('OpenLP.PluginForm', 'Active'))
|
||||
self.statusComboBox.setItemText(1, translate('OpenLP.PluginForm', 'Inactive'))
|
||||
self.plugin_info_group_box.setTitle(translate('OpenLP.PluginForm', 'Plugin Details'))
|
||||
self.version_label.setText('%s:' % UiStrings().Version)
|
||||
self.about_label.setText('%s:' % UiStrings().About)
|
||||
self.status_label.setText(translate('OpenLP.PluginForm', 'Status:'))
|
||||
self.status_combo_box.setItemText(0, translate('OpenLP.PluginForm', 'Active'))
|
||||
self.status_combo_box.setItemText(1, translate('OpenLP.PluginForm', 'Inactive'))
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -50,26 +50,26 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
|
||||
Constructor
|
||||
"""
|
||||
super(PluginForm, self).__init__(parent)
|
||||
self.activePlugin = None
|
||||
self.programaticChange = False
|
||||
self.active_plugin = None
|
||||
self.programatic_change = False
|
||||
self.setupUi(self)
|
||||
self.load()
|
||||
self._clearDetails()
|
||||
self._clear_details()
|
||||
# Right, now let's put some signals and slots together!
|
||||
self.pluginListWidget.itemSelectionChanged.connect(self.onPluginListWidgetSelectionChanged)
|
||||
self.statusComboBox.currentIndexChanged.connect(self.onStatusComboBoxChanged)
|
||||
self.plugin_list_widget.itemSelectionChanged.connect(self.on_plugin_list_widget_selection_changed)
|
||||
self.status_combo_box.currentIndexChanged.connect(self.on_status_combo_box_changed)
|
||||
|
||||
def load(self):
|
||||
"""
|
||||
Load the plugin details into the screen
|
||||
"""
|
||||
self.pluginListWidget.clear()
|
||||
self.programaticChange = True
|
||||
self._clearDetails()
|
||||
self.programaticChange = True
|
||||
pluginListWidth = 0
|
||||
self.plugin_list_widget.clear()
|
||||
self.programatic_change = True
|
||||
self._clear_details()
|
||||
self.programatic_change = True
|
||||
plugin_list_width = 0
|
||||
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
|
||||
# sometimes when it's loaded from the config, it isn't cast to int.
|
||||
plugin.status = int(plugin.status)
|
||||
@ -85,76 +85,76 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
|
||||
# If the plugin has an icon, set it!
|
||||
if plugin.icon:
|
||||
item.setIcon(plugin.icon)
|
||||
self.pluginListWidget.addItem(item)
|
||||
pluginListWidth = max(pluginListWidth, self.fontMetrics().width(
|
||||
self.plugin_list_widget.addItem(item)
|
||||
plugin_list_width = max(plugin_list_width, self.fontMetrics().width(
|
||||
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
|
||||
"""
|
||||
self.statusComboBox.setCurrentIndex(-1)
|
||||
self.versionNumberLabel.setText('')
|
||||
self.aboutTextBrowser.setHtml('')
|
||||
self.statusComboBox.setEnabled(False)
|
||||
self.status_combo_box.setCurrentIndex(-1)
|
||||
self.version_number_label.setText('')
|
||||
self.about_text_browser.setHtml('')
|
||||
self.status_combo_box.setEnabled(False)
|
||||
|
||||
def _setDetails(self):
|
||||
def _set_details(self):
|
||||
"""
|
||||
Set the details of the currently selected plugin
|
||||
"""
|
||||
log.debug('PluginStatus: %s', str(self.activePlugin.status))
|
||||
self.versionNumberLabel.setText(self.activePlugin.version)
|
||||
self.aboutTextBrowser.setHtml(self.activePlugin.about())
|
||||
self.programaticChange = True
|
||||
log.debug('PluginStatus: %s', str(self.active_plugin.status))
|
||||
self.version_number_label.setText(self.active_plugin.version)
|
||||
self.about_text_browser.setHtml(self.active_plugin.about())
|
||||
self.programatic_change = True
|
||||
status = PluginStatus.Active
|
||||
if self.activePlugin.status == PluginStatus.Active:
|
||||
if self.active_plugin.status == PluginStatus.Active:
|
||||
status = PluginStatus.Inactive
|
||||
self.statusComboBox.setCurrentIndex(status)
|
||||
self.statusComboBox.setEnabled(True)
|
||||
self.programaticChange = False
|
||||
self.status_combo_box.setCurrentIndex(status)
|
||||
self.status_combo_box.setEnabled(True)
|
||||
self.programatic_change = False
|
||||
|
||||
def onPluginListWidgetSelectionChanged(self):
|
||||
def on_plugin_list_widget_selection_changed(self):
|
||||
"""
|
||||
If the selected plugin changes, update the form
|
||||
"""
|
||||
if self.pluginListWidget.currentItem() is None:
|
||||
self._clearDetails()
|
||||
if self.plugin_list_widget.currentItem() is None:
|
||||
self._clear_details()
|
||||
return
|
||||
plugin_name_singular = self.pluginListWidget.currentItem().text().split('(')[0][:-1]
|
||||
self.activePlugin = None
|
||||
plugin_name_singular = self.plugin_list_widget.currentItem().text().split('(')[0][:-1]
|
||||
self.active_plugin = None
|
||||
for plugin in self.plugin_manager.plugins:
|
||||
if plugin.status != PluginStatus.Disabled:
|
||||
if plugin.name_strings['singular'] == plugin_name_singular:
|
||||
self.activePlugin = plugin
|
||||
self.active_plugin = plugin
|
||||
break
|
||||
if self.activePlugin:
|
||||
self._setDetails()
|
||||
if self.active_plugin:
|
||||
self._set_details()
|
||||
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 self.programaticChange or status == PluginStatus.Disabled:
|
||||
if self.programatic_change or status == PluginStatus.Disabled:
|
||||
return
|
||||
if status == PluginStatus.Inactive:
|
||||
self.application.set_busy_cursor()
|
||||
self.activePlugin.toggle_status(PluginStatus.Active)
|
||||
self.active_plugin.toggle_status(PluginStatus.Active)
|
||||
self.application.set_normal_cursor()
|
||||
self.activePlugin.app_startup()
|
||||
self.active_plugin.app_startup()
|
||||
else:
|
||||
self.activePlugin.toggle_status(PluginStatus.Inactive)
|
||||
self.active_plugin.toggle_status(PluginStatus.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)')
|
||||
elif self.activePlugin.status == PluginStatus.Inactive:
|
||||
elif self.active_plugin.status == PluginStatus.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)')
|
||||
self.pluginListWidget.currentItem().setText(
|
||||
status_text % self.activePlugin.name_strings['singular'])
|
||||
self.plugin_list_widget.currentItem().setText(
|
||||
status_text % self.active_plugin.name_strings['singular'])
|
||||
|
||||
def _get_plugin_manager(self):
|
||||
"""
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -29,7 +29,6 @@
|
||||
"""
|
||||
The actual print service dialog
|
||||
"""
|
||||
import cgi
|
||||
import datetime
|
||||
import os
|
||||
|
||||
@ -175,7 +174,7 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog):
|
||||
custom_css = DEFAULT_CSS
|
||||
self._add_element('style', custom_css, html_data.head, attribute=('type', 'text/css'))
|
||||
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):
|
||||
self._add_preview_item(html_data.body, item['service_item'], index)
|
||||
# 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')
|
||||
self._add_element(
|
||||
'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.preview_widget.updatePreview()
|
||||
|
||||
@ -195,7 +194,7 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog):
|
||||
# Add the title of the service item.
|
||||
item_title = self._add_element('h2', parent=div, classId='itemTitle')
|
||||
self._add_element('img', parent=item_title, attribute=('src', item.icon))
|
||||
self._add_element('span', ' ' + cgi.escape(item.get_display_title()), item_title)
|
||||
self._add_element('span', ' ' + html.escape(item.get_display_title()), item_title)
|
||||
if self.slide_text_check_box.isChecked():
|
||||
# Add the text of the service item.
|
||||
if item.is_text():
|
||||
@ -219,14 +218,14 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog):
|
||||
foot_text = item.foot_text
|
||||
foot_text = foot_text.partition('<br>')[2]
|
||||
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')
|
||||
# Add service items' notes.
|
||||
if self.notes_check_box.isChecked():
|
||||
if item.notes:
|
||||
p = self._add_element('div', classId='itemNotes', parent=div)
|
||||
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.
|
||||
if item.is_media() and self.meta_data_check_box.isChecked():
|
||||
tme = item.media_length
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -29,7 +29,7 @@
|
||||
"""
|
||||
The service manager sets up, loads, saves and manages services.
|
||||
"""
|
||||
import cgi
|
||||
import html
|
||||
import logging
|
||||
import os
|
||||
import shutil
|
||||
@ -55,12 +55,12 @@ class ServiceManagerList(QtGui.QTreeWidget):
|
||||
"""
|
||||
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
|
||||
"""
|
||||
super(ServiceManagerList, self).__init__(parent)
|
||||
self.serviceManager = serviceManager
|
||||
self.service_manager = service_manager
|
||||
|
||||
def keyPressEvent(self, event):
|
||||
"""
|
||||
@ -69,13 +69,13 @@ class ServiceManagerList(QtGui.QTreeWidget):
|
||||
if isinstance(event, QtGui.QKeyEvent):
|
||||
# here accept the event and do something
|
||||
if event.key() == QtCore.Qt.Key_Up:
|
||||
self.serviceManager.on_move_selection_up()
|
||||
self.service_manager.on_move_selection_up()
|
||||
event.accept()
|
||||
elif event.key() == QtCore.Qt.Key_Down:
|
||||
self.serviceManager.on_move_selection_down()
|
||||
self.service_manager.on_move_selection_down()
|
||||
event.accept()
|
||||
elif event.key() == QtCore.Qt.Key_Delete:
|
||||
self.serviceManager.onDeleteFromService()
|
||||
self.service_manager.onDeleteFromService()
|
||||
event.accept()
|
||||
event.ignore()
|
||||
else:
|
||||
@ -117,7 +117,8 @@ class ServiceManagerDialog(object):
|
||||
triggers=self.on_load_service_clicked)
|
||||
self.toolbar.add_toolbar_action('saveService', text=UiStrings().SaveService,
|
||||
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.theme_label = QtGui.QLabel('%s:' % UiStrings().Theme, self)
|
||||
self.theme_label.setMargin(3)
|
||||
@ -153,19 +154,19 @@ class ServiceManagerDialog(object):
|
||||
self.order_toolbar = OpenLPToolbar(self)
|
||||
action_list = ActionList.get_instance()
|
||||
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',
|
||||
tooltip=translate('OpenLP.ServiceManager', 'Move item to the top of the service.'),
|
||||
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',
|
||||
tooltip=translate('OpenLP.ServiceManager', 'Move item up one position in the service.'),
|
||||
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',
|
||||
tooltip=translate('OpenLP.ServiceManager', 'Move item down one position in the service.'),
|
||||
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',
|
||||
tooltip=translate('OpenLP.ServiceManager', 'Move item to the end of the service.'),
|
||||
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,
|
||||
text=translate('OpenLP.ServiceManager', '&Expand all'), icon=':/services/service_expand_all.png',
|
||||
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,
|
||||
text=translate('OpenLP.ServiceManager', '&Collapse all'), icon=':/services/service_collapse_all.png',
|
||||
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.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',
|
||||
@ -207,30 +208,35 @@ class ServiceManagerDialog(object):
|
||||
self.service_manager_list.itemExpanded.connect(self.expanded)
|
||||
# Last little bits of setting up
|
||||
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
|
||||
self.dndMenu = QtGui.QMenu()
|
||||
self.newAction = self.dndMenu.addAction(translate('OpenLP.ServiceManager', '&Add New Item'))
|
||||
self.newAction.setIcon(build_icon(':/general/general_edit.png'))
|
||||
self.addToAction = self.dndMenu.addAction(translate('OpenLP.ServiceManager', '&Add to Selected Item'))
|
||||
self.addToAction.setIcon(build_icon(':/general/general_edit.png'))
|
||||
self.dnd_menu = QtGui.QMenu()
|
||||
self.new_action = self.dnd_menu.addAction(translate('OpenLP.ServiceManager', '&Add New Item'))
|
||||
self.new_action.setIcon(build_icon(':/general/general_edit.png'))
|
||||
self.add_to_action = self.dnd_menu.addAction(translate('OpenLP.ServiceManager', '&Add to Selected Item'))
|
||||
self.add_to_action.setIcon(build_icon(':/general/general_edit.png'))
|
||||
# build the context menu
|
||||
self.menu = QtGui.QMenu()
|
||||
self.edit_action = create_widget_action(self.menu, text=translate('OpenLP.ServiceManager', '&Edit Item'),
|
||||
icon=':/general/general_edit.png', triggers=self.remote_edit)
|
||||
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'),
|
||||
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'),
|
||||
icon=':/media/media_time.png', triggers=self.on_start_time_form)
|
||||
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.
|
||||
self.menu.addAction(self.service_manager_list.delete)
|
||||
self.create_custom_action = create_widget_action(self.menu,
|
||||
text=translate('OpenLP.ServiceManager', 'Create New &Custom Slide'),
|
||||
icon=':/general/general_edit.png', triggers=self.create_custom)
|
||||
text=translate('OpenLP.ServiceManager', 'Create New &Custom '
|
||||
'Slide'),
|
||||
icon=':/general/general_edit.png',
|
||||
triggers=self.create_custom)
|
||||
self.menu.addSeparator()
|
||||
# Add AutoPlay menu actions
|
||||
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.setExclusive(True)
|
||||
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)
|
||||
auto_play_slides_group.addAction(self.auto_play_slides_loop)
|
||||
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)
|
||||
auto_play_slides_group.addAction(self.auto_play_slides_once)
|
||||
self.auto_play_slides_menu.addSeparator()
|
||||
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)
|
||||
self.menu.addSeparator()
|
||||
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.menu.addMenu(self.theme_menu)
|
||||
self.service_manager_list.addActions(
|
||||
[self.service_manager_list.moveDown,
|
||||
self.service_manager_list.moveUp,
|
||||
[self.service_manager_list.move_down,
|
||||
self.service_manager_list.move_up,
|
||||
self.service_manager_list.make_live,
|
||||
self.service_manager_list.moveTop,
|
||||
self.service_manager_list.moveBottom,
|
||||
self.service_manager_list.move_top,
|
||||
self.service_manager_list.move_bottom,
|
||||
self.service_manager_list.up,
|
||||
self.service_manager_list.down,
|
||||
self.service_manager_list.expand,
|
||||
self.service_manager_list.collapse
|
||||
])
|
||||
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('mediaitem_suffix_reset', self.reset_supported_suffixes)
|
||||
|
||||
@ -418,8 +427,10 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
|
||||
return QtGui.QMessageBox.question(self.main_window,
|
||||
translate('OpenLP.ServiceManager', 'Modified Service'),
|
||||
translate('OpenLP.ServiceManager',
|
||||
'The current service has been modified. Would you like to save this service?'),
|
||||
QtGui.QMessageBox.Save | QtGui.QMessageBox.Discard | QtGui.QMessageBox.Cancel, QtGui.QMessageBox.Save)
|
||||
'The current service has been modified. Would you like to save '
|
||||
'this service?'),
|
||||
QtGui.QMessageBox.Save | QtGui.QMessageBox.Discard |
|
||||
QtGui.QMessageBox.Cancel, QtGui.QMessageBox.Save)
|
||||
|
||||
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'
|
||||
'These files will be removed if you continue to save.') % "\n\t".join(missing_list)
|
||||
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:
|
||||
self.main_window.finished_progress_bar()
|
||||
return False
|
||||
@ -529,8 +541,8 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
|
||||
if audio_from.startswith('audio'):
|
||||
# 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.
|
||||
audio_from = os.path.join(self.servicePath, audio_from)
|
||||
save_file = os.path.join(self.servicePath, audio_to)
|
||||
audio_from = os.path.join(self.service_path, audio_from)
|
||||
save_file = os.path.join(self.service_path, audio_to)
|
||||
save_path = os.path.split(save_file)[0]
|
||||
check_directory_exists(save_path)
|
||||
if not os.path.exists(save_file):
|
||||
@ -539,8 +551,7 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
|
||||
except IOError:
|
||||
log.exception('Failed to save service to disk: %s', temp_file_name)
|
||||
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
|
||||
finally:
|
||||
if zip_file:
|
||||
@ -589,15 +600,13 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
|
||||
success = True
|
||||
self.main_window.increment_progress_bar()
|
||||
try:
|
||||
zip_file = zipfile.ZipFile(temp_file_name, 'w', zipfile.ZIP_STORED,
|
||||
True)
|
||||
zip_file = zipfile.ZipFile(temp_file_name, 'w', zipfile.ZIP_STORED, True)
|
||||
# First we add service contents.
|
||||
zip_file.writestr(service_file_name, service_content)
|
||||
except IOError:
|
||||
log.exception('Failed to save service to disk: %s', temp_file_name)
|
||||
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
|
||||
finally:
|
||||
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:
|
||||
file_name = QtGui.QFileDialog.getSaveFileName(self.main_window, UiStrings().SaveService, path,
|
||||
translate('OpenLP.ServiceManager',
|
||||
'OpenLP Service Files (*.osz);; OpenLP Service Files - lite (*.oszl)'))
|
||||
'OpenLP Service Files (*.osz);; OpenLP Service Files - lite '
|
||||
'(*.oszl)'))
|
||||
else:
|
||||
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:
|
||||
return False
|
||||
if os.path.splitext(file_name)[1] == '':
|
||||
@ -690,14 +701,14 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
|
||||
critical_error_message_box(message=translate('OpenLP.ServiceManager',
|
||||
'File is not a valid service.\n The content encoding is not UTF-8.'))
|
||||
continue
|
||||
osfile = ucs_file.replace('/', os.path.sep)
|
||||
if not osfile.startswith('audio'):
|
||||
osfile = os.path.split(osfile)[1]
|
||||
log.debug('Extract file: %s', osfile)
|
||||
zip_info.filename = osfile
|
||||
zip_file.extract(zip_info, self.servicePath)
|
||||
if osfile.endswith('osj') or osfile.endswith('osd'):
|
||||
p_file = os.path.join(self.servicePath, osfile)
|
||||
os_file = ucs_file.replace('/', os.path.sep)
|
||||
if not os_file.startswith('audio'):
|
||||
os_file = os.path.split(os_file)[1]
|
||||
log.debug('Extract file: %s', os_file)
|
||||
zip_info.filename = os_file
|
||||
zip_file.extract(zip_info, self.service_path)
|
||||
if os_file.endswith('osj') or os_file.endswith('osd'):
|
||||
p_file = os.path.join(self.service_path, os_file)
|
||||
if 'p_file' in locals():
|
||||
file_to = open(p_file, 'r')
|
||||
if p_file.endswith('osj'):
|
||||
@ -717,7 +728,7 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
|
||||
if self._save_lite:
|
||||
service_item.set_from_service(item)
|
||||
else:
|
||||
service_item.set_from_service(item, self.servicePath)
|
||||
service_item.set_from_service(item, self.service_path)
|
||||
service_item.validate_item(self.suffixes)
|
||||
if service_item.is_capable(ItemCapabilities.OnLoadUpdate):
|
||||
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:
|
||||
log.exception('Service file is zero sized: %s' % file_name)
|
||||
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:
|
||||
log.exception('Service file is cannot be extracted as zip: '
|
||||
'%s' % file_name)
|
||||
log.exception('Service file is cannot be extracted as zip: %s' % file_name)
|
||||
QtGui.QMessageBox.information(self, translate('OpenLP.ServiceManager', 'Corrupt File'),
|
||||
translate('OpenLP.ServiceManager',
|
||||
'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.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
|
||||
no service present.
|
||||
@ -893,7 +904,9 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
|
||||
else:
|
||||
timed_slide_interval = service_item.timed_slide_interval
|
||||
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)
|
||||
if ok:
|
||||
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.
|
||||
"""
|
||||
if not self.service_manager_list.selectedItems():
|
||||
if not self.service_manager_list.selected_items():
|
||||
return
|
||||
selected = self.service_manager_list.selectedItems()[0]
|
||||
lookFor = 0
|
||||
serviceIterator = QtGui.QTreeWidgetItemIterator(self.service_manager_list)
|
||||
while serviceIterator.value():
|
||||
if lookFor == 1 and serviceIterator.value().parent() is None:
|
||||
self.service_manager_list.setCurrentItem(serviceIterator.value())
|
||||
selected = self.service_manager_list.selected_items()[0]
|
||||
look_for = 0
|
||||
service_iterator = QtGui.QTreeWidgetItemIterator(self.service_manager_list)
|
||||
while service_iterator.value():
|
||||
if look_for == 1 and service_iterator.value().parent() is None:
|
||||
self.service_manager_list.setCurrentItem(service_iterator.value())
|
||||
self.make_live()
|
||||
return
|
||||
if serviceIterator.value() == selected:
|
||||
lookFor = 1
|
||||
serviceIterator += 1
|
||||
if service_iterator.value() == selected:
|
||||
look_for = 1
|
||||
service_iterator += 1
|
||||
|
||||
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
|
||||
|
||||
"""
|
||||
if not self.service_manager_list.selectedItems():
|
||||
if not self.service_manager_list.selected_items():
|
||||
return
|
||||
selected = self.service_manager_list.selectedItems()[0]
|
||||
prevItem = None
|
||||
prevItemLastSlide = None
|
||||
serviceIterator = QtGui.QTreeWidgetItemIterator(self.service_manager_list)
|
||||
while serviceIterator.value():
|
||||
if serviceIterator.value() == selected:
|
||||
if last_slide and prevItemLastSlide:
|
||||
pos = prevItem.data(0, QtCore.Qt.UserRole)
|
||||
selected = self.service_manager_list.selected_items()[0]
|
||||
prev_item = None
|
||||
prev_item_last_slide = None
|
||||
service_iterator = QtGui.QTreeWidgetItemIterator(self.service_manager_list)
|
||||
while service_iterator.value():
|
||||
if service_iterator.value() == selected:
|
||||
if last_slide and prev_item_last_slide:
|
||||
pos = prev_item.data(0, QtCore.Qt.UserRole)
|
||||
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:
|
||||
self.service_manager_list.collapseItem(prevItem)
|
||||
self.service_manager_list.collapseItem(prev_item)
|
||||
self.make_live()
|
||||
self.service_manager_list.setCurrentItem(prevItem)
|
||||
elif prevItem:
|
||||
self.service_manager_list.setCurrentItem(prevItem)
|
||||
self.service_manager_list.setCurrentItem(prev_item)
|
||||
elif prev_item:
|
||||
self.service_manager_list.setCurrentItem(prev_item)
|
||||
self.make_live()
|
||||
return
|
||||
if serviceIterator.value().parent() is None:
|
||||
prevItem = serviceIterator.value()
|
||||
if serviceIterator.value().parent() is prevItem:
|
||||
prevItemLastSlide = serviceIterator.value()
|
||||
serviceIterator += 1
|
||||
if service_iterator.value().parent() is None:
|
||||
prev_item = service_iterator.value()
|
||||
if service_iterator.value().parent() is prev_item:
|
||||
prev_item_last_slide = service_iterator.value()
|
||||
service_iterator += 1
|
||||
|
||||
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.
|
||||
"""
|
||||
item = self.service_manager_list.currentItem()
|
||||
itemBefore = self.service_manager_list.itemAbove(item)
|
||||
if itemBefore is None:
|
||||
item_before = self.service_manager_list.item_above(item)
|
||||
if item_before is None:
|
||||
return
|
||||
self.service_manager_list.setCurrentItem(itemBefore)
|
||||
self.service_manager_list.setCurrentItem(item_before)
|
||||
|
||||
def on_move_selection_down(self):
|
||||
"""
|
||||
Moves the cursor selection down the window. Called by the down arrow.
|
||||
"""
|
||||
item = self.service_manager_list.currentItem()
|
||||
itemAfter = self.service_manager_list.itemBelow(item)
|
||||
if itemAfter is None:
|
||||
item_after = self.service_manager_list.itemBelow(item)
|
||||
if item_after is None:
|
||||
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.
|
||||
"""
|
||||
@ -1043,7 +1056,7 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
|
||||
pos = item.data(0, QtCore.Qt.UserRole)
|
||||
self.service_items[pos - 1]['expanded'] = False
|
||||
|
||||
def onExpandAll(self):
|
||||
def on_expand_all(self):
|
||||
"""
|
||||
Collapse all the service items.
|
||||
"""
|
||||
@ -1139,51 +1152,51 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
|
||||
self.service_manager_list.clear()
|
||||
self.service_manager_list.clearSelection()
|
||||
for item_count, item in enumerate(self.service_items):
|
||||
serviceitem = item['service_item']
|
||||
treewidgetitem = QtGui.QTreeWidgetItem(self.service_manager_list)
|
||||
if serviceitem.is_valid:
|
||||
if serviceitem.notes:
|
||||
icon = QtGui.QImage(serviceitem.icon)
|
||||
service_item_from_item = item['service_item']
|
||||
tree_widget_item = QtGui.QTreeWidgetItem(self.service_manager_list)
|
||||
if service_item_from_item.is_valid:
|
||||
if service_item_from_item.notes:
|
||||
icon = QtGui.QImage(service_item_from_item.icon)
|
||||
icon = icon.scaled(80, 80, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation)
|
||||
overlay = QtGui.QImage(':/services/service_item_notes.png')
|
||||
overlay = overlay.scaled(80, 80, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation)
|
||||
painter = QtGui.QPainter(icon)
|
||||
painter.drawImage(0, 0, overlay)
|
||||
painter.end()
|
||||
treewidgetitem.setIcon(0, build_icon(icon))
|
||||
elif serviceitem.temporary_edit:
|
||||
icon = QtGui.QImage(serviceitem.icon)
|
||||
tree_widget_item.setIcon(0, build_icon(icon))
|
||||
elif service_item_from_item.temporary_edit:
|
||||
icon = QtGui.QImage(service_item_from_item.icon)
|
||||
icon = icon.scaled(80, 80, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation)
|
||||
overlay = QtGui.QImage(':/general/general_export.png')
|
||||
overlay = overlay.scaled(40, 40, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation)
|
||||
painter = QtGui.QPainter(icon)
|
||||
painter.drawImage(40, 0, overlay)
|
||||
painter.end()
|
||||
treewidgetitem.setIcon(0, build_icon(icon))
|
||||
tree_widget_item.setIcon(0, build_icon(icon))
|
||||
else:
|
||||
treewidgetitem.setIcon(0, serviceitem.iconic_representation)
|
||||
tree_widget_item.setIcon(0, service_item_from_item.iconic_representation)
|
||||
else:
|
||||
treewidgetitem.setIcon(0, build_icon(':/general/general_delete.png'))
|
||||
treewidgetitem.setText(0, serviceitem.get_display_title())
|
||||
tree_widget_item.setIcon(0, build_icon(':/general/general_delete.png'))
|
||||
tree_widget_item.setText(0, service_item_from_item.get_display_title())
|
||||
tips = []
|
||||
if serviceitem.temporary_edit:
|
||||
if service_item_from_item.temporary_edit:
|
||||
tips.append('<strong>%s:</strong> <em>%s</em>' %
|
||||
(translate('OpenLP.ServiceManager', 'Edit'),
|
||||
(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>' %
|
||||
(translate('OpenLP.ServiceManager', 'Slide theme'), serviceitem.theme))
|
||||
if serviceitem.notes:
|
||||
(translate('OpenLP.ServiceManager', 'Slide theme'), service_item_from_item.theme))
|
||||
if service_item_from_item.notes:
|
||||
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):
|
||||
tips.append(item['service_item'].get_media_time())
|
||||
treewidgetitem.setToolTip(0, '<br>'.join(tips))
|
||||
treewidgetitem.setData(0, QtCore.Qt.UserRole, item['order'])
|
||||
treewidgetitem.setSelected(item['selected'])
|
||||
# Add the children to their parent treewidgetitem.
|
||||
for count, frame in enumerate(serviceitem.get_frames()):
|
||||
child = QtGui.QTreeWidgetItem(treewidgetitem)
|
||||
tree_widget_item.setToolTip(0, '<br>'.join(tips))
|
||||
tree_widget_item.setData(0, QtCore.Qt.UserRole, item['order'])
|
||||
tree_widget_item.setSelected(item['selected'])
|
||||
# Add the children to their parent tree_widget_item.
|
||||
for count, frame in enumerate(service_item_from_item.get_frames()):
|
||||
child = QtGui.QTreeWidgetItem(tree_widget_item)
|
||||
text = frame['title'].replace('\n', ' ')
|
||||
child.setText(0, text[:40])
|
||||
child.setData(0, QtCore.Qt.UserRole, count)
|
||||
@ -1191,19 +1204,19 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
|
||||
if item['expanded'] and service_item_child == count:
|
||||
self.service_manager_list.setCurrentItem(child)
|
||||
elif service_item_child == -1:
|
||||
self.service_manager_list.setCurrentItem(treewidgetitem)
|
||||
treewidgetitem.setExpanded(item['expanded'])
|
||||
self.service_manager_list.setCurrentItem(tree_widget_item)
|
||||
tree_widget_item.setExpanded(item['expanded'])
|
||||
|
||||
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')
|
||||
for file_name in os.listdir(self.servicePath):
|
||||
file_path = os.path.join(self.servicePath, file_name)
|
||||
log.debug('Cleaning up service_path')
|
||||
for file_name in os.listdir(self.service_path):
|
||||
file_path = os.path.join(self.service_path, file_name)
|
||||
delete_file(file_path)
|
||||
if os.path.exists(os.path.join(self.servicePath, 'audio')):
|
||||
shutil.rmtree(os.path.join(self.servicePath, 'audio'), True)
|
||||
if os.path.exists(os.path.join(self.service_path, 'audio')):
|
||||
shutil.rmtree(os.path.join(self.service_path, 'audio'), True)
|
||||
|
||||
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.renderer.set_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):
|
||||
"""
|
||||
@ -1224,34 +1237,34 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
|
||||
self.theme_label.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.
|
||||
"""
|
||||
self.application.set_busy_cursor()
|
||||
log.debug('regenerate_service_Items')
|
||||
log.debug('regenerate_service_items')
|
||||
# force reset of renderer as theme data has changed
|
||||
self.service_has_all_original_files = True
|
||||
if self.service_items:
|
||||
for item in self.service_items:
|
||||
item['selected'] = False
|
||||
serviceIterator = QtGui.QTreeWidgetItemIterator(self.service_manager_list)
|
||||
selectedItem = None
|
||||
while serviceIterator.value():
|
||||
if serviceIterator.value().isSelected():
|
||||
selectedItem = serviceIterator.value()
|
||||
serviceIterator += 1
|
||||
if selectedItem is not None:
|
||||
if selectedItem.parent() is None:
|
||||
pos = selectedItem.data(0, QtCore.Qt.UserRole)
|
||||
service_iterator = QtGui.QTreeWidgetItemIterator(self.service_manager_list)
|
||||
selected_item = None
|
||||
while service_iterator.value():
|
||||
if service_iterator.value().isSelected():
|
||||
selected_item = service_iterator.value()
|
||||
service_iterator += 1
|
||||
if selected_item is not None:
|
||||
if selected_item.parent() is None:
|
||||
pos = selected_item.data(0, QtCore.Qt.UserRole)
|
||||
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
|
||||
tempServiceItems = self.service_items
|
||||
temp_service_items = self.service_items
|
||||
self.service_manager_list.clear()
|
||||
self.service_items = []
|
||||
self.isNew = True
|
||||
for item in tempServiceItems:
|
||||
self.is_new = True
|
||||
for item in temp_service_items:
|
||||
self.add_service_item(item['service_item'], False, expand=item['expanded'], repaint=False,
|
||||
selected=item['selected'])
|
||||
# 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:
|
||||
critical_error_message_box(translate('OpenLP.ServiceManager', 'Missing Display Handler'),
|
||||
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()
|
||||
|
||||
def remote_edit(self):
|
||||
@ -1400,7 +1414,7 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
|
||||
|
||||
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
|
||||
item is selected this will return::
|
||||
|
||||
@ -1446,18 +1460,18 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
|
||||
item = self.service_manager_list.itemAt(event.pos())
|
||||
# ServiceManager started the drag and drop
|
||||
if plugin == 'ServiceManager':
|
||||
startpos, child = self.find_service_item()
|
||||
start_pos, child = self.find_service_item()
|
||||
# If no items selected
|
||||
if startpos == -1:
|
||||
if start_pos == -1:
|
||||
return
|
||||
if item is None:
|
||||
endpos = len(self.service_items)
|
||||
end_pos = len(self.service_items)
|
||||
else:
|
||||
endpos = self._get_parent_item_data(item) - 1
|
||||
serviceItem = self.service_items[startpos]
|
||||
self.service_items.remove(serviceItem)
|
||||
self.service_items.insert(endpos, serviceItem)
|
||||
self.repaint_service_list(endpos, child)
|
||||
end_pos = self._get_parent_item_data(item) - 1
|
||||
service_item = self.service_items[start_pos]
|
||||
self.service_items.remove(service_item)
|
||||
self.service_items.insert(end_pos, service_item)
|
||||
self.repaint_service_list(end_pos, child)
|
||||
self.set_modified()
|
||||
else:
|
||||
# we are not over anything so drop
|
||||
@ -1467,15 +1481,15 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
|
||||
else:
|
||||
# we are over something so lets investigate
|
||||
pos = self._get_parent_item_data(item) - 1
|
||||
serviceItem = self.service_items[pos]
|
||||
if (plugin == serviceItem['service_item'].name and
|
||||
serviceItem['service_item'].is_capable(ItemCapabilities.CanAppend)):
|
||||
action = self.dndMenu.exec_(QtGui.QCursor.pos())
|
||||
service_item = self.service_items[pos]
|
||||
if (plugin == service_item['service_item'].name and
|
||||
service_item['service_item'].is_capable(ItemCapabilities.CanAppend)):
|
||||
action = self.dnd_menu.exec_(QtGui.QCursor.pos())
|
||||
# New action required
|
||||
if action == self.newAction:
|
||||
if action == self.new_action:
|
||||
self.drop_position = self._get_parent_item_data(item)
|
||||
# Append to existing action
|
||||
if action == self.addToAction:
|
||||
if action == self.add_to_action:
|
||||
self.drop_position = self._get_parent_item_data(item)
|
||||
item.setSelected(True)
|
||||
replace = True
|
||||
@ -1498,10 +1512,10 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
|
||||
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
|
||||
# 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)
|
||||
self.theme_menu.setDefaultAction(defaultTheme)
|
||||
theme_group.addAction(defaultTheme)
|
||||
self.theme_menu.setDefaultAction(default_theme)
|
||||
theme_group.addAction(default_theme)
|
||||
self.theme_menu.addSeparator()
|
||||
for theme in theme_list:
|
||||
self.theme_combo_box.addItem(theme)
|
||||
@ -1509,7 +1523,7 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
|
||||
triggers=self.on_theme_change_action))
|
||||
find_and_set_in_combo_box(self.theme_combo_box, 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):
|
||||
"""
|
||||
@ -1521,7 +1535,7 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
|
||||
theme = None
|
||||
item = self.find_service_item()[0]
|
||||
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):
|
||||
"""
|
||||
@ -1537,8 +1551,8 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog):
|
||||
"""
|
||||
Print a Service Order Sheet.
|
||||
"""
|
||||
settingDialog = PrintServiceForm()
|
||||
settingDialog.exec_()
|
||||
setting_dialog = PrintServiceForm()
|
||||
setting_dialog.exec_()
|
||||
|
||||
def _get_renderer(self):
|
||||
"""
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -136,11 +136,11 @@ class SettingsForm(QtGui.QDialog, Ui_SettingsDialog):
|
||||
if plugin.settings_tab:
|
||||
plugin.settings_tab.post_set_up()
|
||||
|
||||
def tab_changed(self, tabIndex):
|
||||
def tab_changed(self, tab_index):
|
||||
"""
|
||||
A different settings tab is selected
|
||||
"""
|
||||
self.stacked_layout.setCurrentIndex(tabIndex)
|
||||
self.stacked_layout.setCurrentIndex(tab_index)
|
||||
self.stacked_layout.currentWidget().tab_visible()
|
||||
|
||||
def register_post_process(self, function):
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -67,62 +67,62 @@ class Ui_ShortcutListDialog(object):
|
||||
"""
|
||||
shortcutListDialog.setObjectName('shortcutListDialog')
|
||||
shortcutListDialog.resize(500, 438)
|
||||
self.shortcutListLayout = QtGui.QVBoxLayout(shortcutListDialog)
|
||||
self.shortcutListLayout.setObjectName('shortcutListLayout')
|
||||
self.shortcut_list_layout = QtGui.QVBoxLayout(shortcutListDialog)
|
||||
self.shortcut_list_layout.setObjectName('shortcut_list_layout')
|
||||
self.description_label = QtGui.QLabel(shortcutListDialog)
|
||||
self.description_label.setObjectName('description_label')
|
||||
self.description_label.setWordWrap(True)
|
||||
self.shortcutListLayout.addWidget(self.description_label)
|
||||
self.treeWidget = QtGui.QTreeWidget(shortcutListDialog)
|
||||
self.treeWidget.setObjectName('treeWidget')
|
||||
self.treeWidget.setAlternatingRowColors(True)
|
||||
self.treeWidget.setColumnCount(3)
|
||||
self.treeWidget.setColumnWidth(0, 250)
|
||||
self.shortcutListLayout.addWidget(self.treeWidget)
|
||||
self.detailsLayout = QtGui.QGridLayout()
|
||||
self.detailsLayout.setObjectName('detailsLayout')
|
||||
self.detailsLayout.setContentsMargins(-1, 0, -1, -1)
|
||||
self.defaultRadioButton = QtGui.QRadioButton(shortcutListDialog)
|
||||
self.defaultRadioButton.setObjectName('defaultRadioButton')
|
||||
self.defaultRadioButton.setChecked(True)
|
||||
self.detailsLayout.addWidget(self.defaultRadioButton, 0, 0, 1, 1)
|
||||
self.customRadioButton = QtGui.QRadioButton(shortcutListDialog)
|
||||
self.customRadioButton.setObjectName('customRadioButton')
|
||||
self.detailsLayout.addWidget(self.customRadioButton, 1, 0, 1, 1)
|
||||
self.primaryLayout = QtGui.QHBoxLayout()
|
||||
self.primaryLayout.setObjectName('primaryLayout')
|
||||
self.primaryPushButton = CaptureShortcutButton(shortcutListDialog)
|
||||
self.primaryPushButton.setObjectName('primaryPushButton')
|
||||
self.primaryPushButton.setMinimumSize(QtCore.QSize(84, 0))
|
||||
self.primaryPushButton.setIcon(build_icon(':/system/system_configure_shortcuts.png'))
|
||||
self.primaryLayout.addWidget(self.primaryPushButton)
|
||||
self.clearPrimaryButton = QtGui.QToolButton(shortcutListDialog)
|
||||
self.clearPrimaryButton.setObjectName('clearPrimaryButton')
|
||||
self.clearPrimaryButton.setMinimumSize(QtCore.QSize(0, 16))
|
||||
self.clearPrimaryButton.setIcon(build_icon(':/system/clear_shortcut.png'))
|
||||
self.primaryLayout.addWidget(self.clearPrimaryButton)
|
||||
self.detailsLayout.addLayout(self.primaryLayout, 1, 1, 1, 1)
|
||||
self.alternateLayout = QtGui.QHBoxLayout()
|
||||
self.alternateLayout.setObjectName('alternateLayout')
|
||||
self.alternatePushButton = CaptureShortcutButton(shortcutListDialog)
|
||||
self.alternatePushButton.setObjectName('alternatePushButton')
|
||||
self.alternatePushButton.setIcon(build_icon(':/system/system_configure_shortcuts.png'))
|
||||
self.alternateLayout.addWidget(self.alternatePushButton)
|
||||
self.clearAlternateButton = QtGui.QToolButton(shortcutListDialog)
|
||||
self.clearAlternateButton.setObjectName('clearAlternateButton')
|
||||
self.clearAlternateButton.setIcon(build_icon(':/system/clear_shortcut.png'))
|
||||
self.alternateLayout.addWidget(self.clearAlternateButton)
|
||||
self.detailsLayout.addLayout(self.alternateLayout, 1, 2, 1, 1)
|
||||
self.primaryLabel = QtGui.QLabel(shortcutListDialog)
|
||||
self.primaryLabel.setObjectName('primaryLabel')
|
||||
self.detailsLayout.addWidget(self.primaryLabel, 0, 1, 1, 1)
|
||||
self.alternateLabel = QtGui.QLabel(shortcutListDialog)
|
||||
self.alternateLabel.setObjectName('alternateLabel')
|
||||
self.detailsLayout.addWidget(self.alternateLabel, 0, 2, 1, 1)
|
||||
self.shortcutListLayout.addLayout(self.detailsLayout)
|
||||
self.shortcut_list_layout.addWidget(self.description_label)
|
||||
self.tree_widget = QtGui.QTreeWidget(shortcutListDialog)
|
||||
self.tree_widget.setObjectName('tree_widget')
|
||||
self.tree_widget.setAlternatingRowColors(True)
|
||||
self.tree_widget.setColumnCount(3)
|
||||
self.tree_widget.setColumnWidth(0, 250)
|
||||
self.shortcut_list_layout.addWidget(self.tree_widget)
|
||||
self.details_layout = QtGui.QGridLayout()
|
||||
self.details_layout.setObjectName('details_layout')
|
||||
self.details_layout.setContentsMargins(-1, 0, -1, -1)
|
||||
self.default_radio_button = QtGui.QRadioButton(shortcutListDialog)
|
||||
self.default_radio_button.setObjectName('default_radio_button')
|
||||
self.default_radio_button.setChecked(True)
|
||||
self.details_layout.addWidget(self.default_radio_button, 0, 0, 1, 1)
|
||||
self.custom_radio_button = QtGui.QRadioButton(shortcutListDialog)
|
||||
self.custom_radio_button.setObjectName('custom_radio_button')
|
||||
self.details_layout.addWidget(self.custom_radio_button, 1, 0, 1, 1)
|
||||
self.primary_layout = QtGui.QHBoxLayout()
|
||||
self.primary_layout.setObjectName('primary_layout')
|
||||
self.primary_push_button = CaptureShortcutButton(shortcutListDialog)
|
||||
self.primary_push_button.setObjectName('primary_push_button')
|
||||
self.primary_push_button.setMinimumSize(QtCore.QSize(84, 0))
|
||||
self.primary_push_button.setIcon(build_icon(':/system/system_configure_shortcuts.png'))
|
||||
self.primary_layout.addWidget(self.primary_push_button)
|
||||
self.clear_primary_button = QtGui.QToolButton(shortcutListDialog)
|
||||
self.clear_primary_button.setObjectName('clear_primary_button')
|
||||
self.clear_primary_button.setMinimumSize(QtCore.QSize(0, 16))
|
||||
self.clear_primary_button.setIcon(build_icon(':/system/clear_shortcut.png'))
|
||||
self.primary_layout.addWidget(self.clear_primary_button)
|
||||
self.details_layout.addLayout(self.primary_layout, 1, 1, 1, 1)
|
||||
self.alternate_layout = QtGui.QHBoxLayout()
|
||||
self.alternate_layout.setObjectName('alternate_layout')
|
||||
self.alternate_push_button = CaptureShortcutButton(shortcutListDialog)
|
||||
self.alternate_push_button.setObjectName('alternate_push_button')
|
||||
self.alternate_push_button.setIcon(build_icon(':/system/system_configure_shortcuts.png'))
|
||||
self.alternate_layout.addWidget(self.alternate_push_button)
|
||||
self.clear_alternate_button = QtGui.QToolButton(shortcutListDialog)
|
||||
self.clear_alternate_button.setObjectName('clear_alternate_button')
|
||||
self.clear_alternate_button.setIcon(build_icon(':/system/clear_shortcut.png'))
|
||||
self.alternate_layout.addWidget(self.clear_alternate_button)
|
||||
self.details_layout.addLayout(self.alternate_layout, 1, 2, 1, 1)
|
||||
self.primary_label = QtGui.QLabel(shortcutListDialog)
|
||||
self.primary_label.setObjectName('primary_label')
|
||||
self.details_layout.addWidget(self.primary_label, 0, 1, 1, 1)
|
||||
self.alternate_label = QtGui.QLabel(shortcutListDialog)
|
||||
self.alternate_label.setObjectName('alternate_label')
|
||||
self.details_layout.addWidget(self.alternate_label, 0, 2, 1, 1)
|
||||
self.shortcut_list_layout.addLayout(self.details_layout)
|
||||
self.button_box = create_button_box(shortcutListDialog, 'button_box', ['cancel', 'ok', 'defaults'])
|
||||
self.button_box.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.shortcutListLayout.addWidget(self.button_box)
|
||||
self.shortcut_list_layout.addWidget(self.button_box)
|
||||
self.retranslateUi(shortcutListDialog)
|
||||
|
||||
def retranslateUi(self, shortcutListDialog):
|
||||
@ -133,14 +133,14 @@ class Ui_ShortcutListDialog(object):
|
||||
self.description_label.setText(
|
||||
translate('OpenLP.ShortcutListDialog', 'Select an action and click one of the buttons below to start '
|
||||
'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', 'Alternate')])
|
||||
self.defaultRadioButton.setText(translate('OpenLP.ShortcutListDialog', 'Default'))
|
||||
self.customRadioButton.setText(translate('OpenLP.ShortcutListDialog', 'Custom'))
|
||||
self.primaryPushButton.setToolTip(translate('OpenLP.ShortcutListDialog', 'Capture shortcut.'))
|
||||
self.alternatePushButton.setToolTip(translate('OpenLP.ShortcutListDialog', 'Capture shortcut.'))
|
||||
self.clearPrimaryButton.setToolTip(translate('OpenLP.ShortcutListDialog',
|
||||
self.default_radio_button.setText(translate('OpenLP.ShortcutListDialog', 'Default'))
|
||||
self.custom_radio_button.setText(translate('OpenLP.ShortcutListDialog', 'Custom'))
|
||||
self.primary_push_button.setToolTip(translate('OpenLP.ShortcutListDialog', 'Capture shortcut.'))
|
||||
self.alternate_push_button.setToolTip(translate('OpenLP.ShortcutListDialog', 'Capture shortcut.'))
|
||||
self.clear_primary_button.setToolTip(translate('OpenLP.ShortcutListDialog',
|
||||
'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.'))
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -54,18 +54,18 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog):
|
||||
"""
|
||||
super(ShortcutListForm, self).__init__(parent)
|
||||
self.setupUi(self)
|
||||
self.changedActions = {}
|
||||
self.changed_actions = {}
|
||||
self.action_list = ActionList.get_instance()
|
||||
self.dialog_was_shown = False
|
||||
self.primaryPushButton.toggled.connect(self.onPrimaryPushButtonClicked)
|
||||
self.alternatePushButton.toggled.connect(self.onAlternatePushButtonClicked)
|
||||
self.treeWidget.currentItemChanged.connect(self.onCurrentItemChanged)
|
||||
self.treeWidget.itemDoubleClicked.connect(self.onItemDoubleClicked)
|
||||
self.clearPrimaryButton.clicked.connect(self.onClearPrimaryButtonClicked)
|
||||
self.clearAlternateButton.clicked.connect(self.onClearAlternateButtonClicked)
|
||||
self.button_box.clicked.connect(self.onRestoreDefaultsClicked)
|
||||
self.defaultRadioButton.clicked.connect(self.onDefaultRadioButtonClicked)
|
||||
self.customRadioButton.clicked.connect(self.onCustomRadioButtonClicked)
|
||||
self.primary_push_button.toggled.connect(self.on_primary_push_button_clicked)
|
||||
self.alternate_push_button.toggled.connect(self.on_alternate_push_button_clicked)
|
||||
self.tree_widget.currentItemChanged.connect(self.on_current_item_changed)
|
||||
self.tree_widget.itemDoubleClicked.connect(self.on_item_double_clicked)
|
||||
self.clear_primary_button.clicked.connect(self.on_clear_primary_button_clicked)
|
||||
self.clear_alternate_button.clicked.connect(self.on_clear_alternate_button_clicked)
|
||||
self.button_box.clicked.connect(self.on_restore_defaults_clicked)
|
||||
self.default_radio_button.clicked.connect(self.on_default_radio_button_clicked)
|
||||
self.custom_radio_button.clicked.connect(self.on_custom_radio_button_clicked)
|
||||
|
||||
def keyPressEvent(self, event):
|
||||
"""
|
||||
@ -73,7 +73,7 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog):
|
||||
"""
|
||||
if event.key() == QtCore.Qt.Key_Space:
|
||||
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)
|
||||
elif event.key() == QtCore.Qt.Key_Escape:
|
||||
event.accept()
|
||||
@ -83,7 +83,7 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog):
|
||||
"""
|
||||
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
|
||||
# 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):
|
||||
@ -102,27 +102,27 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog):
|
||||
if event.modifiers() & QtCore.Qt.MetaModifier == QtCore.Qt.MetaModifier:
|
||||
key_string = 'Meta+' + key_string
|
||||
key_sequence = QtGui.QKeySequence(key_string)
|
||||
if self._validiate_shortcut(self._currentItemAction(), key_sequence):
|
||||
if self.primaryPushButton.isChecked():
|
||||
self._adjustButton(self.primaryPushButton, False, text=key_sequence.toString())
|
||||
elif self.alternatePushButton.isChecked():
|
||||
self._adjustButton(self.alternatePushButton, False, text=key_sequence.toString())
|
||||
if self._validiate_shortcut(self._current_item_action(), key_sequence):
|
||||
if self.primary_push_button.isChecked():
|
||||
self._adjust_button(self.primary_push_button, False, text=key_sequence.toString())
|
||||
elif self.alternate_push_button.isChecked():
|
||||
self._adjust_button(self.alternate_push_button, False, text=key_sequence.toString())
|
||||
|
||||
def exec_(self):
|
||||
"""
|
||||
Execute the dialog
|
||||
"""
|
||||
self.changedActions = {}
|
||||
self.reloadShortcutList()
|
||||
self._adjustButton(self.primaryPushButton, False, False, '')
|
||||
self._adjustButton(self.alternatePushButton, False, False, '')
|
||||
self.changed_actions = {}
|
||||
self.reload_shortcut_list()
|
||||
self._adjust_button(self.primary_push_button, False, False, '')
|
||||
self._adjust_button(self.alternate_push_button, False, False, '')
|
||||
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:
|
||||
# Check if the category is for internal use only.
|
||||
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(2, tool_tip_text)
|
||||
item.addChild(action_item)
|
||||
self.treeWidget.addTopLevelItem(item)
|
||||
self.tree_widget.addTopLevelItem(item)
|
||||
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
|
||||
actions.
|
||||
"""
|
||||
iterator = QtGui.QTreeWidgetItemIterator(self.treeWidget)
|
||||
iterator = QtGui.QTreeWidgetItemIterator(self.tree_widget)
|
||||
while iterator.value():
|
||||
item = iterator.value()
|
||||
iterator += 1
|
||||
action = self._currentItemAction(item)
|
||||
action = self._current_item_action(item)
|
||||
if action is None:
|
||||
continue
|
||||
shortcuts = self._actionShortcuts(action)
|
||||
shortcuts = self._action_shortcuts(action)
|
||||
if not shortcuts:
|
||||
item.setText(1, '')
|
||||
item.setText(2, '')
|
||||
@ -167,117 +167,117 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog):
|
||||
else:
|
||||
item.setText(1, shortcuts[0].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.
|
||||
"""
|
||||
self.customRadioButton.setChecked(True)
|
||||
self.custom_radio_button.setChecked(True)
|
||||
if toggled:
|
||||
self.alternatePushButton.setChecked(False)
|
||||
self.primaryPushButton.setText('')
|
||||
self.alternate_push_button.setChecked(False)
|
||||
self.primary_push_button.setText('')
|
||||
return
|
||||
action = self._currentItemAction()
|
||||
action = self._current_item_action()
|
||||
if action is None:
|
||||
return
|
||||
shortcuts = self._actionShortcuts(action)
|
||||
new_shortcuts = [QtGui.QKeySequence(self.primaryPushButton.text())]
|
||||
shortcuts = self._action_shortcuts(action)
|
||||
new_shortcuts = [QtGui.QKeySequence(self.primary_push_button.text())]
|
||||
if len(shortcuts) == 2:
|
||||
new_shortcuts.append(shortcuts[1])
|
||||
self.changedActions[action] = new_shortcuts
|
||||
self.refreshShortcutList()
|
||||
self.changed_actions[action] = new_shortcuts
|
||||
self.refresh_shortcut_list()
|
||||
|
||||
def onAlternatePushButtonClicked(self, toggled):
|
||||
def on_alternate_push_button_clicked(self, toggled):
|
||||
"""
|
||||
Save the new alternate shortcut.
|
||||
"""
|
||||
self.customRadioButton.setChecked(True)
|
||||
self.custom_radio_button.setChecked(True)
|
||||
if toggled:
|
||||
self.primaryPushButton.setChecked(False)
|
||||
self.alternatePushButton.setText('')
|
||||
self.primary_push_button.setChecked(False)
|
||||
self.alternate_push_button.setText('')
|
||||
return
|
||||
action = self._currentItemAction()
|
||||
action = self._current_item_action()
|
||||
if action is None:
|
||||
return
|
||||
shortcuts = self._actionShortcuts(action)
|
||||
shortcuts = self._action_shortcuts(action)
|
||||
new_shortcuts = []
|
||||
if shortcuts:
|
||||
new_shortcuts.append(shortcuts[0])
|
||||
new_shortcuts.append(QtGui.QKeySequence(self.alternatePushButton.text()))
|
||||
self.changedActions[action] = new_shortcuts
|
||||
if not self.primaryPushButton.text():
|
||||
new_shortcuts.append(QtGui.QKeySequence(self.alternate_push_button.text()))
|
||||
self.changed_actions[action] = new_shortcuts
|
||||
if not self.primary_push_button.text():
|
||||
# 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.
|
||||
self.primaryPushButton.setText(self.alternatePushButton.text())
|
||||
self.alternatePushButton.setText('')
|
||||
self.refreshShortcutList()
|
||||
self.primary_push_button.setText(self.alternate_push_button.text())
|
||||
self.alternate_push_button.setText('')
|
||||
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
|
||||
displayed.
|
||||
"""
|
||||
action = self._currentItemAction(item)
|
||||
action = self._current_item_action(item)
|
||||
if action is None:
|
||||
return
|
||||
self.primaryPushButton.setChecked(column in [0, 1])
|
||||
self.alternatePushButton.setChecked(column not in [0, 1])
|
||||
self.primary_push_button.setChecked(column in [0, 1])
|
||||
self.alternate_push_button.setChecked(column not in [0, 1])
|
||||
if column in [0, 1]:
|
||||
self.primaryPushButton.setText('')
|
||||
self.primaryPushButton.setFocus()
|
||||
self.primary_push_button.setText('')
|
||||
self.primary_push_button.setFocus()
|
||||
else:
|
||||
self.alternatePushButton.setText('')
|
||||
self.alternatePushButton.setFocus()
|
||||
self.alternate_push_button.setText('')
|
||||
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.
|
||||
"""
|
||||
action = self._currentItemAction(item)
|
||||
self.primaryPushButton.setEnabled(action is not None)
|
||||
self.alternatePushButton.setEnabled(action is not None)
|
||||
action = self._current_item_action(item)
|
||||
self.primary_push_button.setEnabled(action is not None)
|
||||
self.alternate_push_button.setEnabled(action is not None)
|
||||
primary_text = ''
|
||||
alternate_text = ''
|
||||
primary_label_text = ''
|
||||
alternate_label_text = ''
|
||||
if action is None:
|
||||
self.primaryPushButton.setChecked(False)
|
||||
self.alternatePushButton.setChecked(False)
|
||||
self.primary_push_button.setChecked(False)
|
||||
self.alternate_push_button.setChecked(False)
|
||||
else:
|
||||
if action.defaultShortcuts:
|
||||
primary_label_text = action.defaultShortcuts[0].toString()
|
||||
if len(action.defaultShortcuts) == 2:
|
||||
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
|
||||
# been triggered by a signal.
|
||||
if item is None:
|
||||
primary_text = self.primaryPushButton.text()
|
||||
alternate_text = self.alternatePushButton.text()
|
||||
primary_text = self.primary_push_button.text()
|
||||
alternate_text = self.alternate_push_button.text()
|
||||
elif len(shortcuts) == 1:
|
||||
primary_text = shortcuts[0].toString()
|
||||
elif len(shortcuts) == 2:
|
||||
primary_text = shortcuts[0].toString()
|
||||
alternate_text = shortcuts[1].toString()
|
||||
# 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 = ''
|
||||
if self.alternatePushButton.isChecked():
|
||||
if self.alternate_push_button.isChecked():
|
||||
alternate_text = ''
|
||||
self.primaryPushButton.setText(primary_text)
|
||||
self.alternatePushButton.setText(alternate_text)
|
||||
self.primaryLabel.setText(primary_label_text)
|
||||
self.alternateLabel.setText(alternate_label_text)
|
||||
self.primary_push_button.setText(primary_text)
|
||||
self.alternate_push_button.setText(alternate_text)
|
||||
self.primary_label.setText(primary_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.
|
||||
if item is None:
|
||||
return
|
||||
if primary_label_text == primary_text and alternate_label_text == alternate_text:
|
||||
self.defaultRadioButton.toggle()
|
||||
self.default_radio_button.toggle()
|
||||
else:
|
||||
self.customRadioButton.toggle()
|
||||
self.custom_radio_button.toggle()
|
||||
|
||||
def onRestoreDefaultsClicked(self, button):
|
||||
def on_restore_defaults_clicked(self, button):
|
||||
"""
|
||||
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'),
|
||||
translate('OpenLP.ShortcutListDialog', 'Do you want to restore all '
|
||||
'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
|
||||
self._adjustButton(self.primaryPushButton, False, text='')
|
||||
self._adjustButton(self.alternatePushButton, False, text='')
|
||||
self._adjust_button(self.primary_push_button, False, text='')
|
||||
self._adjust_button(self.alternate_push_button, False, text='')
|
||||
for category in self.action_list.categories:
|
||||
for action in category.actions:
|
||||
self.changedActions[action] = action.defaultShortcuts
|
||||
self.refreshShortcutList()
|
||||
self.changed_actions[action] = action.defaultShortcuts
|
||||
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
|
||||
for the action.
|
||||
"""
|
||||
if not toggled:
|
||||
return
|
||||
action = self._currentItemAction()
|
||||
action = self._current_item_action()
|
||||
if action is None:
|
||||
return
|
||||
temp_shortcuts = self._actionShortcuts(action)
|
||||
self.changedActions[action] = action.defaultShortcuts
|
||||
self.refreshShortcutList()
|
||||
temp_shortcuts = self._action_shortcuts(action)
|
||||
self.changed_actions[action] = action.defaultShortcuts
|
||||
self.refresh_shortcut_list()
|
||||
primary_button_text = ''
|
||||
alternate_button_text = ''
|
||||
if temp_shortcuts:
|
||||
primary_button_text = temp_shortcuts[0].toString()
|
||||
if len(temp_shortcuts) == 2:
|
||||
alternate_button_text = temp_shortcuts[1].toString()
|
||||
self.primaryPushButton.setText(primary_button_text)
|
||||
self.alternatePushButton.setText(alternate_button_text)
|
||||
self.primary_push_button.setText(primary_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
|
||||
functions triggered by button clicks.
|
||||
"""
|
||||
if not toggled:
|
||||
return
|
||||
self.onPrimaryPushButtonClicked(False)
|
||||
self.onAlternatePushButtonClicked(False)
|
||||
self.refreshShortcutList()
|
||||
self.on_primary_push_button_clicked(False)
|
||||
self.on_alternate_push_button_clicked(False)
|
||||
self.refresh_shortcut_list()
|
||||
|
||||
def save(self):
|
||||
"""
|
||||
@ -340,22 +341,22 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog):
|
||||
if category.name is None:
|
||||
continue
|
||||
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()))
|
||||
action.setShortcuts(self.changedActions[action])
|
||||
action.setShortcuts(self.changed_actions[action])
|
||||
self.action_list.update_shortcut_map(action, old_shortcuts)
|
||||
settings.setValue(action.objectName(), action.shortcuts())
|
||||
settings.endGroup()
|
||||
|
||||
def onClearPrimaryButtonClicked(self, toggled):
|
||||
def on_clear_primary_button_clicked(self, toggled):
|
||||
"""
|
||||
Restore the defaults of this action.
|
||||
"""
|
||||
self.primaryPushButton.setChecked(False)
|
||||
action = self._currentItemAction()
|
||||
self.primary_push_button.setChecked(False)
|
||||
action = self._current_item_action()
|
||||
if action is None:
|
||||
return
|
||||
shortcuts = self._actionShortcuts(action)
|
||||
shortcuts = self._action_shortcuts(action)
|
||||
new_shortcuts = []
|
||||
if action.defaultShortcuts:
|
||||
new_shortcuts.append(action.defaultShortcuts[0])
|
||||
@ -367,19 +368,19 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog):
|
||||
return
|
||||
if len(shortcuts) == 2:
|
||||
new_shortcuts.append(shortcuts[1])
|
||||
self.changedActions[action] = new_shortcuts
|
||||
self.refreshShortcutList()
|
||||
self.onCurrentItemChanged(self.treeWidget.currentItem())
|
||||
self.changed_actions[action] = new_shortcuts
|
||||
self.refresh_shortcut_list()
|
||||
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.
|
||||
"""
|
||||
self.alternatePushButton.setChecked(False)
|
||||
action = self._currentItemAction()
|
||||
self.alternate_push_button.setChecked(False)
|
||||
action = self._current_item_action()
|
||||
if action is None:
|
||||
return
|
||||
shortcuts = self._actionShortcuts(action)
|
||||
shortcuts = self._action_shortcuts(action)
|
||||
new_shortcuts = []
|
||||
if shortcuts:
|
||||
new_shortcuts.append(shortcuts[0])
|
||||
@ -388,9 +389,9 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog):
|
||||
if len(new_shortcuts) == 2:
|
||||
if not self._validiate_shortcut(action, new_shortcuts[1]):
|
||||
return
|
||||
self.changedActions[action] = new_shortcuts
|
||||
self.refreshShortcutList()
|
||||
self.onCurrentItemChanged(self.treeWidget.currentItem())
|
||||
self.changed_actions[action] = new_shortcuts
|
||||
self.refresh_shortcut_list()
|
||||
self.on_current_item_changed(self.tree_widget.currentItem())
|
||||
|
||||
def _validiate_shortcut(self, changing_action, key_sequence):
|
||||
"""
|
||||
@ -406,19 +407,19 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog):
|
||||
is_valid = True
|
||||
for category in self.action_list.categories:
|
||||
for action in category.actions:
|
||||
shortcuts = self._actionShortcuts(action)
|
||||
shortcuts = self._action_shortcuts(action)
|
||||
if key_sequence not in shortcuts:
|
||||
continue
|
||||
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
|
||||
if self.alternatePushButton.isChecked() and shortcuts.index(key_sequence) == 1:
|
||||
if self.alternate_push_button.isChecked() and shortcuts.index(key_sequence) == 1:
|
||||
continue
|
||||
# Have the same parent, thus they cannot have the same shortcut.
|
||||
if action.parent() is changing_action.parent():
|
||||
is_valid = False
|
||||
# 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]:
|
||||
is_valid = False
|
||||
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:
|
||||
self.main_window.warning_message(translate('OpenLP.ShortcutListDialog', 'Duplicate Shortcut'),
|
||||
translate('OpenLP.ShortcutListDialog',
|
||||
'The shortcut "%s" is already assigned to another action, please use a different shortcut.') %
|
||||
key_sequence.toString()
|
||||
)
|
||||
'The shortcut "%s" is already assigned to another action, please'
|
||||
' use a different shortcut.') % key_sequence.toString())
|
||||
self.dialog_was_shown = True
|
||||
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
|
||||
yet but already assigned (as changes yre applied when closing the dialog).
|
||||
"""
|
||||
if action in self.changedActions:
|
||||
return self.changedActions[action]
|
||||
if action in self.changed_actions:
|
||||
return self.changed_actions[action]
|
||||
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
|
||||
the ``treeWidget``.
|
||||
the ``tree_widget``.
|
||||
"""
|
||||
if item is None:
|
||||
item = self.treeWidget.currentItem()
|
||||
item = self.tree_widget.currentItem()
|
||||
if item is None:
|
||||
return
|
||||
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.
|
||||
"""
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -45,73 +45,73 @@ class Ui_StartTimeDialog(object):
|
||||
"""
|
||||
StartTimeDialog.setObjectName('StartTimeDialog')
|
||||
StartTimeDialog.resize(350, 10)
|
||||
self.dialogLayout = QtGui.QGridLayout(StartTimeDialog)
|
||||
self.dialogLayout.setObjectName('dialog_layout')
|
||||
self.startLabel = QtGui.QLabel(StartTimeDialog)
|
||||
self.startLabel.setObjectName('startLabel')
|
||||
self.startLabel.setAlignment(QtCore.Qt.AlignHCenter)
|
||||
self.dialogLayout.addWidget(self.startLabel, 0, 1, 1, 1)
|
||||
self.finishLabel = QtGui.QLabel(StartTimeDialog)
|
||||
self.finishLabel.setObjectName('finishLabel')
|
||||
self.finishLabel.setAlignment(QtCore.Qt.AlignHCenter)
|
||||
self.dialogLayout.addWidget(self.finishLabel, 0, 2, 1, 1)
|
||||
self.lengthLabel = QtGui.QLabel(StartTimeDialog)
|
||||
self.lengthLabel.setObjectName('startLabel')
|
||||
self.lengthLabel.setAlignment(QtCore.Qt.AlignHCenter)
|
||||
self.dialogLayout.addWidget(self.lengthLabel, 0, 3, 1, 1)
|
||||
self.hourLabel = QtGui.QLabel(StartTimeDialog)
|
||||
self.hourLabel.setObjectName('hourLabel')
|
||||
self.dialogLayout.addWidget(self.hourLabel, 1, 0, 1, 1)
|
||||
self.hourSpinBox = QtGui.QSpinBox(StartTimeDialog)
|
||||
self.hourSpinBox.setObjectName('hourSpinBox')
|
||||
self.hourSpinBox.setMinimum(0)
|
||||
self.hourSpinBox.setMaximum(4)
|
||||
self.dialogLayout.addWidget(self.hourSpinBox, 1, 1, 1, 1)
|
||||
self.hourFinishSpinBox = QtGui.QSpinBox(StartTimeDialog)
|
||||
self.hourFinishSpinBox.setObjectName('hourFinishSpinBox')
|
||||
self.hourFinishSpinBox.setMinimum(0)
|
||||
self.hourFinishSpinBox.setMaximum(4)
|
||||
self.dialogLayout.addWidget(self.hourFinishSpinBox, 1, 2, 1, 1)
|
||||
self.hourFinishLabel = QtGui.QLabel(StartTimeDialog)
|
||||
self.hourFinishLabel.setObjectName('hourLabel')
|
||||
self.hourFinishLabel.setAlignment(QtCore.Qt.AlignRight)
|
||||
self.dialogLayout.addWidget(self.hourFinishLabel, 1, 3, 1, 1)
|
||||
self.minuteLabel = QtGui.QLabel(StartTimeDialog)
|
||||
self.minuteLabel.setObjectName('minuteLabel')
|
||||
self.dialogLayout.addWidget(self.minuteLabel, 2, 0, 1, 1)
|
||||
self.minuteSpinBox = QtGui.QSpinBox(StartTimeDialog)
|
||||
self.minuteSpinBox.setObjectName('minuteSpinBox')
|
||||
self.minuteSpinBox.setMinimum(0)
|
||||
self.minuteSpinBox.setMaximum(59)
|
||||
self.dialogLayout.addWidget(self.minuteSpinBox, 2, 1, 1, 1)
|
||||
self.minuteFinishSpinBox = QtGui.QSpinBox(StartTimeDialog)
|
||||
self.minuteFinishSpinBox.setObjectName('minuteFinishSpinBox')
|
||||
self.minuteFinishSpinBox.setMinimum(0)
|
||||
self.minuteFinishSpinBox.setMaximum(59)
|
||||
self.dialogLayout.addWidget(self.minuteFinishSpinBox, 2, 2, 1, 1)
|
||||
self.minuteFinishLabel = QtGui.QLabel(StartTimeDialog)
|
||||
self.minuteFinishLabel.setObjectName('minuteLabel')
|
||||
self.minuteFinishLabel.setAlignment(QtCore.Qt.AlignRight)
|
||||
self.dialogLayout.addWidget(self.minuteFinishLabel, 2, 3, 1, 1)
|
||||
self.secondLabel = QtGui.QLabel(StartTimeDialog)
|
||||
self.secondLabel.setObjectName('secondLabel')
|
||||
self.dialogLayout.addWidget(self.secondLabel, 3, 0, 1, 1)
|
||||
self.secondSpinBox = QtGui.QSpinBox(StartTimeDialog)
|
||||
self.secondSpinBox.setObjectName('secondSpinBox')
|
||||
self.secondSpinBox.setMinimum(0)
|
||||
self.secondSpinBox.setMaximum(59)
|
||||
self.secondFinishSpinBox = QtGui.QSpinBox(StartTimeDialog)
|
||||
self.secondFinishSpinBox.setObjectName('secondFinishSpinBox')
|
||||
self.secondFinishSpinBox.setMinimum(0)
|
||||
self.secondFinishSpinBox.setMaximum(59)
|
||||
self.dialogLayout.addWidget(self.secondFinishSpinBox, 3, 2, 1, 1)
|
||||
self.secondFinishLabel = QtGui.QLabel(StartTimeDialog)
|
||||
self.secondFinishLabel.setObjectName('secondLabel')
|
||||
self.secondFinishLabel.setAlignment(QtCore.Qt.AlignRight)
|
||||
self.dialogLayout.addWidget(self.secondFinishLabel, 3, 3, 1, 1)
|
||||
self.dialogLayout.addWidget(self.secondSpinBox, 3, 1, 1, 1)
|
||||
self.dialog_layout = QtGui.QGridLayout(StartTimeDialog)
|
||||
self.dialog_layout.setObjectName('dialog_layout')
|
||||
self.start_label = QtGui.QLabel(StartTimeDialog)
|
||||
self.start_label.setObjectName('start_label')
|
||||
self.start_label.setAlignment(QtCore.Qt.AlignHCenter)
|
||||
self.dialog_layout.addWidget(self.start_label, 0, 1, 1, 1)
|
||||
self.finish_label = QtGui.QLabel(StartTimeDialog)
|
||||
self.finish_label.setObjectName('finish_label')
|
||||
self.finish_label.setAlignment(QtCore.Qt.AlignHCenter)
|
||||
self.dialog_layout.addWidget(self.finish_label, 0, 2, 1, 1)
|
||||
self.length_label = QtGui.QLabel(StartTimeDialog)
|
||||
self.length_label.setObjectName('start_label')
|
||||
self.length_label.setAlignment(QtCore.Qt.AlignHCenter)
|
||||
self.dialog_layout.addWidget(self.length_label, 0, 3, 1, 1)
|
||||
self.hour_label = QtGui.QLabel(StartTimeDialog)
|
||||
self.hour_label.setObjectName('hour_label')
|
||||
self.dialog_layout.addWidget(self.hour_label, 1, 0, 1, 1)
|
||||
self.hour_spin_box = QtGui.QSpinBox(StartTimeDialog)
|
||||
self.hour_spin_box.setObjectName('hour_spin_box')
|
||||
self.hour_spin_box.setMinimum(0)
|
||||
self.hour_spin_box.setMaximum(4)
|
||||
self.dialog_layout.addWidget(self.hour_spin_box, 1, 1, 1, 1)
|
||||
self.hour_finish_spin_box = QtGui.QSpinBox(StartTimeDialog)
|
||||
self.hour_finish_spin_box.setObjectName('hour_finish_spin_box')
|
||||
self.hour_finish_spin_box.setMinimum(0)
|
||||
self.hour_finish_spin_box.setMaximum(4)
|
||||
self.dialog_layout.addWidget(self.hour_finish_spin_box, 1, 2, 1, 1)
|
||||
self.hour_finish_label = QtGui.QLabel(StartTimeDialog)
|
||||
self.hour_finish_label.setObjectName('hour_label')
|
||||
self.hour_finish_label.setAlignment(QtCore.Qt.AlignRight)
|
||||
self.dialog_layout.addWidget(self.hour_finish_label, 1, 3, 1, 1)
|
||||
self.minute_label = QtGui.QLabel(StartTimeDialog)
|
||||
self.minute_label.setObjectName('minute_label')
|
||||
self.dialog_layout.addWidget(self.minute_label, 2, 0, 1, 1)
|
||||
self.minute_spin_box = QtGui.QSpinBox(StartTimeDialog)
|
||||
self.minute_spin_box.setObjectName('minute_spin_box')
|
||||
self.minute_spin_box.setMinimum(0)
|
||||
self.minute_spin_box.setMaximum(59)
|
||||
self.dialog_layout.addWidget(self.minute_spin_box, 2, 1, 1, 1)
|
||||
self.minute_finish_spin_box = QtGui.QSpinBox(StartTimeDialog)
|
||||
self.minute_finish_spin_box.setObjectName('minute_finish_spin_box')
|
||||
self.minute_finish_spin_box.setMinimum(0)
|
||||
self.minute_finish_spin_box.setMaximum(59)
|
||||
self.dialog_layout.addWidget(self.minute_finish_spin_box, 2, 2, 1, 1)
|
||||
self.minute_finish_label = QtGui.QLabel(StartTimeDialog)
|
||||
self.minute_finish_label.setObjectName('minute_label')
|
||||
self.minute_finish_label.setAlignment(QtCore.Qt.AlignRight)
|
||||
self.dialog_layout.addWidget(self.minute_finish_label, 2, 3, 1, 1)
|
||||
self.second_label = QtGui.QLabel(StartTimeDialog)
|
||||
self.second_label.setObjectName('second_label')
|
||||
self.dialog_layout.addWidget(self.second_label, 3, 0, 1, 1)
|
||||
self.second_spin_box = QtGui.QSpinBox(StartTimeDialog)
|
||||
self.second_spin_box.setObjectName('second_spin_box')
|
||||
self.second_spin_box.setMinimum(0)
|
||||
self.second_spin_box.setMaximum(59)
|
||||
self.second_finish_spin_box = QtGui.QSpinBox(StartTimeDialog)
|
||||
self.second_finish_spin_box.setObjectName('second_finish_spin_box')
|
||||
self.second_finish_spin_box.setMinimum(0)
|
||||
self.second_finish_spin_box.setMaximum(59)
|
||||
self.dialog_layout.addWidget(self.second_finish_spin_box, 3, 2, 1, 1)
|
||||
self.second_finish_label = QtGui.QLabel(StartTimeDialog)
|
||||
self.second_finish_label.setObjectName('second_label')
|
||||
self.second_finish_label.setAlignment(QtCore.Qt.AlignRight)
|
||||
self.dialog_layout.addWidget(self.second_finish_label, 3, 3, 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.dialogLayout.addWidget(self.button_box, 5, 2, 1, 2)
|
||||
self.dialog_layout.addWidget(self.button_box, 5, 2, 1, 2)
|
||||
self.retranslateUi(StartTimeDialog)
|
||||
self.setMaximumHeight(self.sizeHint().height())
|
||||
|
||||
@ -119,16 +119,16 @@ class Ui_StartTimeDialog(object):
|
||||
"""
|
||||
Update the translations on the fly
|
||||
"""
|
||||
self.setWindowTitle(translate('OpenLP.StartTimeForm', 'Item Start and Finish Time'))
|
||||
self.hourSpinBox.setSuffix(UiStrings().Hours)
|
||||
self.minuteSpinBox.setSuffix(UiStrings().Minutes)
|
||||
self.secondSpinBox.setSuffix(UiStrings().Seconds)
|
||||
self.hourFinishSpinBox.setSuffix(UiStrings().Hours)
|
||||
self.minuteFinishSpinBox.setSuffix(UiStrings().Minutes)
|
||||
self.secondFinishSpinBox.setSuffix(UiStrings().Seconds)
|
||||
self.hourLabel.setText(translate('OpenLP.StartTimeForm', 'Hours:'))
|
||||
self.minuteLabel.setText(translate('OpenLP.StartTimeForm', 'Minutes:'))
|
||||
self.secondLabel.setText(translate('OpenLP.StartTimeForm', 'Seconds:'))
|
||||
self.startLabel.setText(translate('OpenLP.StartTimeForm', 'Start'))
|
||||
self.finishLabel.setText(translate('OpenLP.StartTimeForm', 'Finish'))
|
||||
self.lengthLabel.setText(translate('OpenLP.StartTimeForm', 'Length'))
|
||||
self.setWindowTitle(translate('OpenLP.StartTime_form', 'Item Start and Finish Time'))
|
||||
self.hour_spin_box.setSuffix(UiStrings().Hours)
|
||||
self.minute_spin_box.setSuffix(UiStrings().Minutes)
|
||||
self.second_spin_box.setSuffix(UiStrings().Seconds)
|
||||
self.hour_finish_spin_box.setSuffix(UiStrings().Hours)
|
||||
self.minute_finish_spin_box.setSuffix(UiStrings().Minutes)
|
||||
self.second_finish_spin_box.setSuffix(UiStrings().Seconds)
|
||||
self.hour_label.setText(translate('OpenLP.StartTime_form', 'Hours:'))
|
||||
self.minute_label.setText(translate('OpenLP.StartTime_form', 'Minutes:'))
|
||||
self.second_label.setText(translate('OpenLP.StartTime_form', 'Seconds:'))
|
||||
self.start_label.setText(translate('OpenLP.StartTime_form', 'Start'))
|
||||
self.finish_label.setText(translate('OpenLP.StartTime_form', 'Finish'))
|
||||
self.length_label.setText(translate('OpenLP.StartTime_form', 'Length'))
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -54,32 +54,34 @@ class StartTimeForm(QtGui.QDialog, Ui_StartTimeDialog):
|
||||
Run the Dialog with correct heading.
|
||||
"""
|
||||
hour, minutes, seconds = self._time_split(self.item['service_item'].start_time)
|
||||
self.hourSpinBox.setValue(hour)
|
||||
self.minuteSpinBox.setValue(minutes)
|
||||
self.secondSpinBox.setValue(seconds)
|
||||
self.hour_spin_box.setValue(hour)
|
||||
self.minute_spin_box.setValue(minutes)
|
||||
self.second_spin_box.setValue(seconds)
|
||||
hours, minutes, seconds = self._time_split(self.item['service_item'].media_length)
|
||||
self.hourFinishSpinBox.setValue(hours)
|
||||
self.minuteFinishSpinBox.setValue(minutes)
|
||||
self.secondFinishSpinBox.setValue(seconds)
|
||||
self.hourFinishLabel.setText('%s%s' % (str(hour), UiStrings().Hours))
|
||||
self.minuteFinishLabel.setText('%s%s' % (str(minutes), UiStrings().Minutes))
|
||||
self.secondFinishLabel.setText('%s%s' % (str(seconds), UiStrings().Seconds))
|
||||
self.hour_finish_spin_box.setValue(hours)
|
||||
self.minute_finish_spin_box.setValue(minutes)
|
||||
self.second_finish_spin_box.setValue(seconds)
|
||||
self.hour_finish_label.setText('%s%s' % (str(hour), UiStrings().Hours))
|
||||
self.minute_finish_label.setText('%s%s' % (str(minutes), UiStrings().Minutes))
|
||||
self.second_finish_label.setText('%s%s' % (str(seconds), UiStrings().Seconds))
|
||||
return QtGui.QDialog.exec_(self)
|
||||
|
||||
def accept(self):
|
||||
"""
|
||||
When the dialog succeeds, this is run
|
||||
"""
|
||||
start = self.hourSpinBox.value() * 3600 + self.minuteSpinBox.value() * 60 + self.secondSpinBox.value()
|
||||
end = self.hourFinishSpinBox.value() * 3600 + \
|
||||
self.minuteFinishSpinBox.value() * 60 + self.secondFinishSpinBox.value()
|
||||
start = self.hour_spin_box.value() * 3600 + self.minute_spin_box.value() * 60 + self.second_spin_box.value()
|
||||
end = self.hour_finish_spin_box.value() * 3600 + \
|
||||
self.minute_finish_spin_box.value() * 60 + self.second_finish_spin_box.value()
|
||||
if end > self.item['service_item'].media_length:
|
||||
critical_error_message_box(title=translate('OpenLP.StartTimeForm', 'Time Validation Error'),
|
||||
message=translate('OpenLP.StartTimeForm', 'Finish time is set after the end of the media item'))
|
||||
critical_error_message_box(title=translate('OpenLP.StartTime_form', 'Time Validation Error'),
|
||||
message=translate('OpenLP.StartTime_form',
|
||||
'Finish time is set after the end of the media item'))
|
||||
return
|
||||
elif start > end:
|
||||
critical_error_message_box(title=translate('OpenLP.StartTimeForm', 'Time Validation Error'),
|
||||
message=translate('OpenLP.StartTimeForm', 'Start time is after the finish time of the media item'))
|
||||
critical_error_message_box(title=translate('OpenLP.StartTime_form', 'Time Validation Error'),
|
||||
message=translate('OpenLP.StartTime_form',
|
||||
'Start time is after the finish time of the media item'))
|
||||
return
|
||||
self.item['service_item'].start_time = start
|
||||
self.item['service_item'].end_time = end
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -18,11 +18,11 @@
|
||||
# Software Foundation; version 2 of the License. #
|
||||
# #
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT #
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
|
||||
# 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 #
|
||||
# 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 #
|
||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||
###############################################################################
|
||||
@ -62,97 +62,97 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
|
||||
super(ThemeForm, self).__init__(parent)
|
||||
self.setupUi(self)
|
||||
self.registerFields()
|
||||
self.updateThemeAllowed = True
|
||||
self.update_theme_allowed = True
|
||||
self.temp_background_filename = ''
|
||||
self.themeLayoutForm = ThemeLayoutForm(self)
|
||||
self.backgroundComboBox.currentIndexChanged.connect(self.onBackgroundComboBoxCurrentIndexChanged)
|
||||
self.gradientComboBox.currentIndexChanged.connect(self.onGradientComboBoxCurrentIndexChanged)
|
||||
self.colorButton.clicked.connect(self.onColorButtonClicked)
|
||||
self.imageColorButton.clicked.connect(self.onImageColorButtonClicked)
|
||||
self.gradientStartButton.clicked.connect(self.onGradientStartButtonClicked)
|
||||
self.gradientEndButton.clicked.connect(self.onGradientEndButtonClicked)
|
||||
self.imageBrowseButton.clicked.connect(self.onImageBrowseButtonClicked)
|
||||
self.imageFileEdit.editingFinished.connect(self.onImageFileEditEditingFinished)
|
||||
self.mainColorButton.clicked.connect(self.onMainColorButtonClicked)
|
||||
self.outlineColorButton.clicked.connect(self.onOutlineColorButtonClicked)
|
||||
self.shadowColorButton.clicked.connect(self.onShadowColorButtonClicked)
|
||||
self.outlineCheckBox.stateChanged.connect(self.onOutlineCheckCheckBoxStateChanged)
|
||||
self.shadowCheckBox.stateChanged.connect(self.onShadowCheckCheckBoxStateChanged)
|
||||
self.footerColorButton.clicked.connect(self.onFooterColorButtonClicked)
|
||||
self.customButtonClicked.connect(self.onCustom1ButtonClicked)
|
||||
self.mainPositionCheckBox.stateChanged.connect(self.onMainPositionCheckBoxStateChanged)
|
||||
self.footerPositionCheckBox.stateChanged.connect(self.onFooterPositionCheckBoxStateChanged)
|
||||
self.currentIdChanged.connect(self.onCurrentIdChanged)
|
||||
Registry().register_function('theme_line_count', self.updateLinesText)
|
||||
self.mainSizeSpinBox.valueChanged.connect(self.calculateLines)
|
||||
self.lineSpacingSpinBox.valueChanged.connect(self.calculateLines)
|
||||
self.outlineSizeSpinBox.valueChanged.connect(self.calculateLines)
|
||||
self.shadowSizeSpinBox.valueChanged.connect(self.calculateLines)
|
||||
self.mainFontComboBox.activated.connect(self.calculateLines)
|
||||
self.footerFontComboBox.activated.connect(self.updateTheme)
|
||||
self.footerSizeSpinBox.valueChanged.connect(self.updateTheme)
|
||||
self.theme_layout_form = ThemeLayoutForm(self)
|
||||
self.background_combo_box.currentIndexChanged.connect(self.on_background_combo_box_current_index_changed)
|
||||
self.gradient_combo_box.currentIndexChanged.connect(self.on_gradient_combo_box_current_index_changed)
|
||||
self.color_button.clicked.connect(self.on_color_button_clicked)
|
||||
self.image_color_button.clicked.connect(self.on_image_color_button_clicked)
|
||||
self.gradient_start_button.clicked.connect(self.on_gradient_start_button_clicked)
|
||||
self.gradient_end_button.clicked.connect(self.on_gradient_end_button_clicked)
|
||||
self.image_browse_button.clicked.connect(self.on_image_browse_button_clicked)
|
||||
self.image_file_edit.editingFinished.connect(self.on_image_file_edit_editing_finished)
|
||||
self.main_color_button.clicked.connect(self.on_main_color_button_clicked)
|
||||
self.outline_color_button.clicked.connect(self.on_outline_color_button_clicked)
|
||||
self.shadow_color_button.clicked.connect(self.on_shadow_color_button_clicked)
|
||||
self.outline_check_box.stateChanged.connect(self.on_outline_check_check_box_state_changed)
|
||||
self.shadow_check_box.stateChanged.connect(self.on_shadow_check_check_box_state_changed)
|
||||
self.footer_color_button.clicked.connect(self.on_footer_color_button_clicked)
|
||||
self.customButtonClicked.connect(self.on_custom_1_button_clicked)
|
||||
self.main_position_check_box.stateChanged.connect(self.on_main_position_check_box_state_changed)
|
||||
self.footer_position_check_box.stateChanged.connect(self.on_footer_position_check_box_state_changed)
|
||||
self.currentIdChanged.connect(self.on_current_id_changed)
|
||||
Registry().register_function('theme_line_count', self.update_lines_text)
|
||||
self.main_size_spin_box.valueChanged.connect(self.calculate_lines)
|
||||
self.line_spacing_spin_box.valueChanged.connect(self.calculate_lines)
|
||||
self.outline_size_spin_box.valueChanged.connect(self.calculate_lines)
|
||||
self.shadow_size_spin_box.valueChanged.connect(self.calculate_lines)
|
||||
self.main_font_combo_box.activated.connect(self.calculate_lines)
|
||||
self.footer_font_combo_box.activated.connect(self.update_theme)
|
||||
self.footer_size_spin_box.valueChanged.connect(self.update_theme)
|
||||
|
||||
def setDefaults(self):
|
||||
"""
|
||||
Set up display at start of theme edit.
|
||||
"""
|
||||
self.restart()
|
||||
self.setBackgroundPageValues()
|
||||
self.setMainAreaPageValues()
|
||||
self.setFooterAreaPageValues()
|
||||
self.setAlignmentPageValues()
|
||||
self.setPositionPageValues()
|
||||
self.setPreviewPageValues()
|
||||
self.set_background_page_values()
|
||||
self.set_main_area_page_values()
|
||||
self.set_footer_area_page_values()
|
||||
self.set_alignment_page_values()
|
||||
self.set_position_page_values()
|
||||
self.set_preview_page_values()
|
||||
|
||||
def registerFields(self):
|
||||
"""
|
||||
Map field names to screen names,
|
||||
"""
|
||||
self.backgroundPage.registerField('background_type', self.backgroundComboBox)
|
||||
self.backgroundPage.registerField('color', self.colorButton)
|
||||
self.backgroundPage.registerField('grandient_start', self.gradientStartButton)
|
||||
self.backgroundPage.registerField('grandient_end', self.gradientEndButton)
|
||||
self.backgroundPage.registerField('background_image', self.imageFileEdit)
|
||||
self.backgroundPage.registerField('gradient', self.gradientComboBox)
|
||||
self.mainAreaPage.registerField('mainColorButton', self.mainColorButton)
|
||||
self.mainAreaPage.registerField('mainSizeSpinBox', self.mainSizeSpinBox)
|
||||
self.mainAreaPage.registerField('lineSpacingSpinBox', self.lineSpacingSpinBox)
|
||||
self.mainAreaPage.registerField('outlineCheckBox', self.outlineCheckBox)
|
||||
self.mainAreaPage.registerField('outlineColorButton', self.outlineColorButton)
|
||||
self.mainAreaPage.registerField('outlineSizeSpinBox', self.outlineSizeSpinBox)
|
||||
self.mainAreaPage.registerField('shadowCheckBox', self.shadowCheckBox)
|
||||
self.mainAreaPage.registerField('mainBoldCheckBox', self.mainBoldCheckBox)
|
||||
self.mainAreaPage.registerField('mainItalicsCheckBox', self.mainItalicsCheckBox)
|
||||
self.mainAreaPage.registerField('shadowColorButton', self.shadowColorButton)
|
||||
self.mainAreaPage.registerField('shadowSizeSpinBox', self.shadowSizeSpinBox)
|
||||
self.mainAreaPage.registerField('footerSizeSpinBox', self.footerSizeSpinBox)
|
||||
self.areaPositionPage.registerField('mainPositionX', self.mainXSpinBox)
|
||||
self.areaPositionPage.registerField('mainPositionY', self.mainYSpinBox)
|
||||
self.areaPositionPage.registerField('mainPositionWidth', self.mainWidthSpinBox)
|
||||
self.areaPositionPage.registerField('mainPositionHeight', self.mainHeightSpinBox)
|
||||
self.areaPositionPage.registerField('footerPositionX', self.footerXSpinBox)
|
||||
self.areaPositionPage.registerField('footerPositionY', self.footerYSpinBox)
|
||||
self.areaPositionPage.registerField('footerPositionWidth', self.footerWidthSpinBox)
|
||||
self.areaPositionPage.registerField('footerPositionHeight', self.footerHeightSpinBox)
|
||||
self.backgroundPage.registerField('horizontal', self.horizontalComboBox)
|
||||
self.backgroundPage.registerField('vertical', self.verticalComboBox)
|
||||
self.backgroundPage.registerField('slideTransition', self.transitionsCheckBox)
|
||||
self.backgroundPage.registerField('name', self.themeNameEdit)
|
||||
self.background_page.registerField('background_type', self.background_combo_box)
|
||||
self.background_page.registerField('color', self.color_button)
|
||||
self.background_page.registerField('gradient_start', self.gradient_start_button)
|
||||
self.background_page.registerField('gradient_end', self.gradient_end_button)
|
||||
self.background_page.registerField('background_image', self.image_file_edit)
|
||||
self.background_page.registerField('gradient', self.gradient_combo_box)
|
||||
self.main_area_page.registerField('main_color_button', self.main_color_button)
|
||||
self.main_area_page.registerField('main_size_spin_box', self.main_size_spin_box)
|
||||
self.main_area_page.registerField('line_spacing_spin_box', self.line_spacing_spin_box)
|
||||
self.main_area_page.registerField('outline_check_box', self.outline_check_box)
|
||||
self.main_area_page.registerField('outline_color_button', self.outline_color_button)
|
||||
self.main_area_page.registerField('outline_size_spin_box', self.outline_size_spin_box)
|
||||
self.main_area_page.registerField('shadow_check_box', self.shadow_check_box)
|
||||
self.main_area_page.registerField('main_bold_check_box', self.main_bold_check_box)
|
||||
self.main_area_page.registerField('main_italics_check_box', self.main_italics_check_box)
|
||||
self.main_area_page.registerField('shadow_color_button', self.shadow_color_button)
|
||||
self.main_area_page.registerField('shadow_size_spin_box', self.shadow_size_spin_box)
|
||||
self.main_area_page.registerField('footer_size_spin_box', self.footer_size_spin_box)
|
||||
self.area_position_page.registerField('main_position_x', self.main_x_spin_box)
|
||||
self.area_position_page.registerField('main_position_y', self.main_y_spin_box)
|
||||
self.area_position_page.registerField('main_position_width', self.main_width_spin_box)
|
||||
self.area_position_page.registerField('main_position_height', self.main_height_spin_box)
|
||||
self.area_position_page.registerField('footer_position_x', self.footer_x_spin_box)
|
||||
self.area_position_page.registerField('footer_position_y', self.footer_y_spin_box)
|
||||
self.area_position_page.registerField('footer_position_width', self.footer_width_spin_box)
|
||||
self.area_position_page.registerField('footer_position_height', self.footer_height_spin_box)
|
||||
self.background_page.registerField('horizontal', self.horizontal_combo_box)
|
||||
self.background_page.registerField('vertical', self.vertical_combo_box)
|
||||
self.background_page.registerField('slide_transition', self.transitions_check_box)
|
||||
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
|
||||
"""
|
||||
# Do not trigger on start up
|
||||
if self.currentPage != self.welcome_page:
|
||||
self.updateTheme()
|
||||
self.update_theme()
|
||||
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
|
||||
"""
|
||||
self.mainLineCountLabel.setText(
|
||||
self.main_line_count_label.setText(
|
||||
translate('OpenLP.ThemeForm', '(approximately %d lines per slide)') % int(lines))
|
||||
|
||||
def resizeEvent(self, event=None):
|
||||
@ -162,50 +162,49 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
|
||||
if not event:
|
||||
event = QtGui.QResizeEvent(self.size(), self.size())
|
||||
QtGui.QWizard.resizeEvent(self, event)
|
||||
if self.currentPage() == self.previewPage:
|
||||
frameWidth = self.previewBoxLabel.lineWidth()
|
||||
pixmapWidth = self.previewArea.width() - 2 * frameWidth
|
||||
pixmapHeight = self.previewArea.height() - 2 * frameWidth
|
||||
aspectRatio = float(pixmapWidth) / pixmapHeight
|
||||
if aspectRatio < self.displayAspectRatio:
|
||||
pixmapHeight = int(pixmapWidth / self.displayAspectRatio + 0.5)
|
||||
if self.currentPage() == self.preview_page:
|
||||
frame_width = self.preview_box_label.lineWidth()
|
||||
pixmap_width = self.preview_area.width() - 2 * frame_width
|
||||
pixmap_height = self.preview_area.height() - 2 * frame_width
|
||||
aspect_ratio = float(pixmap_width) / pixmap_height
|
||||
if aspect_ratio < self.display_aspect_ratio:
|
||||
pixmap_height = int(pixmap_width / self.display_aspect_ratio + 0.5)
|
||||
else:
|
||||
pixmapWidth = int(pixmapHeight * self.displayAspectRatio + 0.5)
|
||||
self.previewBoxLabel.setFixedSize(pixmapWidth + 2 * frameWidth,
|
||||
pixmapHeight + 2 * frameWidth)
|
||||
pixmap_width = int(pixmap_height * self.display_aspect_ratio + 0.5)
|
||||
self.preview_box_label.setFixedSize(pixmap_width + 2 * frame_width, pixmap_height + 2 * frame_width)
|
||||
|
||||
def validateCurrentPage(self):
|
||||
"""
|
||||
Validate the current page
|
||||
"""
|
||||
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):
|
||||
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.'))
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
def onCurrentIdChanged(self, pageId):
|
||||
def on_current_id_changed(self, page_id):
|
||||
"""
|
||||
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)
|
||||
if self.page(pageId) == self.previewPage:
|
||||
self.updateTheme()
|
||||
if self.page(page_id) == self.preview_page:
|
||||
self.update_theme()
|
||||
frame = self.theme_manager.generate_image(self.theme)
|
||||
self.previewBoxLabel.setPixmap(frame)
|
||||
self.displayAspectRatio = float(frame.width()) / frame.height()
|
||||
self.preview_box_label.setPixmap(frame)
|
||||
self.display_aspect_ratio = float(frame.width()) / frame.height()
|
||||
self.resizeEvent()
|
||||
|
||||
def onCustom1ButtonClicked(self, number):
|
||||
def on_custom_1_button_clicked(self, number):
|
||||
"""
|
||||
Generate layout preview and display the form.
|
||||
"""
|
||||
self.updateTheme()
|
||||
self.update_theme()
|
||||
width = self.renderer.width
|
||||
height = self.renderer.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.drawRect(self.renderer.get_footer_rectangle(self.theme))
|
||||
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
|
||||
"""
|
||||
if self.updateThemeAllowed:
|
||||
if self.update_theme_allowed:
|
||||
self.theme.font_main_outline = state == QtCore.Qt.Checked
|
||||
self.outlineColorButton.setEnabled(self.theme.font_main_outline)
|
||||
self.outlineSizeSpinBox.setEnabled(self.theme.font_main_outline)
|
||||
self.calculateLines()
|
||||
self.outline_color_button.setEnabled(self.theme.font_main_outline)
|
||||
self.outline_size_spin_box.setEnabled(self.theme.font_main_outline)
|
||||
self.calculate_lines()
|
||||
|
||||
def onShadowCheckCheckBoxStateChanged(self, state):
|
||||
def on_shadow_check_check_box_state_changed(self, state):
|
||||
"""
|
||||
Change state as Shadow check box changed
|
||||
"""
|
||||
if self.updateThemeAllowed:
|
||||
if self.update_theme_allowed:
|
||||
if state == QtCore.Qt.Checked:
|
||||
self.theme.font_main_shadow = True
|
||||
else:
|
||||
self.theme.font_main_shadow = False
|
||||
self.shadowColorButton.setEnabled(self.theme.font_main_shadow)
|
||||
self.shadowSizeSpinBox.setEnabled(self.theme.font_main_shadow)
|
||||
self.calculateLines()
|
||||
self.shadow_color_button.setEnabled(self.theme.font_main_shadow)
|
||||
self.shadow_size_spin_box.setEnabled(self.theme.font_main_shadow)
|
||||
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
|
||||
"""
|
||||
if self.updateThemeAllowed:
|
||||
if self.update_theme_allowed:
|
||||
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
|
||||
"""
|
||||
if self.updateThemeAllowed:
|
||||
if self.update_theme_allowed:
|
||||
self.theme.font_footer_override = not (value == QtCore.Qt.Checked)
|
||||
|
||||
def exec_(self, edit=False):
|
||||
@ -263,11 +262,11 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
|
||||
"""
|
||||
log.debug('Editing theme %s' % self.theme.theme_name)
|
||||
self.temp_background_filename = ''
|
||||
self.updateThemeAllowed = False
|
||||
self.update_theme_allowed = False
|
||||
self.setDefaults()
|
||||
self.updateThemeAllowed = True
|
||||
self.themeNameLabel.setVisible(not edit)
|
||||
self.themeNameEdit.setVisible(not edit)
|
||||
self.update_theme_allowed = True
|
||||
self.theme_name_label.setVisible(not edit)
|
||||
self.theme_name_edit.setVisible(not edit)
|
||||
self.edit_mode = edit
|
||||
if edit:
|
||||
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
|
||||
"""
|
||||
log.debug('initializePage %s' % page_id)
|
||||
wizardPage = self.page(page_id)
|
||||
if wizardPage == self.backgroundPage:
|
||||
self.setBackgroundPageValues()
|
||||
elif wizardPage == self.mainAreaPage:
|
||||
self.setMainAreaPageValues()
|
||||
elif wizardPage == self.footerAreaPage:
|
||||
self.setFooterAreaPageValues()
|
||||
elif wizardPage == self.alignmentPage:
|
||||
self.setAlignmentPageValues()
|
||||
elif wizardPage == self.areaPositionPage:
|
||||
self.setPositionPageValues()
|
||||
wizard_page = self.page(page_id)
|
||||
if wizard_page == self.background_page:
|
||||
self.set_background_page_values()
|
||||
elif wizard_page == self.main_area_page:
|
||||
self.set_main_area_page_values()
|
||||
elif wizard_page == self.footer_area_page:
|
||||
self.set_footer_area_page_values()
|
||||
elif wizard_page == self.alignment_page:
|
||||
self.set_alignment_page_values()
|
||||
elif wizard_page == self.area_position_page:
|
||||
self.set_position_page_values()
|
||||
|
||||
def setBackgroundPageValues(self):
|
||||
def set_background_page_values(self):
|
||||
"""
|
||||
Handle the display and state of the Background page.
|
||||
"""
|
||||
if self.theme.background_type == \
|
||||
BackgroundType.to_string(BackgroundType.Solid):
|
||||
self.colorButton.setStyleSheet('background-color: %s' % self.theme.background_color)
|
||||
if self.theme.background_type == BackgroundType.to_string(BackgroundType.Solid):
|
||||
self.color_button.setStyleSheet('background-color: %s' % self.theme.background_color)
|
||||
self.setField('background_type', 0)
|
||||
elif self.theme.background_type == BackgroundType.to_string(BackgroundType.Gradient):
|
||||
self.gradientStartButton.setStyleSheet('background-color: %s' % self.theme.background_start_color)
|
||||
self.gradientEndButton.setStyleSheet('background-color: %s' % self.theme.background_end_color)
|
||||
self.gradient_start_button.setStyleSheet('background-color: %s' % self.theme.background_start_color)
|
||||
self.gradient_end_button.setStyleSheet('background-color: %s' % self.theme.background_end_color)
|
||||
self.setField('background_type', 1)
|
||||
elif self.theme.background_type == BackgroundType.to_string(BackgroundType.Image):
|
||||
self.imageColorButton.setStyleSheet('background-color: %s' % self.theme.background_border_color)
|
||||
self.imageFileEdit.setText(self.theme.background_filename)
|
||||
self.image_color_button.setStyleSheet('background-color: %s' % self.theme.background_border_color)
|
||||
self.image_file_edit.setText(self.theme.background_filename)
|
||||
self.setField('background_type', 2)
|
||||
elif self.theme.background_type == BackgroundType.to_string(BackgroundType.Transparent):
|
||||
self.setField('background_type', 3)
|
||||
@ -322,68 +320,68 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
|
||||
else:
|
||||
self.setField('gradient', 4)
|
||||
|
||||
def setMainAreaPageValues(self):
|
||||
def set_main_area_page_values(self):
|
||||
"""
|
||||
Handle the display and state of the Main Area page.
|
||||
"""
|
||||
self.mainFontComboBox.setCurrentFont(QtGui.QFont(self.theme.font_main_name))
|
||||
self.mainColorButton.setStyleSheet('background-color: %s' % self.theme.font_main_color)
|
||||
self.setField('mainSizeSpinBox', self.theme.font_main_size)
|
||||
self.setField('lineSpacingSpinBox', self.theme.font_main_line_adjustment)
|
||||
self.setField('outlineCheckBox', self.theme.font_main_outline)
|
||||
self.outlineColorButton.setStyleSheet('background-color: %s' % self.theme.font_main_outline_color)
|
||||
self.setField('outlineSizeSpinBox', self.theme.font_main_outline_size)
|
||||
self.setField('shadowCheckBox', self.theme.font_main_shadow)
|
||||
self.shadowColorButton.setStyleSheet('background-color: %s' % self.theme.font_main_shadow_color)
|
||||
self.setField('shadowSizeSpinBox', self.theme.font_main_shadow_size)
|
||||
self.setField('mainBoldCheckBox', self.theme.font_main_bold)
|
||||
self.setField('mainItalicsCheckBox', self.theme.font_main_italics)
|
||||
self.main_font_combo_box.setCurrentFont(QtGui.QFont(self.theme.font_main_name))
|
||||
self.main_color_button.setStyleSheet('background-color: %s' % self.theme.font_main_color)
|
||||
self.setField('main_size_spin_box', self.theme.font_main_size)
|
||||
self.setField('line_spacing_spin_box', self.theme.font_main_line_adjustment)
|
||||
self.setField('outline_check_box', self.theme.font_main_outline)
|
||||
self.outline_color_button.setStyleSheet('background-color: %s' % self.theme.font_main_outline_color)
|
||||
self.setField('outline_size_spin_box', self.theme.font_main_outline_size)
|
||||
self.setField('shadow_check_box', self.theme.font_main_shadow)
|
||||
self.shadow_color_button.setStyleSheet('background-color: %s' % self.theme.font_main_shadow_color)
|
||||
self.setField('shadow_size_spin_box', self.theme.font_main_shadow_size)
|
||||
self.setField('main_bold_check_box', self.theme.font_main_bold)
|
||||
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.
|
||||
"""
|
||||
self.footerFontComboBox.setCurrentFont(QtGui.QFont(self.theme.font_footer_name))
|
||||
self.footerColorButton.setStyleSheet('background-color: %s' % self.theme.font_footer_color)
|
||||
self.setField('footerSizeSpinBox', self.theme.font_footer_size)
|
||||
self.footer_font_combo_box.setCurrentFont(QtGui.QFont(self.theme.font_footer_name))
|
||||
self.footer_color_button.setStyleSheet('background-color: %s' % self.theme.font_footer_color)
|
||||
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
|
||||
self.mainPositionCheckBox.setChecked(not self.theme.font_main_override)
|
||||
self.setField('mainPositionX', self.theme.font_main_x)
|
||||
self.setField('mainPositionY', self.theme.font_main_y)
|
||||
self.setField('mainPositionHeight', self.theme.font_main_height)
|
||||
self.setField('mainPositionWidth', self.theme.font_main_width)
|
||||
self.main_position_check_box.setChecked(not self.theme.font_main_override)
|
||||
self.setField('main_position_x', self.theme.font_main_x)
|
||||
self.setField('main_position_y', self.theme.font_main_y)
|
||||
self.setField('main_position_height', self.theme.font_main_height)
|
||||
self.setField('main_position_width', self.theme.font_main_width)
|
||||
# Footer
|
||||
self.footerPositionCheckBox.setChecked(not self.theme.font_footer_override)
|
||||
self.setField('footerPositionX', self.theme.font_footer_x)
|
||||
self.setField('footerPositionY', self.theme.font_footer_y)
|
||||
self.setField('footerPositionHeight', self.theme.font_footer_height)
|
||||
self.setField('footerPositionWidth', self.theme.font_footer_width)
|
||||
self.footer_position_check_box.setChecked(not self.theme.font_footer_override)
|
||||
self.setField('footer_position_x', self.theme.font_footer_x)
|
||||
self.setField('footer_position_y', self.theme.font_footer_y)
|
||||
self.setField('footer_position_height', self.theme.font_footer_height)
|
||||
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.
|
||||
"""
|
||||
self.setField('horizontal', self.theme.display_horizontal_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.
|
||||
"""
|
||||
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.
|
||||
"""
|
||||
# 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)
|
||||
if self.theme.background_type != BackgroundType.to_string(BackgroundType.Image) and \
|
||||
self.temp_background_filename == '':
|
||||
@ -393,122 +391,122 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
|
||||
self.temp_background_filename != '':
|
||||
self.theme.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.
|
||||
"""
|
||||
if self.updateThemeAllowed:
|
||||
if self.update_theme_allowed:
|
||||
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.setBackgroundPageValues()
|
||||
self.theme.background_color = self._color_button(self.theme.background_color)
|
||||
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.setBackgroundPageValues()
|
||||
self.theme.background_border_color = self._color_button(self.theme.background_border_color)
|
||||
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.setBackgroundPageValues()
|
||||
self.theme.background_start_color = self._color_button(self.theme.background_start_color)
|
||||
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.setBackgroundPageValues()
|
||||
self.theme.background_end_color = self._color_button(self.theme.background_end_color)
|
||||
self.set_background_page_values()
|
||||
|
||||
def onImageBrowseButtonClicked(self):
|
||||
def on_image_browse_button_clicked(self):
|
||||
"""
|
||||
Background Image button pushed.
|
||||
"""
|
||||
images_filter = get_images_filter()
|
||||
images_filter = '%s;;%s (*.*) (*)' % (images_filter, UiStrings().AllFiles)
|
||||
filename = QtGui.QFileDialog.getOpenFileName(self,
|
||||
translate('OpenLP.ThemeWizard', 'Select Image'), '', images_filter)
|
||||
filename = QtGui.QFileDialog.getOpenFileName(self, translate('OpenLP.ThemeWizard', 'Select Image'), '',
|
||||
images_filter)
|
||||
if 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
|
||||
"""
|
||||
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
|
||||
"""
|
||||
self.theme.font_main_color = self._colorButton(self.theme.font_main_color)
|
||||
self.setMainAreaPageValues()
|
||||
self.theme.font_main_color = self._color_button(self.theme.font_main_color)
|
||||
self.set_main_area_page_values()
|
||||
|
||||
def onOutlineColorButtonClicked(self):
|
||||
def on_outline_color_button_clicked(self):
|
||||
"""
|
||||
Set the outline colour value
|
||||
"""
|
||||
self.theme.font_main_outline_color = self._colorButton(self.theme.font_main_outline_color)
|
||||
self.setMainAreaPageValues()
|
||||
self.theme.font_main_outline_color = self._color_button(self.theme.font_main_outline_color)
|
||||
self.set_main_area_page_values()
|
||||
|
||||
def onShadowColorButtonClicked(self):
|
||||
def on_shadow_color_button_clicked(self):
|
||||
"""
|
||||
Set the shadow colour value
|
||||
"""
|
||||
self.theme.font_main_shadow_color = self._colorButton(self.theme.font_main_shadow_color)
|
||||
self.setMainAreaPageValues()
|
||||
self.theme.font_main_shadow_color = self._color_button(self.theme.font_main_shadow_color)
|
||||
self.set_main_area_page_values()
|
||||
|
||||
def onFooterColorButtonClicked(self):
|
||||
def on_footer_color_button_clicked(self):
|
||||
"""
|
||||
Set the footer colour value
|
||||
"""
|
||||
self.theme.font_footer_color = self._colorButton(self.theme.font_footer_color)
|
||||
self.setFooterAreaPageValues()
|
||||
self.theme.font_footer_color = self._color_button(self.theme.font_footer_color)
|
||||
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
|
||||
when the are changed.
|
||||
"""
|
||||
if not self.updateThemeAllowed:
|
||||
if not self.update_theme_allowed:
|
||||
return
|
||||
log.debug('updateTheme')
|
||||
log.debug('update_theme')
|
||||
# main page
|
||||
self.theme.font_main_name = self.mainFontComboBox.currentFont().family()
|
||||
self.theme.font_main_size = self.field('mainSizeSpinBox')
|
||||
self.theme.font_main_line_adjustment = self.field('lineSpacingSpinBox')
|
||||
self.theme.font_main_outline_size = self.field('outlineSizeSpinBox')
|
||||
self.theme.font_main_shadow_size = self.field('shadowSizeSpinBox')
|
||||
self.theme.font_main_bold = self.field('mainBoldCheckBox')
|
||||
self.theme.font_main_italics = self.field('mainItalicsCheckBox')
|
||||
self.theme.font_main_name = self.main_font_combo_box.currentFont().family()
|
||||
self.theme.font_main_size = self.field('main_size_spin_box')
|
||||
self.theme.font_main_line_adjustment = self.field('line_spacing_spin_box')
|
||||
self.theme.font_main_outline_size = self.field('outline_size_spin_box')
|
||||
self.theme.font_main_shadow_size = self.field('shadow_size_spin_box')
|
||||
self.theme.font_main_bold = self.field('main_bold_check_box')
|
||||
self.theme.font_main_italics = self.field('main_italics_check_box')
|
||||
# footer page
|
||||
self.theme.font_footer_name = self.footerFontComboBox.currentFont().family()
|
||||
self.theme.font_footer_size = self.field('footerSizeSpinBox')
|
||||
self.theme.font_footer_name = self.footer_font_combo_box.currentFont().family()
|
||||
self.theme.font_footer_size = self.field('footer_size_spin_box')
|
||||
# position page
|
||||
self.theme.font_main_x = self.field('mainPositionX')
|
||||
self.theme.font_main_y = self.field('mainPositionY')
|
||||
self.theme.font_main_height = self.field('mainPositionHeight')
|
||||
self.theme.font_main_width = self.field('mainPositionWidth')
|
||||
self.theme.font_footer_x = self.field('footerPositionX')
|
||||
self.theme.font_footer_y = self.field('footerPositionY')
|
||||
self.theme.font_footer_height = self.field('footerPositionHeight')
|
||||
self.theme.font_footer_width = self.field('footerPositionWidth')
|
||||
self.theme.font_main_x = self.field('main_position_x')
|
||||
self.theme.font_main_y = self.field('main_position_y')
|
||||
self.theme.font_main_height = self.field('main_position_height')
|
||||
self.theme.font_main_width = self.field('main_position_width')
|
||||
self.theme.font_footer_x = self.field('footer_position_x')
|
||||
self.theme.font_footer_y = self.field('footer_position_y')
|
||||
self.theme.font_footer_height = self.field('footer_position_height')
|
||||
self.theme.font_footer_width = self.field('footer_position_width')
|
||||
# position page
|
||||
self.theme.display_horizontal_align = self.horizontalComboBox.currentIndex()
|
||||
self.theme.display_vertical_align = self.verticalComboBox.currentIndex()
|
||||
self.theme.display_slide_transition = self.field('slideTransition')
|
||||
self.theme.display_horizontal_align = self.horizontal_combo_box.currentIndex()
|
||||
self.theme.display_vertical_align = self.vertical_combo_box.currentIndex()
|
||||
self.theme.display_slide_transition = self.field('slide_transition')
|
||||
|
||||
def accept(self):
|
||||
"""
|
||||
@ -526,20 +524,20 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
|
||||
translate('OpenLP.ThemeWizard', 'Theme Name Invalid'),
|
||||
translate('OpenLP.ThemeWizard', 'Invalid theme name. Please enter one.'))
|
||||
return
|
||||
saveFrom = None
|
||||
saveTo = None
|
||||
save_from = None
|
||||
save_to = None
|
||||
if self.theme.background_type == BackgroundType.to_string(BackgroundType.Image):
|
||||
filename = os.path.split(str(self.theme.background_filename))[1]
|
||||
saveTo = os.path.join(self.path, self.theme.theme_name, filename)
|
||||
saveFrom = self.theme.background_filename
|
||||
save_to = os.path.join(self.path, self.theme.theme_name, 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):
|
||||
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)
|
||||
|
||||
def _colorButton(self, field):
|
||||
def _color_button(self, field):
|
||||
"""
|
||||
Handle Color buttons
|
||||
Handle _color buttons
|
||||
"""
|
||||
new_color = QtGui.QColorDialog.getColor(QtGui.QColor(field), self)
|
||||
if new_color.isValid():
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -45,29 +45,29 @@ class Ui_ThemeLayoutDialog(object):
|
||||
"""
|
||||
themeLayoutDialog.setObjectName('themeLayoutDialogDialog')
|
||||
#themeLayoutDialog.resize(300, 200)
|
||||
self.previewLayout = QtGui.QVBoxLayout(themeLayoutDialog)
|
||||
self.previewLayout.setObjectName('previewLayout')
|
||||
self.previewArea = QtGui.QWidget(themeLayoutDialog)
|
||||
self.previewArea.setObjectName('previewArea')
|
||||
self.previewAreaLayout = QtGui.QGridLayout(self.previewArea)
|
||||
self.previewAreaLayout.setMargin(0)
|
||||
self.previewAreaLayout.setColumnStretch(0, 1)
|
||||
self.previewAreaLayout.setRowStretch(0, 1)
|
||||
self.previewAreaLayout.setObjectName('previewAreaLayout')
|
||||
self.themeDisplayLabel = QtGui.QLabel(self.previewArea)
|
||||
self.themeDisplayLabel.setFrameShape(QtGui.QFrame.Box)
|
||||
self.themeDisplayLabel.setScaledContents(True)
|
||||
self.themeDisplayLabel.setObjectName('themeDisplayLabel')
|
||||
self.previewAreaLayout.addWidget(self.themeDisplayLabel)
|
||||
self.previewLayout.addWidget(self.previewArea)
|
||||
self.mainColourLabel = QtGui.QLabel(self.previewArea)
|
||||
self.mainColourLabel.setObjectName('mainColourLabel')
|
||||
self.previewLayout.addWidget(self.mainColourLabel)
|
||||
self.footerColourLabel = QtGui.QLabel(self.previewArea)
|
||||
self.footerColourLabel.setObjectName('footerColourLabel')
|
||||
self.previewLayout.addWidget(self.footerColourLabel)
|
||||
self.preview_layout = QtGui.QVBoxLayout(themeLayoutDialog)
|
||||
self.preview_layout.setObjectName('preview_layout')
|
||||
self.preview_area = QtGui.QWidget(themeLayoutDialog)
|
||||
self.preview_area.setObjectName('preview_area')
|
||||
self.preview_area_layout = QtGui.QGridLayout(self.preview_area)
|
||||
self.preview_area_layout.setMargin(0)
|
||||
self.preview_area_layout.setColumnStretch(0, 1)
|
||||
self.preview_area_layout.setRowStretch(0, 1)
|
||||
self.preview_area_layout.setObjectName('preview_area_layout')
|
||||
self.theme_display_label = QtGui.QLabel(self.preview_area)
|
||||
self.theme_display_label.setFrameShape(QtGui.QFrame.Box)
|
||||
self.theme_display_label.setScaledContents(True)
|
||||
self.theme_display_label.setObjectName('theme_display_label')
|
||||
self.preview_area_layout.addWidget(self.theme_display_label)
|
||||
self.preview_layout.addWidget(self.preview_area)
|
||||
self.main_colour_label = QtGui.QLabel(self.preview_area)
|
||||
self.main_colour_label.setObjectName('main_colour_label')
|
||||
self.preview_layout.addWidget(self.main_colour_label)
|
||||
self.footer_colour_label = QtGui.QLabel(self.preview_area)
|
||||
self.footer_colour_label.setObjectName('footer_colour_label')
|
||||
self.preview_layout.addWidget(self.footer_colour_label)
|
||||
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)
|
||||
|
||||
def retranslateUi(self, themeLayoutDialog):
|
||||
@ -75,5 +75,5 @@ class Ui_ThemeLayoutDialog(object):
|
||||
Translate the UI on the fly
|
||||
"""
|
||||
themeLayoutDialog.setWindowTitle(translate('OpenLP.StartTimeForm', 'Theme Layout'))
|
||||
self.mainColourLabel.setText(translate('OpenLP.StartTimeForm', 'The blue box shows the main area.'))
|
||||
self.footerColourLabel.setText(translate('OpenLP.StartTimeForm', 'The red box shows the footer.'))
|
||||
self.main_colour_label.setText(translate('OpenLP.StartTimeForm', 'The blue box shows the main area.'))
|
||||
self.footer_colour_label.setText(translate('OpenLP.StartTimeForm', 'The red box shows the footer.'))
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -50,7 +50,7 @@ class ThemeLayoutForm(QtGui.QDialog, Ui_ThemeLayoutDialog):
|
||||
Run the Dialog with correct heading.
|
||||
"""
|
||||
pixmap = image.scaledToHeight(400, QtCore.Qt.SmoothTransformation)
|
||||
self.themeDisplayLabel.setPixmap(pixmap)
|
||||
displayAspectRatio = float(image.width()) / image.height()
|
||||
self.themeDisplayLabel.setFixedSize(400, 400 / displayAspectRatio)
|
||||
self.theme_display_label.setPixmap(pixmap)
|
||||
display_aspect_ratio = float(image.width()) / image.height()
|
||||
self.theme_display_label.setFixedSize(400, 400 / display_aspect_ratio)
|
||||
return QtGui.QDialog.exec_(self)
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
@ -54,340 +54,340 @@ class Ui_ThemeWizard(object):
|
||||
# Welcome Page
|
||||
add_welcome_page(themeWizard, ':/wizards/wizard_createtheme.bmp')
|
||||
# Background Page
|
||||
self.backgroundPage = QtGui.QWizardPage()
|
||||
self.backgroundPage.setObjectName('BackgroundPage')
|
||||
self.backgroundLayout = QtGui.QVBoxLayout(self.backgroundPage)
|
||||
self.backgroundLayout.setObjectName('BackgroundLayout')
|
||||
self.backgroundTypeLayout = QtGui.QFormLayout()
|
||||
self.backgroundTypeLayout.setObjectName('BackgroundTypeLayout')
|
||||
self.backgroundLabel = QtGui.QLabel(self.backgroundPage)
|
||||
self.backgroundLabel.setObjectName('BackgroundLabel')
|
||||
self.backgroundComboBox = QtGui.QComboBox(self.backgroundPage)
|
||||
self.backgroundComboBox.addItems(['', '', '', ''])
|
||||
self.backgroundComboBox.setObjectName('BackgroundComboBox')
|
||||
self.backgroundTypeLayout.addRow(self.backgroundLabel, self.backgroundComboBox)
|
||||
self.backgroundTypeLayout.setItem(1, QtGui.QFormLayout.LabelRole, self.spacer)
|
||||
self.backgroundLayout.addLayout(self.backgroundTypeLayout)
|
||||
self.backgroundStack = QtGui.QStackedLayout()
|
||||
self.backgroundStack.setObjectName('BackgroundStack')
|
||||
self.colorWidget = QtGui.QWidget(self.backgroundPage)
|
||||
self.colorWidget.setObjectName('ColorWidget')
|
||||
self.colorLayout = QtGui.QFormLayout(self.colorWidget)
|
||||
self.colorLayout.setMargin(0)
|
||||
self.colorLayout.setObjectName('ColorLayout')
|
||||
self.colorLabel = QtGui.QLabel(self.colorWidget)
|
||||
self.colorLabel.setObjectName('ColorLabel')
|
||||
self.colorButton = QtGui.QPushButton(self.colorWidget)
|
||||
self.colorButton.setObjectName('ColorButton')
|
||||
self.colorLayout.addRow(self.colorLabel, self.colorButton)
|
||||
self.colorLayout.setItem(1, QtGui.QFormLayout.LabelRole, self.spacer)
|
||||
self.backgroundStack.addWidget(self.colorWidget)
|
||||
self.gradientWidget = QtGui.QWidget(self.backgroundPage)
|
||||
self.gradientWidget.setObjectName('GradientWidget')
|
||||
self.gradientLayout = QtGui.QFormLayout(self.gradientWidget)
|
||||
self.gradientLayout.setMargin(0)
|
||||
self.gradientLayout.setObjectName('GradientLayout')
|
||||
self.gradientStartLabel = QtGui.QLabel(self.gradientWidget)
|
||||
self.gradientStartLabel.setObjectName('GradientStartLabel')
|
||||
self.gradientStartButton = QtGui.QPushButton(self.gradientWidget)
|
||||
self.gradientStartButton.setObjectName('GradientStartButton')
|
||||
self.gradientLayout.addRow(self.gradientStartLabel, self.gradientStartButton)
|
||||
self.gradientEndLabel = QtGui.QLabel(self.gradientWidget)
|
||||
self.gradientEndLabel.setObjectName('GradientEndLabel')
|
||||
self.gradientEndButton = QtGui.QPushButton(self.gradientWidget)
|
||||
self.gradientEndButton.setObjectName('GradientEndButton')
|
||||
self.gradientLayout.addRow(self.gradientEndLabel, self.gradientEndButton)
|
||||
self.gradientTypeLabel = QtGui.QLabel(self.gradientWidget)
|
||||
self.gradientTypeLabel.setObjectName('GradientTypeLabel')
|
||||
self.gradientComboBox = QtGui.QComboBox(self.gradientWidget)
|
||||
self.gradientComboBox.setObjectName('GradientComboBox')
|
||||
self.gradientComboBox.addItems(['', '', '', '', ''])
|
||||
self.gradientLayout.addRow(self.gradientTypeLabel, self.gradientComboBox)
|
||||
self.gradientLayout.setItem(3, QtGui.QFormLayout.LabelRole, self.spacer)
|
||||
self.backgroundStack.addWidget(self.gradientWidget)
|
||||
self.imageWidget = QtGui.QWidget(self.backgroundPage)
|
||||
self.imageWidget.setObjectName('ImageWidget')
|
||||
self.imageLayout = QtGui.QFormLayout(self.imageWidget)
|
||||
self.imageLayout.setMargin(0)
|
||||
self.imageLayout.setObjectName('ImageLayout')
|
||||
self.imageColorLabel = QtGui.QLabel(self.colorWidget)
|
||||
self.imageColorLabel.setObjectName('ImageColorLabel')
|
||||
self.imageColorButton = QtGui.QPushButton(self.colorWidget)
|
||||
self.imageColorButton.setObjectName('ImageColorButton')
|
||||
self.imageLayout.addRow(self.imageColorLabel, self.imageColorButton)
|
||||
self.imageLabel = QtGui.QLabel(self.imageWidget)
|
||||
self.imageLabel.setObjectName('ImageLabel')
|
||||
self.imageFileLayout = QtGui.QHBoxLayout()
|
||||
self.imageFileLayout.setObjectName('ImageFileLayout')
|
||||
self.imageFileEdit = QtGui.QLineEdit(self.imageWidget)
|
||||
self.imageFileEdit.setObjectName('ImageFileEdit')
|
||||
self.imageFileLayout.addWidget(self.imageFileEdit)
|
||||
self.imageBrowseButton = QtGui.QToolButton(self.imageWidget)
|
||||
self.imageBrowseButton.setObjectName('ImageBrowseButton')
|
||||
self.imageBrowseButton.setIcon(build_icon(':/general/general_open.png'))
|
||||
self.imageFileLayout.addWidget(self.imageBrowseButton)
|
||||
self.imageLayout.addRow(self.imageLabel, self.imageFileLayout)
|
||||
self.imageLayout.setItem(2, QtGui.QFormLayout.LabelRole, self.spacer)
|
||||
self.backgroundStack.addWidget(self.imageWidget)
|
||||
self.transparentWidget = QtGui.QWidget(self.backgroundPage)
|
||||
self.transparentWidget.setObjectName('TransparentWidget')
|
||||
self.transparentLayout = QtGui.QFormLayout(self.transparentWidget)
|
||||
self.transparentLayout.setMargin(0)
|
||||
self.transparentLayout.setObjectName('TransparentLayout')
|
||||
self.backgroundStack.addWidget(self.transparentWidget)
|
||||
self.backgroundLayout.addLayout(self.backgroundStack)
|
||||
themeWizard.addPage(self.backgroundPage)
|
||||
self.background_page = QtGui.QWizardPage()
|
||||
self.background_page.setObjectName('background_page')
|
||||
self.background_layout = QtGui.QVBoxLayout(self.background_page)
|
||||
self.background_layout.setObjectName('background_layout')
|
||||
self.background_type_layout = QtGui.QFormLayout()
|
||||
self.background_type_layout.setObjectName('background_type_layout')
|
||||
self.background_label = QtGui.QLabel(self.background_page)
|
||||
self.background_label.setObjectName('background_label')
|
||||
self.background_combo_box = QtGui.QComboBox(self.background_page)
|
||||
self.background_combo_box.addItems(['', '', '', ''])
|
||||
self.background_combo_box.setObjectName('background_combo_box')
|
||||
self.background_type_layout.addRow(self.background_label, self.background_combo_box)
|
||||
self.background_type_layout.setItem(1, QtGui.QFormLayout.LabelRole, self.spacer)
|
||||
self.background_layout.addLayout(self.background_type_layout)
|
||||
self.background_stack = QtGui.QStackedLayout()
|
||||
self.background_stack.setObjectName('background_stack')
|
||||
self.color_widget = QtGui.QWidget(self.background_page)
|
||||
self.color_widget.setObjectName('color_widget')
|
||||
self.color_layout = QtGui.QFormLayout(self.color_widget)
|
||||
self.color_layout.setMargin(0)
|
||||
self.color_layout.setObjectName('color_layout')
|
||||
self.color_label = QtGui.QLabel(self.color_widget)
|
||||
self.color_label.setObjectName('color_label')
|
||||
self.color_button = QtGui.QPushButton(self.color_widget)
|
||||
self.color_button.setObjectName('color_button')
|
||||
self.color_layout.addRow(self.color_label, self.color_button)
|
||||
self.color_layout.setItem(1, QtGui.QFormLayout.LabelRole, self.spacer)
|
||||
self.background_stack.addWidget(self.color_widget)
|
||||
self.gradient_widget = QtGui.QWidget(self.background_page)
|
||||
self.gradient_widget.setObjectName('Gradient_widget')
|
||||
self.gradient_layout = QtGui.QFormLayout(self.gradient_widget)
|
||||
self.gradient_layout.setMargin(0)
|
||||
self.gradient_layout.setObjectName('gradient_layout')
|
||||
self.gradient_start_label = QtGui.QLabel(self.gradient_widget)
|
||||
self.gradient_start_label.setObjectName('gradient_start_label')
|
||||
self.gradient_start_button = QtGui.QPushButton(self.gradient_widget)
|
||||
self.gradient_start_button.setObjectName('gradient_start_button')
|
||||
self.gradient_layout.addRow(self.gradient_start_label, self.gradient_start_button)
|
||||
self.gradient_end_label = QtGui.QLabel(self.gradient_widget)
|
||||
self.gradient_end_label.setObjectName('gradient_end_label')
|
||||
self.gradient_end_button = QtGui.QPushButton(self.gradient_widget)
|
||||
self.gradient_end_button.setObjectName('gradient_end_button')
|
||||
self.gradient_layout.addRow(self.gradient_end_label, self.gradient_end_button)
|
||||
self.gradient_type_label = QtGui.QLabel(self.gradient_widget)
|
||||
self.gradient_type_label.setObjectName('Gradient_type_label')
|
||||
self.gradient_combo_box = QtGui.QComboBox(self.gradient_widget)
|
||||
self.gradient_combo_box.setObjectName('gradient_combo_box')
|
||||
self.gradient_combo_box.addItems(['', '', '', '', ''])
|
||||
self.gradient_layout.addRow(self.gradient_type_label, self.gradient_combo_box)
|
||||
self.gradient_layout.setItem(3, QtGui.QFormLayout.LabelRole, self.spacer)
|
||||
self.background_stack.addWidget(self.gradient_widget)
|
||||
self.image_widget = QtGui.QWidget(self.background_page)
|
||||
self.image_widget.setObjectName('image_widget')
|
||||
self.image_layout = QtGui.QFormLayout(self.image_widget)
|
||||
self.image_layout.setMargin(0)
|
||||
self.image_layout.setObjectName('image_layout')
|
||||
self.image_color_label = QtGui.QLabel(self.color_widget)
|
||||
self.image_color_label.setObjectName('image_color_label')
|
||||
self.image_color_button = QtGui.QPushButton(self.color_widget)
|
||||
self.image_color_button.setObjectName('image_color_button')
|
||||
self.image_layout.addRow(self.image_color_label, self.image_color_button)
|
||||
self.image_label = QtGui.QLabel(self.image_widget)
|
||||
self.image_label.setObjectName('image_label')
|
||||
self.image_file_layout = QtGui.QHBoxLayout()
|
||||
self.image_file_layout.setObjectName('image_file_layout')
|
||||
self.image_file_edit = QtGui.QLineEdit(self.image_widget)
|
||||
self.image_file_edit.setObjectName('image_file_edit')
|
||||
self.image_file_layout.addWidget(self.image_file_edit)
|
||||
self.image_browse_button = QtGui.QToolButton(self.image_widget)
|
||||
self.image_browse_button.setObjectName('image_browse_button')
|
||||
self.image_browse_button.setIcon(build_icon(':/general/general_open.png'))
|
||||
self.image_file_layout.addWidget(self.image_browse_button)
|
||||
self.image_layout.addRow(self.image_label, self.image_file_layout)
|
||||
self.image_layout.setItem(2, QtGui.QFormLayout.LabelRole, self.spacer)
|
||||
self.background_stack.addWidget(self.image_widget)
|
||||
self.transparent_widget = QtGui.QWidget(self.background_page)
|
||||
self.transparent_widget.setObjectName('TransparentWidget')
|
||||
self.transparent_layout = QtGui.QFormLayout(self.transparent_widget)
|
||||
self.transparent_layout.setMargin(0)
|
||||
self.transparent_layout.setObjectName('Transparent_layout')
|
||||
self.background_stack.addWidget(self.transparent_widget)
|
||||
self.background_layout.addLayout(self.background_stack)
|
||||
themeWizard.addPage(self.background_page)
|
||||
# Main Area Page
|
||||
self.mainAreaPage = QtGui.QWizardPage()
|
||||
self.mainAreaPage.setObjectName('MainAreaPage')
|
||||
self.mainAreaLayout = QtGui.QFormLayout(self.mainAreaPage)
|
||||
self.mainAreaLayout.setObjectName('MainAreaLayout')
|
||||
self.mainFontLabel = QtGui.QLabel(self.mainAreaPage)
|
||||
self.mainFontLabel.setObjectName('MainFontLabel')
|
||||
self.mainFontComboBox = QtGui.QFontComboBox(self.mainAreaPage)
|
||||
self.mainFontComboBox.setObjectName('MainFontComboBox')
|
||||
self.mainAreaLayout.addRow(self.mainFontLabel, self.mainFontComboBox)
|
||||
self.mainColorLabel = QtGui.QLabel(self.mainAreaPage)
|
||||
self.mainColorLabel.setObjectName('MainColorLabel')
|
||||
self.mainPropertiesLayout = QtGui.QHBoxLayout()
|
||||
self.mainPropertiesLayout.setObjectName('MainPropertiesLayout')
|
||||
self.mainColorButton = QtGui.QPushButton(self.mainAreaPage)
|
||||
self.mainColorButton.setObjectName('MainColorButton')
|
||||
self.mainPropertiesLayout.addWidget(self.mainColorButton)
|
||||
self.mainPropertiesLayout.addSpacing(20)
|
||||
self.mainBoldCheckBox = QtGui.QCheckBox(self.mainAreaPage)
|
||||
self.mainBoldCheckBox.setObjectName('MainBoldCheckBox')
|
||||
self.mainPropertiesLayout.addWidget(self.mainBoldCheckBox)
|
||||
self.mainPropertiesLayout.addSpacing(20)
|
||||
self.mainItalicsCheckBox = QtGui.QCheckBox(self.mainAreaPage)
|
||||
self.mainItalicsCheckBox.setObjectName('MainItalicsCheckBox')
|
||||
self.mainPropertiesLayout.addWidget(self.mainItalicsCheckBox)
|
||||
self.mainAreaLayout.addRow(self.mainColorLabel, self.mainPropertiesLayout)
|
||||
self.mainSizeLabel = QtGui.QLabel(self.mainAreaPage)
|
||||
self.mainSizeLabel.setObjectName('MainSizeLabel')
|
||||
self.mainSizeLayout = QtGui.QHBoxLayout()
|
||||
self.mainSizeLayout.setObjectName('MainSizeLayout')
|
||||
self.mainSizeSpinBox = QtGui.QSpinBox(self.mainAreaPage)
|
||||
self.mainSizeSpinBox.setMaximum(999)
|
||||
self.mainSizeSpinBox.setValue(16)
|
||||
self.mainSizeSpinBox.setObjectName('MainSizeSpinBox')
|
||||
self.mainSizeLayout.addWidget(self.mainSizeSpinBox)
|
||||
self.mainLineCountLabel = QtGui.QLabel(self.mainAreaPage)
|
||||
self.mainLineCountLabel.setObjectName('MainLineCountLabel')
|
||||
self.mainSizeLayout.addWidget(self.mainLineCountLabel)
|
||||
self.mainAreaLayout.addRow(self.mainSizeLabel, self.mainSizeLayout)
|
||||
self.lineSpacingLabel = QtGui.QLabel(self.mainAreaPage)
|
||||
self.lineSpacingLabel.setObjectName('LineSpacingLabel')
|
||||
self.lineSpacingSpinBox = QtGui.QSpinBox(self.mainAreaPage)
|
||||
self.lineSpacingSpinBox.setMinimum(-250)
|
||||
self.lineSpacingSpinBox.setMaximum(250)
|
||||
self.lineSpacingSpinBox.setObjectName('LineSpacingSpinBox')
|
||||
self.mainAreaLayout.addRow(self.lineSpacingLabel, self.lineSpacingSpinBox)
|
||||
self.outlineCheckBox = QtGui.QCheckBox(self.mainAreaPage)
|
||||
self.outlineCheckBox.setObjectName('OutlineCheckBox')
|
||||
self.outlineLayout = QtGui.QHBoxLayout()
|
||||
self.outlineLayout.setObjectName('OutlineLayout')
|
||||
self.outlineColorButton = QtGui.QPushButton(self.mainAreaPage)
|
||||
self.outlineColorButton.setEnabled(False)
|
||||
self.outlineColorButton.setObjectName('OutlineColorButton')
|
||||
self.outlineLayout.addWidget(self.outlineColorButton)
|
||||
self.outlineLayout.addSpacing(20)
|
||||
self.outlineSizeLabel = QtGui.QLabel(self.mainAreaPage)
|
||||
self.outlineSizeLabel.setObjectName('OutlineSizeLabel')
|
||||
self.outlineLayout.addWidget(self.outlineSizeLabel)
|
||||
self.outlineSizeSpinBox = QtGui.QSpinBox(self.mainAreaPage)
|
||||
self.outlineSizeSpinBox.setEnabled(False)
|
||||
self.outlineSizeSpinBox.setObjectName('OutlineSizeSpinBox')
|
||||
self.outlineLayout.addWidget(self.outlineSizeSpinBox)
|
||||
self.mainAreaLayout.addRow(self.outlineCheckBox, self.outlineLayout)
|
||||
self.shadowCheckBox = QtGui.QCheckBox(self.mainAreaPage)
|
||||
self.shadowCheckBox.setObjectName('ShadowCheckBox')
|
||||
self.shadowLayout = QtGui.QHBoxLayout()
|
||||
self.shadowLayout.setObjectName('ShadowLayout')
|
||||
self.shadowColorButton = QtGui.QPushButton(self.mainAreaPage)
|
||||
self.shadowColorButton.setEnabled(False)
|
||||
self.shadowColorButton.setObjectName('shadowColorButton')
|
||||
self.shadowLayout.addWidget(self.shadowColorButton)
|
||||
self.shadowLayout.addSpacing(20)
|
||||
self.shadowSizeLabel = QtGui.QLabel(self.mainAreaPage)
|
||||
self.shadowSizeLabel.setObjectName('ShadowSizeLabel')
|
||||
self.shadowLayout.addWidget(self.shadowSizeLabel)
|
||||
self.shadowSizeSpinBox = QtGui.QSpinBox(self.mainAreaPage)
|
||||
self.shadowSizeSpinBox.setEnabled(False)
|
||||
self.shadowSizeSpinBox.setObjectName('ShadowSizeSpinBox')
|
||||
self.shadowLayout.addWidget(self.shadowSizeSpinBox)
|
||||
self.mainAreaLayout.addRow(self.shadowCheckBox, self.shadowLayout)
|
||||
themeWizard.addPage(self.mainAreaPage)
|
||||
self.main_area_page = QtGui.QWizardPage()
|
||||
self.main_area_page.setObjectName('main_area_page')
|
||||
self.main_area_layout = QtGui.QFormLayout(self.main_area_page)
|
||||
self.main_area_layout.setObjectName('main_area_layout')
|
||||
self.main_font_label = QtGui.QLabel(self.main_area_page)
|
||||
self.main_font_label.setObjectName('main_font_label')
|
||||
self.main_font_combo_box = QtGui.QFontComboBox(self.main_area_page)
|
||||
self.main_font_combo_box.setObjectName('main_font_combo_box')
|
||||
self.main_area_layout.addRow(self.main_font_label, self.main_font_combo_box)
|
||||
self.main_color_label = QtGui.QLabel(self.main_area_page)
|
||||
self.main_color_label.setObjectName('main_color_label')
|
||||
self.main_properties_layout = QtGui.QHBoxLayout()
|
||||
self.main_properties_layout.setObjectName('main_properties_layout')
|
||||
self.main_color_button = QtGui.QPushButton(self.main_area_page)
|
||||
self.main_color_button.setObjectName('main_color_button')
|
||||
self.main_properties_layout.addWidget(self.main_color_button)
|
||||
self.main_properties_layout.addSpacing(20)
|
||||
self.main_bold_check_box = QtGui.QCheckBox(self.main_area_page)
|
||||
self.main_bold_check_box.setObjectName('main_bold_check_box')
|
||||
self.main_properties_layout.addWidget(self.main_bold_check_box)
|
||||
self.main_properties_layout.addSpacing(20)
|
||||
self.main_italics_check_box = QtGui.QCheckBox(self.main_area_page)
|
||||
self.main_italics_check_box.setObjectName('MainItalicsCheckBox')
|
||||
self.main_properties_layout.addWidget(self.main_italics_check_box)
|
||||
self.main_area_layout.addRow(self.main_color_label, self.main_properties_layout)
|
||||
self.main_size_label = QtGui.QLabel(self.main_area_page)
|
||||
self.main_size_label.setObjectName('main_size_label')
|
||||
self.main_size_layout = QtGui.QHBoxLayout()
|
||||
self.main_size_layout.setObjectName('main_size_layout')
|
||||
self.main_size_spin_box = QtGui.QSpinBox(self.main_area_page)
|
||||
self.main_size_spin_box.setMaximum(999)
|
||||
self.main_size_spin_box.setValue(16)
|
||||
self.main_size_spin_box.setObjectName('main_size_spin_box')
|
||||
self.main_size_layout.addWidget(self.main_size_spin_box)
|
||||
self.main_line_count_label = QtGui.QLabel(self.main_area_page)
|
||||
self.main_line_count_label.setObjectName('main_line_count_label')
|
||||
self.main_size_layout.addWidget(self.main_line_count_label)
|
||||
self.main_area_layout.addRow(self.main_size_label, self.main_size_layout)
|
||||
self.line_spacing_label = QtGui.QLabel(self.main_area_page)
|
||||
self.line_spacing_label.setObjectName('line_spacing_label')
|
||||
self.line_spacing_spin_box = QtGui.QSpinBox(self.main_area_page)
|
||||
self.line_spacing_spin_box.setMinimum(-250)
|
||||
self.line_spacing_spin_box.setMaximum(250)
|
||||
self.line_spacing_spin_box.setObjectName('line_spacing_spin_box')
|
||||
self.main_area_layout.addRow(self.line_spacing_label, self.line_spacing_spin_box)
|
||||
self.outline_check_box = QtGui.QCheckBox(self.main_area_page)
|
||||
self.outline_check_box.setObjectName('outline_check_box')
|
||||
self.outline_layout = QtGui.QHBoxLayout()
|
||||
self.outline_layout.setObjectName('outline_layout')
|
||||
self.outline_color_button = QtGui.QPushButton(self.main_area_page)
|
||||
self.outline_color_button.setEnabled(False)
|
||||
self.outline_color_button.setObjectName('Outline_color_button')
|
||||
self.outline_layout.addWidget(self.outline_color_button)
|
||||
self.outline_layout.addSpacing(20)
|
||||
self.outline_size_label = QtGui.QLabel(self.main_area_page)
|
||||
self.outline_size_label.setObjectName('outline_size_label')
|
||||
self.outline_layout.addWidget(self.outline_size_label)
|
||||
self.outline_size_spin_box = QtGui.QSpinBox(self.main_area_page)
|
||||
self.outline_size_spin_box.setEnabled(False)
|
||||
self.outline_size_spin_box.setObjectName('outline_size_spin_box')
|
||||
self.outline_layout.addWidget(self.outline_size_spin_box)
|
||||
self.main_area_layout.addRow(self.outline_check_box, self.outline_layout)
|
||||
self.shadow_check_box = QtGui.QCheckBox(self.main_area_page)
|
||||
self.shadow_check_box.setObjectName('shadow_check_box')
|
||||
self.shadow_layout = QtGui.QHBoxLayout()
|
||||
self.shadow_layout.setObjectName('shadow_layout')
|
||||
self.shadow_color_button = QtGui.QPushButton(self.main_area_page)
|
||||
self.shadow_color_button.setEnabled(False)
|
||||
self.shadow_color_button.setObjectName('shadow_color_button')
|
||||
self.shadow_layout.addWidget(self.shadow_color_button)
|
||||
self.shadow_layout.addSpacing(20)
|
||||
self.shadow_size_label = QtGui.QLabel(self.main_area_page)
|
||||
self.shadow_size_label.setObjectName('shadow_size_label')
|
||||
self.shadow_layout.addWidget(self.shadow_size_label)
|
||||
self.shadow_size_spin_box = QtGui.QSpinBox(self.main_area_page)
|
||||
self.shadow_size_spin_box.setEnabled(False)
|
||||
self.shadow_size_spin_box.setObjectName('shadow_size_spin_box')
|
||||
self.shadow_layout.addWidget(self.shadow_size_spin_box)
|
||||
self.main_area_layout.addRow(self.shadow_check_box, self.shadow_layout)
|
||||
themeWizard.addPage(self.main_area_page)
|
||||
# Footer Area Page
|
||||
self.footerAreaPage = QtGui.QWizardPage()
|
||||
self.footerAreaPage.setObjectName('FooterAreaPage')
|
||||
self.footerAreaLayout = QtGui.QFormLayout(self.footerAreaPage)
|
||||
self.footerAreaLayout.setObjectName('FooterAreaLayout')
|
||||
self.footerFontLabel = QtGui.QLabel(self.footerAreaPage)
|
||||
self.footerFontLabel.setObjectName('FooterFontLabel')
|
||||
self.footerFontComboBox = QtGui.QFontComboBox(self.footerAreaPage)
|
||||
self.footerFontComboBox.setObjectName('footerFontComboBox')
|
||||
self.footerAreaLayout.addRow(self.footerFontLabel, self.footerFontComboBox)
|
||||
self.footerColorLabel = QtGui.QLabel(self.footerAreaPage)
|
||||
self.footerColorLabel.setObjectName('FooterColorLabel')
|
||||
self.footerColorButton = QtGui.QPushButton(self.footerAreaPage)
|
||||
self.footerColorButton.setObjectName('footerColorButton')
|
||||
self.footerAreaLayout.addRow(self.footerColorLabel, self.footerColorButton)
|
||||
self.footerSizeLabel = QtGui.QLabel(self.footerAreaPage)
|
||||
self.footerSizeLabel.setObjectName('FooterSizeLabel')
|
||||
self.footerSizeSpinBox = QtGui.QSpinBox(self.footerAreaPage)
|
||||
self.footerSizeSpinBox.setMaximum(999)
|
||||
self.footerSizeSpinBox.setValue(10)
|
||||
self.footerSizeSpinBox.setObjectName('FooterSizeSpinBox')
|
||||
self.footerAreaLayout.addRow(self.footerSizeLabel, self.footerSizeSpinBox)
|
||||
self.footerAreaLayout.setItem(3, QtGui.QFormLayout.LabelRole, self.spacer)
|
||||
themeWizard.addPage(self.footerAreaPage)
|
||||
self.footer_area_page = QtGui.QWizardPage()
|
||||
self.footer_area_page.setObjectName('footer_area_page')
|
||||
self.footer_area_layout = QtGui.QFormLayout(self.footer_area_page)
|
||||
self.footer_area_layout.setObjectName('footer_area_layout')
|
||||
self.footer_font_label = QtGui.QLabel(self.footer_area_page)
|
||||
self.footer_font_label.setObjectName('FooterFontLabel')
|
||||
self.footer_font_combo_box = QtGui.QFontComboBox(self.footer_area_page)
|
||||
self.footer_font_combo_box.setObjectName('footer_font_combo_box')
|
||||
self.footer_area_layout.addRow(self.footer_font_label, self.footer_font_combo_box)
|
||||
self.footer_color_label = QtGui.QLabel(self.footer_area_page)
|
||||
self.footer_color_label.setObjectName('footer_color_label')
|
||||
self.footer_color_button = QtGui.QPushButton(self.footer_area_page)
|
||||
self.footer_color_button.setObjectName('footer_color_button')
|
||||
self.footer_area_layout.addRow(self.footer_color_label, self.footer_color_button)
|
||||
self.footer_size_label = QtGui.QLabel(self.footer_area_page)
|
||||
self.footer_size_label.setObjectName('footer_size_label')
|
||||
self.footer_size_spin_box = QtGui.QSpinBox(self.footer_area_page)
|
||||
self.footer_size_spin_box.setMaximum(999)
|
||||
self.footer_size_spin_box.setValue(10)
|
||||
self.footer_size_spin_box.setObjectName('FooterSizeSpinBox')
|
||||
self.footer_area_layout.addRow(self.footer_size_label, self.footer_size_spin_box)
|
||||
self.footer_area_layout.setItem(3, QtGui.QFormLayout.LabelRole, self.spacer)
|
||||
themeWizard.addPage(self.footer_area_page)
|
||||
# Alignment Page
|
||||
self.alignmentPage = QtGui.QWizardPage()
|
||||
self.alignmentPage.setObjectName('AlignmentPage')
|
||||
self.alignmentLayout = QtGui.QFormLayout(self.alignmentPage)
|
||||
self.alignmentLayout.setObjectName('AlignmentLayout')
|
||||
self.horizontalLabel = QtGui.QLabel(self.alignmentPage)
|
||||
self.horizontalLabel.setObjectName('HorizontalLabel')
|
||||
self.horizontalComboBox = QtGui.QComboBox(self.alignmentPage)
|
||||
self.horizontalComboBox.addItems(['', '', '', ''])
|
||||
self.horizontalComboBox.setObjectName('HorizontalComboBox')
|
||||
self.alignmentLayout.addRow(self.horizontalLabel, self.horizontalComboBox)
|
||||
self.verticalLabel, self.verticalComboBox = create_valign_selection_widgets(self.alignmentPage)
|
||||
self.verticalLabel.setObjectName('verticalLabel')
|
||||
self.verticalComboBox.setObjectName('verticalComboBox')
|
||||
self.alignmentLayout.addRow(self.verticalLabel, self.verticalComboBox)
|
||||
self.transitionsLabel = QtGui.QLabel(self.alignmentPage)
|
||||
self.transitionsLabel.setObjectName('TransitionsLabel')
|
||||
self.transitionsCheckBox = QtGui.QCheckBox(self.alignmentPage)
|
||||
self.transitionsCheckBox.setObjectName('TransitionsCheckBox')
|
||||
self.alignmentLayout.addRow(self.transitionsLabel, self.transitionsCheckBox)
|
||||
self.alignmentLayout.setItem(3, QtGui.QFormLayout.LabelRole, self.spacer)
|
||||
themeWizard.addPage(self.alignmentPage)
|
||||
self.alignment_page = QtGui.QWizardPage()
|
||||
self.alignment_page.setObjectName('alignment_page')
|
||||
self.alignment_layout = QtGui.QFormLayout(self.alignment_page)
|
||||
self.alignment_layout.setObjectName('alignment_layout')
|
||||
self.horizontal_label = QtGui.QLabel(self.alignment_page)
|
||||
self.horizontal_label.setObjectName('horizontal_label')
|
||||
self.horizontal_combo_box = QtGui.QComboBox(self.alignment_page)
|
||||
self.horizontal_combo_box.addItems(['', '', '', ''])
|
||||
self.horizontal_combo_box.setObjectName('horizontal_combo_box')
|
||||
self.alignment_layout.addRow(self.horizontal_label, self.horizontal_combo_box)
|
||||
self.vertical_label, self.vertical_combo_box = create_valign_selection_widgets(self.alignment_page)
|
||||
self.vertical_label.setObjectName('vertical_label')
|
||||
self.vertical_combo_box.setObjectName('vertical_combo_box')
|
||||
self.alignment_layout.addRow(self.vertical_label, self.vertical_combo_box)
|
||||
self.transitions_label = QtGui.QLabel(self.alignment_page)
|
||||
self.transitions_label.setObjectName('transitions_label')
|
||||
self.transitions_check_box = QtGui.QCheckBox(self.alignment_page)
|
||||
self.transitions_check_box.setObjectName('transitions_check_box')
|
||||
self.alignment_layout.addRow(self.transitions_label, self.transitions_check_box)
|
||||
self.alignment_layout.setItem(3, QtGui.QFormLayout.LabelRole, self.spacer)
|
||||
themeWizard.addPage(self.alignment_page)
|
||||
# Area Position Page
|
||||
self.areaPositionPage = QtGui.QWizardPage()
|
||||
self.areaPositionPage.setObjectName('AreaPositionPage')
|
||||
self.areaPositionLayout = QtGui.QHBoxLayout(self.areaPositionPage)
|
||||
self.areaPositionLayout.setObjectName('AreaPositionLayout')
|
||||
self.mainPositionGroupBox = QtGui.QGroupBox(self.areaPositionPage)
|
||||
self.mainPositionGroupBox.setObjectName('MainPositionGroupBox')
|
||||
self.mainPositionLayout = QtGui.QFormLayout(self.mainPositionGroupBox)
|
||||
self.mainPositionLayout.setObjectName('MainPositionLayout')
|
||||
self.mainPositionCheckBox = QtGui.QCheckBox(self.mainPositionGroupBox)
|
||||
self.mainPositionCheckBox.setObjectName('MainPositionCheckBox')
|
||||
self.mainPositionLayout.addRow(self.mainPositionCheckBox)
|
||||
self.mainXLabel = QtGui.QLabel(self.mainPositionGroupBox)
|
||||
self.mainXLabel.setObjectName('MainXLabel')
|
||||
self.mainXSpinBox = QtGui.QSpinBox(self.mainPositionGroupBox)
|
||||
self.mainXSpinBox.setMaximum(9999)
|
||||
self.mainXSpinBox.setObjectName('MainXSpinBox')
|
||||
self.mainPositionLayout.addRow(self.mainXLabel, self.mainXSpinBox)
|
||||
self.mainYLabel = QtGui.QLabel(self.mainPositionGroupBox)
|
||||
self.mainYLabel.setObjectName('MainYLabel')
|
||||
self.mainYSpinBox = QtGui.QSpinBox(self.mainPositionGroupBox)
|
||||
self.mainYSpinBox.setMaximum(9999)
|
||||
self.mainYSpinBox.setObjectName('MainYSpinBox')
|
||||
self.mainPositionLayout.addRow(self.mainYLabel, self.mainYSpinBox)
|
||||
self.mainWidthLabel = QtGui.QLabel(self.mainPositionGroupBox)
|
||||
self.mainWidthLabel.setObjectName('MainWidthLabel')
|
||||
self.mainWidthSpinBox = QtGui.QSpinBox(self.mainPositionGroupBox)
|
||||
self.mainWidthSpinBox.setMaximum(9999)
|
||||
self.mainWidthSpinBox.setObjectName('MainWidthSpinBox')
|
||||
self.mainPositionLayout.addRow(self.mainWidthLabel, self.mainWidthSpinBox)
|
||||
self.mainHeightLabel = QtGui.QLabel(self.mainPositionGroupBox)
|
||||
self.mainHeightLabel.setObjectName('MainHeightLabel')
|
||||
self.mainHeightSpinBox = QtGui.QSpinBox(self.mainPositionGroupBox)
|
||||
self.mainHeightSpinBox.setMaximum(9999)
|
||||
self.mainHeightSpinBox.setObjectName('MainHeightSpinBox')
|
||||
self.mainPositionLayout.addRow(self.mainHeightLabel, self.mainHeightSpinBox)
|
||||
self.areaPositionLayout.addWidget(self.mainPositionGroupBox)
|
||||
self.footerPositionGroupBox = QtGui.QGroupBox(self.areaPositionPage)
|
||||
self.footerPositionGroupBox.setObjectName('FooterPositionGroupBox')
|
||||
self.footerPositionLayout = QtGui.QFormLayout(self.footerPositionGroupBox)
|
||||
self.footerPositionLayout.setObjectName('FooterPositionLayout')
|
||||
self.footerPositionCheckBox = QtGui.QCheckBox(self.footerPositionGroupBox)
|
||||
self.footerPositionCheckBox.setObjectName('FooterPositionCheckBox')
|
||||
self.footerPositionLayout.addRow(self.footerPositionCheckBox)
|
||||
self.footerXLabel = QtGui.QLabel(self.footerPositionGroupBox)
|
||||
self.footerXLabel.setObjectName('FooterXLabel')
|
||||
self.footerXSpinBox = QtGui.QSpinBox(self.footerPositionGroupBox)
|
||||
self.footerXSpinBox.setMaximum(9999)
|
||||
self.footerXSpinBox.setObjectName('FooterXSpinBox')
|
||||
self.footerPositionLayout.addRow(self.footerXLabel, self.footerXSpinBox)
|
||||
self.footerYLabel = QtGui.QLabel(self.footerPositionGroupBox)
|
||||
self.footerYLabel.setObjectName('FooterYLabel')
|
||||
self.footerYSpinBox = QtGui.QSpinBox(self.footerPositionGroupBox)
|
||||
self.footerYSpinBox.setMaximum(9999)
|
||||
self.footerYSpinBox.setObjectName('FooterYSpinBox')
|
||||
self.footerPositionLayout.addRow(self.footerYLabel, self.footerYSpinBox)
|
||||
self.footerWidthLabel = QtGui.QLabel(self.footerPositionGroupBox)
|
||||
self.footerWidthLabel.setObjectName('FooterWidthLabel')
|
||||
self.footerWidthSpinBox = QtGui.QSpinBox(self.footerPositionGroupBox)
|
||||
self.footerWidthSpinBox.setMaximum(9999)
|
||||
self.footerWidthSpinBox.setObjectName('FooterWidthSpinBox')
|
||||
self.footerPositionLayout.addRow(self.footerWidthLabel, self.footerWidthSpinBox)
|
||||
self.footerHeightLabel = QtGui.QLabel(self.footerPositionGroupBox)
|
||||
self.footerHeightLabel.setObjectName('FooterHeightLabel')
|
||||
self.footerHeightSpinBox = QtGui.QSpinBox(self.footerPositionGroupBox)
|
||||
self.footerHeightSpinBox.setMaximum(9999)
|
||||
self.footerHeightSpinBox.setObjectName('FooterHeightSpinBox')
|
||||
self.footerPositionLayout.addRow(self.footerHeightLabel, self.footerHeightSpinBox)
|
||||
self.areaPositionLayout.addWidget(self.footerPositionGroupBox)
|
||||
themeWizard.addPage(self.areaPositionPage)
|
||||
self.area_position_page = QtGui.QWizardPage()
|
||||
self.area_position_page.setObjectName('area_position_page')
|
||||
self.area_position_layout = QtGui.QHBoxLayout(self.area_position_page)
|
||||
self.area_position_layout.setObjectName('area_position_layout')
|
||||
self.main_position_group_box = QtGui.QGroupBox(self.area_position_page)
|
||||
self.main_position_group_box.setObjectName('main_position_group_box')
|
||||
self.main_position_layout = QtGui.QFormLayout(self.main_position_group_box)
|
||||
self.main_position_layout.setObjectName('main_position_layout')
|
||||
self.main_position_check_box = QtGui.QCheckBox(self.main_position_group_box)
|
||||
self.main_position_check_box.setObjectName('main_position_check_box')
|
||||
self.main_position_layout.addRow(self.main_position_check_box)
|
||||
self.main_x_label = QtGui.QLabel(self.main_position_group_box)
|
||||
self.main_x_label.setObjectName('main_x_label')
|
||||
self.main_x_spin_box = QtGui.QSpinBox(self.main_position_group_box)
|
||||
self.main_x_spin_box.setMaximum(9999)
|
||||
self.main_x_spin_box.setObjectName('main_x_spin_box')
|
||||
self.main_position_layout.addRow(self.main_x_label, self.main_x_spin_box)
|
||||
self.main_y_label = QtGui.QLabel(self.main_position_group_box)
|
||||
self.main_y_label.setObjectName('main_y_label')
|
||||
self.main_y_spin_box = QtGui.QSpinBox(self.main_position_group_box)
|
||||
self.main_y_spin_box.setMaximum(9999)
|
||||
self.main_y_spin_box.setObjectName('main_y_spin_box')
|
||||
self.main_position_layout.addRow(self.main_y_label, self.main_y_spin_box)
|
||||
self.main_width_label = QtGui.QLabel(self.main_position_group_box)
|
||||
self.main_width_label.setObjectName('main_width_label')
|
||||
self.main_width_spin_box = QtGui.QSpinBox(self.main_position_group_box)
|
||||
self.main_width_spin_box.setMaximum(9999)
|
||||
self.main_width_spin_box.setObjectName('main_width_spin_box')
|
||||
self.main_position_layout.addRow(self.main_width_label, self.main_width_spin_box)
|
||||
self.main_height_label = QtGui.QLabel(self.main_position_group_box)
|
||||
self.main_height_label.setObjectName('main_height_label')
|
||||
self.main_height_spin_box = QtGui.QSpinBox(self.main_position_group_box)
|
||||
self.main_height_spin_box.setMaximum(9999)
|
||||
self.main_height_spin_box.setObjectName('main_height_spin_box')
|
||||
self.main_position_layout.addRow(self.main_height_label, self.main_height_spin_box)
|
||||
self.area_position_layout.addWidget(self.main_position_group_box)
|
||||
self.footer_position_group_box = QtGui.QGroupBox(self.area_position_page)
|
||||
self.footer_position_group_box.setObjectName('footer_position_group_box')
|
||||
self.footer_position_layout = QtGui.QFormLayout(self.footer_position_group_box)
|
||||
self.footer_position_layout.setObjectName('footer_position_layout')
|
||||
self.footer_position_check_box = QtGui.QCheckBox(self.footer_position_group_box)
|
||||
self.footer_position_check_box.setObjectName('footer_position_check_box')
|
||||
self.footer_position_layout.addRow(self.footer_position_check_box)
|
||||
self.footer_x_label = QtGui.QLabel(self.footer_position_group_box)
|
||||
self.footer_x_label.setObjectName('footer_x_label')
|
||||
self.footer_x_spin_box = QtGui.QSpinBox(self.footer_position_group_box)
|
||||
self.footer_x_spin_box.setMaximum(9999)
|
||||
self.footer_x_spin_box.setObjectName('footer_x_spin_box')
|
||||
self.footer_position_layout.addRow(self.footer_x_label, self.footer_x_spin_box)
|
||||
self.footer_y_label = QtGui.QLabel(self.footer_position_group_box)
|
||||
self.footer_y_label.setObjectName('footer_y_label')
|
||||
self.footer_y_spin_box = QtGui.QSpinBox(self.footer_position_group_box)
|
||||
self.footer_y_spin_box.setMaximum(9999)
|
||||
self.footer_y_spin_box.setObjectName('footer_y_spin_box')
|
||||
self.footer_position_layout.addRow(self.footer_y_label, self.footer_y_spin_box)
|
||||
self.footer_width_label = QtGui.QLabel(self.footer_position_group_box)
|
||||
self.footer_width_label.setObjectName('footer_width_label')
|
||||
self.footer_width_spin_box = QtGui.QSpinBox(self.footer_position_group_box)
|
||||
self.footer_width_spin_box.setMaximum(9999)
|
||||
self.footer_width_spin_box.setObjectName('footer_width_spin_box')
|
||||
self.footer_position_layout.addRow(self.footer_width_label, self.footer_width_spin_box)
|
||||
self.footer_height_label = QtGui.QLabel(self.footer_position_group_box)
|
||||
self.footer_height_label.setObjectName('footer_height_label')
|
||||
self.footer_height_spin_box = QtGui.QSpinBox(self.footer_position_group_box)
|
||||
self.footer_height_spin_box.setMaximum(9999)
|
||||
self.footer_height_spin_box.setObjectName('footer_height_spin_box')
|
||||
self.footer_position_layout.addRow(self.footer_height_label, self.footer_height_spin_box)
|
||||
self.area_position_layout.addWidget(self.footer_position_group_box)
|
||||
themeWizard.addPage(self.area_position_page)
|
||||
# Preview Page
|
||||
self.previewPage = QtGui.QWizardPage()
|
||||
self.previewPage.setObjectName('PreviewPage')
|
||||
self.previewLayout = QtGui.QVBoxLayout(self.previewPage)
|
||||
self.previewLayout.setObjectName('PreviewLayout')
|
||||
self.themeNameLayout = QtGui.QFormLayout()
|
||||
self.themeNameLayout.setObjectName('ThemeNameLayout')
|
||||
self.themeNameLabel = QtGui.QLabel(self.previewPage)
|
||||
self.themeNameLabel.setObjectName('ThemeNameLabel')
|
||||
self.themeNameEdit = QtGui.QLineEdit(self.previewPage)
|
||||
self.themeNameEdit.setValidator(QtGui.QRegExpValidator(QtCore.QRegExp(r'[^/\\?*|<>\[\]":<>+%]+'), self))
|
||||
self.themeNameEdit.setObjectName('ThemeNameEdit')
|
||||
self.themeNameLayout.addRow(self.themeNameLabel, self.themeNameEdit)
|
||||
self.previewLayout.addLayout(self.themeNameLayout)
|
||||
self.previewArea = QtGui.QWidget(self.previewPage)
|
||||
self.previewArea.setObjectName('PreviewArea')
|
||||
self.previewAreaLayout = QtGui.QGridLayout(self.previewArea)
|
||||
self.previewAreaLayout.setMargin(0)
|
||||
self.previewAreaLayout.setColumnStretch(0, 1)
|
||||
self.previewAreaLayout.setRowStretch(0, 1)
|
||||
self.previewAreaLayout.setObjectName('PreviewAreaLayout')
|
||||
self.previewBoxLabel = QtGui.QLabel(self.previewArea)
|
||||
self.previewBoxLabel.setFrameShape(QtGui.QFrame.Box)
|
||||
self.previewBoxLabel.setScaledContents(True)
|
||||
self.previewBoxLabel.setObjectName('PreviewBoxLabel')
|
||||
self.previewAreaLayout.addWidget(self.previewBoxLabel)
|
||||
self.previewLayout.addWidget(self.previewArea)
|
||||
themeWizard.addPage(self.previewPage)
|
||||
self.preview_page = QtGui.QWizardPage()
|
||||
self.preview_page.setObjectName('preview_page')
|
||||
self.preview_layout = QtGui.QVBoxLayout(self.preview_page)
|
||||
self.preview_layout.setObjectName('preview_layout')
|
||||
self.theme_name_layout = QtGui.QFormLayout()
|
||||
self.theme_name_layout.setObjectName('theme_name_layout')
|
||||
self.theme_name_label = QtGui.QLabel(self.preview_page)
|
||||
self.theme_name_label.setObjectName('theme_name_label')
|
||||
self.theme_name_edit = QtGui.QLineEdit(self.preview_page)
|
||||
self.theme_name_edit.setValidator(QtGui.QRegExpValidator(QtCore.QRegExp(r'[^/\\?*|<>\[\]":<>+%]+'), self))
|
||||
self.theme_name_edit.setObjectName('ThemeNameEdit')
|
||||
self.theme_name_layout.addRow(self.theme_name_label, self.theme_name_edit)
|
||||
self.preview_layout.addLayout(self.theme_name_layout)
|
||||
self.preview_area = QtGui.QWidget(self.preview_page)
|
||||
self.preview_area.setObjectName('PreviewArea')
|
||||
self.preview_area_layout = QtGui.QGridLayout(self.preview_area)
|
||||
self.preview_area_layout.setMargin(0)
|
||||
self.preview_area_layout.setColumnStretch(0, 1)
|
||||
self.preview_area_layout.setRowStretch(0, 1)
|
||||
self.preview_area_layout.setObjectName('preview_area_layout')
|
||||
self.preview_box_label = QtGui.QLabel(self.preview_area)
|
||||
self.preview_box_label.setFrameShape(QtGui.QFrame.Box)
|
||||
self.preview_box_label.setScaledContents(True)
|
||||
self.preview_box_label.setObjectName('preview_box_label')
|
||||
self.preview_area_layout.addWidget(self.preview_box_label)
|
||||
self.preview_layout.addWidget(self.preview_area)
|
||||
themeWizard.addPage(self.preview_page)
|
||||
self.retranslateUi(themeWizard)
|
||||
QtCore.QObject.connect(self.backgroundComboBox, QtCore.SIGNAL('currentIndexChanged(int)'),
|
||||
self.backgroundStack, QtCore.SLOT('setCurrentIndex(int)'))
|
||||
QtCore.QObject.connect(self.outlineCheckBox, QtCore.SIGNAL('toggled(bool)'), self.outlineColorButton,
|
||||
QtCore.QObject.connect(self.background_combo_box, QtCore.SIGNAL('currentIndexChanged(int)'),
|
||||
self.background_stack, QtCore.SLOT('setCurrentIndex(int)'))
|
||||
QtCore.QObject.connect(self.outline_check_box, QtCore.SIGNAL('toggled(bool)'), self.outline_color_button,
|
||||
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.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.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.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.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.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.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.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.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.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.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)'))
|
||||
|
||||
def retranslateUi(self, themeWizard):
|
||||
@ -400,91 +400,92 @@ class Ui_ThemeWizard(object):
|
||||
self.information_label.setText(
|
||||
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.'))
|
||||
self.backgroundPage.setTitle(translate('OpenLP.ThemeWizard', 'Set Up Background'))
|
||||
self.backgroundPage.setSubTitle(translate('OpenLP.ThemeWizard', 'Set up your theme\'s background '
|
||||
self.background_page.setTitle(translate('OpenLP.ThemeWizard', 'Set Up Background'))
|
||||
self.background_page.setSubTitle(translate('OpenLP.ThemeWizard', 'Set up your theme\'s background '
|
||||
'according to the parameters below.'))
|
||||
self.backgroundLabel.setText(translate('OpenLP.ThemeWizard', 'Background type:'))
|
||||
self.backgroundComboBox.setItemText(BackgroundType.Solid,
|
||||
translate('OpenLP.ThemeWizard', 'Solid Color'))
|
||||
self.backgroundComboBox.setItemText(BackgroundType.Gradient,
|
||||
self.background_label.setText(translate('OpenLP.ThemeWizard', 'Background type:'))
|
||||
self.background_combo_box.setItemText(BackgroundType.Solid,
|
||||
translate('OpenLP.ThemeWizard', 'Solid color'))
|
||||
self.background_combo_box.setItemText(BackgroundType.Gradient,
|
||||
translate('OpenLP.ThemeWizard', 'Gradient'))
|
||||
self.backgroundComboBox.setItemText(BackgroundType.Image, UiStrings().Image)
|
||||
self.backgroundComboBox.setItemText(BackgroundType.Transparent, translate('OpenLP.ThemeWizard', 'Transparent'))
|
||||
self.colorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:'))
|
||||
self.gradientStartLabel.setText(translate('OpenLP.ThemeWizard', 'Starting color:'))
|
||||
self.gradientEndLabel.setText(translate('OpenLP.ThemeWizard', 'Ending color:'))
|
||||
self.gradientTypeLabel.setText(translate('OpenLP.ThemeWizard', 'Gradient:'))
|
||||
self.gradientComboBox.setItemText(BackgroundGradientType.Horizontal,
|
||||
self.background_combo_box.setItemText(BackgroundType.Image, UiStrings().Image)
|
||||
self.background_combo_box.setItemText(BackgroundType.Transparent, translate('OpenLP.ThemeWizard', 'Transparent'))
|
||||
self.color_label.setText(translate('OpenLP.ThemeWizard', 'color:'))
|
||||
self.gradient_start_label.setText(translate('OpenLP.ThemeWizard', 'Starting color:'))
|
||||
self.gradient_end_label.setText(translate('OpenLP.ThemeWizard', 'Ending color:'))
|
||||
self.gradient_type_label.setText(translate('OpenLP.ThemeWizard', 'Gradient:'))
|
||||
self.gradient_combo_box.setItemText(BackgroundGradientType.Horizontal,
|
||||
translate('OpenLP.ThemeWizard', 'Horizontal'))
|
||||
self.gradientComboBox.setItemText(BackgroundGradientType.Vertical, translate('OpenLP.ThemeWizard', 'Vertical'))
|
||||
self.gradientComboBox.setItemText(BackgroundGradientType.Circular, translate('OpenLP.ThemeWizard', 'Circular'))
|
||||
self.gradientComboBox.setItemText(BackgroundGradientType.LeftTop,
|
||||
self.gradient_combo_box.setItemText(BackgroundGradientType.Vertical, translate('OpenLP.ThemeWizard', 'Vertical'))
|
||||
self.gradient_combo_box.setItemText(BackgroundGradientType.Circular, translate('OpenLP.ThemeWizard', 'Circular'))
|
||||
self.gradient_combo_box.setItemText(BackgroundGradientType.LeftTop,
|
||||
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'))
|
||||
self.imageColorLabel.setText(translate('OpenLP.ThemeWizard', 'Background color:'))
|
||||
self.imageLabel.setText('%s:' % UiStrings().Image)
|
||||
self.mainAreaPage.setTitle(translate('OpenLP.ThemeWizard', 'Main Area Font Details'))
|
||||
self.mainAreaPage.setSubTitle(translate('OpenLP.ThemeWizard', 'Define the font and display '
|
||||
self.image_color_label.setText(translate('OpenLP.ThemeWizard', 'Background color:'))
|
||||
self.image_label.setText('%s:' % UiStrings().Image)
|
||||
self.main_area_page.setTitle(translate('OpenLP.ThemeWizard', 'Main Area Font Details'))
|
||||
self.main_area_page.setSubTitle(translate('OpenLP.ThemeWizard', 'Define the font and display '
|
||||
'characteristics for the Display text'))
|
||||
self.mainFontLabel.setText(translate('OpenLP.ThemeWizard', 'Font:'))
|
||||
self.mainColorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:'))
|
||||
self.mainSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:'))
|
||||
self.mainSizeSpinBox.setSuffix(UiStrings().FontSizePtUnit)
|
||||
self.lineSpacingLabel.setText(translate('OpenLP.ThemeWizard', 'Line Spacing:'))
|
||||
self.lineSpacingSpinBox.setSuffix(UiStrings().FontSizePtUnit)
|
||||
self.outlineCheckBox.setText(translate('OpenLP.ThemeWizard', '&Outline:'))
|
||||
self.outlineSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:'))
|
||||
self.outlineSizeSpinBox.setSuffix(UiStrings().FontSizePtUnit)
|
||||
self.shadowCheckBox.setText(translate('OpenLP.ThemeWizard', '&Shadow:'))
|
||||
self.shadowSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:'))
|
||||
self.shadowSizeSpinBox.setSuffix(UiStrings().FontSizePtUnit)
|
||||
self.mainBoldCheckBox.setText(translate('OpenLP.ThemeWizard', 'Bold'))
|
||||
self.mainItalicsCheckBox.setText(translate('OpenLP.ThemeWizard', 'Italic'))
|
||||
self.footerAreaPage.setTitle(translate('OpenLP.ThemeWizard', 'Footer Area Font Details'))
|
||||
self.footerAreaPage.setSubTitle(translate('OpenLP.ThemeWizard', 'Define the font and display '
|
||||
self.main_font_label.setText(translate('OpenLP.ThemeWizard', 'Font:'))
|
||||
self.main_color_label.setText(translate('OpenLP.ThemeWizard', 'color:'))
|
||||
self.main_size_label.setText(translate('OpenLP.ThemeWizard', 'Size:'))
|
||||
self.main_size_spin_box.setSuffix(UiStrings().FontSizePtUnit)
|
||||
self.line_spacing_label.setText(translate('OpenLP.ThemeWizard', 'Line Spacing:'))
|
||||
self.line_spacing_spin_box.setSuffix(UiStrings().FontSizePtUnit)
|
||||
self.outline_check_box.setText(translate('OpenLP.ThemeWizard', '&Outline:'))
|
||||
self.outline_size_label.setText(translate('OpenLP.ThemeWizard', 'Size:'))
|
||||
self.outline_size_spin_box.setSuffix(UiStrings().FontSizePtUnit)
|
||||
self.shadow_check_box.setText(translate('OpenLP.ThemeWizard', '&Shadow:'))
|
||||
self.shadow_size_label.setText(translate('OpenLP.ThemeWizard', 'Size:'))
|
||||
self.shadow_size_spin_box.setSuffix(UiStrings().FontSizePtUnit)
|
||||
self.main_bold_check_box.setText(translate('OpenLP.ThemeWizard', 'Bold'))
|
||||
self.main_italics_check_box.setText(translate('OpenLP.ThemeWizard', 'Italic'))
|
||||
self.footer_area_page.setTitle(translate('OpenLP.ThemeWizard', 'Footer Area Font Details'))
|
||||
self.footer_area_page.setSubTitle(translate('OpenLP.ThemeWizard', 'Define the font and display '
|
||||
'characteristics for the Footer text'))
|
||||
self.footerFontLabel.setText(translate('OpenLP.ThemeWizard', 'Font:'))
|
||||
self.footerColorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:'))
|
||||
self.footerSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:'))
|
||||
self.footerSizeSpinBox.setSuffix(UiStrings().FontSizePtUnit)
|
||||
self.alignmentPage.setTitle(translate('OpenLP.ThemeWizard', 'Text Formatting Details'))
|
||||
self.alignmentPage.setSubTitle(translate('OpenLP.ThemeWizard', 'Allows additional display '
|
||||
self.footer_font_label.setText(translate('OpenLP.ThemeWizard', 'Font:'))
|
||||
self.footer_color_label.setText(translate('OpenLP.ThemeWizard', 'color:'))
|
||||
self.footer_size_label.setText(translate('OpenLP.ThemeWizard', 'Size:'))
|
||||
self.footer_size_spin_box.setSuffix(UiStrings().FontSizePtUnit)
|
||||
self.alignment_page.setTitle(translate('OpenLP.ThemeWizard', 'Text Formatting Details'))
|
||||
self.alignment_page.setSubTitle(translate('OpenLP.ThemeWizard', 'Allows additional display '
|
||||
'formatting information to be defined'))
|
||||
self.horizontalLabel.setText(translate('OpenLP.ThemeWizard', 'Horizontal Align:'))
|
||||
self.horizontalComboBox.setItemText(HorizontalType.Left, translate('OpenLP.ThemeWizard', 'Left'))
|
||||
self.horizontalComboBox.setItemText(HorizontalType.Right, translate('OpenLP.ThemeWizard', 'Right'))
|
||||
self.horizontalComboBox.setItemText(HorizontalType.Center, translate('OpenLP.ThemeWizard', 'Center'))
|
||||
self.horizontalComboBox.setItemText(HorizontalType.Justify, translate('OpenLP.ThemeWizard', 'Justify'))
|
||||
self.transitionsLabel.setText(translate('OpenLP.ThemeWizard', 'Transitions:'))
|
||||
self.areaPositionPage.setTitle(translate('OpenLP.ThemeWizard', 'Output Area Locations'))
|
||||
self.areaPositionPage.setSubTitle(translate('OpenLP.ThemeWizard', 'Allows you to change and move the'
|
||||
' main and footer areas.'))
|
||||
self.mainPositionGroupBox.setTitle(translate('OpenLP.ThemeWizard', '&Main Area'))
|
||||
self.mainPositionCheckBox.setText(translate('OpenLP.ThemeWizard', '&Use default location'))
|
||||
self.mainXLabel.setText(translate('OpenLP.ThemeWizard', 'X position:'))
|
||||
self.mainXSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'px'))
|
||||
self.mainYSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'px'))
|
||||
self.mainYLabel.setText(translate('OpenLP.ThemeWizard', 'Y position:'))
|
||||
self.mainWidthSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'px'))
|
||||
self.mainWidthLabel.setText(translate('OpenLP.ThemeWizard', 'Width:'))
|
||||
self.mainHeightSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'px'))
|
||||
self.mainHeightLabel.setText(translate('OpenLP.ThemeWizard', 'Height:'))
|
||||
self.footerPositionGroupBox.setTitle(translate('OpenLP.ThemeWizard', '&Footer Area'))
|
||||
self.footerXLabel.setText(translate('OpenLP.ThemeWizard', 'X position:'))
|
||||
self.footerXSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'px'))
|
||||
self.footerYLabel.setText(translate('OpenLP.ThemeWizard', 'Y position:'))
|
||||
self.footerYSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'px'))
|
||||
self.footerWidthLabel.setText(translate('OpenLP.ThemeWizard', 'Width:'))
|
||||
self.footerWidthSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'px'))
|
||||
self.footerHeightLabel.setText(translate('OpenLP.ThemeWizard', 'Height:'))
|
||||
self.footerHeightSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'px'))
|
||||
self.footerPositionCheckBox.setText(translate('OpenLP.ThemeWizard', 'Use default location'))
|
||||
self.horizontal_label.setText(translate('OpenLP.ThemeWizard', 'Horizontal Align:'))
|
||||
self.horizontal_combo_box.setItemText(HorizontalType.Left, translate('OpenLP.ThemeWizard', 'Left'))
|
||||
self.horizontal_combo_box.setItemText(HorizontalType.Right, translate('OpenLP.ThemeWizard', 'Right'))
|
||||
self.horizontal_combo_box.setItemText(HorizontalType.Center, translate('OpenLP.ThemeWizard', 'Center'))
|
||||
self.horizontal_combo_box.setItemText(HorizontalType.Justify, translate('OpenLP.ThemeWizard', 'Justify'))
|
||||
self.transitions_label.setText(translate('OpenLP.ThemeWizard', 'Transitions:'))
|
||||
self.area_position_page.setTitle(translate('OpenLP.ThemeWizard', 'Output Area Locations'))
|
||||
self.area_position_page.setSubTitle(translate('OpenLP.ThemeWizard', 'Allows you to change and move the'
|
||||
' Main and Footer areas.'))
|
||||
self.main_position_group_box.setTitle(translate('OpenLP.ThemeWizard', '&Main Area'))
|
||||
self.main_position_check_box.setText(translate('OpenLP.ThemeWizard', '&Use default location'))
|
||||
self.main_x_label.setText(translate('OpenLP.ThemeWizard', 'X position:'))
|
||||
self.main_x_spin_box.setSuffix(translate('OpenLP.ThemeWizard', 'px'))
|
||||
self.main_y_spin_box.setSuffix(translate('OpenLP.ThemeWizard', 'px'))
|
||||
self.main_y_label.setText(translate('OpenLP.ThemeWizard', 'Y position:'))
|
||||
self.main_width_spin_box.setSuffix(translate('OpenLP.ThemeWizard', 'px'))
|
||||
self.main_width_label.setText(translate('OpenLP.ThemeWizard', 'Width:'))
|
||||
self.main_height_spin_box.setSuffix(translate('OpenLP.ThemeWizard', 'px'))
|
||||
self.main_height_label.setText(translate('OpenLP.ThemeWizard', 'Height:'))
|
||||
self.footer_position_group_box.setTitle(translate('OpenLP.ThemeWizard', '&Footer Area'))
|
||||
self.footer_x_label.setText(translate('OpenLP.ThemeWizard', 'X position:'))
|
||||
self.footer_x_spin_box.setSuffix(translate('OpenLP.ThemeWizard', 'px'))
|
||||
self.footer_y_label.setText(translate('OpenLP.ThemeWizard', 'Y position:'))
|
||||
self.footer_y_spin_box.setSuffix(translate('OpenLP.ThemeWizard', 'px'))
|
||||
self.footer_width_label.setText(translate('OpenLP.ThemeWizard', 'Width:'))
|
||||
self.footer_width_spin_box.setSuffix(translate('OpenLP.ThemeWizard', 'px'))
|
||||
self.footer_height_label.setText(translate('OpenLP.ThemeWizard', 'Height:'))
|
||||
self.footer_height_spin_box.setSuffix(translate('OpenLP.ThemeWizard', 'px'))
|
||||
self.footer_position_check_box.setText(translate('OpenLP.ThemeWizard', 'Use default location'))
|
||||
themeWizard.setOption(QtGui.QWizard.HaveCustomButton1, False)
|
||||
themeWizard.setButtonText(QtGui.QWizard.CustomButton1, translate('OpenLP.ThemeWizard', 'Layout Preview'))
|
||||
self.previewPage.setTitle(translate('OpenLP.ThemeWizard', 'Preview and Save'))
|
||||
self.previewPage.setSubTitle(translate('OpenLP.ThemeWizard', 'Preview the theme and save it.'))
|
||||
self.themeNameLabel.setText(translate('OpenLP.ThemeWizard', 'Theme name:'))
|
||||
self.preview_page.setTitle(translate('OpenLP.ThemeWizard', 'Preview and Save'))
|
||||
self.preview_page.setSubTitle(translate('OpenLP.ThemeWizard', 'Preview the theme and save it.'))
|
||||
self.theme_name_label.setText(translate('OpenLP.ThemeWizard', 'Theme name:'))
|
||||
# Align all QFormLayouts towards each other.
|
||||
labelWidth = max(self.backgroundLabel.minimumSizeHint().width(), self.horizontalLabel.minimumSizeHint().width())
|
||||
self.spacer.changeSize(labelWidth, 0, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
|
||||
label_width = max(self.background_label.minimumSizeHint().width(),
|
||||
self.horizontal_label.minimumSizeHint().width())
|
||||
self.spacer.changeSize(label_width, 0, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
@ -4,8 +4,8 @@
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2013 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Copyright (c) 2008-2014 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
|
||||
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
|
||||
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user