Fix Message popup on windows , load last service

This commit is contained in:
Tim Bentley 2009-10-18 15:53:04 +01:00
parent efec5e1e95
commit 2f618d8504
3 changed files with 13 additions and 9 deletions

View File

@ -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,9 @@ 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)
def onHelpAboutItemClicked(self):
"""

View File

@ -24,7 +24,7 @@
import logging
log = logging.getLogger(u'media_dockManager')
log = logging.getLogger(u'MediaDockManager')
class MediaDockManager(object):

View File

@ -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'':