Toolbox/Startup.py

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

eric ide

mercurial