%PDF- %PDF-
Mini Shell

Mini Shell

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

�

=	f�����ddlZddlZddl�ddlmZmZmZmZmZddl	�ddl
mZddl�ddl
m
Z
mZmZmZmZmZddl�ddl�ddlmZdZdZdZd	Zd
ZdZdZd	ZdZdZdZ dZ!dZ"Gd
�de#�Z$dd�Z%Gd�de&�Z'Gd�de#e�Z(y)�N)�*)�device�models�wifi�LedmWifi�CdmWifi)�
to_unicode�)�PY3�
to_bytes_utf8r	�to_string_latin�to_string_utf8�	xStringIO)�	Ui_Dialog�����c�6�eZdZdd�Zd	d�Zd�Zd�Zd�Zd
d�Zy)�PasswordDialogNc��tj||�|jtt	dd���||_t
|�}|jdddd�|jd�t|�|_
|j|jdddd�t|�|_|j|jdd�t|�|_|jjtj �|j|jdddd�t|�|_|j|j"dd�t|�|_|j$jtj&�|j|j$dddd�t)|�|_|j|j*dd�|j-�|j/t1d	d
�j3|j5���|j*j6j9|j:�|j$j<j9|j:�y)N�hp_logo�128x128�
�rr
rri��)�QDialog�__init__�
setWindowIcon�QIcon�load_pixmap�prompt�QGridLayout�setContentsMargins�
setSpacing�QLabel�PromptTextLabel�	addWidget�UsernameTextLabel�	QLineEdit�UsernameLineEdit�setEchoMode�Normal�PasswordTextLabel�PasswordLineEdit�Password�QPushButton�OkPushButton�languageChange�resize�QSize�
expandedTo�minimumSizeHint�clicked�connect�accept�
returnPressed)�selfr#�parent�name�modal�fl�Layouts       �'/usr/share/hplip/ui5/wifisetupdialog.pyrzPasswordDialog.__init__?s�������v�&����5��Y�	�!B�C�D�����D�!���!�!�"�R��2�.����!��%�d�|�������-�-�a��!�A�6�!'���������/�/��!�4� )�$�������)�)�)�*:�*:�;�����.�.�q��1�Q�7�!'���������/�/��!�4� )�$�������)�)�)�*<�*<�=�����.�.�q��1�Q�7�'��-�������*�*�1�Q�/��������E�#�c�N�-�-�d�.B�.B�.D�E�F����!�!�)�)�$�+�+�6����+�+�3�3�D�K�K�@�c��|jj|�|s7|jjd�|jjd�yy)NTz'QLineEdit {background-color: lightgray})r,�setText�setReadOnly�
setStyleSheet)r=�defUser�allowUsernameEdits   rC�setDefaultUsernamez!PasswordDialog.setDefaultUsernamedsG�����%�%�g�.� ��!�!�-�-�d�3��!�!�/�/�0Y�Z�!rDc�H�t|jj��S�N)r	r,�text�r=s rC�getUsernamezPasswordDialog.getUsernamej����$�/�/�4�4�6�7�7rDc�H�t|jj��SrM)r	r0rNrOs rC�getPasswordzPasswordDialog.getPasswordnrQrDc��|j|jd��|jj|j|j��|j
j|jd��|jj|jd��|jj|jd��y)Nz+HP Device Manager - Enter Username/Passwordz	Username:z	Password:�OK)�setWindowTitle�_PasswordDialog__trr(rFr#r*r/r3rOs rCr4zPasswordDialog.languageChangers������D�I�I�&S�T�U����$�$�T�Y�Y�t�{�{�%;�<����&�&�t�y�y��'=�>����&�&�t�y�y��'=�>����!�!�$�)�)�D�/�2rDc�0�tjd||�S)N�SetupDialog��qApp�	translate�r=�s�cs   rC�__trzPasswordDialog.__trzs���~�~�m�A�a�0�0rD)NNrr)TrM)	�__name__�
__module__�__qualname__rrKrPrSr4rW�rDrCrr>s#��#A�J[�8�8�3�1rDrc���	t|d�}|dk7r|j||�|j�tjk(r!d|j�|j
�fS	y#wxYw)Nr
)r�rf)rrK�exec_r�AcceptedrPrS)r#�userNamerJ�dlgs    rC�showPasswordUIrk}si��
��V�T�*���t���"�"�8�->�?��9�9�;�'�*�*�*��c�o�o�'����):�;�	
�����s�A$A)�)A+c��eZdZd�Zy)�DeviceTableWidgetItemc�\�tj||tj�||_yrM)�QTableWidgetItemr�UserType�
device_uri)r=rNrqs   rCrzDeviceTableWidgetItem.__init__�s"���!�!�$��.>�.G�.G�H�$��rDN)rarbrcrrdrDrCrmrm�s��%rDrmc��eZdZe�Zd)d�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Ze d�fd�Z!d�Z"d �Z#d!�Z$d"�Z%d#�Z&e'fd$�Z(d%�Z)d&�Z*d*d'�Z+d(�Z,y)+�WifiSetupDialogNc���tj||�|j|�||_i|_i|_d|_d|_d|_d|_	d|_
t|_i|_
d|_t|_d|_d|_||_|j)�d|_t,|_t0|_t4j7d|j8�y)NrfF�usb�0.0.0.0�Wifi0r)rr�setupUirq�devices�networks�ssid�directed�
show_extended�bus�search�	PAGE_EXIT�max_page�location_cache�dev�SUCCESS_NOT_CONNECTED�success�ip�hn�
standalone�initUi�adapterNamer�wifiObj�WIFI_CONFIG_LEDM�wifiConfVal�QTimer�
singleShot�
showIntroPage)r=r>rqr�s    rCrzWifiSetupDialog.__init__�s�������v�&����T��$��������
���	���
�"���������!��
� ������,���������$������
�"������+���	���!�T�/�/�0rDc�j�|jttdd���|jjj|j�|jjj|j�|jjj|j�tjtjtj�|j�|j�|j!�|j#�|j%�y)Nrr)r r!r"�CancelButtonr9r:�CancelButton_clicked�
BackButton�BackButton_clicked�
NextButton�NextButton_clicked�signal�SIGINT�SIG_DFL�
initIntroPage�initDevicesPage�initNetworkPage�initConfigWifiPage�initExitPagerOs rCr�zWifiSetupDialog.initUi�s������5��Y�	�!B�C�D�	
���!�!�)�)�$�*C�*C�D������'�'��(?�(?�@������'�'��(?�(?�@��
�
�f�m�m�V�^�^�4����������������!����rDc�Z�|jjtdd��|jjtdd��|jr+|j
j
|jd��y|j
j
|jd��y)N�usb_connection�other�info�16x16a�This utility allows you configure your wireless capable printer using a temporary USB connection. You will be prompted to disconnect the USB cable once wireless network setup is complete. <p><i>Note: This configuration utility does not setup (install) your printer on this computer. Use hp-setup to setup your printer after it has been configured on the network by this utility.</i></p> <p><i>Note: Only select wireless capable printers are supported by this utility.</i></p>a�This utility allows you configure your wireless capable printer using a temporary USB connection. You will be prompted to disconnect the USB cable once wireless network setup is complete. <p><i>Note: Printer setup (installation) will continue after your printer is configured on the network.</i></p> <p><i>Note: Only select wireless capable printers are supported by this utility.</i></p>)�Picture�	setPixmapr"�InfoIconr��MainTitleLabelrF�_WifiSetupDialog__trrOs rCr�zWifiSetupDialog.initIntroPage�s��������{�+;�W�E�F��
�
����F�G� <�=��?�?����'�'��	�	�3P�)Q�
R����'�'��	�	�3y�)z�
{rDc��|jjd�|jjd�|jt�y)NFT)r��
setEnabledr��displayPage�
PAGE_INTROrOs rCr�zWifiSetupDialog.showIntroPage�s4�����"�"�5�)����"�"�4�(�����$rDc�b�|jjj|j�yrM)�
RefreshButtonr9r:�RefreshButton_clickedrOs rCr�zWifiSetupDialog.initDevicesPage�s"�����"�"�*�*�4�+E�+E�FrDc�R�|jjd�|jt�t	�	|j
s�tjd�dtjtfi}	ddlm}t�|jtd�t	�t%j&|j(gdd||j*�|_t�|j-�|j
r�|j.jd�|j0j3t5dd	��t7|j
�d
k(r+|j8j;|j=d��n@|j8j;|j=dt7|j
�z��|j?�n�|j.jd
�|j0j3t5dd	��tj#d|j(z�|j8j;|j=d��|jAtB�y#t $rtj#d�Y���wxYw#t�wxYw)NTzSearching on USB bus...�wifi-configr)�
smart_install�qt4z+Failed to Import smart_install.py from baser�r�r
zF<b>1 wireless capable device found.</b> Click <i>Next</i> to continue.zi<b>%s wireless capable devices found.</b> Select the device to install and click <i>Next</i> to continue.F�errorzNo devices found on bus: %sz|<b>No wireless capable devices found.</b><br>Plug in your printer with a USB cable and click <i>Refresh</i> to search again.)"r�r��
setNextButton�BUTTON_NEXT�beginWaitCursorry�logr��operator�gt�WIFI_CONFIG_NONE�baser��
endWaitCursor�disable�GUI_MODE�ImportErrorr�r�probeDevicesr~r�clearDevicesTabler��DevicesFoundIconr�r"�len�DevicesFoundLabelrFr��loadDevicesTabler��PAGE_DEVICES)r=�filter_dictr�s   rC�showDevicesPagezWifiSetupDialog.showDevicesPage�s�����"�"�4�(����;�'���	��<�<����2�3�,����=M�/N�O��&�2�"�O�!�)�)�(�E�:�#�%�%�2�2�D�H�H�:�q�!�[�RV�R]�R]�^���
�O���� ��<�<��O�O�&�&�t�,��!�!�+�+�K���,H�I��4�<�<� �A�%��&�&�.�.�t�y�y�:B�0C�D��&�&�.�.�t�y�y�:e�hk�lp�lx�lx�hy�:y�0z�{��!�!�#�
�O�O�&�&�u�-��!�!�+�+�K���,I�J��I�I�3�d�h�h�>�?��"�"�*�*�4�9�9�6t�,u�
v�����&��?#�M��I�I�K�L�M��
�O�s0�9J�6I5�<AJ�5J�J�J�J�J&c
� �|jjd�|jjt|j��|jd�|jd�g}d}|jj
t|��|jj|�tjtjz}t|j�D]�\}}tj|�\	}}}}	}
}}}
}tj|	�}t!t#|�|�}|j%|�|jj'|d|�t)t#|��}|j%|�|jj'|||���|jj+�|jjd�|jj-d�|jj/d�y)NF�Modelz
Device URIr
rT)�DevicesTableWidget�setSortingEnabled�setRowCountr�ryr��setColumnCount�setHorizontalHeaderLabels�Qt�ItemIsSelectable�
ItemIsEnabled�	enumerater�parseDeviceURIr�normalizeModelUINamerm�str�setFlags�setItemro�resizeColumnsToContents�	sortItems�	selectRow)r=�headers�device_uri_col�flags�row�d�back_end�is_hpr~�model�serial�dev_file�host�zc�port�model_ui�is                 rCr�z WifiSetupDialog.loadDevicesTables������1�1�%�8����+�+�C����,=�>��9�9�W�%�t�y�y��'>�?�������.�.�s�7�|�<����9�9�'�B��#�#�b�&6�&6�6������-�
	D�F�C��LR�La�La�bc�Ld�I�H�e�S�%���4��T��2�2�5�9�H�%�c�(�m�Q�7�A�
�J�J�u���#�#�+�+�C��A�6� ��Q��(�A�
�J�J�u���#�#�+�+�C���C�
	D�	
���7�7�9����1�1�$�7����)�)�!�,����)�)�!�,rDc��|jj�|jjd�|jjd�y�Nr�r��clearr�r�rOs rCr�z!WifiSetupDialog.clearDevicesTable2�<�����%�%�'����+�+�A�.����.�.�q�1rDc�r�|j�g|_tjd|j�yr�)r�ryr�r�r�rOs rCr�z%WifiSetupDialog.RefreshButton_clicked8s+����� �������!�T�1�1�2rDc��|jjtdd��|jj	d�|jj
tj|j�|jj
j|j�|jj
tj|j�|jj
tj|j�|jjj|j �y)N�"rF)�NetworksTableWidget�setIconSizer6�ShowExtendedCheckBox�
setCheckedr9�boolr:�ShowExtendedCheckBox_clicked�SearchPushButton�SearchPushButton_clicked�UndirectedRadioButton�UndirectedRadioButton_clicked�DirectedRadioButton�DirectedRadioButton_clicked�itemSelectionChanged�(NetworksTableWidget_itemSelectionChangedrOs rCr�zWifiSetupDialog.initNetworkPageBs���� � �,�,�U�2�r�]�;��!�!�,�,�U�3��!�!�)�)�$�/�7�7��8Y�8Y�Z����%�%�-�-�d�.K�.K�L��"�"�*�*�4�0�8�8��9[�9[�\�� � �(�(��.�6�6�t�7W�7W�X�� � �5�5�=�=�d�>k�>k�lrDc	��|j�%	tj|j�|_|jj�d|_|jtk(rp|jt k(r]	d}	t#|�\}}}|dk(ryt%�|jj'|j||�}|dk(rn
d}t)��Y	|jj+|j�}t/|�dk(rQt||j
d��|j�|jj�|j�t0j3d�	|jj5|j|�\|_|_}}	|j6dk(rAt||j
d	��|j�|jj�t0j3d
|j6z�t0j3d|j8z�t0j3d|z�t0j3d
|	z�|j;�|j=t>�|jAtB�y#t$r}}t||j
d�|jt|j�fz�|j�|jj�|j�Yd}~yd}~wwxYw#t$r}|j-|�Yd}~yd}~wwxYw#t$r}|j-|�Yd}~yd}~wwxYw)Nz0<b>Error opening device:</b><p>%s</p><p>(%s)</p>rz%Enter printer's username and passwordTzIInvalid Username/Password
.Please reenter printer's username and passwordz4<b>Unable to locate wireless hardware on device.</b>zTurning on wireless radio...���z*<b>Unable to turn on wireless adaptor.</b>zAdaptor ID: %szAdaptor name: %szAdaptor state: %szAdaptor presence: %s)"r�r�Devicerq�Error�	FailureUIr�r��msg�closerzr��num_networksr�rr��WIFI_CONFIG_CDM_AUTHrkr��getCDMTokenr��getWifiAdaptorID�showIOErrorr�r��debug�setAdaptorPower�
adaptor_idr��performScanr�r�r��PAGE_NETWORK)
r=�er#�rtnvalue�uname�password�ret�adaptor_list�state�presences
          rC�showNetworkPagezWifiSetupDialog.showNetworkPageLs����8�8��	
�!�=�=����9���	
�
�
��������<�<�7�"�t�'7�'7�;O�'O��@���/=�f�/E�,�H�U�H��1�}��#�%��,�,�2�2�4�8�8�U�H�M�C��d�{��j�F�!�O��	��<�<�8�8����B�L�
�|���!��d�D�I�I�&\�]�^��x�x�#������ ��J�J�L��	�	�0�1�	�BF�,�,�B^�B^�_c�_g�_g�iu�Bw�>�D�O�T�-�u�h��?�?�b� ��d�D�I�I�&R�S�T��x�x�#������ ��	�	�"�T�_�_�4�5��	�	�$�t�'7�'7�7�8��	�	�%��-�.��	�	�(�8�3�4��������;�'�����&��u�
��$��	�	�*\� ]�`d�`o�`o�qt�uv�uz�uz�q{�_|� |�}��8�8�'��H�H�N�N�$��
�
����
��:�	����Q����	���	����Q����	�sH�$J%�%L.�15M�%	L+�.A3L&�&L+�.	M�7M
�
M�	M9�M4�4M9c�2�t�	t|jj��|_|j
rN|jrB	|jj|j|j|j�|_
n6	|jj|j|j�|_
|jj�t�|jd|_|j!�|jr�|j"j%d�|j&j)t+dd��|jdk(r+|j,j/|j1d��n7|j,j/|j1d|jz��|j3�y|j"j%d�|j&j)t+d	d��t4j7d
�|j,j/|j1d��y#t$r?}|j|�Yd}~|jj�t�yd}~wwxYw#t$r?}|j|�Yd}~|jj�t�yd}~wwxYw#|jj�t�wxYw)N�numberofscanentriesTr�r�r
z�<b>1 wireless network found. </b> If the wireless network you would like to connect to is not listed, try entering a wireless network name and/or press <i>Search</i> to search again.z�<b>%d wireless networks found.</b> If the wireless network you would like to connect to is not listed, try entering a wireless network name and/or press <i>Search</i> to search again.Fr�zNo wireless networks found.zo<b>No wireless networks found.</b><br>Enter a wireless network name and/or press <i>Search</i> to search again.)r�r	�SSIDLineEditrNr{r|r�rr�r�rzrrr	r�r
�clearNetworksTabler�r��NetworksFoundIconr�r"�NetworksFoundLabelrFr��loadNetworksTabler��warning�r=rs  rCrzWifiSetupDialog.performScan�s^����	�"�4�#4�#4�#9�#9�#;�<�D�I��}�}�����$(�L�L�$<�$<�T�X�X�t�GW�GW�Y]�Yb�Yb�$c�D�M�
�$(�L�L�$<�$<�T�X�X�t�GW�GW�$X�D�M�

�H�H�N�N���O� �M�M�*?�@������!�����O�O�&�&�t�,��"�"�,�,�[���-I�J�� � �A�%��'�'�/�/��	�	�;s�1t�u��'�'�/�/��	�	�;t�vz�vG�vG�;G�1H�I��"�"�$�
�O�O�&�&�u�-��"�"�,�,�[��'�-J�K��K�K�5�6��#�#�+�+�D�I�I�7h�-i�
j��=���$�$�Q�'��
�H�H�N�N���O�������$�$�Q�'���H�H�N�N���O����
�H�H�N�N���O�s[�AK0�
AI�
K0�5J%�	J"�#J�4K0�J"�"K0�%	K-�.K(�?K0�(K-�-K0�0&Lc�2�||_|j�yrM)r}r#�r=�bs  rCr�z,WifiSetupDialog.ShowExtendedCheckBox_clicked�s�������� rDc�D�|j�|j�yrM)rr#rOs rCr�z(WifiSetupDialog.SearchPushButton_clicked�s��������� rDc�L�||_|jj|�yrM�r|rr�r's  rCr�z-WifiSetupDialog.UndirectedRadioButton_clicked�s!�����
����$�$��U�+rDc�H�||_|jj|�yrMr+r's  rCrz+WifiSetupDialog.DirectedRadioButton_clicked�s����
����$�$�Q�'rDc�$�dtd�c|_|_|j�r�t	�	|j
r�t
|j�D]y}|jd|z}|jd|z}	|j||j|\|jd|z<|jd|z<|jd|z<�{|jjd�|jj|j�|j!d
�|j!d�|j!d�|j!d�g}|j
rQ|j#|j!d�|j!d�|j!d�|j!d�g�|jj%t'|��|jj)|�t*j,t*j.z}	t
|j�D�]�}|jd|z}
|
dk(rd}n|	}|jd|z}|jd|z}|jd|z}
t0j3d||
|||
fz�|j
r�|jd|z}|jd|z}|jd|z}|jd|z}|jd|z}|jd|z}t0j3d|||||||fz�t5t7|
��}|�|j9|�|j;t*j<|�|jj?|d|�tAd|zd�}|j
r+t5tC|�|j!|�d�d ���}n't5tC|�|j!d!|z��}|�|j9|�|jj?|d"|�t5t7|��}|�|j9|�|jj?|d#|�t5t7|
��}|�|j9|�|jj?|d$|�|j
s���t5t7t7���}|�|j9|�|jj?|d%|�t5t7��}|�|j9|�|jj?|d&|�t5t7��}|�|j9|�|jj?|d'|�t5t7�d(����}|�|j9|�|jj?|d)|����|jjE�|jjd*�|jjGd"t*jH�|jjKd�|jjLjO�tQ�|jRjUd*�y|jRjUd�y#t$r�tj||�}|jdd	�x}|jd|z<|jd
d	�x}|jd|z<|jdd	�x}|jd|z<|||f|j|<Y��wxYw#tQ�|jRjUd*�wxYw)+Nrrfzbssid-%dzsignalstrength-%dzlatitude-%dzlongitude-%dz
address-%d�latitude�Unknown�	longitude�addressFzNetwork Name (SSID)zSignal Strength�Security�Mode�ChannelzAddress (BSSID)�LocationzLat/Longzssid-%dz	(unknown)�encryptiontype-%dzcommunicationmode-%dz.%d: Name=%s, strength=%s, security=%s, mode=%sz
channel-%dzdbm-%dz8%d: channel=%d bssid=%s dbm=%s lat=%s long=%s address=%s�signal%dr�z/5 (� dBm)z%s/5r
rrr�r�/�T)+r	�n�networkr
r�r}�rangerzr��KeyErrorr�getLocation�getr�r�r�r��extendr�r�r�r�r�r�r�rror�r��setData�UserRoler�r"r!r�r��DescendingOrderr�r�emitr�r�r�)r=r<�bssid�ss�location�lat�lngr1r��
enabled_flagsr?r��sec�mode�chn�dbmr��pixmaps                  rCr#z!WifiSetupDialog.loadNetworksTable�s��� �*�R�.�����������j
1��%�%�"�4�#4�#4�5�
;�� $�
�
�j�1�n� =��!�]�]�+>��+B�C��
;� �/�/��6�!%� 3� 3�E� :�A�D�M�M�-�!�*;�<�d�m�m�N�]^�L^�>_�ae�an�an�o{�~�o�bA�
;��(�(�:�:�5�A��(�(�4�4�T�5F�5F�G��9�9�%:�;�T�Y�Y�GX�=Y� �I�I�j�1�4�9�9�V�3D�F���%�%��N�N�D�I�I�i�$8� �I�I�&7�8�$�)�)�J�:O� �I�I�j�1�$3�4��(�(�7�7��G��E��(�(�B�B�7�K� "� 3� 3�b�6F�6F� F�
��t�0�0�1�>B�A��=�=��Q��7�D��{�*� $�� -�����':�Q�'>�?�B��-�-�(;�a�(?�@�C��=�=�)?�!�)C�D�D��I�I�N��D�"�c�4�0�1�2��)�)�"�m�m�L�1�,<�=��"�m�m�H�q�L�9�� $�
�
�j�1�n� =��"&�-�-��q�0@�"A��"�m�m�M�A�,=�>��"�m�m�N�Q�,>�?���	�	�"\���U�C��c�7�C�#D�E�)��T��3�A��(�!�*�*�U�*;��I�I�b�k�k�1�-��,�,�4�4�Q��1�=�(��b��'�B�F��)�)�,�U�6�]�D�I�I�XZ�\_�F`�<a�b��,�U�6�]�D�I�I�f�r�k�<R�S���(�!�*�*�U�*;��,�,�4�4�Q��1�=�(��S��2�A��(�!�*�*�U�*;��,�,�4�4�Q��1�=�(��T��3�A��(�!�*�*�U�*;��,�,�4�4�Q��1�=��)�)�,�S��S��]�;�� �,�a�j�j��.?��0�0�8�8��A�q�A�,�S��Z�8�� �,�a�j�j��.?��0�0�8�8��A�q�A�,�S��\�:�� �,�a�j�j��.?��0�0�8�8��A�q�A�,�S�C��1E�-F�G�� �,�a�j�j��.?��0�0�8�8��A�q�A�}>B�B�(�(�@�@�B��(�(�:�:�4�@��(�(�2�2�1�b�6H�6H�I��(�(�2�2�1�5��(�(�=�=�B�B�D������*�*�4�0�
�O�O�&�&�u�-��M (�M�'+�'7�'7��r�'B�H�EM�\�\�R\�^g�Eh�h�C�$�-�-�
��0A�"B�GO�|�|�T_�aj�Gk�k�C�4�=�=��!�1C�#D�HP���U^�`i�Hj�j�G�d�m�m�L�1�4D�&E�:=�s�G�9L�D�/�/��6�M��D�����*�*�4�0�s9�A](�:[�	P8](�F?](�B]%�!](�$]%�%](�('^c�l�|jj�}|jj|d�}t|j	t
j��\}}|rQ|jd|z}|j�dk(r|jt�y|jt�yy)Nrr6�none)r��
currentRow�item�	value_int�datar�rDrz�lowerr��BUTTON_CONNECTr�)r=r�rUr<�okrMs      rCrz8WifiSetupDialog.NetworksTableWidget_itemSelectionChanged=s����&�&�1�1�3���'�'�,�,�S�!�4���$�)�)�B�K�K�0�1���2�
��-�-� 3�a� 7�8�C��y�y�{�f�$��"�"�>�2��"�"�;�/�rDc��|jj�|jjd�|jjd�yr�r�rOs rCr z"WifiSetupDialog.clearNetworksTableIr�rDc�r�|j�i|_tjd|j�yr�)r rzr�r�rrOs rC�RefreshButton2_clickedz&WifiSetupDialog.RefreshButton2_clickedOs+�����!���
����!�T�1�1�2rDc�p�|jjtj|j�yrM)�ShowKeyCheckBox�toggledr�r:�ShowKeyCheckBox_toggledrOs rCr�z"WifiSetupDialog.initConfigWifiPageYs'�����$�$�T�*�2�2�4�3O�3O�PrDc��|jt�|jj|j�t�}|j
d�|jj|�|jjt��|jjd�|jjtd|jzd��|j jtdd��|j"jtdd��d	|j$j'�vr|j(jd
�nSd|j$j'�vr|j*jd
�n|j*jd
�|jj-�|jj/t0j2�|j5t6�y)N�Fr7r�r�r��keys�32x32�wpaT�wep)r�rY�	SSIDLabelrFr=�QFont�setPointSize�setFont�KeyLineEditr�r_r��StrengthIconr�r"rH�
ConfigureIcon�KeysIcon�securityrX�WPARadioButton�WEPRadioButton�setFocusr-r+r1r��PAGE_CONFIGURE_WIFI)r=�fonts  rC�showConfigWifiPagez"WifiSetupDialog.showConfigWifiPage]sp�����>�*������t�|�|�,��w�����"�������t�$���� � ���'����'�'��.����#�#�K�
�T�W�W�0D�g�$N�O����$�$�[���%A�B��
�
����F�G� <�=��D�M�M�'�'�)�)����*�*�4�0�
�d�m�m�)�)�+�
+����*�*�4�0����*�*�4�0����!�!�#����$�$�Y�%7�%7�8����,�-rDc��|r*|jjtj�y|jjtj�yrM)rlr-r+r.r1r's  rCraz'WifiSetupDialog.ShowKeyCheckBox_toggledus9������(�(��)9�)9�:����(�(��);�);�<rDc�@�|jjtj|j�t|�|_|jjj|j�g|_	d|_
|jjd�y)Nrr
)�PageSpinBox�valueChanged�intr:�PageSpinBox_valueChangedr��RefreshTimer�timeout�RefreshTimer_timeout�pages�
page_index�
setMinimumrOs rCr�zWifiSetupDialog.initExitPage�su�����%�%�c�*�2�2�4�3P�3P�Q�"�4�L������!�!�)�)�$�*C�*C�D���
�������#�#�A�&rDc
�L�|jt�|jjd�|jjd�|j
j
t|j��d|_	d|_
d\}}}}g}t|_t�		|jj|j |j"�\|_	}}}}	}
}|jdk(rO|jt$k(s<|jj'|j |j"�\|_	}}	}
}}|jj)|j |j"�}|jj+|j |j"|j|j,�\}}}}|jj/|j �|_
	|j j5�t7�	t:|_|jdk(rt|_g|_|jtk(ra|j>jA|jCdtDz�tGdd�f�|jHjKtDd	z��n:|jt<k(r�|j>jA|jCd
|jz�tGdd�f�|jjd�|jLjd�|jHjO�n�|j>jA|jCd|jz�tGd
d�f�|jjd�|jLjd�|jHjO�|�+|jPj
|jCd��n$|jPj
t|��|j�+|jRj
|jCd��n.|jRj
t|j��|jTj
t|j��|jVj
t|	��|jXj
t|
��|jjd�|jZj
t|�d|�d|�d���|j\j_tGd|zd��|D]�\}
}|
s�	|j9�}|jad
�r
tGd
d�}nH|jad�r
tGdd�}n*|jad�r
tGdd�}ntGd
d�}|j>jAtcjddt|
�jgd�z�|f���ti|j>�}|jjjm|�|jjj|dkD�|jjjod�|jpj|dkD�|jrj|dkD�|jpj
|jCdt|���d|_:|jvj
|j>|jtd�|jxj_|j>|jtd�|j{t|�y#t0$r?}|j3|�Yd}~|j j5�t7�yd}~wwxYw#|j j5�t7�wxYw)NFTrvrf)r9rri8���a,<b>Your printer has not been connected to the wireless network.</b> A valid connection to a wireless network can take up to 2 minutes. This screen will automatically refresh every %s seconds.<p>If your printer fails to connect within a reasonable time, there may be a problem with your configuration.r�r�i�z�Your printer has been connected to the wireless network and has been assinged a IP. Now run <pre>hp-setup %s</pre>  If IP is not accessible, try again for another IP.r$z�Your printer has been successfully configured on the wireless network. You may now unplug the USB cable. To setup the printer, now run <pre>hp-setup %s</pre>r�r/r:z (r8r7r��warn�critzvsa_%srr
zof %sr)?r��
BUTTON_FINISHr�r�r��SSIDLabel_2rFr�r=r�r�r�r�r�r��getIPConfigurationr�r�r�getwifiotherdetails�getVSACodes�getSignalStrengthr�getHostnamerrr	r�rX�SUCCESS_CONNECTED�SUCCESS_AUTO_IPr��appendr��REFRESH_INTERVALr"r}�startr��stop�AddressModeLabel�
HostnameLabel�IPAddressLabel�GatewayLabel�DNSLabel�SignalStrengthLabel�SignalStrengthIconr��
startswithr�queryString�zfillr�ry�
setMaximum�setValue�	PageLabel�
PageLabel2r��	ExitLabel�ExitIconr�r�)r=�ss_max�ss_min�ss_val�ss_dbm�	vsa_codes�_�addressmode�
subnetmask�gateway�pridns�sec_dnsrr_r^rHrQ�	num_pagess                  rC�showExitPagezWifiSetupDialog.showExitPage�s������=�)����"�"�5�)����$�$�T�*���� � ��T�\�\�!2�3�������)6�&������	�,�����	�

�MQ�\�\�Ml�Ml�mq�mu�mu�w{�xH�xH�NI�K����+�z�7�F�G��7�7�i�'��<�<�7�2�UY�Ua�Ua�Uu�Uu�vz�v~�v~�@D�@P�@P�VQ�R����W�f�g�{� �L�L�4�4�T�X�X�t�?O�?O�P�	�15���1O�1O�PT�PX�PX�Z^�Zj�Zj�ko�kw�kw�y}�zI�zI�2J�.������,�,�2�2�4�8�8�<���

�H�H�N�N���O��,�D�L�
�7�7�i��0�D�L���
��<�<�0�0��J�J���t�y�y�*X�[k�*k� l�ny�zA�CJ�nK�L�
M����#�#�$4�t�$;�<�
�\�\�_�
,��J�J���t�y�y�*R�SW�SZ�SZ�*Z� [�]h�ir�t{�]|�}�
~����(�(��/��O�O�&�&�u�-����"�"�$�
�J�J���t�y�y�*I�JN�JQ�JQ�*Q� R�T_�`f�ho�Tp�q�
r����(�(��/��O�O�&�&�u�-����"�"�$����!�!�)�)�$�)�)�I�*>�?��!�!�)�)�#�k�*:�;��7�7�?����&�&�t�y�y��';�<����&�&�s�4�7�7�|�4����#�#�C����L�1����!�!�#�g�,�/��
�
���c�&�k�*����"�"�4�(�� � �(�(����QW�-X�)Y�Z����)�)�+�j�6�6I�7�*S�T��	\�D�A�q���W�W�Y���=�=��(�(���9�F��]�]�6�*�(��G�<�F��]�]�6�*�(��'�:�F�)���9�F��
�
�!�!�6�#5�#5�h��Q����a��6P�#Q�SY�"Z�[�	\�"��
�
�O�	����#�#�I�.����#�#�I�a�K�0����!�!�!�$����!�!�)�A�+�.����"�"�9�Q�;�/������t�y�y��#�i�.�A�B���������t�z�z�$�/�/�:�1�=�>��
�
����
�
�4�?�?� ;�A� >�?�����#��c�
�� � ��#���H�H�N�N���O��
��
�H�H�N�N���O�s+�(E^2�2	_:�;_5�_=�5_:�:_=�=&`#c���|dz
|_|jj|j|jd�|jj|j|jd�y)Nr
r)r�r�rFr�r�r�)r=r�s  rCr|z(WifiSetupDialog.PageSpinBox_valueChanged�sU���A�#��������t�z�z�$�/�/�:�1�=�>��
�
����
�
�4�?�?� ;�A� >�?rDc�$�|j�yrM)r�rOs rCrz$WifiSetupDialog.RefreshTimer_timeout�s�����rDrfc��t�		|jj|j|j�\}}}tjd|z�tjd|z�t�t�		|jtk(rS|jj|j|j|j|j|j|�nR|jj|j|j|j|j |j|�t�y#t
$r%}|j
|�Yd}~t�yd}~wwxYw#t�wxYw#t
$r%}|j
|�Yd}~t�yd}~wwxYw#t�wxYw)NzCrypto algorithm: %szCrypto mode: %s)r�r��getCryptoSuiter�r�rrr�r�rr�	associate�wpaVersionPreferencer=�authenticationModerprN)r=�key�algrN�secretidrs      rCr�zWifiSetupDialog.associatesl����
	�
�&*�l�l�&A�&A�$�(�(�D�L\�L\�&]�#��T�8�

�I�I�,�s�2�3��I�I�'�$�.�/��O���	�
��<�<�7�*��L�L�*�*�4�8�8�T�5N�5N�PT�P\�P\�^b�^u�^u�w{�xE�xE�GJ�K��L�L�*�*�4�8�8�T�5E�5E�t�|�|�UY�U^�U^�`d�`m�`m�or�s�

�O��+�
�� � ��#��

�O��
��
�O���
�� � ��#���O��	
��
�O�sZ�4E
�0E;�B8F
�
	E8�E3�$E;�3E8�8E;�;F�
	F8�F3�$F;�3F8�8F;�;Gc	�&	�|jj�}|tk(r|j�y|tk(r�|j
j
�}|dk7r�|j
j|d�j|_tj|j�|_|j|jd�tj|j�\	}}}}}}}	}
}tj|�j!�|_|j%�y|t&k(�r�d|_d|_d|_|j.j
�}|dk7�r|j.j|d�}|���t1|j3��|_t6j9d|j4z�t;|j=t>j@��\|_!}
|
�r�|jDjGdjI|jB��|_t6j9d|j(z�|jDjGd	jI|jB��|_t6j9d
|j*z�|jDjGdjI|jB��|_t6j9d|j,z�|jDjGd
jI|jB��|_%|jDjGdjI|jB��|_&|j(j!�dk7r|jO�y|jQ�|jS�|jU�y|tVk(rUt1|jXj3��}|jQ|�|jS�|jU�y|tZk(r7|j\�|j\j_�|j_�yt6jad�y)Nrrr��None�InfrastructurezSelected network SSID: %szencryptiontype-{}zSecurity: %szcommunicationmode-{}zMode: %szsignalstrength-{}zSignal strength: %szwpaVersionPreference-{}zauthenticationMode-{}rS�
Invalid page!)1�
StackedWidget�currentIndexr�r�r�r�rTrUrqr�queryModelByURI�mq�
getWifiObjectr�r�normalizeModelNamerXr�rrrprNrHr�r	rNr=r�rrVrWr�rDr<rzrA�formatr�r�rvr��showAssociateProgressDialogr�rtrlr�r�r	r�)r=�pr�r�r�r~r�r�r�r�r�r�r�rZr�s               rCr�z"WifiSetupDialog.NextButton_clicked"sT�����+�+�-���
�?�� � �"�
�,�
��)�)�4�4�6�C��b�y�"&�"9�"9�">�">�s�A�"F�"Q�"Q��� �0�0����A����"�"�4�7�7�=�#9�:�PV�Pe�Pe�fj�fu�fu�Pv�M��%��e�V�X�t�R��#�6�6�u�=�C�C�E��
�� � �"�
�,�
�"�D�M�(�D�I��D�G��*�*�5�5�7�C��b�y��,�,�1�1�#�q�9���=�#-�a�f�f�h�#7�D�L��I�I�9�D�L�L�H�I�!*�1�6�6�"�+�+�+>�!?�J�D�F�B��(,�
�
�(9�(9�:M�:T�:T�UY�U[�U[�:\�(]��
��	�	�.�4�=�=�"@�A�$(�M�M�$5�$5�6L�6S�6S�TX�TZ�TZ�6[�$\��	��	�	�*�t�y�y�"8�9�"&�-�-�"3�"3�4G�4N�4N�t�v�v�4V�"W����	�	�"7�$�'�'�"A�B�48�M�M�4E�4E�F_�Ff�Ff�gk�gm�gm�Fn�4o��1�26�-�-�2C�2C�D[�Db�Db�cg�ci�ci�Dj�2k��/��}�}�"�"�$��.��'�'�)���� ��0�0�2��!�!�#�
�%�
%��T�-�-�2�2�4�5�C��N�N�3���,�,�.�����
�)�^��x�x�#������ ��J�J�L�
�I�I�o�&rDc��t|jd�|jd�dt|�}|j|jd��|j	t
j�|jd�|j�d}tt�D]P}|j|�tjd�tj�|j�s�Nd}n|jt�|j!�|r7|j"�|j"j!�|j!�yy)Nz9Waiting for printer to connect to the wireless network...�Cancelrz"HP Device Manager - Please wait...Fr
T)�QProgressDialogr��ASSOCIATE_DELAYrV�setWindowModalityr��WindowModal�setMinimumDuration�	forceShowr>r��QThread�sleepr[�
processEvents�wasCanceledr	r�)r=�AssociateProgressDialog�canceled�xs    rCr�z+WifiSetupDialog.showAssociateProgressDialogcs*��"1�$�)�)�<w�2x�z~�{D�{D�EM�{N�PQ�Sb�dh�#i���.�.�t�y�y�9]�/^�_��1�1�"�.�.�A��2�2�1�5��)�)�+�����'�	�A�#�,�,�Q�/��M�M�!����� �&�2�2�4����	�	 �(�(��9��%�%�'���x�x�#������ ��J�J�L�	rDc���|jj�}|tk(ri|_|j	�y|t
k(r|j
�y|tk(r|j�y|tk(rY|jj�|jj�dk7r|j�y|j�ytj!d�y)NrSr�)r�r�r�ryr�rr�rtrr�r}r�rprXrvr�r��r=r�s  rCr�z"WifiSetupDialog.BackButton_clicked}s������+�+�-������D�L���� �
�,�
�� � �"�
�%�
%�� � �"�
�)�^����"�"�$��}�}�"�"�$��.��'�'�)��$�$�&�
�I�I�o�&rDc�p�|j�|jj�|j�yrM)r�r	rOs rCr�z$WifiSetupDialog.CancelButton_clicked�s#���8�8���H�H�N�N���
�
�rDc�\�|jj|�|j|�yrM)r��setCurrentIndex�updateStepText)r=�pages  rCr�zWifiSetupDialog.displayPage�s$�����*�*�4�0����D�!rDc�<�|tk(r+|jj|jd��y|tk(r+|jj|jd��y|t
k(r+|jj|jd��yy)NzNext >�Finish�Connect)r�r�rFr�r�rY)r=�typs  rCr�zWifiSetupDialog.setNextButton�sp���+���O�O�#�#�D�I�I�h�$7�8�
�M�
!��O�O�#�#�D�I�I�h�$7�8�
�N�
"��O�O�#�#�D�I�I�i�$8�9�#rDc	��|jj|jd|dz�d|jdz����y)NzStep r
z of )�StepTextrFr�r�r�s  rCr�zWifiSetupDialog.updateStepText�s.���
�
���d�i�i�1�Q�3��
�
�a��(P�Q�RrDc	���t||jdt|j�z��|j�|jj�|j�y)Nzf<b>An I/O error occurred.</b><p>Please check the USB connection to your printer and try again.</p>(%s))rr�r�rr�r	r%s  rCrzWifiSetupDialog.showIOError�si���$��	�	�#K�NQ�RS�RW�RW�NX�#X�Y�	Z��8�8���H�H�N�N���
�
�rDc�0�tjd||�S)NrsrZr]s   rCr`zWifiSetupDialog.__tr�s���~�~�/��!�4�4rDc��||_|tk(rt|_y|tk(s	|t
k(rt|_yt|_yrM)r�r�rr��WIFI_CONFIG_CDMrrr)r=r�s  rCr�zWifiSetupDialog.getWifiObject�s8��&����*�*�#�D�L�
�O�
+�{�>R�/R�"�D�L��D�LrD�NTrM)-rarbrc�
pyqtSignalrrr�r�r�r�r�r�r�r�r�rrr�r�r�rr#rr r]r�rvrar�r�r|rr	r�r�r�r�r�r�r�r�r�rr�r�rdrDrCrsrs�s���%�<��1�F�({�%�G�+'�\-�:2�3�m�>'�B%j�P!�
!�
,�
(�
q.�h	0�2�3�Q�.�0=�'�f$�R@��'�r�N��B>'�B�4'�.�"�
!.�:�S��5�
 rDrsr�))r�r��base.gr�rrrrr�
base.codes�base.sixextr	�ui_utilsrrr
rr�PyQt5.QtCore�PyQt5.QtGui�wifisetupdialog_baserr�r�rrtr�r�r�rYr�r�r�r�r�rrrkrormrsrdrDrC�<module>r�s���.�
��8�8��#��b�b���,��
�������
�	����
�������������=1�W�=1�~�"%�,�%�p �g�y�p rD

Zerion Mini Shell 1.0