corrections and enable slide loop updates

This commit is contained in:
Josh Miller 2011-05-24 18:32:30 -04:00
parent 541feef8ea
commit b92b733828
3 changed files with 1548 additions and 1547 deletions

View File

@ -257,4 +257,3 @@ if __name__ == u'__main__':
Instantiate and run the application. Instantiate and run the application.
""" """
main() main()

View File

@ -1,390 +1,390 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
############################################################################### ###############################################################################
# OpenLP - Open Source Lyrics Projection # # OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman # # Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # # Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, # # Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, # # Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode Woldsund # # Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode Woldsund #
# --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- #
# This program is free software; you can redistribute it and/or modify it # # This program is free software; you can redistribute it and/or modify it #
# under the terms of the GNU General Public License as published by the Free # # under the terms of the GNU General Public License as published by the Free #
# Software Foundation; version 2 of the License. # # Software Foundation; version 2 of the License. #
# # # #
# This program is distributed in the hope that it will be useful, but WITHOUT # # This program is distributed in the hope that it will be useful, but WITHOUT #
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
# more details. # # more details. #
# # # #
# You should have received a copy of the GNU General Public License along # # You should have received a copy of the GNU General Public License along #
# with this program; if not, write to the Free Software Foundation, Inc., 59 # # with this program; if not, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Temple Place, Suite 330, Boston, MA 02111-1307 USA #
############################################################################### ###############################################################################
import logging import logging
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import SettingsTab, Receiver, translate from openlp.core.lib import SettingsTab, Receiver, translate
from openlp.core.lib.ui import UiStrings from openlp.core.lib.ui import UiStrings
from openlp.core.ui import ScreenList from openlp.core.ui import ScreenList
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
class GeneralTab(SettingsTab): class GeneralTab(SettingsTab):
""" """
GeneralTab is the general settings tab in the settings dialog. GeneralTab is the general settings tab in the settings dialog.
""" """
def __init__(self, parent): def __init__(self, parent):
""" """
Initialise the general settings tab Initialise the general settings tab
""" """
self.screens = ScreenList.get_instance() self.screens = ScreenList.get_instance()
self.icon_path = u':/icon/openlp-logo-16x16.png' self.icon_path = u':/icon/openlp-logo-16x16.png'
generalTranslated = translate('GeneralTab', 'General') generalTranslated = translate('GeneralTab', 'General')
SettingsTab.__init__(self, parent, u'General', generalTranslated) SettingsTab.__init__(self, parent, u'General', generalTranslated)
def setupUi(self): def setupUi(self):
""" """
Create the user interface for the general settings tab Create the user interface for the general settings tab
""" """
self.setObjectName(u'GeneralTab') self.setObjectName(u'GeneralTab')
SettingsTab.setupUi(self) SettingsTab.setupUi(self)
self.monitorGroupBox = QtGui.QGroupBox(self.leftColumn) self.monitorGroupBox = QtGui.QGroupBox(self.leftColumn)
self.monitorGroupBox.setObjectName(u'monitorGroupBox') self.monitorGroupBox.setObjectName(u'monitorGroupBox')
self.monitorLayout = QtGui.QFormLayout(self.monitorGroupBox) self.monitorLayout = QtGui.QFormLayout(self.monitorGroupBox)
self.monitorLayout.setObjectName(u'monitorLayout') self.monitorLayout.setObjectName(u'monitorLayout')
self.monitorLabel = QtGui.QLabel(self.monitorGroupBox) self.monitorLabel = QtGui.QLabel(self.monitorGroupBox)
self.monitorLabel.setObjectName(u'monitorLabel') self.monitorLabel.setObjectName(u'monitorLabel')
self.monitorLayout.addRow(self.monitorLabel) self.monitorLayout.addRow(self.monitorLabel)
self.monitorComboBox = QtGui.QComboBox(self.monitorGroupBox) self.monitorComboBox = QtGui.QComboBox(self.monitorGroupBox)
self.monitorComboBox.setObjectName(u'monitorComboBox') self.monitorComboBox.setObjectName(u'monitorComboBox')
self.monitorLayout.addRow(self.monitorComboBox) self.monitorLayout.addRow(self.monitorComboBox)
self.displayOnMonitorCheck = QtGui.QCheckBox(self.monitorGroupBox) self.displayOnMonitorCheck = QtGui.QCheckBox(self.monitorGroupBox)
self.displayOnMonitorCheck.setObjectName(u'monitorComboBox') self.displayOnMonitorCheck.setObjectName(u'monitorComboBox')
self.monitorLayout.addRow(self.displayOnMonitorCheck) self.monitorLayout.addRow(self.displayOnMonitorCheck)
self.leftLayout.addWidget(self.monitorGroupBox) self.leftLayout.addWidget(self.monitorGroupBox)
self.startupGroupBox = QtGui.QGroupBox(self.leftColumn) self.startupGroupBox = QtGui.QGroupBox(self.leftColumn)
self.startupGroupBox.setObjectName(u'startupGroupBox') self.startupGroupBox.setObjectName(u'startupGroupBox')
self.startupLayout = QtGui.QVBoxLayout(self.startupGroupBox) self.startupLayout = QtGui.QVBoxLayout(self.startupGroupBox)
self.startupLayout.setObjectName(u'startupLayout') self.startupLayout.setObjectName(u'startupLayout')
self.warningCheckBox = QtGui.QCheckBox(self.startupGroupBox) self.warningCheckBox = QtGui.QCheckBox(self.startupGroupBox)
self.warningCheckBox.setObjectName(u'warningCheckBox') self.warningCheckBox.setObjectName(u'warningCheckBox')
self.startupLayout.addWidget(self.warningCheckBox) self.startupLayout.addWidget(self.warningCheckBox)
self.autoOpenCheckBox = QtGui.QCheckBox(self.startupGroupBox) self.autoOpenCheckBox = QtGui.QCheckBox(self.startupGroupBox)
self.autoOpenCheckBox.setObjectName(u'autoOpenCheckBox') self.autoOpenCheckBox.setObjectName(u'autoOpenCheckBox')
self.startupLayout.addWidget(self.autoOpenCheckBox) self.startupLayout.addWidget(self.autoOpenCheckBox)
self.showSplashCheckBox = QtGui.QCheckBox(self.startupGroupBox) self.showSplashCheckBox = QtGui.QCheckBox(self.startupGroupBox)
self.showSplashCheckBox.setObjectName(u'showSplashCheckBox') self.showSplashCheckBox.setObjectName(u'showSplashCheckBox')
self.startupLayout.addWidget(self.showSplashCheckBox) self.startupLayout.addWidget(self.showSplashCheckBox)
self.checkForUpdatesCheckBox = QtGui.QCheckBox(self.startupGroupBox) self.checkForUpdatesCheckBox = QtGui.QCheckBox(self.startupGroupBox)
self.checkForUpdatesCheckBox.setObjectName(u'checkForUpdatesCheckBox') self.checkForUpdatesCheckBox.setObjectName(u'checkForUpdatesCheckBox')
self.startupLayout.addWidget(self.checkForUpdatesCheckBox) self.startupLayout.addWidget(self.checkForUpdatesCheckBox)
self.leftLayout.addWidget(self.startupGroupBox) self.leftLayout.addWidget(self.startupGroupBox)
self.settingsGroupBox = QtGui.QGroupBox(self.leftColumn) self.settingsGroupBox = QtGui.QGroupBox(self.leftColumn)
self.settingsGroupBox.setObjectName(u'settingsGroupBox') self.settingsGroupBox.setObjectName(u'settingsGroupBox')
self.settingsLayout = QtGui.QFormLayout(self.settingsGroupBox) self.settingsLayout = QtGui.QFormLayout(self.settingsGroupBox)
self.settingsLayout.setObjectName(u'settingsLayout') self.settingsLayout.setObjectName(u'settingsLayout')
self.saveCheckServiceCheckBox = QtGui.QCheckBox(self.settingsGroupBox) self.saveCheckServiceCheckBox = QtGui.QCheckBox(self.settingsGroupBox)
self.saveCheckServiceCheckBox.setObjectName(u'saveCheckServiceCheckBox') self.saveCheckServiceCheckBox.setObjectName(u'saveCheckServiceCheckBox')
self.settingsLayout.addRow(self.saveCheckServiceCheckBox) self.settingsLayout.addRow(self.saveCheckServiceCheckBox)
self.autoUnblankCheckBox = QtGui.QCheckBox(self.settingsGroupBox) self.autoUnblankCheckBox = QtGui.QCheckBox(self.settingsGroupBox)
self.autoUnblankCheckBox.setObjectName(u'autoUnblankCheckBox') self.autoUnblankCheckBox.setObjectName(u'autoUnblankCheckBox')
self.settingsLayout.addRow(self.autoUnblankCheckBox) self.settingsLayout.addRow(self.autoUnblankCheckBox)
self.autoPreviewCheckBox = QtGui.QCheckBox(self.settingsGroupBox) self.autoPreviewCheckBox = QtGui.QCheckBox(self.settingsGroupBox)
self.autoPreviewCheckBox.setObjectName(u'autoPreviewCheckBox') self.autoPreviewCheckBox.setObjectName(u'autoPreviewCheckBox')
self.settingsLayout.addRow(self.autoPreviewCheckBox) self.settingsLayout.addRow(self.autoPreviewCheckBox)
self.enableLoopCheckbox = QtGui.QCheckBox(self.settingsGroupBox) self.enableLoopCheckBox = QtGui.QCheckBox(self.settingsGroupBox)
self.enableLoopCheckbox.setObjectName(u'enableLoopCheckbox') self.enableLoopCheckBox.setObjectName(u'enableLoopCheckBox')
self.settingsLayout.addRow(self.enableLoopCheckbox) self.settingsLayout.addRow(self.enableLoopCheckBox)
# Moved here from image tab # Moved here from image tab
self.timeoutLabel = QtGui.QLabel(self.settingsGroupBox) self.timeoutLabel = QtGui.QLabel(self.settingsGroupBox)
self.timeoutLabel.setObjectName(u'timeoutLabel') self.timeoutLabel.setObjectName(u'timeoutLabel')
self.timeoutSpinBox = QtGui.QSpinBox(self.settingsGroupBox) self.timeoutSpinBox = QtGui.QSpinBox(self.settingsGroupBox)
self.timeoutSpinBox.setObjectName(u'timeoutSpinBox') self.timeoutSpinBox.setObjectName(u'timeoutSpinBox')
self.timeoutSpinBox.setRange(1, 180) self.timeoutSpinBox.setRange(1, 180)
self.settingsLayout.addRow(self.timeoutLabel, self.timeoutSpinBox) self.settingsLayout.addRow(self.timeoutLabel, self.timeoutSpinBox)
self.leftLayout.addWidget(self.settingsGroupBox) self.leftLayout.addWidget(self.settingsGroupBox)
self.leftLayout.addStretch() self.leftLayout.addStretch()
self.ccliGroupBox = QtGui.QGroupBox(self.rightColumn) self.ccliGroupBox = QtGui.QGroupBox(self.rightColumn)
self.ccliGroupBox.setObjectName(u'ccliGroupBox') self.ccliGroupBox.setObjectName(u'ccliGroupBox')
self.ccliLayout = QtGui.QFormLayout(self.ccliGroupBox) self.ccliLayout = QtGui.QFormLayout(self.ccliGroupBox)
self.ccliLayout.setObjectName(u'ccliLayout') self.ccliLayout.setObjectName(u'ccliLayout')
self.numberLabel = QtGui.QLabel(self.ccliGroupBox) self.numberLabel = QtGui.QLabel(self.ccliGroupBox)
self.numberLabel.setObjectName(u'numberLabel') self.numberLabel.setObjectName(u'numberLabel')
self.numberEdit = QtGui.QLineEdit(self.ccliGroupBox) self.numberEdit = QtGui.QLineEdit(self.ccliGroupBox)
self.numberEdit.setValidator(QtGui.QIntValidator()) self.numberEdit.setValidator(QtGui.QIntValidator())
self.numberEdit.setObjectName(u'numberEdit') self.numberEdit.setObjectName(u'numberEdit')
self.ccliLayout.addRow(self.numberLabel, self.numberEdit) self.ccliLayout.addRow(self.numberLabel, self.numberEdit)
self.usernameLabel = QtGui.QLabel(self.ccliGroupBox) self.usernameLabel = QtGui.QLabel(self.ccliGroupBox)
self.usernameLabel.setObjectName(u'usernameLabel') self.usernameLabel.setObjectName(u'usernameLabel')
self.usernameEdit = QtGui.QLineEdit(self.ccliGroupBox) self.usernameEdit = QtGui.QLineEdit(self.ccliGroupBox)
self.usernameEdit.setObjectName(u'usernameEdit') self.usernameEdit.setObjectName(u'usernameEdit')
self.ccliLayout.addRow(self.usernameLabel, self.usernameEdit) self.ccliLayout.addRow(self.usernameLabel, self.usernameEdit)
self.passwordLabel = QtGui.QLabel(self.ccliGroupBox) self.passwordLabel = QtGui.QLabel(self.ccliGroupBox)
self.passwordLabel.setObjectName(u'passwordLabel') self.passwordLabel.setObjectName(u'passwordLabel')
self.passwordEdit = QtGui.QLineEdit(self.ccliGroupBox) self.passwordEdit = QtGui.QLineEdit(self.ccliGroupBox)
self.passwordEdit.setEchoMode(QtGui.QLineEdit.Password) self.passwordEdit.setEchoMode(QtGui.QLineEdit.Password)
self.passwordEdit.setObjectName(u'passwordEdit') self.passwordEdit.setObjectName(u'passwordEdit')
self.ccliLayout.addRow(self.passwordLabel, self.passwordEdit) self.ccliLayout.addRow(self.passwordLabel, self.passwordEdit)
self.rightLayout.addWidget(self.ccliGroupBox) self.rightLayout.addWidget(self.ccliGroupBox)
# Moved here from display tab # Moved here from display tab
self.displayGroupBox = QtGui.QGroupBox(self.rightColumn) self.displayGroupBox = QtGui.QGroupBox(self.rightColumn)
self.displayGroupBox.setObjectName(u'displayGroupBox') self.displayGroupBox.setObjectName(u'displayGroupBox')
self.displayLayout = QtGui.QGridLayout(self.displayGroupBox) self.displayLayout = QtGui.QGridLayout(self.displayGroupBox)
self.displayLayout.setObjectName(u'displayLayout') self.displayLayout.setObjectName(u'displayLayout')
self.overrideCheckBox = QtGui.QCheckBox(self.displayGroupBox) self.overrideCheckBox = QtGui.QCheckBox(self.displayGroupBox)
self.overrideCheckBox.setObjectName(u'overrideCheckBox') self.overrideCheckBox.setObjectName(u'overrideCheckBox')
self.displayLayout.addWidget(self.overrideCheckBox, 2, 0, 1, 4) self.displayLayout.addWidget(self.overrideCheckBox, 2, 0, 1, 4)
self.rightLayout.addWidget(self.displayGroupBox) self.rightLayout.addWidget(self.displayGroupBox)
# Custom position # Custom position
self.customXLabel = QtGui.QLabel(self.displayGroupBox) self.customXLabel = QtGui.QLabel(self.displayGroupBox)
self.customXLabel.setObjectName(u'customXLabel') self.customXLabel.setObjectName(u'customXLabel')
self.displayLayout.addWidget(self.customXLabel, 3, 0) self.displayLayout.addWidget(self.customXLabel, 3, 0)
self.customXValueEdit = QtGui.QSpinBox(self.displayGroupBox) self.customXValueEdit = QtGui.QSpinBox(self.displayGroupBox)
self.customXValueEdit.setObjectName(u'customXValueEdit') self.customXValueEdit.setObjectName(u'customXValueEdit')
self.customXValueEdit.setRange(-9999, 9999) self.customXValueEdit.setRange(-9999, 9999)
self.displayLayout.addWidget(self.customXValueEdit, 4, 0) self.displayLayout.addWidget(self.customXValueEdit, 4, 0)
self.customYLabel = QtGui.QLabel(self.displayGroupBox) self.customYLabel = QtGui.QLabel(self.displayGroupBox)
self.customYLabel.setObjectName(u'customYLabel') self.customYLabel.setObjectName(u'customYLabel')
self.displayLayout.addWidget(self.customYLabel, 3, 1) self.displayLayout.addWidget(self.customYLabel, 3, 1)
self.customYValueEdit = QtGui.QSpinBox(self.displayGroupBox) self.customYValueEdit = QtGui.QSpinBox(self.displayGroupBox)
self.customYValueEdit.setObjectName(u'customYValueEdit') self.customYValueEdit.setObjectName(u'customYValueEdit')
self.customYValueEdit.setRange(-9999, 9999) self.customYValueEdit.setRange(-9999, 9999)
self.displayLayout.addWidget(self.customYValueEdit, 4, 1) self.displayLayout.addWidget(self.customYValueEdit, 4, 1)
self.customWidthLabel = QtGui.QLabel(self.displayGroupBox) self.customWidthLabel = QtGui.QLabel(self.displayGroupBox)
self.customWidthLabel.setObjectName(u'customWidthLabel') self.customWidthLabel.setObjectName(u'customWidthLabel')
self.displayLayout.addWidget(self.customWidthLabel, 3, 2) self.displayLayout.addWidget(self.customWidthLabel, 3, 2)
self.customWidthValueEdit = QtGui.QSpinBox(self.displayGroupBox) self.customWidthValueEdit = QtGui.QSpinBox(self.displayGroupBox)
self.customWidthValueEdit.setObjectName(u'customWidthValueEdit') self.customWidthValueEdit.setObjectName(u'customWidthValueEdit')
self.customWidthValueEdit.setMaximum(9999) self.customWidthValueEdit.setMaximum(9999)
self.displayLayout.addWidget(self.customWidthValueEdit, 4, 2) self.displayLayout.addWidget(self.customWidthValueEdit, 4, 2)
self.customHeightLabel = QtGui.QLabel(self.displayGroupBox) self.customHeightLabel = QtGui.QLabel(self.displayGroupBox)
self.customHeightLabel.setObjectName(u'customHeightLabel') self.customHeightLabel.setObjectName(u'customHeightLabel')
self.displayLayout.addWidget(self.customHeightLabel, 3, 3) self.displayLayout.addWidget(self.customHeightLabel, 3, 3)
self.customHeightValueEdit = QtGui.QSpinBox(self.displayGroupBox) self.customHeightValueEdit = QtGui.QSpinBox(self.displayGroupBox)
self.customHeightValueEdit.setObjectName(u'customHeightValueEdit') self.customHeightValueEdit.setObjectName(u'customHeightValueEdit')
self.customHeightValueEdit.setMaximum(9999) self.customHeightValueEdit.setMaximum(9999)
self.displayLayout.addWidget(self.customHeightValueEdit, 4, 3) self.displayLayout.addWidget(self.customHeightValueEdit, 4, 3)
self.rightLayout.addWidget(self.displayGroupBox) self.rightLayout.addWidget(self.displayGroupBox)
self.rightLayout.addStretch() self.rightLayout.addStretch()
# Signals and slots # Signals and slots
QtCore.QObject.connect(self.overrideCheckBox, QtCore.QObject.connect(self.overrideCheckBox,
QtCore.SIGNAL(u'toggled(bool)'), self.onOverrideCheckBoxToggled) QtCore.SIGNAL(u'toggled(bool)'), self.onOverrideCheckBoxToggled)
QtCore.QObject.connect(self.customHeightValueEdit, QtCore.QObject.connect(self.customHeightValueEdit,
QtCore.SIGNAL(u'valueChanged(int)'), self.onDisplayChanged) QtCore.SIGNAL(u'valueChanged(int)'), self.onDisplayChanged)
QtCore.QObject.connect(self.customWidthValueEdit, QtCore.QObject.connect(self.customWidthValueEdit,
QtCore.SIGNAL(u'valueChanged(int)'), self.onDisplayChanged) QtCore.SIGNAL(u'valueChanged(int)'), self.onDisplayChanged)
QtCore.QObject.connect(self.customYValueEdit, QtCore.QObject.connect(self.customYValueEdit,
QtCore.SIGNAL(u'valueChanged(int)'), self.onDisplayChanged) QtCore.SIGNAL(u'valueChanged(int)'), self.onDisplayChanged)
QtCore.QObject.connect(self.customXValueEdit, QtCore.QObject.connect(self.customXValueEdit,
QtCore.SIGNAL(u'valueChanged(int)'), self.onDisplayChanged) QtCore.SIGNAL(u'valueChanged(int)'), self.onDisplayChanged)
QtCore.QObject.connect(self.monitorComboBox, QtCore.QObject.connect(self.monitorComboBox,
QtCore.SIGNAL(u'currentIndexChanged(int)'), self.onDisplayChanged) QtCore.SIGNAL(u'currentIndexChanged(int)'), self.onDisplayChanged)
# Reload the tab, as the screen resolution/count may have changed. # Reload the tab, as the screen resolution/count may have changed.
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'config_screen_changed'), self.load) QtCore.SIGNAL(u'config_screen_changed'), self.load)
# Remove for now # Remove for now
self.usernameLabel.setVisible(False) self.usernameLabel.setVisible(False)
self.usernameEdit.setVisible(False) self.usernameEdit.setVisible(False)
self.passwordLabel.setVisible(False) self.passwordLabel.setVisible(False)
self.passwordEdit.setVisible(False) self.passwordEdit.setVisible(False)
def retranslateUi(self): def retranslateUi(self):
""" """
Translate the general settings tab to the currently selected language Translate the general settings tab to the currently selected language
""" """
self.tabTitleVisible = translate('OpenLP.GeneralTab', 'General') self.tabTitleVisible = translate('OpenLP.GeneralTab', 'General')
self.monitorGroupBox.setTitle(translate('OpenLP.GeneralTab', self.monitorGroupBox.setTitle(translate('OpenLP.GeneralTab',
'Monitors')) 'Monitors'))
self.monitorLabel.setText(translate('OpenLP.GeneralTab', self.monitorLabel.setText(translate('OpenLP.GeneralTab',
'Select monitor for output display:')) 'Select monitor for output display:'))
self.displayOnMonitorCheck.setText( self.displayOnMonitorCheck.setText(
translate('OpenLP.GeneralTab', 'Display if a single screen')) translate('OpenLP.GeneralTab', 'Display if a single screen'))
self.startupGroupBox.setTitle( self.startupGroupBox.setTitle(
translate('OpenLP.GeneralTab', 'Application Startup')) translate('OpenLP.GeneralTab', 'Application Startup'))
self.warningCheckBox.setText( self.warningCheckBox.setText(
translate('OpenLP.GeneralTab', 'Show blank screen warning')) translate('OpenLP.GeneralTab', 'Show blank screen warning'))
self.autoOpenCheckBox.setText(translate('OpenLP.GeneralTab', self.autoOpenCheckBox.setText(translate('OpenLP.GeneralTab',
'Automatically open the last service')) 'Automatically open the last service'))
self.showSplashCheckBox.setText( self.showSplashCheckBox.setText(
translate('OpenLP.GeneralTab', 'Show the splash screen')) translate('OpenLP.GeneralTab', 'Show the splash screen'))
self.checkForUpdatesCheckBox.setText( self.checkForUpdatesCheckBox.setText(
translate('OpenLP.GeneralTab', 'Check for updates to OpenLP')) translate('OpenLP.GeneralTab', 'Check for updates to OpenLP'))
self.settingsGroupBox.setTitle( self.settingsGroupBox.setTitle(
translate('OpenLP.GeneralTab', 'Application Settings')) translate('OpenLP.GeneralTab', 'Application Settings'))
self.saveCheckServiceCheckBox.setText(translate('OpenLP.GeneralTab', self.saveCheckServiceCheckBox.setText(translate('OpenLP.GeneralTab',
'Prompt to save before starting a new service')) 'Prompt to save before starting a new service'))
self.autoUnblankCheckBox.setText(translate('OpenLP.GeneralTab', self.autoUnblankCheckBox.setText(translate('OpenLP.GeneralTab',
'Unblank display when adding new live item')) 'Unblank display when adding new live item'))
self.autoPreviewCheckBox.setText(translate('OpenLP.GeneralTab', self.autoPreviewCheckBox.setText(translate('OpenLP.GeneralTab',
'Automatically preview next item in service')) 'Automatically preview next item in service'))
self.enableLoopCheckbox.setText(translate('OpenLP.GeneralTab', self.enableLoopCheckBox.setText(translate('OpenLP.GeneralTab',
'enable slide loop')) 'Enable slide loop'))
self.timeoutLabel.setText(translate('OpenLP.GeneralTab', self.timeoutLabel.setText(translate('OpenLP.GeneralTab',
'Slide loop delay:')) 'Slide loop delay:'))
self.timeoutSpinBox.setSuffix(translate('OpenLP.GeneralTab', ' sec')) self.timeoutSpinBox.setSuffix(translate('OpenLP.GeneralTab', ' sec'))
self.ccliGroupBox.setTitle( self.ccliGroupBox.setTitle(
translate('OpenLP.GeneralTab', 'CCLI Details')) translate('OpenLP.GeneralTab', 'CCLI Details'))
self.numberLabel.setText(UiStrings().CCLINumberLabel) self.numberLabel.setText(UiStrings().CCLINumberLabel)
self.usernameLabel.setText( self.usernameLabel.setText(
translate('OpenLP.GeneralTab', 'SongSelect username:')) translate('OpenLP.GeneralTab', 'SongSelect username:'))
self.passwordLabel.setText( self.passwordLabel.setText(
translate('OpenLP.GeneralTab', 'SongSelect password:')) translate('OpenLP.GeneralTab', 'SongSelect password:'))
# Moved from display tab # Moved from display tab
self.displayGroupBox.setTitle( self.displayGroupBox.setTitle(
translate('OpenLP.GeneralTab', 'Display Position')) translate('OpenLP.GeneralTab', 'Display Position'))
self.overrideCheckBox.setText(translate('OpenLP.GeneralTab', self.overrideCheckBox.setText(translate('OpenLP.GeneralTab',
'Override display position')) 'Override display position'))
self.customXLabel.setText(translate('OpenLP.GeneralTab', 'X')) self.customXLabel.setText(translate('OpenLP.GeneralTab', 'X'))
self.customYLabel.setText(translate('OpenLP.GeneralTab', 'Y')) self.customYLabel.setText(translate('OpenLP.GeneralTab', 'Y'))
self.customHeightLabel.setText(translate('OpenLP.GeneralTab', 'Height')) self.customHeightLabel.setText(translate('OpenLP.GeneralTab', 'Height'))
self.customWidthLabel.setText(translate('OpenLP.GeneralTab', 'Width')) self.customWidthLabel.setText(translate('OpenLP.GeneralTab', 'Width'))
def load(self): def load(self):
""" """
Load the settings to populate the form Load the settings to populate the form
""" """
settings = QtCore.QSettings() settings = QtCore.QSettings()
settings.beginGroup(self.settingsSection) settings.beginGroup(self.settingsSection)
self.monitorComboBox.clear() self.monitorComboBox.clear()
self.monitorComboBox.addItems(self.screens.get_screen_list()) self.monitorComboBox.addItems(self.screens.get_screen_list())
monitorNumber = settings.value(u'monitor', monitorNumber = settings.value(u'monitor',
QtCore.QVariant(self.screens.display_count - 1)).toInt()[0] QtCore.QVariant(self.screens.display_count - 1)).toInt()[0]
self.monitorComboBox.setCurrentIndex(monitorNumber) self.monitorComboBox.setCurrentIndex(monitorNumber)
self.numberEdit.setText(unicode(settings.value( self.numberEdit.setText(unicode(settings.value(
u'ccli number', QtCore.QVariant(u'')).toString())) u'ccli number', QtCore.QVariant(u'')).toString()))
self.usernameEdit.setText(unicode(settings.value( self.usernameEdit.setText(unicode(settings.value(
u'songselect username', QtCore.QVariant(u'')).toString())) u'songselect username', QtCore.QVariant(u'')).toString()))
self.passwordEdit.setText(unicode(settings.value( self.passwordEdit.setText(unicode(settings.value(
u'songselect password', QtCore.QVariant(u'')).toString())) u'songselect password', QtCore.QVariant(u'')).toString()))
self.saveCheckServiceCheckBox.setChecked(settings.value(u'save prompt', self.saveCheckServiceCheckBox.setChecked(settings.value(u'save prompt',
QtCore.QVariant(False)).toBool()) QtCore.QVariant(False)).toBool())
self.autoUnblankCheckBox.setChecked(settings.value(u'auto unblank', self.autoUnblankCheckBox.setChecked(settings.value(u'auto unblank',
QtCore.QVariant(False)).toBool()) QtCore.QVariant(False)).toBool())
self.displayOnMonitorCheck.setChecked(self.screens.display) self.displayOnMonitorCheck.setChecked(self.screens.display)
self.warningCheckBox.setChecked(settings.value(u'blank warning', self.warningCheckBox.setChecked(settings.value(u'blank warning',
QtCore.QVariant(False)).toBool()) QtCore.QVariant(False)).toBool())
self.autoOpenCheckBox.setChecked(settings.value(u'auto open', self.autoOpenCheckBox.setChecked(settings.value(u'auto open',
QtCore.QVariant(False)).toBool()) QtCore.QVariant(False)).toBool())
self.showSplashCheckBox.setChecked(settings.value(u'show splash', self.showSplashCheckBox.setChecked(settings.value(u'show splash',
QtCore.QVariant(True)).toBool()) QtCore.QVariant(True)).toBool())
self.checkForUpdatesCheckBox.setChecked(settings.value(u'update check', self.checkForUpdatesCheckBox.setChecked(settings.value(u'update check',
QtCore.QVariant(False)).toBool()) QtCore.QVariant(True)).toBool())
self.autoPreviewCheckBox.setChecked(settings.value(u'auto preview', self.autoPreviewCheckBox.setChecked(settings.value(u'auto preview',
QtCore.QVariant(False)).toBool()) QtCore.QVariant(False)).toBool())
self.enableLoopCheckbox.setChecked(settings.value(u'enable slide loop', self.enableLoopCheckBox.setChecked(settings.value(u'enable slide loop',
QtCore.QVariant(True)).toBool()) QtCore.QVariant(True)).toBool())
self.timeoutSpinBox.setValue(settings.value(u'loop delay', self.timeoutSpinBox.setValue(settings.value(u'loop delay',
QtCore.QVariant(5)).toInt()[0]) QtCore.QVariant(5)).toInt()[0])
self.overrideCheckBox.setChecked(settings.value(u'override position', self.overrideCheckBox.setChecked(settings.value(u'override position',
QtCore.QVariant(False)).toBool()) QtCore.QVariant(False)).toBool())
self.customXValueEdit.setValue(settings.value(u'x position', self.customXValueEdit.setValue(settings.value(u'x position',
QtCore.QVariant(self.screens.current[u'size'].x())).toInt()[0]) QtCore.QVariant(self.screens.current[u'size'].x())).toInt()[0])
self.customYValueEdit.setValue(settings.value(u'y position', self.customYValueEdit.setValue(settings.value(u'y position',
QtCore.QVariant(self.screens.current[u'size'].y())).toInt()[0]) QtCore.QVariant(self.screens.current[u'size'].y())).toInt()[0])
self.customHeightValueEdit.setValue(settings.value(u'height', self.customHeightValueEdit.setValue(settings.value(u'height',
QtCore.QVariant(self.screens.current[u'size'].height())).toInt()[0]) QtCore.QVariant(self.screens.current[u'size'].height())).toInt()[0])
self.customWidthValueEdit.setValue(settings.value(u'width', self.customWidthValueEdit.setValue(settings.value(u'width',
QtCore.QVariant(self.screens.current[u'size'].width())).toInt()[0]) QtCore.QVariant(self.screens.current[u'size'].width())).toInt()[0])
settings.endGroup() settings.endGroup()
self.customXValueEdit.setEnabled(self.overrideCheckBox.isChecked()) self.customXValueEdit.setEnabled(self.overrideCheckBox.isChecked())
self.customYValueEdit.setEnabled(self.overrideCheckBox.isChecked()) self.customYValueEdit.setEnabled(self.overrideCheckBox.isChecked())
self.customHeightValueEdit.setEnabled(self.overrideCheckBox.isChecked()) self.customHeightValueEdit.setEnabled(self.overrideCheckBox.isChecked())
self.customWidthValueEdit.setEnabled(self.overrideCheckBox.isChecked()) self.customWidthValueEdit.setEnabled(self.overrideCheckBox.isChecked())
self.display_changed = False self.display_changed = False
def save(self): def save(self):
""" """
Save the settings from the form Save the settings from the form
""" """
settings = QtCore.QSettings() settings = QtCore.QSettings()
settings.beginGroup(self.settingsSection) settings.beginGroup(self.settingsSection)
settings.setValue(u'monitor', settings.setValue(u'monitor',
QtCore.QVariant(self.monitorComboBox.currentIndex())) QtCore.QVariant(self.monitorComboBox.currentIndex()))
settings.setValue(u'display on monitor', settings.setValue(u'display on monitor',
QtCore.QVariant(self.displayOnMonitorCheck.isChecked())) QtCore.QVariant(self.displayOnMonitorCheck.isChecked()))
settings.setValue(u'blank warning', settings.setValue(u'blank warning',
QtCore.QVariant(self.warningCheckBox.isChecked())) QtCore.QVariant(self.warningCheckBox.isChecked()))
settings.setValue(u'auto open', settings.setValue(u'auto open',
QtCore.QVariant(self.autoOpenCheckBox.isChecked())) QtCore.QVariant(self.autoOpenCheckBox.isChecked()))
settings.setValue(u'show splash', settings.setValue(u'show splash',
QtCore.QVariant(self.showSplashCheckBox.isChecked())) QtCore.QVariant(self.showSplashCheckBox.isChecked()))
settings.setValue(u'update check', settings.setValue(u'update check',
QtCore.QVariant(self.checkForUpdatesCheckBox.isChecked())) QtCore.QVariant(self.checkForUpdatesCheckBox.isChecked()))
settings.setValue(u'save prompt', settings.setValue(u'save prompt',
QtCore.QVariant(self.saveCheckServiceCheckBox.isChecked())) QtCore.QVariant(self.saveCheckServiceCheckBox.isChecked()))
settings.setValue(u'auto unblank', settings.setValue(u'auto unblank',
QtCore.QVariant(self.autoUnblankCheckBox.isChecked())) QtCore.QVariant(self.autoUnblankCheckBox.isChecked()))
settings.setValue(u'auto preview', settings.setValue(u'auto preview',
QtCore.QVariant(self.autoPreviewCheckBox.isChecked())) QtCore.QVariant(self.autoPreviewCheckBox.isChecked()))
settings.setValue(u'enable slide loop', settings.setValue(u'enable slide loop',
QtCore.QVariant(self.enableLoopCheckbox.isChecked())) QtCore.QVariant(self.enableLoopCheckBox.isChecked()))
settings.setValue(u'loop delay', settings.setValue(u'loop delay',
QtCore.QVariant(self.timeoutSpinBox.value())) QtCore.QVariant(self.timeoutSpinBox.value()))
settings.setValue(u'ccli number', settings.setValue(u'ccli number',
QtCore.QVariant(self.numberEdit.displayText())) QtCore.QVariant(self.numberEdit.displayText()))
settings.setValue(u'songselect username', settings.setValue(u'songselect username',
QtCore.QVariant(self.usernameEdit.displayText())) QtCore.QVariant(self.usernameEdit.displayText()))
settings.setValue(u'songselect password', settings.setValue(u'songselect password',
QtCore.QVariant(self.passwordEdit.displayText())) QtCore.QVariant(self.passwordEdit.displayText()))
settings.setValue(u'x position', settings.setValue(u'x position',
QtCore.QVariant(self.customXValueEdit.value())) QtCore.QVariant(self.customXValueEdit.value()))
settings.setValue(u'y position', settings.setValue(u'y position',
QtCore.QVariant(self.customYValueEdit.value())) QtCore.QVariant(self.customYValueEdit.value()))
settings.setValue(u'height', settings.setValue(u'height',
QtCore.QVariant(self.customHeightValueEdit.value())) QtCore.QVariant(self.customHeightValueEdit.value()))
settings.setValue(u'width', settings.setValue(u'width',
QtCore.QVariant(self.customWidthValueEdit.value())) QtCore.QVariant(self.customWidthValueEdit.value()))
settings.setValue(u'override position', settings.setValue(u'override position',
QtCore.QVariant(self.overrideCheckBox.isChecked())) QtCore.QVariant(self.overrideCheckBox.isChecked()))
settings.endGroup() settings.endGroup()
# On save update the screens as well # On save update the screens as well
self.postSetUp(True) self.postSetUp(True)
def postSetUp(self, postUpdate=False): def postSetUp(self, postUpdate=False):
""" """
Apply settings after settings tab has loaded and most of the Apply settings after settings tab has loaded and most of the
system so must be delayed system so must be delayed
""" """
Receiver.send_message(u'slidecontroller_live_spin_delay', Receiver.send_message(u'slidecontroller_live_spin_delay',
self.timeoutSpinBox.value()) self.timeoutSpinBox.value())
# Do not continue on start up. # Do not continue on start up.
if not postUpdate: if not postUpdate:
return return
self.screens.set_current_display(self.monitorComboBox.currentIndex()) self.screens.set_current_display(self.monitorComboBox.currentIndex())
self.screens.display = self.displayOnMonitorCheck.isChecked() self.screens.display = self.displayOnMonitorCheck.isChecked()
self.screens.override[u'size'] = QtCore.QRect( self.screens.override[u'size'] = QtCore.QRect(
self.customXValueEdit.value(), self.customXValueEdit.value(),
self.customYValueEdit.value(), self.customYValueEdit.value(),
self.customWidthValueEdit.value(), self.customWidthValueEdit.value(),
self.customHeightValueEdit.value()) self.customHeightValueEdit.value())
if self.overrideCheckBox.isChecked(): if self.overrideCheckBox.isChecked():
self.screens.set_override_display() self.screens.set_override_display()
else: else:
self.screens.reset_current_display() self.screens.reset_current_display()
if self.display_changed: if self.display_changed:
Receiver.send_message(u'config_screen_changed') Receiver.send_message(u'config_screen_changed')
self.display_changed = False self.display_changed = False
def onOverrideCheckBoxToggled(self, checked): def onOverrideCheckBoxToggled(self, checked):
""" """
Toggle screen state depending on check box state. Toggle screen state depending on check box state.
``checked`` ``checked``
The state of the check box (boolean). The state of the check box (boolean).
""" """
self.customXValueEdit.setEnabled(checked) self.customXValueEdit.setEnabled(checked)
self.customYValueEdit.setEnabled(checked) self.customYValueEdit.setEnabled(checked)
self.customHeightValueEdit.setEnabled(checked) self.customHeightValueEdit.setEnabled(checked)
self.customWidthValueEdit.setEnabled(checked) self.customWidthValueEdit.setEnabled(checked)
self.display_changed = True self.display_changed = True
def onDisplayChanged(self): def onDisplayChanged(self):
""" """
Called when the width, height, x position or y position has changed. Called when the width, height, x position or y position has changed.
""" """
self.display_changed = True self.display_changed = True

File diff suppressed because it is too large Load Diff