Add destop startup file selection

This commit is contained in:
Tim Bentley 2011-03-19 10:08:05 +00:00
parent 10107f447b
commit 38243af7de
3 changed files with 15 additions and 9 deletions

View File

@ -184,7 +184,7 @@ class OpenLP(QtGui.QApplication):
# make sure Qt really display the splash screen
self.processEvents()
# start the main app window
self.mainWindow = MainWindow(screens, app_version, self.clipboard())
self.mainWindow = MainWindow(screens, app_version, self)
self.mainWindow.show()
if show_splash:
# now kill the splashscreen

View File

@ -468,7 +468,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
actionList = ActionList()
def __init__(self, screens, applicationVersion, clipboard):
def __init__(self, screens, applicationVersion, application):
"""
This constructor sets up the interface, the various managers, and the
plugins.
@ -476,7 +476,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
QtGui.QMainWindow.__init__(self)
self.screens = screens
self.applicationVersion = applicationVersion
self.clipboard = clipboard
self.application = application
# Set up settings sections for the main application
# (not for use by plugins)
self.uiSettingsSection = u'user interface'
@ -658,7 +658,12 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
if self.liveController.display.isVisible():
self.liveController.display.setFocus()
self.activateWindow()
if QtCore.QSettings().value(
if len(self.application.arguments()) > 0:
args = []
for a in self.application.arguments():
args.extend([a])
self.ServiceManagerContents.loadFile(unicode(args[0]))
elif QtCore.QSettings().value(
self.generalSettingsSection + u'/auto open',
QtCore.QVariant(False)).toBool():
self.ServiceManagerContents.loadLastFile()

View File

@ -33,12 +33,12 @@ from openlp.core.ui.printservicedialog import Ui_PrintServiceDialog, ZoomSize
class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog):
def __init__(self, parent, serviceManager):
def __init__(self, mainWindow, serviceManager):
"""
Constructor
"""
QtGui.QDialog.__init__(self, parent)
self.parent = parent
QtGui.QDialog.__init__(self, mainWindow)
self.mainWindow = mainWindow
self.serviceManager = serviceManager
self.printer = QtGui.QPrinter()
self.printDialog = QtGui.QPrintDialog(self.printer, self)
@ -181,13 +181,14 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog):
"""
Copies the display text to the clipboard as plain text
"""
self.parent.clipboard.setText(self.document.toPlainText())
self.mainWindow.application.clipboard.setText(
self.document.toPlainText())
def copyHtmlText(self):
"""
Copies the display text to the clipboard as Html
"""
self.parent.clipboard.setText(self.document.toHtml())
self.mainWindow.application.clipboard.setText(self.document.toHtml())
def printServiceOrder(self):
"""