diff --git a/openlp.pyw b/openlp.pyw index 04f65a5dd..3fbb473fd 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -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 diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 294cca49b..85872155f 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -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() diff --git a/openlp/core/ui/printserviceform.py b/openlp/core/ui/printserviceform.py index 713e7c27b..da4d6205e 100644 --- a/openlp/core/ui/printserviceform.py +++ b/openlp/core/ui/printserviceform.py @@ -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): """