forked from openlp/openlp
r1976
This commit is contained in:
commit
612500c677
@ -91,6 +91,7 @@ class OpenLP(QtGui.QApplication):
|
|||||||
"""
|
"""
|
||||||
Override exec method to allow the shared memory to be released on exit
|
Override exec method to allow the shared memory to be released on exit
|
||||||
"""
|
"""
|
||||||
|
self.eventLoopIsActive = True
|
||||||
QtGui.QApplication.exec_()
|
QtGui.QApplication.exec_()
|
||||||
self.sharedMemory.detach()
|
self.sharedMemory.detach()
|
||||||
|
|
||||||
@ -98,6 +99,7 @@ class OpenLP(QtGui.QApplication):
|
|||||||
"""
|
"""
|
||||||
Run the OpenLP application.
|
Run the OpenLP application.
|
||||||
"""
|
"""
|
||||||
|
self.eventLoopIsActive = False
|
||||||
# On Windows, the args passed into the constructor are
|
# On Windows, the args passed into the constructor are
|
||||||
# ignored. Not very handy, so set the ones we want to use.
|
# ignored. Not very handy, so set the ones we want to use.
|
||||||
self.args.extend(args)
|
self.args.extend(args)
|
||||||
@ -127,7 +129,7 @@ class OpenLP(QtGui.QApplication):
|
|||||||
# make sure Qt really display the splash screen
|
# make sure Qt really display the splash screen
|
||||||
self.processEvents()
|
self.processEvents()
|
||||||
# start the main app window
|
# start the main app window
|
||||||
self.mainWindow = MainWindow(self.clipboard(), self.args)
|
self.mainWindow = MainWindow(self)
|
||||||
self.mainWindow.show()
|
self.mainWindow.show()
|
||||||
if show_splash:
|
if show_splash:
|
||||||
# now kill the splashscreen
|
# now kill the splashscreen
|
||||||
|
@ -543,14 +543,15 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
"""
|
"""
|
||||||
log.info(u'MainWindow loaded')
|
log.info(u'MainWindow loaded')
|
||||||
|
|
||||||
def __init__(self, clipboard, arguments):
|
def __init__(self, application):
|
||||||
"""
|
"""
|
||||||
This constructor sets up the interface, the various managers, and the
|
This constructor sets up the interface, the various managers, and the
|
||||||
plugins.
|
plugins.
|
||||||
"""
|
"""
|
||||||
QtGui.QMainWindow.__init__(self)
|
QtGui.QMainWindow.__init__(self)
|
||||||
self.clipboard = clipboard
|
self.application = application
|
||||||
self.arguments = arguments
|
self.clipboard = self.application.clipboard()
|
||||||
|
self.arguments = self.application.args
|
||||||
# Set up settings sections for the main application
|
# Set up settings sections for the main application
|
||||||
# (not for use by plugins)
|
# (not for use by plugins)
|
||||||
self.uiSettingsSection = u'user interface'
|
self.uiSettingsSection = u'user interface'
|
||||||
@ -1133,6 +1134,11 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
"""
|
"""
|
||||||
Hook to close the main window and display windows on exit
|
Hook to close the main window and display windows on exit
|
||||||
"""
|
"""
|
||||||
|
# The MainApplication did not even enter the event loop (this happens
|
||||||
|
# when OpenLP is not fully loaded). Just ignore the event.
|
||||||
|
if not self.application.eventLoopIsActive:
|
||||||
|
event.ignore()
|
||||||
|
return
|
||||||
# If we just did a settings import, close without saving changes.
|
# If we just did a settings import, close without saving changes.
|
||||||
if self.settingsImported:
|
if self.settingsImported:
|
||||||
self.cleanUp(False)
|
self.cleanUp(False)
|
||||||
@ -1169,7 +1175,6 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
self.cleanUp()
|
self.cleanUp()
|
||||||
event.accept()
|
event.accept()
|
||||||
|
|
||||||
|
|
||||||
def cleanUp(self, save_settings=True):
|
def cleanUp(self, save_settings=True):
|
||||||
"""
|
"""
|
||||||
Runs all the cleanup code before OpenLP shuts down.
|
Runs all the cleanup code before OpenLP shuts down.
|
||||||
@ -1193,7 +1198,9 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
# Save settings
|
# Save settings
|
||||||
self.saveSettings()
|
self.saveSettings()
|
||||||
# Close down the display
|
# Close down the display
|
||||||
|
if self.liveController.display:
|
||||||
self.liveController.display.close()
|
self.liveController.display.close()
|
||||||
|
self.liveController.display = None
|
||||||
|
|
||||||
def serviceChanged(self, reset=False, serviceName=None):
|
def serviceChanged(self, reset=False, serviceName=None):
|
||||||
"""
|
"""
|
||||||
|
@ -73,6 +73,7 @@ class Controller(QtGui.QWidget):
|
|||||||
controller = self
|
controller = self
|
||||||
Receiver.send_message('%s' % sender, [controller, args])
|
Receiver.send_message('%s' % sender, [controller, args])
|
||||||
|
|
||||||
|
|
||||||
class SlideController(Controller):
|
class SlideController(Controller):
|
||||||
"""
|
"""
|
||||||
SlideController is the slide controller widget. This widget is what the
|
SlideController is the slide controller widget. This widget is what the
|
||||||
@ -577,8 +578,7 @@ class SlideController(Controller):
|
|||||||
# rebuild display as screen size changed
|
# rebuild display as screen size changed
|
||||||
if self.display:
|
if self.display:
|
||||||
self.display.close()
|
self.display.close()
|
||||||
self.display = MainDisplay(self, self.imageManager, self.isLive,
|
self.display = MainDisplay(self, self.imageManager, self.isLive, self)
|
||||||
self)
|
|
||||||
self.display.setup()
|
self.display.setup()
|
||||||
if self.isLive:
|
if self.isLive:
|
||||||
self.__addActionsToWidget(self.display)
|
self.__addActionsToWidget(self.display)
|
||||||
|
@ -34,7 +34,6 @@ import os
|
|||||||
import re
|
import re
|
||||||
from subprocess import Popen, PIPE
|
from subprocess import Popen, PIPE
|
||||||
import sys
|
import sys
|
||||||
import time
|
|
||||||
import urllib2
|
import urllib2
|
||||||
|
|
||||||
from PyQt4 import QtGui, QtCore
|
from PyQt4 import QtGui, QtCore
|
||||||
@ -69,7 +68,7 @@ class VersionThread(QtCore.QThread):
|
|||||||
"""
|
"""
|
||||||
Run the thread.
|
Run the thread.
|
||||||
"""
|
"""
|
||||||
time.sleep(1)
|
self.sleep(1)
|
||||||
app_version = get_application_version()
|
app_version = get_application_version()
|
||||||
version = check_latest_version(app_version)
|
version = check_latest_version(app_version)
|
||||||
if LooseVersion(str(version)) > LooseVersion(str(app_version[u'full'])):
|
if LooseVersion(str(version)) > LooseVersion(str(app_version[u'full'])):
|
||||||
|
Loading…
Reference in New Issue
Block a user