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
class in order to provide the core of the application.
"""
def exec_(self):
"""
Override exec method to allow the shared memory to be released on exit
@ -85,10 +84,13 @@ class OpenLP(QtGui.QApplication):
QtGui.QApplication.exec_()
self.sharedMemory.detach()
def run(self):
def run(self, args):
"""
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.
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'openlp_process_events'), self.processEvents)
@ -115,7 +117,7 @@ class OpenLP(QtGui.QApplication):
# make sure Qt really display the splash screen
self.processEvents()
# start the main app window
self.mainWindow = MainWindow(self.clipboard(), self.arguments())
self.mainWindow = MainWindow(self.clipboard(), self.args)
self.mainWindow.show()
if show_splash:
# now kill the splashscreen
@ -250,7 +252,7 @@ def main():
log.debug(u'Could not find default_translator.')
if not options.no_error_form:
sys.excepthook = app.hookException
sys.exit(app.run())
sys.exit(app.run(qt_args))
if __name__ == u'__main__':
"""

View File

@ -615,11 +615,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
if self.liveController.display.isVisible():
self.liveController.display.setFocus()
self.activateWindow()
# On Windows, arguments contains the entire commandline
# 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':
if len(self.arguments):
args = []
for a in self.arguments:
args.extend([a])

View File

@ -16,7 +16,7 @@
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (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}
AppVerName={#AppVerName}
AppPublisher={#AppPublisher}
@ -29,11 +29,12 @@ AllowNoIcons=true
LicenseFile=LICENSE.txt
OutputDir=..\..\dist
OutputBaseFilename=OpenLP-{#RealVersion}-setup
Compression=lzma
Compression=lzma/Max
SolidCompression=true
SetupIconFile=OpenLP.ico
WizardImageFile=WizImageBig.bmp
WizardSmallImageFile=WizImageSmall.bmp
ChangesAssociations=true
[Languages]
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
[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]
function GetUninstallString(): String;