diff --git a/openlp/core/lib/toolbar.py b/openlp/core/lib/toolbar.py index 81ee3e667..b0473b767 100644 --- a/openlp/core/lib/toolbar.py +++ b/openlp/core/lib/toolbar.py @@ -136,4 +136,4 @@ class OpenLPToolbar(QtGui.QToolBar): pushButton.setCheckable(True) pushButton.setFlat(True) self.addWidget(pushButton) - return pushButton \ No newline at end of file + return pushButton diff --git a/openlp/core/ui/generaltab.py b/openlp/core/ui/generaltab.py index 46941b6fa..0c3af4c5d 100644 --- a/openlp/core/ui/generaltab.py +++ b/openlp/core/ui/generaltab.py @@ -173,7 +173,7 @@ class GeneralTab(SettingsTab): self.MonitorComboBox.addItem(screen_name) # Get the configs 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'Blank Warning', 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')) @@ -190,7 +190,7 @@ class GeneralTab(SettingsTab): def save(self): self.config.set_config(u'Monitor', self.MonitorNumber) - self.config.set_config(u'Warning', self.Warning) + self.config.set_config(u'Blank Warning', self.Warning) 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) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index e98d1eb96..6f3bf910d 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -182,6 +182,7 @@ class MainDisplay(DisplayLabel): self.displayBlank = False if self.frame is not None: self.frameView(self.frame) + self.parent.generalConfig.set_config(u'Screen Blank',self.displayBlank) def displayAlert(self, text=u''): """ diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 6a5401e3a..601cab59a 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -32,7 +32,7 @@ from openlp.core.ui import AboutForm, SettingsForm, AlertForm, \ PluginForm, MediaDockManager from openlp.core.lib import translate, RenderManager, PluginConfig, \ OpenLPDockWidget, SettingsManager, PluginManager, Receiver, \ - buildIcon + buildIcon, str_to_bool from openlp.core.utils import check_latest_version media_manager_style = """ @@ -540,7 +540,6 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): self.ThemeManagerContents.loadThemes() log.info(u'Load data from Settings') self.settingsForm.postSetUp() - self.versionCheck() def versionCheck(self): applicationVersion = self.generalConfig.get_config(u'Application version', u'1.9.0-595') @@ -569,7 +568,6 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): monitor_exists = True if not monitor_exists: screen_number = 0 - return screen_number def show(self): @@ -580,6 +578,17 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): screen_number = self.getMonitorNumber() self.mainDisplay.setup(screen_number) self.setFocus() + self.versionCheck() + if str_to_bool(self.generalConfig.get_config(u'Auto Open', False)): + self.ServiceManagerContents.onLoadService(True) + if str_to_bool(self.generalConfig.get_config(u'Screen Blank', False)) \ + and str_to_bool(self.generalConfig.get_config(u'Blank Warning', False)): + QtGui.QMessageBox.question(None, + translate(u'mainWindow', u'OpenLP Main Display Blanked'), + translate(u'mainWindow', u'The Main Display has been blanked out'), + QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok), + QtGui.QMessageBox.Ok) + self.LiveController.blackPushButton.setChecked(True) def onHelpAboutItemClicked(self): """ diff --git a/openlp/core/ui/mediadockmanager.py b/openlp/core/ui/mediadockmanager.py index e7e7d53a1..4b1d64178 100644 --- a/openlp/core/ui/mediadockmanager.py +++ b/openlp/core/ui/mediadockmanager.py @@ -24,7 +24,7 @@ import logging -log = logging.getLogger(u'media_dockManager') +log = logging.getLogger(u'MediaDockManager') class MediaDockManager(object): diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 29a0acf06..2b5838b3f 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -420,16 +420,19 @@ class ServiceManager(QtGui.QWidget): def onQuickSaveService(self): self.onSaveService(True) - def onLoadService(self): + def onLoadService(self, lastService = False): """ Load an existing service from disk and rebuild the serviceitems. All files retrieved from the zip file are placed in a temporary directory and will only be used for this service. """ - filename = QtGui.QFileDialog.getOpenFileName(self, - translate(u'ThemeManager', u'Open Service'), - self.config.get_last_dir(), - u'Services (*.osz)') + if lastService: + filename = self.config.get_last_dir() + else: + filename = QtGui.QFileDialog.getOpenFileName(self, + translate(u'ThemeManager', u'Open Service'), + self.config.get_last_dir(), + u'Services (*.osz)') filename = unicode(filename) name = filename.split(os.path.sep) if filename != u'':