Utilities/Startup.py

changeset 1849
fb1d05e523d3
parent 1775
cbe864be5274
child 2077
68a34718a0ce
child 2303
0ed4ed026c16
equal deleted inserted replaced
1848:aa5003c03f83 1849:fb1d05e523d3
201 loc = None 201 loc = None
202 return loc 202 return loc
203 203
204 204
205 def simpleAppStartup(argv, appinfo, mwFactory, quitOnLastWindowClosed=True, 205 def simpleAppStartup(argv, appinfo, mwFactory, quitOnLastWindowClosed=True,
206 app=None): 206 app=None, raiseIt=True):
207 """ 207 """
208 Module function to start up an application that doesn't need a specialized start up. 208 Module function to start up an application that doesn't need a specialized start up.
209 209
210 This function is used by all of eric5's helper programs. 210 This function is used by all of eric5's helper programs.
211 211
218 <dd>list of commandline parameters (list of strings)</dd> 218 <dd>list of commandline parameters (list of strings)</dd>
219 </dl> 219 </dl>
220 @keyparam quitOnLastWindowClosed flag indicating to quit the application, 220 @keyparam quitOnLastWindowClosed flag indicating to quit the application,
221 if the last window was closed (boolean) 221 if the last window was closed (boolean)
222 @keyparam app reference to the application object (QApplication or None) 222 @keyparam app reference to the application object (QApplication or None)
223 @keyparam raiseIt flag indicating to raise the generated application window (boolean)
223 """ 224 """
224 handleArgs(argv, appinfo) 225 handleArgs(argv, appinfo)
225 if app is None: 226 if app is None:
226 app = E5Application(argv) 227 app = E5Application(argv)
227 app.setQuitOnLastWindowClosed(quitOnLastWindowClosed) 228 app.setQuitOnLastWindowClosed(quitOnLastWindowClosed)
241 242
242 w = mwFactory(argv) 243 w = mwFactory(argv)
243 if quitOnLastWindowClosed: 244 if quitOnLastWindowClosed:
244 app.lastWindowClosed.connect(app.quit) 245 app.lastWindowClosed.connect(app.quit)
245 w.show() 246 w.show()
246 w.raise_() 247 if raiseIt:
248 w.raise_()
247 249
248 return app.exec_() 250 return app.exec_()

eric ide

mercurial