
    =	f                          d dl  d dlmZmZmZ d dlmZ d dl ddl d dl	m
Z
 d dlmZ d dl d dl d dlZddlmZ  G d	 d
ee      Zy)    )*)deviceutilspkit)cups   )pluginhandler)
to_unicodeN)	Ui_Dialogc                   @    e Zd ZeedfdZd Zd Zd Zd Z	d Z
d
d	Zy)PluginDiagnoseFc                 b   t         j                  | |       || _        || _        d | _        d| _        t        j                         | _        | j                  |        t               | _        | j                  j                          | j                  j                          | j                          y )NF)QDialog__init__install_modeplugin_reasonplugin_pathresultr	   PluginHandle	pluginObjsetupUiUserSettingsuser_settingsloaddebuginitUi)selfparentr   r   upgrades        &/usr/share/hplip/ui5/plugindiagnose.pyr   zPluginDiagnose.__init__+   s    v&(*&335T)^!  "    c                 l   | j                   j                  j                  | j                         | j                  j                  j                  | j
                         t        j                  t        j                  t        j                         | j                  t        t        dd                   y )Nhp_logo128x128)CancelButtonclickedconnectCancelButton_clicked
NextButtonNextButton_clickedsignalSIGINTSIG_DFLsetWindowIconQIconload_pixmapr   s    r    r   zPluginDiagnose.initUi=   sr    !!))$*C*CD''(?(?@fmmV^^4 	5Y	!BCDr!   c                 D    t        |      | _        | j                          y N)r
   r   setPathIndicators)r   ts     r    PathLineEdit_textChangedz'PluginDiagnose.PathLineEdit_textChangedG   s    %a= r!   c                 \    | j                  |       | j                  j                  |       y r3   )updateStepTextStackedWidgetsetCurrentIndex)r   pages     r    displayPagezPluginDiagnose.displayPageP   s$    D!**40r!   c                 $    | j                          y r3   )closer1   s    r    r(   z#PluginDiagnose.CancelButton_clickedT   s    

r!   c                    | j                   j                  d       | j                  j                  d       	 t        }t        }t        j                  |t        k(  |      \  }}|r+| j                  j                         t        j                  k7  rt        | | j                  d             t                d| _        | j                          y # t                w xY w)NFzrFailed to install Plug-in.
Either you have chosen to skip the Plug-in installation  or entered incorrect Password.T)r)   
setEnabledr%   PLUGIN_REQUIREDPLUGIN_REASON_NONEr   run_plugin_commandr   	getStatusr	   PLUGIN_INSTALLED	FailureUI_PluginDiagnose__trendWaitCursorr   r>   )r   pluginr   oksudo_oks        r    r*   z!PluginDiagnose.NextButton_clickedX   s    ""5)$$U+		$F.M11&O2K][KB113}7U7UU$		  +`  !a  b O

 Os   A4C CNc                 0    t         j                  d||      S )NPluginDialog)qApp	translate)r   scs      r    __trzPluginDiagnose.__tri   s    ~~nQq11r!   r3   )__name__
__module____qualname__PLUGIN_NONErB   r   r   r6   r<   r(   r*   rG    r!   r    r   r   *   s/    ,7GYch $E!1"2r!   r   )base.gbaser   r   r   prntr   
base.codesui_utils	installerr	   base.sixextr
   PyQt5.QtCorePyQt5.QtGuir+   plugindiagnose_baser   r   r   rW   r!   r    <module>rb      s?   0  $ $    # #    +@2Wi @2r!   