ó
ĝ`9Sc           @   s¨   d  Z  d d l Z d d l Z d d l Z d d l Td d l Td   Z e e _ e e j	  Z
 e e d   Z e j d e j e j Be j  e j   d   Z d S(   sÇ   Common startup code for GUI applications.

Import this module at the beginning of the top-level application script, then
create the main application widget, call 'runApplication' and do nothing
more.i˙˙˙˙N(   t   *c         C   s^   t  j |  | | d t j t j   } t  j |  | | d | t j d d | j    d S(   sD   Exception handler that displays a message box showing the traceback.t   files   Unhandled exceptionN(	   t	   tracebackt   print_exceptiont   syst   stderrt   StringIOt   QMessageBoxt   criticalt   Nonet   getvalue(   t   typet   valuet   tracebackObjt	   errorText(    (    s   code\common\utils\startup.pyt   _excepthook    s    s1   code/media/images/institute-of-physics-splash.pngs     Loading...c         C   s%   |  j    t j |   t j   d S(   sR   Show 'mainWidget', close the splash screen and run the application event
    loop.N(   t   showt   _splashScreent   finisht   _appt   exec_(   t
   mainWidget(    (    s   code\common\utils\startup.pyt   runApplication;   s    
(   t   __doc__R   R   R   t   PyQt4.QtCoret   PyQt4.QtGuiR   t
   excepthookt   QApplicationt   argvR   t   QSplashScreent   QPixmapR   t   showMessaget   Qtt   AlignHCentert   AlignBottomt   whiteR   R   (    (    (    s   code\common\utils\startup.pyt   <module>   s   

			
