3
N ŸZ   ã               @   sŠ   d dl T d dlmZmZmZ d dlmZ d dlT ddlT d dl	m
Z
 d dlmZ d dlT d dlT d dlZddlmZ G d	d
„ d
eeƒZdS )é    )Ú*)ÚdeviceÚutilsÚpkit)Úcupsé   )Úpluginhandler)Ú
to_unicodeN)Ú	Ui_Dialogc               @   sN   e Zd Zeedfdd„Zdd„ Zdd„ Zdd	„ Zd
d„ Z	dd„ Z
ddd„ZdS )ÚPluginDiagnoseFc             C   s`   t j| |ƒ || _|| _d | _d| _tjƒ | _| j	| ƒ t
ƒ | _| jjƒ  | jjƒ  | jƒ  d S )NF)ÚQDialogÚ__init__Úinstall_modeÚplugin_reasonÚplugin_pathÚresultr   ZPluginHandleÚ	pluginObjZsetupUiZUserSettingsZuser_settingsÚloadÚdebugÚinitUi)ÚselfÚparentr   r   Zupgrade© r   ú&/usr/share/hplip/ui5/plugindiagnose.pyr   +   s    



zPluginDiagnose.__init__c             C   sH   | j jj| jƒ | jjj| jƒ tjtjtjƒ | j	t
tddƒƒƒ d S )NZhp_logoZ128x128)ÚCancelButtonZclickedZconnectÚCancelButton_clickedÚ
NextButtonÚNextButton_clickedÚsignalÚSIGINTÚSIG_DFLZsetWindowIconZQIconZload_pixmap)r   r   r   r   r   =   s    zPluginDiagnose.initUic             C   s   t |ƒ| _| jƒ  d S )N)r	   r   ZsetPathIndicators)r   Útr   r   r   ÚPathLineEdit_textChangedG   s    
z'PluginDiagnose.PathLineEdit_textChangedc             C   s   | j |ƒ | jj|ƒ d S )N)ZupdateStepTextZStackedWidgetZsetCurrentIndex)r   Zpager   r   r   ÚdisplayPageP   s    
zPluginDiagnose.displayPagec             C   s   | j ƒ  d S )N)Úclose)r   r   r   r   r   T   s    z#PluginDiagnose.CancelButton_clickedc          
   C   sz   | j jdƒ | jjdƒ zFt}t}tj|tk|ƒ\}}| sL| jjƒ t	j
kr\t| | jdƒƒ W d tƒ  X d| _| jƒ  d S )NFzrFailed to install Plug-in.
Either you have chosen to skip the Plug-in installation  or entered incorrect Password.T)r   Z
setEnabledr   ZPLUGIN_REQUIREDÚPLUGIN_REASON_NONEr   Zrun_plugin_commandr   Z	getStatusr   ZPLUGIN_INSTALLEDZ	FailureUIÚ_PluginDiagnose__trZendWaitCursorr   r$   )r   Zpluginr   ÚokZsudo_okr   r   r   r   X   s    z!PluginDiagnose.NextButton_clickedNc             C   s   t jd||ƒS )NZPluginDialog)ZqAppÚ	translate)r   ÚsÚcr   r   r   Z__tri   s    zPluginDiagnose.__tr)N)Ú__name__Ú
__module__Ú__qualname__ZPLUGIN_NONEr%   r   r   r"   r#   r   r   r&   r   r   r   r   r   *   s   
	r   )Zbase.gÚbaser   r   r   Zprntr   Z
base.codesZui_utilsZ	installerr   Zbase.sixextr	   ZPyQt5.QtCoreZPyQt5.QtGuir   Zplugindiagnose_baser
   r   r   r   r   r   r   Ú<module>   s   