Toolbox/Startup.py

branch
Py2 comp.
changeset 2791
a9577f248f04
parent 2677
3d4277929fb3
parent 2683
ef93fc7332a2
child 3057
10516539f238
equal deleted inserted replaced
2790:6686a3326df8 2791:a9577f248f04
185 loc = None 185 loc = None
186 return loc 186 return loc
187 187
188 188
189 def simpleAppStartup(argv, appinfo, mwFactory, quitOnLastWindowClosed=True, 189 def simpleAppStartup(argv, appinfo, mwFactory, quitOnLastWindowClosed=True,
190 app=None, raiseIt=True): 190 app=None, raiseIt=True, installErrorHandler=False):
191 """ 191 """
192 Module function to start up an application that doesn't need a specialized start up. 192 Module function to start up an application that doesn't need a specialized start up.
193 193
194 This function is used by all of eric5's helper programs. 194 This function is used by all of eric5's helper programs.
195 195
203 </dl> 203 </dl>
204 @keyparam quitOnLastWindowClosed flag indicating to quit the application, 204 @keyparam quitOnLastWindowClosed flag indicating to quit the application,
205 if the last window was closed (boolean) 205 if the last window was closed (boolean)
206 @keyparam app reference to the application object (QApplication or None) 206 @keyparam app reference to the application object (QApplication or None)
207 @keyparam raiseIt flag indicating to raise the generated application window (boolean) 207 @keyparam raiseIt flag indicating to raise the generated application window (boolean)
208 @keyparam installErrorHandler flag indicating to install an error
209 handler dialog (boolean)
208 """ 210 """
209 handleArgs(argv, appinfo) 211 handleArgs(argv, appinfo)
210 if app is None: 212 if app is None:
211 app = E5Application(argv) 213 app = E5Application(argv)
212 app.setQuitOnLastWindowClosed(quitOnLastWindowClosed) 214 app.setQuitOnLastWindowClosed(quitOnLastWindowClosed)
228 app.lastWindowClosed.connect(app.quit) 230 app.lastWindowClosed.connect(app.quit)
229 w.show() 231 w.show()
230 if raiseIt: 232 if raiseIt:
231 w.raise_() 233 w.raise_()
232 234
235 if installErrorHandler:
236 # generate a graphical error handler
237 from E5Gui import E5ErrorMessage
238 eMsg = E5ErrorMessage.qtHandler()
239 eMsg.setMinimumSize(600, 400)
240
233 return app.exec_() 241 return app.exec_()

eric ide

mercurial