forked from openlp/openlp
Merge from lp:~raoul-snyman/openlp/bugfixes
bzr-revno: 537
This commit is contained in:
commit
f2e52ae596
21
openlp.pyw
21
openlp.pyw
@ -29,9 +29,10 @@ from optparse import OptionParser
|
|||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import Receiver
|
from openlp.core.lib import Receiver, str_to_bool
|
||||||
from openlp.core.resources import *
|
from openlp.core.resources import *
|
||||||
from openlp.core.ui import MainWindow, SplashScreen
|
from openlp.core.ui import MainWindow, SplashScreen
|
||||||
|
from openlp.core.utils import ConfigHelper
|
||||||
|
|
||||||
log = logging.getLogger()
|
log = logging.getLogger()
|
||||||
|
|
||||||
@ -55,10 +56,13 @@ class OpenLP(QtGui.QApplication):
|
|||||||
#provide a listener for widgets to reqest a screen update.
|
#provide a listener for widgets to reqest a screen update.
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'process_events'), self.processEvents)
|
QtCore.SIGNAL(u'process_events'), self.processEvents)
|
||||||
self.setApplicationName(u'openlp.org')
|
self.setApplicationName(u'OpenLP')
|
||||||
self.setApplicationVersion(u'1.9.0')
|
self.setApplicationVersion(u'1.9.0')
|
||||||
self.splash = SplashScreen(self.applicationVersion())
|
show_splash = str_to_bool(ConfigHelper.get_registry().get_value(
|
||||||
self.splash.show()
|
u'general', u'show splash', True))
|
||||||
|
if show_splash:
|
||||||
|
self.splash = SplashScreen(self.applicationVersion())
|
||||||
|
self.splash.show()
|
||||||
# make sure Qt really display the splash screen
|
# make sure Qt really display the splash screen
|
||||||
self.processEvents()
|
self.processEvents()
|
||||||
screens = []
|
screens = []
|
||||||
@ -72,9 +76,10 @@ class OpenLP(QtGui.QApplication):
|
|||||||
# start the main app window
|
# start the main app window
|
||||||
self.mainWindow = MainWindow(screens)
|
self.mainWindow = MainWindow(screens)
|
||||||
self.mainWindow.show()
|
self.mainWindow.show()
|
||||||
# now kill the splashscreen
|
if show_splash:
|
||||||
self.splash.finish(self.mainWindow)
|
# now kill the splashscreen
|
||||||
sys.exit(self.exec_())
|
self.splash.finish(self.mainWindow)
|
||||||
|
return self.exec_()
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
@ -102,7 +107,7 @@ def main():
|
|||||||
log.setLevel(logging.INFO)
|
log.setLevel(logging.INFO)
|
||||||
# Now create and actually run the application.
|
# Now create and actually run the application.
|
||||||
app = OpenLP(sys.argv)
|
app = OpenLP(sys.argv)
|
||||||
app.run()
|
sys.exit(app.run())
|
||||||
|
|
||||||
if __name__ == u'__main__':
|
if __name__ == u'__main__':
|
||||||
"""
|
"""
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import SettingsTab, translate, str_to_bool
|
from openlp.core.lib import SettingsTab, translate, str_to_bool
|
||||||
|
|
||||||
class GeneralTab(SettingsTab):
|
class GeneralTab(SettingsTab):
|
||||||
"""
|
"""
|
||||||
@ -59,24 +59,22 @@ class GeneralTab(SettingsTab):
|
|||||||
self.MonitorComboBox.setObjectName(u'MonitorComboBox')
|
self.MonitorComboBox.setObjectName(u'MonitorComboBox')
|
||||||
self.MonitorLayout.addWidget(self.MonitorComboBox)
|
self.MonitorLayout.addWidget(self.MonitorComboBox)
|
||||||
self.GeneralLeftLayout.addWidget(self.MonitorGroupBox)
|
self.GeneralLeftLayout.addWidget(self.MonitorGroupBox)
|
||||||
self.BlankScreenGroupBox = QtGui.QGroupBox(self.GeneralLeftWidget)
|
self.StartupGroupBox = QtGui.QGroupBox(self.GeneralLeftWidget)
|
||||||
self.BlankScreenGroupBox.setObjectName(u'BlankScreenGroupBox')
|
self.StartupGroupBox.setObjectName(u'StartupGroupBox')
|
||||||
self.BlankScreenLayout = QtGui.QVBoxLayout(self.BlankScreenGroupBox)
|
self.StartupLayout = QtGui.QVBoxLayout(self.StartupGroupBox)
|
||||||
self.BlankScreenLayout.setSpacing(8)
|
self.StartupLayout.setSpacing(8)
|
||||||
self.BlankScreenLayout.setMargin(8)
|
self.StartupLayout.setMargin(8)
|
||||||
self.BlankScreenLayout.setObjectName(u'BlankScreenLayout')
|
self.StartupLayout.setObjectName(u'StartupLayout')
|
||||||
self.WarningCheckBox = QtGui.QCheckBox(self.BlankScreenGroupBox)
|
self.WarningCheckBox = QtGui.QCheckBox(self.StartupGroupBox)
|
||||||
self.WarningCheckBox.setObjectName(u'WarningCheckBox')
|
self.WarningCheckBox.setObjectName(u'WarningCheckBox')
|
||||||
self.BlankScreenLayout.addWidget(self.WarningCheckBox)
|
self.StartupLayout.addWidget(self.WarningCheckBox)
|
||||||
self.GeneralLeftLayout.addWidget(self.BlankScreenGroupBox)
|
self.AutoOpenCheckBox = QtGui.QCheckBox(self.StartupGroupBox)
|
||||||
self.AutoOpenGroupBox = QtGui.QGroupBox(self.GeneralLeftWidget)
|
|
||||||
self.AutoOpenGroupBox.setObjectName(u'AutoOpenGroupBox')
|
|
||||||
self.AutoOpenLayout = QtGui.QVBoxLayout(self.AutoOpenGroupBox)
|
|
||||||
self.AutoOpenLayout.setObjectName(u'AutoOpenLayout')
|
|
||||||
self.AutoOpenCheckBox = QtGui.QCheckBox(self.AutoOpenGroupBox)
|
|
||||||
self.AutoOpenCheckBox.setObjectName(u'AutoOpenCheckBox')
|
self.AutoOpenCheckBox.setObjectName(u'AutoOpenCheckBox')
|
||||||
self.AutoOpenLayout.addWidget(self.AutoOpenCheckBox)
|
self.StartupLayout.addWidget(self.AutoOpenCheckBox)
|
||||||
self.GeneralLeftLayout.addWidget(self.AutoOpenGroupBox)
|
self.ShowSplashCheckBox = QtGui.QCheckBox(self.StartupGroupBox)
|
||||||
|
self.ShowSplashCheckBox.setObjectName(u'ShowSplashCheckBox')
|
||||||
|
self.StartupLayout.addWidget(self.ShowSplashCheckBox)
|
||||||
|
self.GeneralLeftLayout.addWidget(self.StartupGroupBox)
|
||||||
self.GeneralLeftSpacer = QtGui.QSpacerItem(20, 40,
|
self.GeneralLeftSpacer = QtGui.QSpacerItem(20, 40,
|
||||||
QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
|
QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
|
||||||
self.GeneralLeftLayout.addItem(self.GeneralLeftSpacer)
|
self.GeneralLeftLayout.addItem(self.GeneralLeftSpacer)
|
||||||
@ -123,6 +121,8 @@ class GeneralTab(SettingsTab):
|
|||||||
QtCore.SIGNAL(u'stateChanged(int)'), self.onWarningCheckBoxChanged)
|
QtCore.SIGNAL(u'stateChanged(int)'), self.onWarningCheckBoxChanged)
|
||||||
QtCore.QObject.connect(self.AutoOpenCheckBox,
|
QtCore.QObject.connect(self.AutoOpenCheckBox,
|
||||||
QtCore.SIGNAL(u'stateChanged(int)'), self.onAutoOpenCheckBoxChanged)
|
QtCore.SIGNAL(u'stateChanged(int)'), self.onAutoOpenCheckBoxChanged)
|
||||||
|
QtCore.QObject.connect(self.ShowSplashCheckBox,
|
||||||
|
QtCore.SIGNAL(u'stateChanged(int)'), self.onShowSplashCheckBoxChanged)
|
||||||
QtCore.QObject.connect(self.NumberEdit,
|
QtCore.QObject.connect(self.NumberEdit,
|
||||||
QtCore.SIGNAL(u'editingFinished()'), self.onNumberEditLostFocus)
|
QtCore.SIGNAL(u'editingFinished()'), self.onNumberEditLostFocus)
|
||||||
QtCore.QObject.connect(self.UsernameEdit,
|
QtCore.QObject.connect(self.UsernameEdit,
|
||||||
@ -133,10 +133,10 @@ class GeneralTab(SettingsTab):
|
|||||||
def retranslateUi(self):
|
def retranslateUi(self):
|
||||||
self.MonitorGroupBox.setTitle(translate(u'GeneralTab', u'Monitors'))
|
self.MonitorGroupBox.setTitle(translate(u'GeneralTab', u'Monitors'))
|
||||||
self.MonitorLabel.setText(translate(u'GeneralTab', u'Select monitor for output display:'))
|
self.MonitorLabel.setText(translate(u'GeneralTab', u'Select monitor for output display:'))
|
||||||
self.BlankScreenGroupBox.setTitle(translate(u'GeneralTab', u'Blank Screen'))
|
self.StartupGroupBox.setTitle(translate(u'GeneralTab', u'Application Startup'))
|
||||||
self.WarningCheckBox.setText(translate(u'GeneralTab', u'Show warning on startup'))
|
self.WarningCheckBox.setText(translate(u'GeneralTab', u'Show blank screen warning'))
|
||||||
self.AutoOpenGroupBox.setTitle(translate(u'GeneralTab', u'Auto Open Last Service'))
|
self.AutoOpenCheckBox.setText(translate(u'GeneralTab', u'Automatically open the last service'))
|
||||||
self.AutoOpenCheckBox.setText(translate(u'GeneralTab', u'Automatically open the last service at startup'))
|
self.ShowSplashCheckBox.setText(translate(u'GeneralTab', u'Show the splash screen'))
|
||||||
self.CCLIGroupBox.setTitle(translate(u'GeneralTab', u'CCLI Details'))
|
self.CCLIGroupBox.setTitle(translate(u'GeneralTab', u'CCLI Details'))
|
||||||
self.NumberLabel.setText(translate(u'GeneralTab', u'CCLI Number:'))
|
self.NumberLabel.setText(translate(u'GeneralTab', u'CCLI Number:'))
|
||||||
self.UsernameLabel.setText(translate(u'GeneralTab', u'SongSelect Username:'))
|
self.UsernameLabel.setText(translate(u'GeneralTab', u'SongSelect Username:'))
|
||||||
@ -146,16 +146,13 @@ class GeneralTab(SettingsTab):
|
|||||||
self.MonitorNumber = self.MonitorComboBox.currentIndex()
|
self.MonitorNumber = self.MonitorComboBox.currentIndex()
|
||||||
|
|
||||||
def onAutoOpenCheckBoxChanged(self, value):
|
def onAutoOpenCheckBoxChanged(self, value):
|
||||||
self.AutoOpen = False
|
self.AutoOpen = (value == QtCore.Qt.Checked)
|
||||||
if value == 2:
|
|
||||||
# we have a set value convert to True/False
|
def onShowSplashCheckBoxChanged(self, value):
|
||||||
self.AutoOpen = True
|
self.ShowSplash = (value == QtCore.Qt.Checked)
|
||||||
|
|
||||||
def onWarningCheckBoxChanged(self, value):
|
def onWarningCheckBoxChanged(self, value):
|
||||||
self.Warning = False
|
self.Warning = (value == QtCore.Qt.Checked)
|
||||||
if value == 2:
|
|
||||||
# we have a set value convert to True/False
|
|
||||||
self.Warning = True
|
|
||||||
|
|
||||||
def onNumberEditLostFocus(self):
|
def onNumberEditLostFocus(self):
|
||||||
self.CCLNumber = self.NumberEdit.displayText()
|
self.CCLNumber = self.NumberEdit.displayText()
|
||||||
@ -178,6 +175,7 @@ class GeneralTab(SettingsTab):
|
|||||||
self.MonitorNumber = int(self.config.get_config(u'Monitor', u'0'))
|
self.MonitorNumber = int(self.config.get_config(u'Monitor', u'0'))
|
||||||
self.Warning = str_to_bool(self.config.get_config(u'Warning', u'False'))
|
self.Warning = str_to_bool(self.config.get_config(u'Warning', u'False'))
|
||||||
self.AutoOpen = str_to_bool(self.config.get_config(u'Auto Open', u'False'))
|
self.AutoOpen = str_to_bool(self.config.get_config(u'Auto Open', u'False'))
|
||||||
|
self.ShowSplash = str_to_bool(self.config.get_config(u'show splash', u'True'))
|
||||||
self.CCLNumber = unicode(self.config.get_config(u'CCL Number', u'XXX'))
|
self.CCLNumber = unicode(self.config.get_config(u'CCL Number', u'XXX'))
|
||||||
self.Username = unicode(self.config.get_config(u'User Name', u''))
|
self.Username = unicode(self.config.get_config(u'User Name', u''))
|
||||||
self.Password = unicode(self.config.get_config(u'Password', u''))
|
self.Password = unicode(self.config.get_config(u'Password', u''))
|
||||||
@ -185,6 +183,7 @@ class GeneralTab(SettingsTab):
|
|||||||
self.MonitorComboBox.setCurrentIndex(self.MonitorNumber)
|
self.MonitorComboBox.setCurrentIndex(self.MonitorNumber)
|
||||||
self.WarningCheckBox.setChecked(self.Warning)
|
self.WarningCheckBox.setChecked(self.Warning)
|
||||||
self.AutoOpenCheckBox.setChecked(self.AutoOpen)
|
self.AutoOpenCheckBox.setChecked(self.AutoOpen)
|
||||||
|
self.ShowSplashCheckBox.setChecked(self.ShowSplash)
|
||||||
self.NumberEdit.setText(self.CCLNumber)
|
self.NumberEdit.setText(self.CCLNumber)
|
||||||
self.UsernameEdit.setText(self.Username)
|
self.UsernameEdit.setText(self.Username)
|
||||||
self.PasswordEdit.setText(self.Password)
|
self.PasswordEdit.setText(self.Password)
|
||||||
@ -193,6 +192,7 @@ class GeneralTab(SettingsTab):
|
|||||||
self.config.set_config(u'Monitor', self.MonitorNumber)
|
self.config.set_config(u'Monitor', self.MonitorNumber)
|
||||||
self.config.set_config(u'Warning', self.Warning)
|
self.config.set_config(u'Warning', self.Warning)
|
||||||
self.config.set_config(u'Auto Open', self.AutoOpen)
|
self.config.set_config(u'Auto Open', self.AutoOpen)
|
||||||
|
self.config.set_config(u'show splash', self.ShowSplash)
|
||||||
self.config.set_config(u'CCL Number', self.CCLNumber)
|
self.config.set_config(u'CCL Number', self.CCLNumber)
|
||||||
self.config.set_config(u'User Name', self.Username)
|
self.config.set_config(u'User Name', self.Username)
|
||||||
self.config.set_config(u'Password', self.Password)
|
self.config.set_config(u'Password', self.Password)
|
||||||
|
Loading…
Reference in New Issue
Block a user