๓
า:\c           @` s)  d  Z  d d l m Z m Z m Z d d l m Z d d l m Z m	 Z	 d d l
 m Z m Z m Z m Z m Z m Z m Z d d l m Z d d l m Z m Z d d l m Z m Z m Z m Z m Z d d	 l m Z d
 e f d     YZ d e f d     YZ  d   Z! e" d k r%e!   n  d S(   s(   Splash screen and intial startup splash.i    (   t   absolute_importt   divisiont   print_function(   t   Qt(   t   QColort   QPixmap(   t   QApplicationt	   QCheckBoxt   QGraphicsOpacityEffectt   QHBoxLayoutt   QLabelt   QSplashScreent   QVBoxLayout(   t   CONF(   t   ANACONDA_ICON_256_PATHt   ANACONDA_NAVIGATOR_LOGO(   t   ButtonNormalt   ButtonPrimaryt
   QSvgWidgett   SpacerHorizontalt   SpacerVertical(   t
   DialogBaset   SplashScreenc           B` s)   e  Z d  Z d   Z d   Z d   Z RS(   s"   Splash screen for the main window.c         O` sพ   t  t |   j | |   t   |  _ |  j   |  _ t t  |  _	 d |  _
 |  j j d  |  j j d  |  j |  j  |  j |  j  |  j |  j	  |  j t j t j Bt j B d S(   s"   Splash screen for the main window.t    i
   gอฬฬฬฬฬ์?N(   t   superR   t   __init__R   t   _effectt   fontt   _fontR   R   t   _pixmapt   _messaget   setPixelSizet
   setOpacityt   setFontt   setGraphicsEffectt	   setPixmapt   setWindowFlagsR   t   FramelessWindowHintt   WindowStaysOnTopHint(   t   selft   argst   kwargs(    (    sH   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/splash.pyR   $   s    	c         C` s   |  j  S(   s#   Return currently displayed message.(   R   (   R'   (    (    sH   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/splash.pyt   get_message6   s    c         C` sX   | |  _  | d 7} |  j   |  j | t j t j Bt j Bt t j   t	 j
   d S(   s   Show message in the screen.s   
N(   R   t   showt   showMessageR   t   AlignBottomt   AlignCentert   AlignAbsoluteR   t   whiteR   t   processEvents(   R'   t   message(    (    sH   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/splash.pyt   show_message:   s    	

(   t   __name__t
   __module__t   __doc__R   R*   R3   (    (    (    sH   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/splash.pyR   !   s   		t   FirstSplashc           B` s5   e  Z d  Z d d  Z d   Z d   Z d   Z RS(   s=   Startup splash to display the first time that Navigator runs.c         ` sช  t  t    j d |  d } t   _ t d    _ t d    _ t	 d    _
 t |    _ t t    _   j j     j j   j j d   t   } | j   | j   j  | j t    | j   j  t   } | j   j d t j  | j   j  | j   j
 d t j  | j t    | j t    | j |    j |    j j j   f d      j j j   f d	      j    d
 S(   s=   Startup splash to display the first time that Navigator runs.t   parents  
        Thanks for installing Anaconda!

        Anaconda Navigator helps you easily start important Python applications
        and manage the packages in your local Anaconda installation. It also
        connects you to online resources for learning and engaging with the
        Python, SciPy, and PyData community.

        To help us improve Anaconda Navigator, fix bugs, and make it even
        easier for everyone to use Python, we gather anonymized usage
        information, just like most web browsers and mobile apps.

        To opt out of this, please uncheck below (You can always change this
        setting in the Preferences menu).
        t   Oks   Ok, and don't show agains'   Yes, I'd like to help improve Anaconda.i  i    c           ` s     j  d t  S(   Nt   show_startup(   t   acceptt   True(    (   R'   (    sH   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/splash.pyt   <lambda>~   R   c           ` s     j  d t  S(   NR:   (   R;   t   False(    (   R'   (    sH   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/splash.pyR=      R   N(!   R   R7   R   R   t   configR   t	   button_okR   t   button_ok_dont_showR   t   checkbox_trackR
   t   label_aboutR   R   t   widget_icont   frame_title_bart   hidet   setFixedSizet   size_for_widthR	   t
   addStretcht	   addWidgetR   R   R   R.   R   t	   addLayoutt	   setLayoutt   clickedt   connectt   setup(   R'   R8   t   textt   layout_buttonst   layout(    (   R'   sH   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/splash.pyR   I   s8    		
	c         C` s)   |  j  j d d  } |  j j |  d S(   s   Setup widget content.t   maint   provide_analyticsN(   R?   t   getRB   t
   setChecked(   R'   RT   (    (    sH   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/splash.pyRO      s    c         C` sU   |  j  j   t j k } |  j j d d |  |  j j d d |  t j |   d S(   s   Override Qt method.RS   RT   R:   N(   RB   t
   checkStateR   t   CheckedR?   t   setR   R;   (   R'   R:   RT   (    (    sH   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/splash.pyR;      s    c         C` s   d S(   s   
        Override Qt method.

        Force user to select one of the two options bellow and disalow
        canceling the dialog (pressing escape)
        N(    (   R'   (    (    sH   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/splash.pyt   reject   s    N(   R4   R5   R6   t   NoneR   RO   R;   RZ   (    (    (    sH   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/splash.pyR7   F   s
   <		c          C` sd   d d l  m }  |    } t   } | j d  | j   t   } | j   | j   | j   d S(   s   Run local test.i    (   t   qapplications   Initializing...N(   t"   anaconda_navigator.utils.qthelpersR\   R   R3   R+   R7   t   update_style_sheett   exec_(   R\   t   appt   widget_splasht   widget_first_splash(    (    sH   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/splash.pyt
   local_test   s    		
	

t   __main__N(#   R6   t
   __future__R    R   R   t   qtpy.QtCoreR   t
   qtpy.QtGuiR   R   t   qtpy.QtWidgetsR   R   R   R	   R
   R   R   t   anaconda_navigator.configR   t    anaconda_navigator.static.imagesR   R   t   anaconda_navigator.widgetsR   R   R   R   R   t"   anaconda_navigator.widgets.dialogsR   R   R7   Rc   R4   (    (    (    sH   lib/python2.7/site-packages/anaconda_navigator/widgets/dialogs/splash.pyt   <module>   s   4(%W	