Windows command line

This commit is contained in:
Jonathan Corwin 2011-05-21 23:16:28 +01:00
parent 8872d146a6
commit 0c365e2a59
3 changed files with 14 additions and 11 deletions

View File

@ -77,7 +77,6 @@ class OpenLP(QtGui.QApplication):
The core application class. This class inherits from Qt's QApplication The core application class. This class inherits from Qt's QApplication
class in order to provide the core of the application. class in order to provide the core of the application.
""" """
def exec_(self): def exec_(self):
""" """
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
@ -85,10 +84,13 @@ class OpenLP(QtGui.QApplication):
QtGui.QApplication.exec_() QtGui.QApplication.exec_()
self.sharedMemory.detach() self.sharedMemory.detach()
def run(self): def run(self, args):
""" """
Run the OpenLP application. Run the OpenLP application.
""" """
# On Windows, the args passed into the constructor are
# ignored. Not very handy, so set the ones we want to use.
self.args = args
# provide a listener for widgets to reqest a screen update. # provide a listener for widgets to reqest a screen update.
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'openlp_process_events'), self.processEvents) QtCore.SIGNAL(u'openlp_process_events'), self.processEvents)
@ -115,7 +117,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.arguments()) self.mainWindow = MainWindow(self.clipboard(), self.args)
self.mainWindow.show() self.mainWindow.show()
if show_splash: if show_splash:
# now kill the splashscreen # now kill the splashscreen
@ -250,7 +252,7 @@ def main():
log.debug(u'Could not find default_translator.') log.debug(u'Could not find default_translator.')
if not options.no_error_form: if not options.no_error_form:
sys.excepthook = app.hookException sys.excepthook = app.hookException
sys.exit(app.run()) sys.exit(app.run(qt_args))
if __name__ == u'__main__': if __name__ == u'__main__':
""" """

View File

@ -615,11 +615,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
if self.liveController.display.isVisible(): if self.liveController.display.isVisible():
self.liveController.display.setFocus() self.liveController.display.setFocus()
self.activateWindow() self.activateWindow()
# On Windows, arguments contains the entire commandline if len(self.arguments):
# So args[0]=='python' args[1]=='openlp.pyw'
# Therefore this approach is not going to work
# Bypass for now.
if len(self.arguments) and os.name != u'nt':
args = [] args = []
for a in self.arguments: for a in self.arguments:
args.extend([a]) args.extend([a])

View File

@ -16,7 +16,7 @@
; NOTE: The value of AppId uniquely identifies this application. ; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications. ; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{AA7699FA-B2D2-43F4-8A70-D497D03C9485} AppID={{AA7699FA-B2D2-43F4-8A70-D497D03C9485}
AppName={#AppName} AppName={#AppName}
AppVerName={#AppVerName} AppVerName={#AppVerName}
AppPublisher={#AppPublisher} AppPublisher={#AppPublisher}
@ -29,11 +29,12 @@ AllowNoIcons=true
LicenseFile=LICENSE.txt LicenseFile=LICENSE.txt
OutputDir=..\..\dist OutputDir=..\..\dist
OutputBaseFilename=OpenLP-{#RealVersion}-setup OutputBaseFilename=OpenLP-{#RealVersion}-setup
Compression=lzma Compression=lzma/Max
SolidCompression=true SolidCompression=true
SetupIconFile=OpenLP.ico SetupIconFile=OpenLP.ico
WizardImageFile=WizImageBig.bmp WizardImageFile=WizImageBig.bmp
WizardSmallImageFile=WizImageSmall.bmp WizardSmallImageFile=WizImageSmall.bmp
ChangesAssociations=true
[Languages] [Languages]
Name: english; MessagesFile: compiler:Default.isl Name: english; MessagesFile: compiler:Default.isl
@ -79,6 +80,10 @@ Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#AppName}; Filenam
Filename: {app}\{#AppExeName}; Description: {cm:LaunchProgram,{#AppName}}; Flags: nowait postinstall skipifsilent Filename: {app}\{#AppExeName}; Description: {cm:LaunchProgram,{#AppName}}; Flags: nowait postinstall skipifsilent
[Registry] [Registry]
Root: HKCR; Subkey: ".osz"; ValueType: string; ValueName: ""; ValueData: "OpenLP"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "OpenLP"; ValueType: string; ValueName: ""; ValueData: "OpenLP Service"; Flags: uninsdeletekey
Root: HKCR; Subkey: "OpenLP\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\OpenLP.exe,0"
Root: HKCR; Subkey: "OpenLP\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\OpenLP.exe"" ""%1"""
[Code] [Code]
function GetUninstallString(): String; function GetUninstallString(): String;