
    ce-                     n    d Z ddlmZmZmZ ddlmZmZ ddlm	Z	m
Z
mZmZ ddlmZ  G d de          ZdS )	Update application dialog.    )QHBoxLayoutQLabelQVBoxLayout)CONFWIN)ButtonNormalButtonPrimarySpacerHorizontalSpacerVertical)
DialogBasec                   6     e Zd ZdZdZedddf fd	Zd Z xZS )DialogUpdateApplicationr   iD  Fc                    t                                                       d}|s	t          rd}t          d| d| d          | _        t          d          | _        t          d          | _        t          d          | _	        || _
        |s4| j	                            d	           | j                            d
           | j                            d           |                     | j                   |                     | j                   |                     d           |rN| j                            d           | j                            d           | j	                            d           t'                      }|                                 |                    | j	                   |                    t-                                 |                    | j                   |                    t-                                 |                    | j                   t/                      }|                    | j                   |                    t1                                 |                    t1                                 |                    |           |                     |           | j        j                            | j                   | j        j                            | j                   | j	        j                            | j                   | j                                          dS )z
        Update application dialog.

        Parameter
        ---------
        version: str
            New version of update available.
         z4<br>(You will be prompted to elevate privileges)<br>a  There's a new version of Anaconda Navigator available. We strongly recommend you to update. <br><br>If you click yes, Anaconda Navigator will close and then the Anaconda Navigator Updater will start.<br><br><br>Do you wish to update to <b>Anaconda Navigator z</b> now?<br>z<br>YeszNo, remind me laterzNo, don't show againFNoTzUpdate ApplicationN)!super__init__r   r   labelr
   
button_yesr	   	button_nobutton_no_showconfig
setVisiblesetTextsetWordWrapsetMinimumWidthWIDTHsetMaximumWidthsetWindowTitlesetDisabledr   
addStretch	addWidgetr   r   r   	addLayout	setLayoutclickedconnectacceptrejectno_showsetFocus)
selfversionr   startup
qa_testingis_root_writable
extra_textlayout_buttonslayout	__class__s
            Ilib/python3.11/site-packages/anaconda_navigator/widgets/dialogs/update.pyr   z DialogUpdateApplication.__init__   s	     	
 	PC 	POJe ?F	e e U_	e e e
 

 (..%&;<<*+ABB 	)**5111N""4((( 	
t$$$TZ(((TZ(((0111  	2O''---N&&t,,,++D111 %!!###  !4555  !1!3!3444  000  !1!3!3444  111$$$  !1!1222  !1!1222(((v 	''444&&t{333#++DL999  """""    c                 f    | j                             ddd           |                                  dS )z&Handle not showing updates on startup.mainhide_update_dialogTN)r   setr*   )r-   s    r6   r+   zDialogUpdateApplication.no_showc   s,     4d;;;r7   )	__name__
__module____qualname____doc__r   r   r   r+   __classcell__)r5   s   @r6   r   r      sl        $$E
 J# J# J# J# J# J#X      r7   r   N)r?   qtpy.QtWidgetsr   r   r   anaconda_navigator.configr   r   anaconda_navigator.widgetsr	   r
   r   r   "anaconda_navigator.widgets.dialogsr   r    r7   r6   <module>rF      s    !   ; ; ; ; ; ; ; ; ; ; / / / / / / / / d d d d d d d d d d d d 9 9 9 9 9 9T T T T Tj T T T T Tr7   