
:\c           @`  sa  d  Z  d d l m Z m Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l	 m
 Z
 m Z m Z m Z m Z m Z d d l m Z d d l m Z m Z m Z m Z m Z d d l Z d d l Z d d l m Z d d l 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* d d l+ m, Z, d d l- m. Z. m/ Z/ d d l0 m1 Z1 d d l2 m3 Z3 d d l4 m5 Z5 d d l6 m7 Z7 d d l8 m9 Z9 m: Z: d d l; m< Z< m= Z= m> Z> m? Z? m@ Z@ mA ZA mB ZB mC ZC d d lD mE ZE mF ZF mG ZG mH ZH d d lI mJ ZJ d d lK mL ZL d d lM mN ZN mO ZO mP ZP mQ ZQ mR ZR d d lS mT ZT d d lU mV ZV d d lW mX ZX d d lY mZ ZZ d d l[ m\ Z\ d d l] m^ Z^ d d l_ m` Z` d d la mb Zb mc Zc md Zd me Ze d d  lf mg Zg d d! lh mi Zi d d" lj mk Zk d d# ll mm Zm d d$ ln mo Zo d% e> f d&     YZp d' e= f d(     YZq d) e< f d*     YZr d+ e? f d,     YZs d- e@ f d.     YZt d/ e@ f d0     YZu d1 eA f d2     YZv d3 eA f d4     YZw d5 eA f d6     YZx d7 eA f d8     YZy d9 e f d:     YZz d;   Z{ e| d< k r]e{   n  d S(=   s   Main Application Window.i    (   t   absolute_importt   divisionN(   t   QPointt   QSizet   Qtt   QTimert   QUrlt   Signal(   t   QDesktopServices(   t   QApplicationt   QHBoxLayoutt   QMainWindowt   QVBoxLayoutt   QWidget(   t   __version__(   t   AnacondaAPI(   t   CHANNELS_PATHt   CONFt   DEFAULT_BRANDt   GLOBAL_VSCODE_APPt   LINUXt   MACt   WIN(   t   images(   t	   constants(   t	   GATracker(   t   get_package_logst   launch(   t   logger(   t   set_windows_appusermodelid(   t   is_text_string(   t   create_action(   t	   BLUR_SIZEt   load_style_sheet(   t
   ButtonBaset   ButtonLabelt
   ButtonLinkt   ButtonPrimaryt	   FrameBaset	   LabelBaset
   QSvgWidgett   SpacerHorizontal(   t   MessageBoxErrort   MessageBoxInformationt   MessageBoxQuestiont   projects(   t   AboutDialog(   t   DialogChannels(   t   CloneDialogt   ConflictDialogt   CreateDialogt   ImportDialogt   RemoveDialog(   t   LicenseManagerDialog(   t   LogViewerDialog(   t   AuthenticationDialog(   t   DialogOfflineMode(   t   PackagesDialog(   t   PasswordDialog(   t   PreferencesDialog(   t   ClosePackageManagerDialogt   QuitApplicationDialogt   QuitBusyDialogt   QuitRunningAppsDialog(   t   DialogUpdateApplication(   t   CommunityTab(   t   EnvironmentsTab(   t   HomeTab(   t	   TabWidgett   ButtonLinkLoginc           B`  s   e  Z d  Z RS(   s   Button used in CSS styling.(   t   __name__t
   __module__t   __doc__(    (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyRE   Q   s   t   ButtonLabelLoginc           B`  s   e  Z d  Z RS(   s   Button used in CSS styling.(   RF   RG   RH   (    (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyRI   U   s   t   ButtonHeaderUpdatec           B`  s   e  Z d  Z RS(   s   Button used in CSS styling.(   RF   RG   RH   (    (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyRJ   Y   s   t   ButtonLoginc           B`  s   e  Z d  Z RS(   s   Button used in CSS styling.(   RF   RG   RH   (    (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyRK   ]   s   t   FrameHeaderc           B`  s   e  Z d  Z RS(   sA   
    Frame used in CSS styling.

    Top application header.
    (   RF   RG   RH   (    (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyRL   a   s   t	   FrameBodyc           B`  s   e  Z d  Z RS(   s   Frame used in CSS styling.(   RF   RG   RH   (    (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyRM   i   s   t   LabelHeaderLogoc           B`  s   e  Z d  Z RS(   s   Label used in CSS styling.(   RF   RG   RH   (    (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyRN   m   s   t   LabelOfflineModec           B`  s   e  Z d  Z RS(   s   Label used in CSS styling.(   RF   RG   RH   (    (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyRO   q   s   t   LabelHeaderUpdatec           B`  s   e  Z d  Z RS(   s   Label used in CSS styling.(   RF   RG   RH   (    (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyRP   u   s   t	   LabelBetac           B`  s   e  Z d  Z RS(   s   Label used in CSS styling.(   RF   RG   RH   (    (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyRQ   y   s   t
   MainWindowc           B`  s  e  Z d  Z e   Z e   Z e   Z e   Z e   Z d Z	 f  Z
 d Z d Z d Z d Z e d Z e d Z e d Z e e e e e e e d	  Z e d
  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z e e e d  Z d   Z  e e d  Z! e d  Z" e e d  Z# d   Z$ e% d    Z& e% d    Z' e d  Z( d   Z) e d  Z* d   Z+ d   Z, d   Z- d    Z. d!   Z/ d"   Z0 d#   Z1 d$   Z2 d%   Z3 e e d&  Z4 d'   Z5 d(   Z6 d)   Z7 d*   Z8 d+   Z9 d,   Z: e e e d-  Z; d.   Z< d/   Z= d0   Z> d1   Z? d2   Z@ d3   ZA d4   ZB d5   ZC d6   ZD d7   ZE d8   ZF d9   ZG d:   ZH d;   ZI d<   ZJ d=   ZK d>   ZL e e d?  ZM d@   ZN dA   ZO dB   ZP dC   ZQ dD   ZR dE   ZS dF   ZT dG   ZU dH   ZV dI   ZW dJ   ZX dK   ZY e dL  ZZ dM   Z[ dN   Z\ dO   Z] e e e e dP  Z^ dQ   Z_ e e e e dR  Z` dS   Za dT   Zb dU   Zc RS(V   s   Main window widget.s,   https://docs.anaconda.com/anaconda/navigators#   https://www.anaconda.com/api/videoss#   https://www.anaconda.com/api/eventss%   https://www.anaconda.com/api/webinarss1   http://api-dev-continuum-content.pantheonsite.io/s
   api/videoss
   api/eventss   api/webinarsc         `  s
  t  t    j   t     _ t   _ t   _ d2   _
 |   _ t   _ t   _ d2   _   j j d d    _ d2   _ d2   _ t   _ d2   _ d2   _ d2   _ d2   _ d2   _ d2   _ d2   _ d2   _ d2   _ d2   _ d2   _ d2   _ d2   _  d2   _! d2   _" d2   _# d2   _$ d2   _% t   _& t' j( j d   j j)    _* g    _+ d2   _, t-   _. d   _/ t   _0 d   _1   j j2 j3     _4 d2   _5 t   _6 d2   _7 d2   _8   j j d d  } | rt9 |  rt' j: j; |  r|   _8 n   j j< d d d2  t= rLt>   }	 t? j@ d jA |	   n  tB     _C   jC jD d  tB     _E   jE jD d	  tB     _F   jF jD d
  tB     _G   jG jD d  tB     _H   jH jD d  d2   _I d2   _J d2   _K d2   _L d2   _M |   _N tO      _P tQ      _R tS tT jU    _V tW d    _X tY d    _Z t[ d    _\ t] d    _^ t_     _` ta     _b tc      _d   je d    j^ jf t    jZ jg th ji    j` jj t    jk     jV jl tm d d     jn     j j d d  }
   j j d d  }   j j d d  }   jd jo d d   jp   jd jo d d d | r  jd jq d d | n  |
 r  jd jq d d |
 n  | r  jd jq d d | n  | r{tr d      _I   jd js   jI d d   jI jt ju   jv    jI jw ju   jx    jI jy ju   jz    jI j{ ju   j|    jI j} ju   j~  n  | rt d      _J   jd js   jJ d d   jJ jw ju   jx    jJ j ju   j    jJ jt ju   jv    jJ j ju   j    jJ j ju   j    jJ j ju   j    jJ j ju   j    jJ j ju   j    jJ j ju   f d      jJ j ju   j  n  | rt d   d  d! d" d# d$ g d%   j   j g d& t j d'   j    _L   jd js   jL d d(   jL j ju   f d)    n  | rt d   d  d* d+ d, g d%   j g d& t j d'   j    _M   jM j ju   f d-      jd js   jM d d. n    jI   jJ   jK   jM   jL g   _ t   } | j   jV  | j   | j   jX  | j t    | j   j^  | j t    | j   jZ  | j   j\  | j t    | j   j`    jP j |  t   } | j   jd  | j d/ d/ d/ d/  | j d/    jR j |  t   } | j   jP  | j   jR  | j d/ d/ d/ d/  | j d/    jb j |    j d/ d/ d/ d/    j   jb    jG j ju   j    jC j ju   j    jF j ju   j    jE j ju   j    jH j ju   j    j` j ju   j    j\ j ju   j    j^ j ju   j    jd j ju   j    jd j ju   j    jd jy ju   jz    j ju   j    j ju   j    j j< d d0 d2    j j t    j     j j d1   j*  } | j ju   j    j j d1   j*  } | j ju   j  d2 S(3   s   Main window widget.t   maint	   first_runt   CONDA_PREFIXs   Sign in to t    t   projects_paths   appusermodelid: {0}i>  i6  i:  i  ii  s   Upgrade Nows   Anaconda Navigatori  i2   t   youtube_urlt   twitter_urlt
   github_urlt   Documentationt   urls   Developer Blogs,   https://www.anaconda.com/blog/developer-blogt   Twittert   Youtubet   Githubt   parentt   textt   Homet   Environmentsc           `  s     j  d t  S(   Nt   conda(   t   set_busy_statust   False(    (   t   self(    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyt   <lambda>Z  RV   t   tagst   webinart   documentationt   videot   trainingt   content_urlst   tab_namet   configt   Learningc           `  s     j  d t  S(   Nt   learning(   Re   Rf   (    (   Rg   (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyRh   {  RV   t   eventt   forumt   socialc           `  s     j  d t  S(   Nt	   community(   Re   Rf   (    (   Rg   (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyRh     RV   t	   Communityi    t   last_status_is_offlinet   prefixN(   t   superRR   t   __init__R   t   apit   Truet   initial_setupRf   t   setup_readyt   Nonet   trackerRp   t   fullscreen_flagt   maximized_flagt   style_sheett   getRT   t   application_update_versiont   restart_requiredt   _toobar_setup_readyt   _dialog_aboutt   _dialog_logst   _dialog_preferencest   _dialog_updatet   _dialog_message_boxt   _dialog_quitt   _dialog_quit_busyt   _dialog_quit_running_appst   _dialog_welcomet   _dialog_offlinet   _dialog_channelst   _dialog_licensest   _dialog_environment_actiont   _dialog_project_actiont   busy_communityt   busy_learningt   licensest   environmentst
   busy_condat   ost   environt   ROOT_PREFIXt   current_prefixt   running_processest   _anaconda_urlR   t   _brandt   _login_textt   loggedt   usernamet   _client_apit
   load_tokent   tokenR-   t   busy_projectst   current_projectRW   R   t   patht   isdirt   setR   R   R   t   infot   formatR   t   _timer_environmentst   setIntervalt   _timer_projectst   _timer_licensest   _timer_clientt   _timer_offlinet   tab_homet   tab_environmentst   tab_projectst   tab_learningt   tab_communityt   splashRL   t   frame_headerRM   t
   frame_bodyR(   R   t   ANACONDA_NAVIGATOR_LOGOt
   label_logoRO   t   label_offline_modeRI   t   button_logged_textRE   t   button_logged_usernameRJ   t   button_update_availableRK   t   button_loginR   t   widgetRD   t   stackt   setWindowTitlet
   setVisiblet   setFocusPolicyR   t   NoFocust
   setDefaultt   update_login_button_textt   setFixedSizeR   t   set_initial_batch_configt   add_linkt   DOCS_URLt
   add_socialRC   t   addTabt   sig_item_selectedt   connectt   select_environmentt   sig_channels_requestedt   show_channelst   sig_url_clickedt   open_urlt   sig_launch_action_requestedt   launch_applicationt   sig_conda_action_requestedt   conda_application_actionRB   t   sig_update_index_requestedt   update_indext   sig_create_requestedt   show_create_environmentt   sig_clone_requestedt   show_clone_environmentt   sig_import_requestedt   show_import_environmentt   sig_remove_requestedt   show_remove_environmentt   sig_packages_action_requestedt   show_conda_packages_actiont	   sig_readyt   sig_cancel_requestedt   show_cancel_processRA   t
   VIDEOS_URLt   WEBINARS_URLt   Ct   TAB_LEARNINGt
   EVENTS_URLt   TAB_COMMUNITYt   all_tab_widgetsR
   t	   addWidgett
   addStretchR)   t	   setLayoutt   setContentsMarginst
   setSpacingR   t   setCentralWidgett   timeoutt   check_for_new_logint   check_for_new_environmentst   check_for_new_licensest   check_for_new_projectst   check_internet_connectivityt   clickedt   handle_logint   open_login_paget   update_applicationt   sig_current_changedt
   _track_tabt   fix_tab_ordert   sig_setup_readyt   check_package_cachet   set_data_directoryR   t   update_style_sheett   conda_configt   sig_chain_finishedt   add_featured_channelst
   conda_datat   setup(   Rg   R   Rp   R   R   t   tab_projectR   R   RW   t   resRX   RY   RZ   t   layout_headert   layout_bodyt   layout_maint   workert   worker_data(    (   Rg   sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR{      s   																																															

	
	








			
		

c         C`  s   t  j d j |   | d k r4 |  j j   } n  |  j j   } | rX | j   } n  |  j r | r d j |  } |  j j	 |  n  d S(   s@   Track the active tab by index, or set `Home` when index is None.s	   index: {}s   /{0}N(
   R   t   debugR   R   R   t   currentIndext   currentTextt   lowerR   t
   track_page(   Rg   t   indexRa   t   page(    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR    s    c         `  s     f d   } t  }   j j d d  } | d k	 rs t | t  sW t j j |  rs   j	 j
 |  | } qs n    j j d d  } | d k	 r | | d | r   j	 j |  q n  d S(   sW   
        Set configuration settings that force conda and client config update.
        c         `  s"     j  j |  d t d | } | S(   s6   Check if a given URL is a valid anaconda api endpoint.t   non_blockingt   verify(   R|   t   download_is_valid_api_urlRf   (   R\   R  t   output(   Rg   (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyt   is_valid_api  s
    		RS   t   default_ssl_certificatet   default_anaconda_api_urlR  N(   R}   Rp   R   R   t
   isinstancet   boolR   R   t   isfileR|   t   client_set_sslt   client_set_api_url(   Rg   R"  R  R#  R$  (    (   Rg   sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR     s    			c   	      C`  s  t  j d j | |   |  j   |  j r	t  j d  |  j d  |  j j   } |  j	 |  |  j d  |  j
   |  j d  |  j j   | } |  j d |  |  j j   |  _ | j d i   } | j d  |  _ |  j j d	 |  j g  |  _ t |  _ n t  j d
  |  j r2|  j j |  n  |  j rN|  j j |  n  | d } | j d i   } | j d t  } |  j d | d |  |  j   d S(   s   
        Perform initial setup and configuration.

        This is the first method called after the main window has been created.
        s   output: {}, error: {}s   Initial setups   Loading user...s   Preparing interface...s   Loading bundled metadata...R  t   processed_infot   __environmentst   pathss   Normal setupt   packagest   root_writablet   is_root_writableN(   R   R  R   R   R~   R   t
   set_splashR|   t   client_usert   update_login_statust   setup_toolbarst   load_bundled_metadatat
   post_setupt   load_licensesR   R   R   t   get_projectsRW   R-   Rf   R   R  R   t   check_for_updatesR  (	   Rg   R  R!  t   errort   userR  R   R-  R/  (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR    s:    
	
		
	c         C`  s  t  j d j |   t |  _ |  j j d d t  |  j rn |  j	 d t  |  j
 d  |  j j |  n  |  j r |  j	 d t  |  j
 d  |  j j |  n  |  j r|  j	 d t  |  j
 d  |  j j |  j g  } |  j j |  |  j   n  |  j r8|  j	 d	 t  |  j
 d
  |  j j   n  |  j rn|  j	 d t  |  j
 d
  |  j j   n  |  j   |  j j d d d  } | ry$ |  j t j |   |  j   Wqt k
 r|  j   qXn
 |  j   |  j |  d S(   s   Setup tab widgets.s   conda_data: {}RS   RT   Rd   s   Loading applications...s   Loading environments...R-   s   Loading projects...Rv   s   Loading content...Rr   t   geoN(   R   R  R   R}   R   Rp   R   Rf   R   Re   R0  R  R   R   R|   R7  RW   t   select_projectR   R   R
  R   R   t   restoreGeometryt   picklet   loadst   showt	   Exceptiont   showMaximizedt   post_visible_setup(   Rg   R  R-   R;  (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR5  6  sF    						

c         `  s3  t  j d    j r d S  j   } | j d  } | j t   d d   j d d  | j t   d d   j d d	  | j t   d
 d   j	 d d  | j d  } | j t   d d   f d    | j t   d d   j
 d d  | j   | j t   d d   j  t   _ d S(   s    Setup toolbar menus and actions.RV   Ns   &Files   &Preferencest	   triggeredt   shortcuts   Ctrl+Ps   &Restarts   Ctrl+Rs   &Quits   Ctrl+Qs   &Helps   &Online Documentationc           `  s     j    j  S(   N(   R   R   (    (   Rg   (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyRh     RV   s   &Logs viewert   F6s   &About(   R   R  R   t   menuBart   addMenut	   addActionR   t   show_preferencest   restartt   closet   show_log_viewert   addSeparatort
   show_aboutR}   (   Rg   t   menubart	   file_menut   helpmenu(    (   Rg   sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR3  b  sB    		
		

c         C`  s*  t  j d j |   |  j r/ |  j j   n  |  j j d d t  t   |  _	 |  j
 d  |  j   | j d  } | j d i   } | j d t  } |  j d | d |  |  j d  |  j j j } | r | d j   n  |  j j d	 |  j  } | j j |  j  |  j   |  j j   d
 S(   s)   Setup after show method has been applied.s   conda_data: {}RS   RT   i    R-  R*  R.  R/  Ry   N(   R   R  R   R   t   hideRp   R   Rf   R   R   R  t   show_welcome_screenR   R8  R  R   t   tabbart   buttonst   setFocusR|   t   conda_config_and_sourcesR   R  R   t   check_outdated_channelsR   R  t   emit(   Rg   R  R-  R   R/  RV  R  (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyRC    s(    	
	
c         C`  sR   t  j d j |   |  j r2 |  j j |  n  |  j rN |  j j |  n  d S(   s@   Set the widgets enabled/disabled status for subwidgets and tabs.s	   value: {}N(   R   R  R   R   t   set_widgets_enabledR   (   Rg   t   value(    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR[    s
    		c         C`  s]   t  j d  t   |  _ x- |  j D]" } | r# | j d |  j  q# q# W|  j |  j  d S(   s   Update custom CSS style sheet.RV   R   N(   R   R  R!   R   R   R
  t   setStyleSheet(   Rg   t   tab(    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR
    s    c         C`  s1  t  j d j | |   d d l m } | p2 t } |  j j t  |  j j	 t  | r-| j
 d  } | r-| j
 d  } | r*| | d  | |  k s d | k r*| d | j d d  k r*| d |  _ |  j j t  |  j j	 t  |  j j
 d	 d
  s'|  j d t d |  q'q*q-n  d S(   s   Check for application updates.s   packages: {}, version: {}i    (   t   LooseVersions   anaconda-navigatort   versionsit   devRV   RS   t   hide_update_dialogt   center_dialogR/  N(   R   R  R   t   distutils.versionR_  R   R   t
   setEnabledRf   R   R   t   replaceR   R}   Rp   R  (   Rg   R-  t   versionR/  t   lvt   navi_versiont   package_dataR`  (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR8    s(    	c         C`  s   t  j d j | |   | rs |  j j t  d } t d | d | d d  } |  j j d d d	 | j	   nX |  j j t
  d
 } t d | d d  } |  j j d d d | j	   |  j t
  |  j   |  j   d S(   s   Update application callback.s   output: {}, error: {}s    Anaconda Navigator Update error:Ra   R9  t   titles   Application Update Errors   /update/errort	   pagetitles$   Update Application Error Message BoxsF   Anaconda Navigator Updated succefully.

Please restart the applications   Application Updates   /update/successfuls(   Application Update Succesful Message BoxN(   R   R  R   R   Re  R}   R*   R   R  t   exec_Rf   R+   t   update_busy_statust   update_statusR  (   Rg   R  R!  R9  Ra   t   dlg(    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyt   _update_application  s(    		

c   
   	   C`  sS  t  j d j |   |  j } | d k } | rOt d | d | d | d |  } |  j d k r9| |  _ | s |  j j   } |  j j	   } |  j j
 t | j | |   } | j |  n  |  j r |  j j d d d	 n  | j   r9|  j j d
 d |  |  j | d | }	 |	 d k	 r6|  j   q6q9n  d |  _ |  j   n  d S(   s/   Update application to latest available version.s   center_dialog: {}s   1000.0.0Rg  t   startupt
   qa_testingR/  s   /updateRl  s   Update Application Dialogt   applicationt   updatedN(   R   R  R   R   R@   R   R   R   t   heightt   widtht   mapToGlobalR   t   WIDTHt   moveR   R  Rm  t   track_eventt   open_updaterRL  R  (
   Rg   Rc  R/  Rg  Rs  Rp  Rv  Rw  t   pointt   pid(    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR    s8    							c         C`  s   t  j d j |   |  j j d d |  t } |  j j } t j	 j
 d |  } d d | d | g } t or | } t | | | d d	 d
 | d t d | S(   s#   Open the Anaconda Navigator Updaters   version: {}Rt  s   updater-requestedRU   s   navigator-updaters   --latest-versions   --prefixt   package_names   anaconda-navigator-updatert   root_prefixt	   non_condat   as_admin(   R   R  R   R   R{  R}   R|   R   R   R   R   R   R   (   Rg   Rg  R/  t   leave_path_aloneR  Ry   t   commandR  (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR|  ?  s&    	c         C`  sO   t  j d j | | |   t |  } t j |  |  j j d d |  d S(   s   Open url and track event.s!   url: {}, category: {}, action: {}t   helpRk   N(   R   R  R   R   R   t   openUrlR   R{  (   Rg   R\   t   categoryt   actiont   qurl(    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR   ^  s
    c         C`  sX   t  j d  d j |  j |  j  } t |  } t j |  |  j j	 d d |  d S(   s"   Open logged in user anaconda page.RV   s   {0}/{1}t   contentR   N(
   R   R  R   R   R   R   R   R  R   R{  (   Rg   R\   R  (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR  i  s
    c         C`  sR   t  j d  |  j j   } | j d d  } | d d k rH | d  n | } | S(   s;   Return the conda url based on the api info from config url.RV   t	   conda_urls   https://conda.anaconda.orgit   /(   R   R  R|   t   download_get_api_infoR   (   Rg   t   api_infoR\   (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR  s  s
     c         C`  s   t  j d  |  j j   S(   s/   Return the api url from anaconda client config.RV   (   R   R  R|   t   client_get_api_url(   Rg   (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyt   api_url|  s    c         `  sr  t  j d j |     f d   } | rL | j d d    _ t   _ n    j r   j j t	    j }   j
 j   } | | _ | j j |    j j t    j j |    j j t    j j d  nF d }   j j d    j j d    j j t	    j j t	    j
 j     j j t	    j
 j   } | | _ | j j |  t j   d S(   s$   Update login button and information.s   user_data: {}c         `  s   t  j d j | |   | j d d  } |   _ | j d t    _ |  j r d j | |  j  } y   j j	 |  Wq t
 k
 r q Xn    j   y   j j t  Wn t
 k
 r n Xd  S(   Ns   output: {}, error: {}t   main_urls   https://anaconda.orgt   brands   {0}/{1}(   R   R  R   R   R   R   R   R   R   t
   setToolTipt   RuntimeErrorR   R   Re  R}   (   R  R!  R9  t   anaconda_main_urlR\   (   Rg   (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyt   _update_tool_tip  s    		
t   loginRV   s   Signed in as N(   R   R  R   R   R   R}   R   R   Re  Rf   R|   t   api_urlsR  R   R   R   t   setTextR   R   t   client_reloadR	   t   restoreOverrideCursor(   Rg   t	   user_dataR  R   R  (    (   Rg   sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR2    s4    				c         C`  sm   |  j  r d } n |  j |  j } |  j rA |  j j |  j  n  y |  j j |  Wn t k
 rh n Xd S(   s3   Update login button text based on `brand` from api.s   Sign outN(   R   R   R   R   t   update_brandR   R  R  (   Rg   Ra   (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR     s    			c         C`  sS  t  j d j |   | r( t |  _ n  |  j r t j t j  |  j	 j
   t |  _ |  j j   |  j j d d d |  j n t |  j	 d |  d |  j } |  j r |  j j d d d	 n  | j   r| j |  _ t |  _ |  j j   |  j r|  j j d d
 d |  j qn  |  j   |  j   t  j t |  j |  j f   d S(   s;   Open up login dialog or log out depending on logged status.s
   logout: {}t   authenticatet   logoutt   labelR`   R  s   /loginRl  s   Login dialogR  N(   R   R  R   R}   R   R	   t   setOverrideCursorR   t
   WaitCursorR|   R  Rf   t   sig_logged_outRZ  R   R{  R   R7   R   R  Rm  t   sig_logged_inR  R2  t   str(   Rg   R  Rp  (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR    s0    							

c         `  s   t  j d    j r/   j j d d d n  t d   d   j    _   j j j   f d      j j	   d   _   j   d S(	   s<   Display the preferences dialog and apply the needed actions.RV   s   /preferencesRl  s   Preferences dialogR`   Rp   c         `  s     j  d t  S(   NR  (   R  R}   (   t   aut   cu(   Rg   (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyRh     RV   N(   R   R  R   R  R;   Rp   R   t   sig_urls_updatedR   Rm  R   R  (   Rg   (    (   Rg   sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyRJ    s    			c         C`  sx   t  j d  t |   |  _ |  j r> |  j j d d d n  |  j j j |  j  |  j j	   d |  _ |  j   d S(   s;   Display the `About` dialog with information on the project.RV   s   /aboutRl  s   About dialogN(   R   R  R.   R   R   R  R   R   R   Rm  R   R  (   Rg   (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyRO    s    		c         C`  s   t  j d  t |  d t  r |  j j d d t  r d d l m } t |  _	 |  j
 r |  j
 j   |   |  _ |  j r |  j j d d d	 n  |  j j   |  j j   d
 |  _ q n  |  j   d
 S(   s   Show initial splash screen.RV   t   showmeRS   t   show_startupi    (   t   FirstSplashs   /welcomeRl  s   Welcome dialogN(   R   R  t   getattrR}   Rp   R   t)   anaconda_navigator.widgets.dialogs.splashR  Rf   R  R   RS  R   R   R  t   raise_Rm  R   R  (   Rg   R  (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyRT    s    				c         C`  s   t  j d  t d |   |  _ |  j rA |  j j d d d n  |  j j j |  j  |  j j	   rv |  j
 j   n  d |  _ |  j   d S(   s   Show license manager dialog.RV   R`   s	   /licensesRl  s   Licenses dialogN(   R   R  R5   R   R   R  R   R   R   Rm  R   t   update_itemsR   R  (   Rg   (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyt   show_license_manager$  s    		c         C`  s_   t  j d  t   |  _ |  j r; |  j j d d d n  |  j j   d |  _ |  j   d S(   s$   Display the logs viewer to the user.RV   s   /logsRl  s   Log Viewer DialogN(	   R   R  R6   R   R   R  Rm  R   R  (   Rg   (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyRM  2  s    		c   
      C`  s|  t  j d j | |   |  j d t  d | k r> t } n t } | r_ d } d } | } nY d } d } g  | j d  D] } d	 | k r{ | j   ^ q{ } d j |  } | d
 7} |  j	 j
   r t } d | k r d } d } q n  |  j r|  j j d d d n  t d | d | d | d t d d  }	 |	 |  _ |	 j d  |	 j   |  j d t  |  j   |  j   d S(   s"   Display application error message.s   error_name: {}, error_text: {}Rd   t   UnsatisfiableSpecificationss   Conda process errors   The following errors occurred:s%   Unsatisfiable package specifications:s:   The following specifications were found to be in conflict:s   
t   -s9   


A package you tried to install conflicts with another.t   PackagesNotFoundErrors%   Package not available in offline modes   Some of the functionality of Anaconda Navigator will be limited in <b>offline mode</b>. <br><br>Installation and upgrade of packages will be subject to the packages currently available on your package cache.s   /messagebox/errorRl  s   Conda error message boxRa   R9  Rk  t   reportt
   learn_mores?   http://conda.pydata.org/docs/troubleshooting.html#unsatisfiablei  N(   R   R  R   Re   R}   Rf   t   splitt   stript   joinR|   t
   is_offlineR   R  R*   R   t   setMinimumWidthRm  Ro  R  (
   Rg   t
   error_namet
   error_textR  Rk  Ra   t	   error_msgt   et   package_errorsRp  (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyt   show_error_message<  sH    		4				

c         C`  s   |  j  d k	 r d St j d  |  j j d d  } |  j j d d  } | sW | r t d |   |  _  |  j r |  j j d d d	 n  |  j  j	   r n  |  j j
 d d t  d |  _  |  j   n  d S(
   s   Show offline mode dialogNRV   RS   t   hide_offline_dialogt   first_time_offlineR`   s   /offlineRl  s   Offline dialog(   R   R   R   R  Rp   R   R8   R   R  Rm  R   Rf   R  (   Rg   t   show_dialogR  (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyt   show_offline_mode_dialog{  s    		c         C`  s   t  j d j |   | j d i   } |  j j j } | j | i   } | j d g   } t |  d k s t j	 j
 |  r |  j j d d  } | j   n  |  j j   d S(   s2   Add defaults to user condarc if it does not exist.s   conda_data: {}t   config_sourcest   channelsi    t   defaultsN(   R   R  R   R   R|   t
   _conda_apit   user_rc_patht   lenR   R   R'  t   conda_config_addt   communicatet   client_get_ssl(   Rg   R  R  t   user_rct   user_configt   user_channelsR  (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyt   add_default_channels  s    %c         C`  s  t  j d j | |   |  j d t  | j d i   } | j d g   } |  j |  g  } d |  j k r x- | D]" } d | k rv | j |  qv qv Wn  | rg  | D] } d j |  ^ q }	 d j	 |	  }	 d	 j d
 |	  }
 |  j
 j d d d t d |
 d d  |  _ |  j j d  |  j j   rxa | D]V } | j d d  } |  j j d |  } | j   |  j j d |  } | j   q<Wn  d |  _ |  j   n  |  j d t  d S(   s=   Check if the user has binstar channels as part of the config.s   conda_data: {}, error: {}Rd   Rp   R  s   anaconda.orgs   binstar.orgs   - <b>{0}</b><br>RV   ss   We detected some outdated channels making use of <b>binstar.org</b><br><br>{chs}<br><br>Do you want to update them?t   chss   /channels/outdatedRl  s#   Show outdated channels check dialogRa   Rk  s   Outdated channels detectedi,  N(   R   R  R   Re   R}   R   R  R  t   appendR  R   R  R,   R   R  Rm  Rf  R|   R  R  t   conda_config_removeR   R  Rf   (   Rg   R  R  R9  Rp   t   current_channelst   outdated_channelst   channelt   chR  Ra   t   new_channel(    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyRY    s@    "			
	c         `  sC  t  j d j  |    f d     | t j k r: n | t j k rL n   j j d d d t d   } |  _	 | j
 d  j   j j d  j  }  j j   } | j j | j  | j j | j  | j j  j   r j t  | j j  f d	    | j j  j  | j j  j  | j j d    f d
    j   j   }  j    j! |  } | j"   t# } | j$    j%   t# }	 | | j& }
 t' j(   j)   j*   } |
 | k r| |
 | } n | d k  rd } n  | j+ | |	  n  | j,   r(n  | j- j    j.   d S(   s-   Show the conda channels configuration dialog.s   button: {}, sender: {}c         `  sD   t  j d j |    |  j t  |  j   |  j   d    _ d  S(   Ns   button: {}, (	   R   R  R   Re  R}   RW  t   toggleR   R   (   t   button(   Rg   (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyt   _accept_channels_dialog  s
    

s	   /channelsRl  s   Show channels dialogR`   R   Ry   c           `  s     j  t  S(   N(   Re  R}   (    (   R  (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyRh     RV   c         `  s
       S(   N(    (   t   v(   R  R  (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyRh     RV   i    N(/   R   R  R   R   t   TAB_HOMEt   TAB_ENVIRONMENTR   R  R/   R   R
  R   R|   t   conda_config_sourcesR   R  R  R   R  t   sig_finishedt
   update_apit   sig_channels_updatedt   update_channelst   setDisabledR}   t   rejectedR  RW  t   acceptedR   t   geometryt   topLeftt   parentWidgetRx  t   xR    t   yRv  Ry  R	   t   desktopt   availableGeometryRw  Rz  Rm  t
   button_addR  (   Rg   R  t   senderRp  R  t   worker_api_infot   geo_tlt   tlR  R  t   x_right_dialogt   x_right_screen(    (   R  R  Rg   sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR     sJ    			c         C`  s!  t  j d  |  j j d d d t d |  d |  j  } | |  _ |  j j   } | j j	 | j
  | j   r| j } | j } | j } | j } | j } | j } | r| rg  }	 t  j t d j | |    | r |	 j d j |   n  | rL| | j k r|	 j d	  n | | j k r<|	 j d
  n  |	 j d  n  |  j d t  t  j t | | |	 f   |  j j d | d |	  }
 |
 j j	 |  j  |
 j j	 |  j  |  j d |
 j d d d d  | |  _  |  j! t"  |  j# j$ |  qn  d |  _ |  j j d  d S(   s<   Create new basic environment with selectable python version.RV   s   /environments/createRl  s   Create new environment dialogR`   R|   s   {0}, {1}s
   python={0}s   mro-bases   r-bases   r-essentialsRd   Ry   R-  R  R\  i    t	   max_values   /environmentsN(&   R   R  R   R  R2   R|   R   R  R  R   R  Rm  Ry   t   namet   python_versiont   install_pythont	   install_rt   r_typeR  R   R  t   MROt   RRe   R}   t   create_environmentt   sig_partialt   _conda_partial_output_readyR  t   _conda_output_readyRo  t
   action_msgR   R[  Rf   R   t   add_temporal_itemR   (   Rg   Rp  t   worker_infoRy   R  R  R  R  R  t   pkgsR  (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR     sR    												c      
   C`  s  t  j d  |  j j d d d t d |   } | |  _ |  j j   } | j j	 | j
  | j   rd } | j } | j } | j } | j } y( t | d   } | j   }	 Wd QXWn t k
 r d }	 n X| | j k r n	| | j k r*y t j |	  } | | d <Wqt k
 r&qXnw | | j k r|	 j d	  }
 g  |
 D]( } | rO| j   j d
  rO| ^ qO} i | d 6d i | d 6g d 6} n  | rt j d d  \ } } t | d   } t j | | d t Wd QXn  t  j t  d j! | |    |  j" d t#  |  j j$ d | d |  } | j% j	 |  j&  | j' j	 |  j(  |  j) d | j* d d d d  |  j+ j, |  |  j- t  n  d |  _ |  j j d  d S(   s9   Create environment based on specfile or environment YAML.RV   s   /environments/importRl  s    Create new environment by importR`   t   rNR  s   
t   #t   pythont   pipt   dependenciest   suffixs   .yamlt   wt   default_flow_styles   {0}, {1}Rd   Ry   t   fileR  R\  i    R  s   /environments(.   R   R  R   R  R3   R   R|   R  R  R   R  Rm  R   R   R  Ry   t   selected_file_filtert   opent   readRA  t   CONDA_SPEC_FILESt   CONDA_ENV_FILESt   yamlt   loadt   PIP_REQUIREMENT_FILESR  R  t
   startswitht   tempfilet   mkstempt   dumpRf   R  R   Re   R}   t   import_environmentR  R   R  R  Ro  R  R   R  R[  (   Rg   Rp  R  t   dataR  R  Ry   t   selected_filtert   ft   rawt   lst   lt   depst   fdR  (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR   <  sf    						
5			c         C`  s-  t  j d  |  j } t j j |  } | |  j j k r)|  j j	 d d d t
 d |  d | d |  } | |  _ | j   rt  j t |   |  j d t  |  j j d |  } | j j |  j  | j j |  j  |  j d	 | j d
 d d d  |  j t  n  d |  _ |  j j	 d  n  d S(   s%   Clone currently selected environment.RV   s   /environments/removeRl  s   Remove environment dialogR`   R  Ry   Rd   R  R\  i    R  s   /environmentsN(   R   R  R   R   R   t   basenameR|   R   R   R  R4   R   Rm  R  Re   R}   t   remove_environmentR  R   R   R  R  Ro  R  R[  Rf   R   (   Rg   Ry   R  Rp  R  (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR     s,    						c         C`  sw  t  j d  |  j } t j j |  } |  j j d d d t d |  d |  } | |  _	 |  j
 j   } | j j | j  | j   rZ| j } | j } | rZ| rZt  j t d j | |    |  j d t  |  j
 j d	 | d
 |  } | j j |  j  | j j |  j  |  j d | j d d d d  |  j t  |  j j  |  qZn  d |  _	 |  j j d  d S(   s%   Clone currently selected environment.RV   s   /environments/cloneRl  s   Clone environment dialogR`   t   clone_from_names   {0}, {1}Rd   t   clone_from_prefixRy   R  R\  i    R  s   /environmentsN("   R   R  R   R   R   R$  R   R  R0   R   R|   R  R  R   R  Rm  R  Ry   R  R   Re   R}   t   clone_environmentR  R   R  R  Ro  R  R[  Rf   R   R  R   (   Rg   R'  R&  Rp  R  R  Ry   R  (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR     s6    								c      	   C`  s  t  j d j | |   g  } g  } g  } g  } xy t j t j t j g D]_ } | | } xL | D]D }	 |	 d }
 |	 d } | r |
 d | } n |
 } | j |  qa WqJ Wx& | t j D] }	 | j |	 d  q Wx& | t j	 D] }	 | j |	 d  q Wx& | t j D] }	 | j |	 d  qW|  j
 j d d d |  j d t  | r| } t d	 |  d
 |  } |  j j d |  j d | d t  } n | r| } t d	 |  d
 | d t  } |  j j d |  j d | d t  } nT | r8| } t d	 |  d
 | d t d |  } |  j j d |  j d | d t  } n  | |  _ |  j | _ | j j | j  | j   r^d } | r|  j j d |  j d |  } nW | r|  j j d |  j d |  } n0 | r|  j j d |  j d |  } n	 | rn  | r| j j |  j  | j j |  j  |  j t  |  j d t  |  j  d | j! d d d d  qn, | j"   sz|  j j#   n  |  j d t  |  j
 j d  d S(   sA   Process the coda actions on the packages for current environment.s4   conda_packages_actions: {}, pip_packages_actions: {}R  t
   version_tos   ==s   /environments/packagesRl  s   Packages actions dialogRd   R`   R-  Ry   R  t   dry_runt   update_onlyt   remove_onlyt   pip_packagesR  R\  i    R  s   /environmentsN($   R   R  R   R   t   ACTION_DOWNGRADEt   ACTION_INSTALLt   ACTION_UPGRADER  t   ACTION_REMOVEt   ACTION_UPDATER   R  Re   R}   R9   R|   t   install_packagesR   t   update_packagest   remove_packagesR   Ry   R  R   R  Rm  R   R  R   R  R[  Rf   Ro  R  t   is_finishedt   conda_terminate(   Rg   t   conda_packages_actionst   pip_packages_actionsR3  R5  R4  t   remove_pip_packagesR  t   pkgs_actiont   pkgR  Rg  t   specR  Rp  t   worker_depsR  (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR     s    


					c         C`  s   t  j d  t  j t d   |  j   r t d |   } | |  _ |  j j   r |  j d d d d
  |  j	 j
   |  j	 j   |  j	 j   n  |  j	 j |  _ |  j d t d t  |  j d	 |  j	 j  n  d
 S(   s(   Allow user to cancel an ongoing process.RV   s   process canceled by user.R`   R  s   Process cancelledt   messageRd   R-   Ry   N(   R   R  R  t   is_busyR<   R   Rm  Ro  R   R|   R7  t   download_terminatet   conda_clear_lockR   R   Re   Rf   R   (   Rg   Rp  (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR   -  s    	c         C`  s   t  j d j | | |   |  j d t  | |  _ |  j rZ |  j j d | d t  n  d j |  } |  j d | d d d d  |  j	 t
  |  j j d |  j  } | j j |  j  d	 S(
   s7   Select the active conda environment of the application.s    name: {}, prefix: {}, sender: {}Rd   Ry   R\  s!   Loading packages of <b>{0}</b>...R  i    R  N(   R   R  R   Re   R}   R   R   t   set_loadingRo  R[  Rf   R|   R  R  R   R  (   Rg   R  Ry   R  t   msgR  (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR   A  s    		c         C`  s?   |  j  j j   } | s+ t |  d k r; |  j |   n  d S(   s9   Check if package cache is not empty and run index update.i    N(   R|   R  t   get_repodataR  R   (   Rg   t   repodata(    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR  Q  s    c         C`  sq   t  j d j |   |  j d t  |  j d d d d d d |  j j d |  j  } | j	 j
 |  j  d	 S(
   s   Update conda repodata index.s
   sender: {}Rd   s&   Updating package index and metadata...RV   R\  i    R  Ry   N(   R   R  R   Re   R}   Ro  R|   t   update_index_and_metadataR   R  R   R  (   Rg   R  R  (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR   W  s    c         C`  s   t  j d j | |   |  j d d d d d d  x9 | D]1 \ } } |  j j d | d | } | j   q< Wx9 | D]1 \ } } |  j j d | d | } | j   qx W|  j j d	 |  j	  } | j
 j |  j  d
 S(   s*   Save updated channels to the conda config.s&   soruces_added: {}, sources_removed: {}R  s!   Updating channel configuration...R\  i    R  R  R  Ry   N(   R   R  R   Ro  R|   R  R  R  RG  R   R  R   R  (   Rg   t   sources_addedt   sources_removedt   sourceR  R  (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR  a  s"    			c         C`  s   t  j d j | |   |  j d  |  j j d d  } | j d g   } d |  j k r | r x? |  j D]4 } | | k rl |  j j	 d |  } | j
   ql ql W|  j j d d t  n  d S(   s<   Automatically add featured channels on startup if not found.s   conda_config: {}, error: {}s   Adding featured channels...RS   R  R  s   anaconda.orgN(   R   R  R   R0  Rp   R   R  t   FEATURED_CHANNELSR|   R  R  R   Rf   (   Rg   R  R  R9  t   add_channelsR  R  (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR  {  s    c   
   	   C`  s   t  j d j | |   |  j d t  | j } t | t  sJ i  } n  | j d  } | j d  } | j d d  } | j d d  } | r d j |  }	 |  j	 d	 | d
 |	 d | d |  n  | r d j |  n  d S(   s	   Callback.s   output: {}, error: {}Rd   R  t   fetcht   progressi    t   maxvals   Fetching <b>{0}</b>...R  R?  R\  R  s   Linking <b>{0}</b>...N(
   R   R  R   Re   R}   R  R%  t   dictR   Ro  (
   Rg   R  R!  R9  R  R  RM  R\  R  R?  (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR     s$    			
c         C`  s  t  j d j | |   |  j d t  | j } t | t  sJ i  } n  | j d d  } | j d d  } | j d d  } | j d t	  } | t
 j k r t j j | j  } n  | p | p | }	 t | d d
  }
 t | d	 |
  } | r|  j j d	 |  r| |  _ n6 |
 r=|  j j d	 |
  r=|
 |  _ n |  j j |  _ |	 s_| s_| rt  j |  |  j | |  |  j d	 |  j  n; | t
 j k r|  j d	 |  j j  n |  j d	 |  j  d
 S(   s&   Callback for handling action finished.s   output: {}, error: {}Rd   R9  RV   t   exception_typet   exception_namet   successt
   old_prefixRy   N(   R   R  R   Re   Rf   R  R%  RP  R   R}   R   t   ACTION_IMPORTR   R   R   Ry   R  R   R|   t   conda_environment_existsR   R   R9  R  R   t   ACTION_REMOVE_ENV(   Rg   R  R!  R9  R  R  RQ  RR  RS  t   is_errorRT  Ry   (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR    s6    		c   	      `  s   t  j d j          j d d j   d d d d   r  t k r  j j d  j          f d   }  j j   } | j	 j
 |  | j   q n  j         d	 S(
   s$   Launch application from home screen.sO   package_name: {0}, command: {1}, leave_path_alone: {2}, prefix: {3}, sender:{4}R  s   Launching <b>{0}</b>R\  i    R  Ry   c         `  s     j          d  S(   N(   t   launch_application_2(   R  R!  R9  (   R  R  R  R  Ry   Rg   R  (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyt	   _finished  s    N(   R   R  R   Ro  R   R|   t   vscode_update_configR   t   vscode_install_extensionsR  R   t   startRY  (	   Rg   R  R  R  Ry   R  R  RZ  R  (    (   R  R  R  R  Ry   Rg   R  sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR     s*    
	!	c         `  s  d  } t r t j j   } t j j d  } t j j d  }	 t |  ra t |	  ra | }	 n, t |  r t |	  r |	 } n
 d } }	 | | d <|	 | d < d k r d | d <q n  | r n  t  | | d  d	  j j	 d
 | d | \ }
   | s|
 g } t
 j |
  rYt
 j |
  } x- | j d t  D] } | j | j  q<Wn   j j |  |   } | j j  j  n  t rd n d } t    _  j j t   j j | d   j j j  f d     j j j      f d     j j   d  S(   Nt   LANGt   LC_ALLs   en_US.UTF-8t   orange3t   spydert   1t   EVENT_NOKQUEUER  R  t   environmentR  t	   recursivei   i
   i  c           `  s
     j    S(   N(   Ro  (    (   Rg   (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyRh   K  RV   c           `  s    j       S(   N(   t   check_application_launch_errors(    (   t   id_R  Ry   Rg   (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyRh   M  s   (   R`  Ra  (   R   R   R   R   t   copyR   R&  R   R|   R   t   psutilt
   pid_existst   Processt   childrenR}   R  R~  t	   check_pidR  R   t   handle_pid_checkR   R   t   _launch_timert   setSingleShotR   R   R]  (   Rg   R  R  R  Ry   R  R  Rd  R^  R_  t   processt   pidst   proct   pR  t   time_seconds(    (   Rg  R  Ry   Rg   sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyRY    sP    			


	c         C`  s#   | r | } |  j  j |  n  d S(   s    Check for pid and children pids.N(   R   R  (   Rg   R  R!  R9  R  (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyRn  R  s    c         C`  sF  t  j d j | |   |  j j } t | d | d | d | \ } } } d } t j j |  r t	 | d   } | j
   } Wd QXn  | j   }	 |	 r d |	 k p d	 |	 k }
 |
 rB|  j j d
 d  rB|  j j d d d t d d j |  d d d | d t d d  |  _ |  j j   d |  _ |  j j d  n  d S(   s?   Check if application launched correctly by looking at the logs.s   prefix: {}, package_name: {}Ry   R  Rg  RV   R  NR9  t	   exceptionRS   t   show_application_launch_errorss   /home/errorsRl  s   Launch errors dialog.Ra   s6   Application <b>{}</b> launch may have produced errors.Rk  s   Application launch errorR  R  s   /home(   R   R  R   R|   R   R   R   R   R'  R  R  R  Rp   R   R   R  R*   Rf   R   R   Rm  (   Rg   Ry   R  Rg  R  t   out_patht   err_patht   err_logR  t   e_lowt   display_msg(    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyRf  X  s8    			c      	   C`  s  t  j d j | |   t | t  rU t | j d d   } | j d i   } n d } i  } t } |  j j	 | |  j
  } d } d | k s | r t } |  j j d d  n  | r|  j j d d d	 t d
 |  d | j d d | d |  j
  }	 |	 |  _ |  j j d |  j
  }
 |
 j j |	 j  |	 j   r`|	 j } d j | j d |  } | |	 j k r|  j j d | d | j d t  } | j | _ | | _ | j j |  j  | j j |  j   nw |  j j! d | d | j d t  } | j | _ t" j# | _$ | | _ | j | _ | j j |  j  | j j |  j   |  j% | d d d d n' |  j& t  |  j' d t  |  j%   d |  _ |  j j d  n | j$ t" j( k rd j | j d | j  } n1 | j$ t" j) k rd j | j d | j  } n  |  j j! d | j d | j  } | | _ | j$ | _$ | j* | _* | j+ | _+ | j | _ | j j |  j  | j j |  j   |  j% | d d d d d S(   s   
        Check if the package to be installed changes navigator dependencies.

        This check is made for Orange3 which is not qt5 compatible.
        s   output: {}, error: {}RQ  RV   t   actionst   UnsatisfiableErrort   default_pythons   /environments/create/conflictRl  s-   Create new environment due to conflict importR`   t   packagei    t   extra_messageR   Ry   s>   Installing application <b>{0}</b> on newenvironment <b>{1}</b>R-  t   no_default_pythonR  R\  R  Rd   s   /environmentss,   Install application <b>{0}</b> on <b>{1}</b>s-   Updating application <b>{0}</b> on <b>{1}</b>N(,   R   R  R   R%  RP  R  R   Rf   R|   t   check_navigator_dependenciesR   R}   t   conda_config_setR   R   R  R1   R  R   R  R  R   R  Rm  Ry   R   R  RT  R  R  R  R  R   R3  R   R/  R  Ro  R[  Re   t   APPLICATION_INSTALLt   APPLICATION_UPDATER  R  (   Rg   R  R!  R9  RQ  R}  t	   conflictst   nav_deps_conflictt   conflict_messageRp  R  t
   env_prefixR  t
   new_worker(    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyt!   check_dependencies_before_install  s    												

			c         C`  s    | | _  |  j | | |  d S(   s;   Check if package requires licensing and try to get a trial.N(   R!  R  (   Rg   R  R!  R9  (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyt   check_license_requirements  s    K	c         C`  sp  t  j d j | | | |   |  j j t  |  j j t  |  j d t  |  j	 j
 d | d |  j  } | r | t k r | t j k r |  j   n | t j k r |  j   n  d S| r d j | |  g } n d j |  g } | t j k r|  j	 j d |  j d | d	 t  } d
 }	 | ryV d d l m }
 |
 |  } |
 |  } | | k rjd }	 n | | k  rd }	 n  Wqt k
 rqXn  d j |	 | |  j  } |  j | _ | | _ | | _ | | _ | | _ | | _ | j j |  j  | j j |  j   nB| t j! k r|  j	 j d |  j d | d	 t  } d j | |  j  } |  j | _ | | _ | | _ | | _ | | _ | | _ | j j |  j  | j j |  j   n | t j k rS|  j	 j" d |  j d |  } d j | |  j  } | | _ | | _ | | _ | | _ | | _ | j j |  j#  | j j |  j   n  |  j$ | d d d d d S(   s   FIXME:.s9   action: {0}, package_name: {1}, version: {2}, sender: {3}Rd   R<  Ry   Ns   {0}=={1}s   {0}R  R*  t
   Installingi    (   R_  t   Downgradingt	   Upgradings(   {0} application <b>{1}</b> on <b>{2}</b>s-   Updating application <b>{0}</b> on <b>{1}</b>s/   Removing application <b>{0}</b> from <b>{1}</b>R\  R  (%   R   R  R   R   R[  Rf   R   Re   R}   R|   t   conda_package_versionR   R   R   R  t   install_vscodet   APPLICATION_REMOVEt   remove_vscodeR3  Rd  R_  RA  Ry   R  R  R  R  R  R  R   R  R  R   R  R5  R  Ro  (   Rg   R  R  Rg  R  R  t   current_versionR  R  t   text_actionR_  t   cur_vert   verR  (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR   Z  s    																c   
      C`  s   t  | t  s i  } n  | j d d  } | j d d  } | j d d  } | j d t  } | po | po | } t | d d  }	 |	 r |	 |  _ n  | s | r t j |  |  j	 | |  |  j
 t  |  j d t  n  |  j d |  j  d S(	   s%   Callback for handling vscode actions.R9  RV   RQ  RR  RS  Ry   Rd   N(   R%  RP  R   R}   R  R   R   R   R9  R  R[  Re   Rf   R   (
   Rg   R  R!  R9  R  RQ  RR  RS  RX  Ry   (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyt   _output_vscode_ready  s     	c         C`  s   t  | t  r | j d  } | j d  } | j d  } | j d  } | r | r t | k r |  j d d d | d | q | r |  j d | d d	 d d	 q n t  | t  r n  d
 S(   s%   Callback for handling vscode actions.R   t   progress_sizet
   total_sizeR?  s   Installing <b>vscode<b>s   Downloading...R\  R  i    N(   R%  RP  R   R   Ro  R  (   Rg   R  R!  R9  R   RN  t   totalR?  (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyt   _partial_vscode_ready  s&    
c         C`  s   |  j  d d d d d d d
 } t r{ t d |   } | j   rO | j } q{ d } |  j d t  |  j d |  j	  n  |  j
 j d	 |  } | j j |  j  | j j |  j  d
 S(   s   Installing VSCode.s   Installing <b>vscode<b>RV   R\  i    R  R`   Rd   Ry   t   passwordN(   Ro  R   R   R:   Rm  R  Re   Rf   R   R   R|   t   vscode_installR  R   R  R  R  (   Rg   R  Rp  R  (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR    s     c         C`  s   |  j  d d d d d d d
 } t } t r t d |   } | j   r[ | j } t } q t } |  j d t  |  j	 d |  j
  n  | s |  j j d	 |  } | j j |  j  | j j |  j  n  d
 S(   s   Removing VSCode.s   Removing <b>vscode<b>RV   R\  i    R  R`   Rd   Ry   R  N(   Ro  R   Rf   R   R:   Rm  R  R}   Re   R   R   R|   t   vscode_removeR  R   R  R  R  (   Rg   R  t	   cancelledRp  R  (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR    s&    		c         C`  s   t  j d j | |   |  j d t  |  j j |  j g  } | r | d k rs t	 | j
    d d |  _ q | |  _ n	 d |  _ |  j r |  j j | |  j  |  j   n  d S(   s&   Select the project and set as current.s   name: {0}, path: {1}R-   i    N(   R   R  R   Re   R}   R|   R7  RW   R   t   listt   itemsR   R   t   set_projectsR  (   Rg   R  R   R-   (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR<  	  s     		c         C`  s   t  j d j | |   | j d k r1 d } n d } | sL | r | j r d } | rv | j rv d j | j  } n | } t  j t |   t j	 | j
  t d d j | j  d	 d
 j |  d |  } | j   n | j
 |  _ |  j d |  j  d S(   s   Project created callback.s   output: {}, error: {}t   createt   creationt   importRV   s   
Rk  s   Project {0} errorRa   s   Project {0} failed due to:R9  R   N(   R   R  R   t   typet   problemsR  R9  R  t   shutilt   rmtreet   directory_pathR*   Rm  R   R<  (   Rg   R  R!  R9  t   project_typet   msg_box(    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyt   _project_created-	  s(    			c         C`  s8  t  j d  |  j j d d d t j d |  d |  j j |  j g   } |  j d k ri |  j
   n  | |  _ | j   r$|  j r$| j } t j j |  j |  } |  j r |  j j |  n  t j j |  r d St j |  |  j j | d | d	 t } | j j |  j  d
 | _ n  |  j j d  d S(   s   Create new basic project.RV   s   /projects/createRl  s   Create new project dialogR`   R-   NR  t   make_directoryR  s	   /projects(   R   R  R   R  R-   R2   R|   R7  RW   R   t   show_project_folderR   Rm  R  R   R   R  R   R  R   t   makedirst   project_createRf   R  R   R  R  (   Rg   Rp  R  R   R  (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyt   show_create_projectI	  s,    						c         C`  s  t  j d  t j d |  d |  j j |  j g   } |  j j d d d |  j d k ri |  j
   n  | j   rz|  j rz| j } t j j |  j |  } | j } |  j r |  j j |  n  t j j |  r d St j j |  r t j | |  n> t j |  t j j | t j j |   } t j | |  |  j j | d | d	 t } | j j |  j  d
 | _ n  |  j j d  d S(   s   Create new basic project.RV   R`   R-   s   /projects/importRl  s   Import project dialogNR  R  R  s	   /projects(   R   R  R-   R3   R|   R7  RW   R   R  R   R  Rm  R  R   R   R  R   R  R   R  t   copytreet   mkdirR$  t   copyfileR  Rf   R  R   R  R  (   Rg   Rp  R  R   t   folder_file_patht	   file_pathR  (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyt   show_import_projectl	  s8    							c         C`  s   t  j d  |  j d
 k	 r t j d |  d |  j  } |  j j d d d | j   r |  j } |  j	 r |  j	 j
 d | d t  |  j	 j   y t j |  Wn t k
 r n X|  j   q q n  |  j j d	  d
 S(   s   Create new basic project.RV   R`   t   projects   /projects/removeRl  s   Remove project dialogRy   R\  s	   /projectsN(   R   R  R   R   R-   R4   R   R  Rm  R   RC  R}   t   before_deleteR  R  RA  R<  (   Rg   Rp  R   (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyt   show_remove_project	  s"    				c         C`  s   t  j d  |  j d	 k r t j d |   } |  j rP |  j j d d d n  | |  _ x} t	 r | j
   | j k r\ |  j j d d | j  t j j | j  s t j | j  n  | j |  _ |  j   Pq\ q\ Wn  |  j r |  j j d  n  d	 S(
   s1   Create projects folder if it has not been set up.RV   R`   s   /projects/pathRl  s   Project local folder.RS   RW   s	   /projectsN(   R   R  RW   R   R-   t   ProjectsPathDialogR   R  R   R}   Rm  t   AcceptedRp   R   R   R   R   R  R<  (   Rg   Rp  (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR  	  s"    				
	c         C`  sH   |  j  j   } | |  j k rD t j d  | |  _ |  j j   n  d S(   s2   Check for new licenses periodically on the system.RV   N(   R|   R6  R   R   R  R   R  (   Rg   t   new_licenses(    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR   	  s
    	c         `  s;     f d   }   j  j d   j  } | j j |  d S(   s6   Check for new environments periodically on the system.c         `  sN   | j  d  }   j | k rJ t j d  |   _   j d   j  n  d  S(   NR+  RV   Ry   (   R   R   R   R  R   R   (   R  R!  R9  t   new_envs(   Rg   (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyt   _process	  s
    	Ry   N(   R|   t
   conda_infoR   R  R   (   Rg   R  R  (    (   Rg   sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR   	  s    c         C`  s   t  j d  |  j j d d  } | rR t |  rR t j j |  rR | |  _ n |  j j	 d d d  |  j j |  j g  } | |  j k r | |  _ |  j d |  j  n  d S(   s2   Check for new projects periodically on the system.RV   RS   RW   R   N(   R   R  Rp   R   R   R   R   R   RW   R   R   R|   R7  R-   R<  R   (   Rg   RW   t   new_projects(    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR   	  s    	c         C`  s]   |  j  j j   } | |  j k rY t j d  | |  _ | d k rY |  j d t  qY n  d S(   s   
        Check for new login status periodically on the system.

        Also checks for internet connectivity and updates.
        RV   R  N(	   R|   R   R   R   R   R  R   R  R}   (   Rg   t	   new_token(    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR   	  s    	c         C`  s   |  j  j d d  } |  j j   } | | k r |  j r |  j  j d d |  } | r |  j j t  |  j	 j t  d } t
 j } |  j j |  |  j j |  |  j   q |  j j t  |  j	 j t  |  j j d  |  j j d  n  d S(   s%   Check if there is internet available.RS   Rx   s   <i>Working in offline mode</i>RV   N(   Rp   R   R|   R  R   R   R   R  R}   R   R8   t   MESSAGE_TOOLR   R  R  R  Re  (   Rg   Rx   R  t   offline_textt   tooltip(    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR   
  s$    			c         C`  sR   t  j d  |  j j   |  j j   |  j j   |  j j   |  j j   d S(   s   Stop all refreshing timers.RV   N(   R   R  R   t   stopR   R   R   R   (   Rg   (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyt   stop_timers!
  s    c         C`  sR   t  j d  |  j j   |  j j   |  j j   |  j j   |  j j   d S(   s   Start all refreshing timers.RV   N(   R   R  R   R]  R   R   R   R   (   Rg   (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyt   start_timers*
  s    c         C`  s  t  j d  |  j j   } | d k	 r_|  j |  j |  j g } | |  j j j	 7} |  j j j
 d } | | j |  7} | |  j j j
 7} | |  j j j 7} | |  j g 7} x t | d   D] \ } } y | j   } Wn t k
 r d } n Xy | j d d  } Wn t k
 rn Xt  j d j | | |   |  j | | | | d  q Wn  |  j r| |  j k r|  j   n  d S(   s   Fix tab order of UI widgets.RV   i    iu   …s   {0}, {1}, {2}i   N(   R   R  R   t   currentWidgetR   R   R   R   RU  RV  t   linkst   ordered_widgetst   links_socialt	   enumerateRa   RA  Rf  R   t   setTabOrderR   R  (   Rg   t	   tab_indext   current_widgetR  t   next_widdgett   iR   Ra   (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR  3
  s2    
#c         C`  s   t  j d  |  j j } t j j d |  } t } d g } t |  _	 |  j
   r t | | | d d d | t |  _	 |  j   n  d S(   s   Restart application.RV   RU   s   anaconda-navigatorR  s   anaconda-navigator-restartR  N(   R   R  R|   R   R   R   R   R}   Rf   R   t   closingR   RL  (   Rg   R  Ry   R  R  (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyRK  [
  s    			c         C`  s@   t  j d j |   |  j r2 |  j j |  n  t j   d S(   s   Set splash dialog message.s   message: {}N(   R   R  R   R   t   show_messageR	   t   processEvents(   Rg   R?  (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR0  n
  s    	c         C`  sk   t  j d  |  j   rE t |  _ |  j r8 |  j   qg |  j   n" |  j   |  _ t	 |  _ |  j
   d S(   s   Toggle fullscreen status.RV   N(   R   R  t   isFullScreenRf   R   R   RB  t
   showNormalt   isMaximizedR}   t   showFullScreen(   Rg   (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyt   toggle_fullscreenu
  s    			c         C`  s5  t  j d j | |   | d k	 r` t | t  r` | |  _ |  j rS |  j   q` |  j   n  | d k	 r t | t  r | |  _	 n  | d k	 r t | t  r | |  _
 n  | d k	 r t | t  r | |  _ n  |  j	 r |  j r |  j j   n  |  j	 r1|  j r1|  j
 r1|  j r1|  j j   n  d S(   s]  
        Update the busy status of conda and anaconda projects the application.

        Conda status is defined by actions taken on Home/Environments tab.
        (Anaconda) Project status is defined by actions taken on Projects tab.

        The value will only update if True or False, if None, the current value
        set will remain.
        s   conda: {}, project: {}N(   R   R  R   R   R%  R&  R   R  R  R   R   R   t   sig_conda_readyRZ  R   (   Rg   Rd   R-   Rr   Rv   (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyRe   
  s"    		c         C`  s   t  j d  |  j p |  j S(   s,   Return if the application is currently busy.RV   (   R   R  R   R   (   Rg   (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR@  
  s    c      
   C`  sk   t  j d j | | | |   xE |  j |  j g D]1 } | r2 | j d | d | d | d |  q2 q2 Wd S(   s   Update status bar.s5   action: {0}, message: {1}, value: {2}, max_value: {3}R  R?  R\  R  N(   R   R  R   R   R   Ro  (   Rg   R  R?  R\  R  R^  (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyRo  
  s    	c         C`  sx  t  j d  t } |  j   s|  j j d d  } g  } |  j r x |  j D] } | d } xr | D]j } t j |  rf | j	 |  t j
 |  } x6 | j d t  D] } | j	 t j | j   q Wqf qf Wt |  sO |  j j |  qO qO Wn  t |  r| r|  j j d d d t d	 |  d
 |  j  }	 |	 |  _ |	 j   r`|  j j d d  }
 x |  j D] } | d |
 k rot t | d d t  } x | D] } t j |  rt j
 |  } x< | j d t  D]( } y | j   Wqt k
 rqXqWy | j   Wn t k
 r,n X| |  j k rR|  j j |  qRqqWqoqoWn t } d |  _ |  j   qn  | rt|  j   r|  j r|  j j d d d n  t d	 |   |  _ |  j j   st } n  d |  _ |  j   qt|  j j d d  } | rt|  j r1|  j j d d d n  t d	 |   |  _ |  j j   set } |  j   n  d |  _ qtn  | S(   s:   Closing helper method to reuse on close event and restart.RV   RS   t   hide_running_apps_dialogRr  Re  s   /quit/runningRl  s    Quit running applications dialogR`   R   t   running_apps_to_closeR  t   reverses
   /quit/busys   Quit busy dialogt   hide_quit_dialogs   /quits   Quit dialogN(   R   R  R}   R@  Rp   R   R   Ri  Rj  R  Rk  Rl  R~  t   anyt   removeR   R  R?   R   Rm  R  t   sortedt   killRA  Rf   R   R  R>   R   R=   R   (   Rg   RL  t   show_apps_dialogt
   pids_existt   process_dataRr  R~  Rs  Rt  Rp  t
   close_appsR  (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR  
  s    		
$											c         C`  s   t  j d  |  j r1 |  j   r1 | j   n  y/ t j |  j    } |  j j	 d d |  Wn  t
 k
 r } t  j |  n Xd S(   s   Catch close event.RV   RS   R;  N(   R   R  R   R  t   ignoreR>  t   dumpst   saveGeometryRp   R   RA  R9  (   Rg   Rs   R;  R  (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyt
   closeEvent'  s    c         C`  s   | j    } | j   } | t j k rA t j d  |  j   nR | t j k rd t rd |  j	   n/ | t j
 k r | t j @r t r |  j	   n  t t |   j |  d S(   s   Override Qt method.s   Refreshing stylesheetsN(   t   keyt	   modifiersR   t   Key_F5R   R  R
  t   Key_F11R   R  t   Key_Ft   ControlModifierRz   RR   t   keyPressEvent(   Rg   Rs   R  R  (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyR  4  s    "(d   RF   RG   RH   R   R   R  R  R  R  R   RK  R   R   R   t   TEST_URLt   TEST_VIDEOS_URLt   TEST_EVENTS_URLt   TEST_WEBINARS_URLR   R   R}   R{   R  R   R  R5  R3  RC  R[  R
  Rf   R8  Rq  R  R|  R   R  t   propertyR  R  R2  R   R  RJ  RO  RT  R  RM  R  R  R  RY  R   R   R   R   R   R   R   R   R  R   R  R  R   R  R   RY  Rn  Rf  R  R  R   R  R  R  R  R<  R  R  R  R  R  R   R   R   R   R   R  R  R  RK  R0  R  Re   R@  Ro  R  R  R  (    (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyRR      s   					


 -	%	3	,	:	"		!	!+	
	8	'					
	?			,9	8	J		&	b			
				>	1	?		(		N	]						#	+											(			+		a	c          C`  sL   d d l  m }  |    } t   } | | _ | j   t j | j    d S(   s   Run local test.i    (   t   qapplicationN(   t"   anaconda_navigator.utils.qthelpersR  RR   R  R@  t   syst   exitRm  (   R  t   appR  (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyt
   local_testE  s    			
t   __main__(}   RH   t
   __future__R    R   R   R>  R  R  R  t   qtpy.QtCoreR   R   R   R   R   R   t
   qtpy.QtGuiR   t   qtpy.QtWidgetsR	   R
   R   R   R   Ri  R  t   anaconda_navigatorR   t#   anaconda_navigator.api.anaconda_apiR   t   anaconda_navigator.configR   R   R   R   R   R   R   t   anaconda_navigator.staticR   t   anaconda_navigator.utilsR   R   t"   anaconda_navigator.utils.analyticsR   t   anaconda_navigator.utils.launchR   R   t   anaconda_navigator.utils.logsR   t   anaconda_navigator.utils.miscR   t"   anaconda_navigator.utils.py3compatR   R  R   t   anaconda_navigator.utils.stylesR    R!   t   anaconda_navigator.widgetsR"   R#   R$   R%   R&   R'   R(   R)   t"   anaconda_navigator.widgets.dialogsR*   R+   R,   R-   t(   anaconda_navigator.widgets.dialogs.aboutR.   t+   anaconda_navigator.widgets.dialogs.channelsR/   t.   anaconda_navigator.widgets.dialogs.environmentR0   R1   R2   R3   R4   t*   anaconda_navigator.widgets.dialogs.licenseR5   t)   anaconda_navigator.widgets.dialogs.loggerR6   t(   anaconda_navigator.widgets.dialogs.loginR7   t*   anaconda_navigator.widgets.dialogs.offlineR8   t+   anaconda_navigator.widgets.dialogs.packagesR9   t+   anaconda_navigator.widgets.dialogs.passwordR:   t.   anaconda_navigator.widgets.dialogs.preferencesR;   t'   anaconda_navigator.widgets.dialogs.quitR<   R=   R>   R?   t)   anaconda_navigator.widgets.dialogs.updateR@   t)   anaconda_navigator.widgets.tabs.communityRA   t,   anaconda_navigator.widgets.tabs.environmentsRB   t$   anaconda_navigator.widgets.tabs.homeRC   t)   anaconda_navigator.widgets.tabs.tabwidgetRD   RE   RI   RJ   RK   RL   RM   RN   RO   RP   RQ   RR   R   RF   (    (    (    sE   lib/python2.7/site-packages/anaconda_navigator/widgets/main_window.pyt   <module>   s   .(4:"("          	