%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/share/hplip/ui5/__pycache__/
Upload File :
Create Path :
Current File : //usr/share/hplip/ui5/__pycache__/plugindialog.cpython-312.pyc

�

=	f�0���ddl�ddlmZmZddlmZddl�ddl�ddlm	Z	ddl
mZddl�ddl
�ddl�ddlmZddlZdZdZGd	�d
ee�Zy)�)�*)�device�utils)�cups�)�
pluginhandler)�
to_unicode)�	Ui_DialogNc��eZdZeefd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd�Zd	�Z
d
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zdd�Zy)�PluginDialogc��tj||�||_||_d|_d|_t
j�|_|j|�t�|_|jj�|jj�|j�tj!d|j"�y)N�Fr)�QDialog�__init__�install_mode�
plugin_reason�plugin_path�resultr�PluginHandle�	pluginObj�setupUi�UserSettings�
user_settings�load�debug�initUi�QTimer�
singleShot�showSourcePage)�self�parentrrs    �$/usr/share/hplip/ui5/plugindialog.pyrzPluginDialog.__init__0s�������v�&�(���*���������&�3�3�5������T��)�^��������!���� � �"����
����!�T�0�0�1�c�6�|jj�S�N)r�	getStatus�r s r"�isPluginInstalledzPluginDialog.isPluginInstalledBs���~�~�'�'�)�)r#c��|jjj|j�|jjj|j
�|j
ttdd���itd�t|jd��t|jd��t|jd��t|jd��td�t d�t"|jd��t$|jd��t&|jd	��t(d�t*d�t,|jd
��t.|jd��t0d�t2d�|_y)N�hp_logo�128x128z)This plugin will enable printing support.z%This plugin will enhance print speed.z'This plugin will enhance print quality.z'This plugin will add printing features.z)This plugin will enable scanning support.z(This plugin will enhance scanning speed.z0This plugin will enhance scanning image quality.z'This plugin will enable faxing support.z)This plugin will enhnace faxing features.)�CancelButton�clicked�connect�CancelButton_clicked�
NextButton�NextButton_clicked�
setWindowIcon�QIcon�load_pixmap�PLUGIN_REASON_NONE�PLUGIN_REASON_PRINTING_SUPPORT�_PluginDialog__tr�PLUGIN_REASON_FASTER_PRINTING� PLUGIN_REASON_BETTER_PRINTING_PQ�PLUGIN_REASON_PRINTING_FEATURES�PLUGIN_REASON_RESERVED_10�PLUGIN_REASON_RESERVED_20�PLUGIN_REASON_SCANNING_SUPPORT�PLUGIN_REASON_FASTER_SCANNING� PLUGIN_REASON_BETTER_SCANNING_IQ�PLUGIN_REASON_RESERVED_200�PLUGIN_REASON_RESERVED_400�PLUGIN_REASON_FAXING_SUPPORT�PLUGIN_REASON_FAX_FEATURES�PLUGIN_REASON_RESERVED_20000�PLUGIN_REASON_RESERVED_40000�PLUGIN_REASON_TEXTr's r"rzPluginDialog.initUiFs~��	
���!�!�)�)�$�*C�*C�D������'�'��(?�(?�@�	
���5��Y�	�!B�C�D�#
���#
�*�D�I�I�6a�,b�#
�
*�4�9�9�5\�+]�#
�
-�d�i�i�8a�.b�	#
�

,�T�Y�Y�7`�-a�#
�
&�t�
#
�
&�t�#
�
+�D�I�I�6a�,b�#
�
*�4�9�9�5_�+`�#
�
-�d�i�i�8j�.k�#
�
'��#
�
'��#
�
)�$�)�)�4]�*^�#
�
'��	�	�2]�(^�#
�
)�$�#
� 
)�$�!#
��r#c�p�|j�}|jtk(rR|jj	d�d}|�|d|zz
}|j
j
|j|��nI|jtk(r6d}|�|d|zz
}|j
j
|j|��|jjtj|j�|jjtj|j�|jjtj|j �|j"j$dj|j&�|j(j*j|j,�t/j.t.j0t.j2�|j(j5t7t9dd���|j;t<�y)NFz�An additional driver plug-in is required to operate this printer. You may download the plug-in directly from an HP authorized server (recommended), or, if you already have a copy of the file, you can specify a path to the file (advanced).z
<br><br>%sa(An optional driver plug-in is available to enhance the operation of this printer. You may download the plug-in directly from an HP authorized server (recommended), skip this installation (not recommended), or, if you already have a copy of the file, you can specify a path to the file (advanced).zconst QString &�folder_open�16x16)�plugin_reason_textr�PLUGIN_REQUIRED�SkipRadioButton�
setEnabled�
TitleLabel�setTextr7�PLUGIN_OPTIONAL�DownloadRadioButton�toggled�boolr.�DownloadRadioButton_toggled�CopyRadioButton�CopyRadioButton_toggled�SkipRadioButton_toggled�PathLineEdit�textChanged�PathLineEdit_textChanged�BrowseToolButtonr-�BrowseToolButton_clicked�signal�SIGINT�SIG_DFL�setIconr3r4�displayPage�PAGE_SOURCE)r �reason_text�msgs   r"rzPluginDialog.showSourcePagefs����-�-�/������/�� � �+�+�E�2�C�C��&��|�K�/�/���O�O�#�#�D�I�I�c�N�3�
�
�
�/�
1�}�C��&��|�K�/�/���O�O�#�#�D�I�I�c�N�3�� � �(�(��.�6�6�t�7W�7W�X����$�$�T�*�2�2�4�3O�3O�P����$�$�T�*�2�2�4�3O�3O�P����%�%�&7�8�@�@��A^�A^�_����%�%�-�-�d�.K�.K�L��
�
�f�m�m�V�^�^�4����%�%�e�K�
�w�,O�&P�Q�����%r#c��|ru|jjd�|jjd�|jjd�	|jj	d�d|_yy#t
$rY�wxYw�NFTr�rXrMr[r0�
setStyleSheet�AttributeErrorr�r �bs  r"rTz(PluginDialog.DownloadRadioButton_toggled��{������(�(��/��!�!�,�,�U�3��O�O�&�&�t�,�
��!�!�/�/��3� $�D��
��"�
��
���A9�9	B�Bc���|ro|jjd�|jjd�t|jj	��|_|j
�yy)NT)rXrMr[r	�textr�setPathIndicatorsrjs  r"rVz$PluginDialog.CopyRadioButton_toggled�sZ������(�(��.��!�!�,�,�T�2�)�$�*;�*;�*@�*@�*B�C�D���"�"�$�	
r#c��|ru|jjd�|jjd�|jjd�	|jj	d�d|_yy#t
$rY�wxYwrfrgrjs  r"rWz$PluginDialog.SkipRadioButton_toggled�rlrmc�D�t|�|_|j�yr%)r	rrp)r �ts  r"rZz%PluginDialog.PathLineEdit_textChanged�s��%�a�=������ r#c��d}|jr5|jrqtjj|j�rH|jj|j
d|jj�z��d}n�tjj|j�|jj�k7rG|jj|j
d|jj�z��d}|s8	|jjd�|jjd�y	|jjd�|jjd�|jjd�y#t$rY�zwxYw#t$rY�QwxYw)NTz)You must specify a path to the '%s' file.Fz!The plugin filename must be '%s'.zbackground-color: yellow; r)r�os�path�isdirrX�
setToolTipr7r�getFileName�basenamerhrir0rM)r �oks  r"rpzPluginDialog.setPathIndicators�s`��
�����D�$4�$4������t�GW�GW�9X����(�(����3^�_c�_m�_m�_y�_y�_{�3{�)}�~��B�
�W�W�
�
�d�.�.�
/�4�>�>�3M�3M�3O�
O����(�(����3V�W[�We�We�Wq�Wq�Ws�3s�)t�u��B��
��!�!�/�/�0L�M�
�O�O�&�&�u�-�
��!�!�/�/��3�
�O�O�&�&�t�,����(�(��,��"�
��
��"�
��
�s$�F$�F3�$	F0�/F0�3	F?�>F?c��t|jj��}d}tjj|�sJtj||jd�|jj|jd��}|rd|d|_|jj|j�|j|j_
|jj�|j�y)NrzSelect Plug-in FilezPlugin Files (*.run)r)r	rXrorurv�exists�QFileDialog�getOpenFileNamer7r�working_dirrrO�saverp)r rsrvs   r"r\z%PluginDialog.BrowseToolButton_clicked�s����t�(�(�-�-�/�0�����w�w�~�~�a� ��.�.�t�T�Y�Y�?T�5U�/3�/A�/A�/M�/M�/3�y�y�9O�/P�R�D�
�#�A�w�D�����%�%�d�&6�&6�7�-1�-=�-=�D���*����#�#�%���� r#c�\�|j|�|jj|�yr%)�updateStepText�
StackedWidget�setCurrentIndex)r �pages  r"razPluginDialog.displayPage�s$�����D�!����*�*�4�0r#c�$�|j�yr%)�closer's r"r/z!PluginDialog.CancelButton_clicked�s���
�
�r#c	�h	�|jj�r&tjd�|j	�yt�	|jr0|jjd�s�d|jz|_n�tjd�tj�}|sVtjd�t�t||jd��|j	�	t�ytjd|jz�|jj!|j|j"�\}}}|t$t&fvr�t�t(j+|d|jd|z�t(j,t(j.zt(j.�t(j,k7r�|jj1|�|j	�	t�y|t2k7rM|jj1|�t�t||�|j	�	t�y|jj5|t6�s\|jj1|�t�t||jd	��|j	�	t�yt9j:d
g�}|D]�}t9j<|�}|j?dd�s�+tjtjAd
|z��	d}	t9jB|�}|jG�rtjd�n(t�t||jd|z��|���|j	���	t�|jj1|�tI||jd��d|_%|j	�y#tD$rUtjd�t�t||jd|z��Y|���v|j	����wxYw#�|j	�wwxYw#t�wxYw)NzSkipping plug-in installation.zhttp://zfile://z"Checking for network connection...z Network connection not detected.zDownloading plug-in from: %s� z�<b>%s</b><p>Without this, it is not possible to authenticate and validate the plug-in prior to installation.</p>Do you still want to install the plug-in?zPlug-in install failed.�hpzfw-downloadFz%
Downloading firmware to device %s...zError opening device.z3<b>Firmware download to device failed.</b><p>%s</p>zFirmware download successful.
z&<b>Plug-in installation successful</b>T)&rL�	isChecked�logrr��beginWaitCursorr�
startswith�infor�check_network_connection�error�
endWaitCursor�	FailureUIr7r�download�plugin_download_callback�ERROR_UNABLE_TO_RECV_KEYS�ERROR_DIGITAL_SIGN_NOT_FOUND�QMessageBox�question�Yes�No�deleteInstallationFiles�
ERROR_SUCCESS�
run_plugin�GUI_MODEr�getSupportedCUPSDevices�queryModelByURI�get�bold�Device�Error�downloadFirmware�	SuccessUIr)	r r{�status�download_plugin_file�	error_str�cups_devices�dev�mq�ds	         r"r1zPluginDialog.NextButton_clicked�s������)�)�+��I�I�6�7��J�J�L����I	�����'�'�2�2�9�=�'0�4�3C�3C�'C�D�$����=�>��3�3�5����I�I�@�A�!�O��d�D�I�I�.P�$Q�R��J�J�L��t
�O�q
�H�H�3�d�6F�6F�F�G�6:�n�n�6M�6M�d�N^�N^�_c�_|�_|�6}�3�F�(�)��3�5Q�R�R����'�'��c��	�	�#~�@I�#I�J�(3���+�.�.�(H�+�.�.�Z�]h�]l�]l�m��N�N�:�:�;O�P��J�J�L��V
�O�S�=�(����6�6�7K�L����$�	�*��
�
���H
�O�E�>�>�,�,�-A�8�L����6�6�7K�L����$��	�	�*C� D�E��
�
���:
�O�7"�9�9�4�&�A�L�#�
&���+�+�C�0���6�6�-��/��H�H�S�X�X�&N�QT�&T�U�V�&� ��%� &�
�
�c� 2�A��-�-�/��H�H�%F�G�)�O�%�d�D�I�I�6k�lo�6o�,p�q��=��G�G�I�1
&�4
�O����.�.�/C�D��$��	�	�"J�K�L�����
�
���+ %�%��I�I�&=�>�)�O�%�d�D�I�I�6k�lo�6o�,p�q�$��=��G�G�I�%���=��G�G�I�)��
�O�s�B1R%�	DR%�A
R%�-A0R%�)AR%�,+R%�R
�P,�0AR
�>R%�R%�,AR
�2R
�3R%�7R%�	R
�
R
�
R"�"R%�%R1c��yr%�)r �c�srss    r"r�z%PluginDialog.plugin_download_callback6s��r#c��t|�yr%)�print)r r�s  r"�plugin_install_callbackz$PluginDialog.plugin_install_callback:s	��
�a�r#c	�x�|jj|jd|dz�dtdz����y)NzStep rz of )�StepTextrOr7�PAGE_MAX)r �ps  r"r�zPluginDialog.updateStepText>s*���
�
���d�i�i�!�A�#�x��z�(J�K�Lr#c�T�	|j|jS#t$rYywxYwr%)rFr�KeyErrorr's r"rJzPluginDialog.plugin_reason_textBs0��	��*�*�4�+=�+=�>�>���	��	�s��	'�'Nc�0�tjd||�S)Nr)�qApp�	translate)r r�r�s   r"�__trzPluginDialog.__trIs���~�~�n�Q�q�1�1r#r%)�__name__�
__module__�__qualname__�PLUGIN_NONEr5rr(rrrTrVrWrZrpr\rar/r1r�r�r�rJr7r�r#r"rr/sf��,7�GY�2�$*�
�@&�8	$�%�	$�!�
-�0!�,1�
�U�p
��M��2r#r)�base.g�baserr�prntr�
base.codes�ui_utils�	installerr�base.sixextr	�PyQt5.QtCore�PyQt5.QtGui�PyQt5.QtWidgets�plugindialog_baser
r]rbr�rrr�r#r"�<module>r�sI��0�����#�#����(������[2�7�I�[2r#

Zerion Mini Shell 1.0