%PDF- %PDF-
Mini Shell

Mini Shell

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

�

=	f������ddlZddlZddlZddlZddl�ddlmZmZmZm	Z	ddl
mZddl�ddl
�ddlmZddlmZmZmZ	ddl�ddl�ddlmZdd	lmZdd
lmZmZ	ddlmZdZ dZ#dZ$dZ%dZ&dZ'dZ(dZ)dZ*dZ+dZ,dZ-dZ.dZ/Gd�de0�Z1d�Z2dd�Z3Gd�de4�Z5Gd�de0e�Z6y#e$rddl�ddl�ddl�Y�wwxYw#e$rd
Z e!jEd�Y�xwxYw)�N)�*)�device�utils�models�pkit)�cups�)�
pluginhandler)�
to_unicode�PY3�from_unicode_to_str)�	Ui_Dialog)�PluginDialog)�WifiSetupDialog�SUCCESS_CONNECTED)�faxTFz*Fax setup disabled - Python 2.3+ required.��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�t)|�|_|j|j,dd�|j/�|j1t3d	d
�j5|j7���|j*j8j;|j<�|j,j8j;|j>�|j$j@j;|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�CancelPushButton�languageChange�resize�QSize�
expandedTo�minimumSizeHint�clicked�connect�accept�reject�
returnPressed)�selfr"�parent�name�modal�fl�Layouts       �#/usr/share/hplip/ui5/setupdialog.pyrzPasswordDialog.__init__Qs)������v�&����5��Y�	�!B�C�D�����T�"���!�!�"�b�"�b�1����!��%�d�|�������-�-�q�!�Q��:�!'���������/�/��A�6� )�$�������)�)�)�*:�*:�;�����.�.��1�a��;�!'���������/�/��A�6� )�$�������)�)�)�*<�*<�=�����.�.��1�a��;�'��-�������*�*�A�q�1� +�D� 1�������.�.��1�5��������E�#�s�O�.�.�t�/C�/C�/E�F�G����!�!�)�)�$�+�+�6����%�%�-�-�d�k�k�:����+�+�3�3�D�K�K�@�c��|jj|�|s7|jjd�|jjd�yy)NTz'QLineEdit {background-color: lightgray})r+�setText�setReadOnly�
setStyleSheet)r>�defUser�allowUsernameEdits   rD�setDefaultUsernamez!PasswordDialog.setDefaultUsernamezsI�����%�%�g�.� ��!�!�-�-�d�3��!�!�/�/�9�
;�!rEc�H�t|jj��S�N)rr+�text�r>s rD�getUsernamezPasswordDialog.getUsername�����$�/�/�4�4�6�7�7rEc�H�t|jj��SrN)rr/rOrPs rD�getPasswordzPasswordDialog.getPassword�rRrEc��|j|jd��|jj|j|j��|j
j|jd��|jj|jd��|jj|jd��|jj|jd��y)Nz+HP Device Manager - Enter Username/Passwordz	Username:z	Password:�OK�Cancel)	�setWindowTitle�_PasswordDialog__trr'rGr"r)r.r2r3rPs rDr4zPasswordDialog.languageChange�s�������I�I�C�D�	F����$�$�T�Y�Y�t�{�{�%;�<����&�&�t�y�y��'=�>����&�&�t�y�y��'=�>����!�!�$�)�)�D�/�2����%�%�d�i�i��&9�:rEc�0�tjd||�S�N�SetupDialog��qApp�	translate�r>�s�cs   rD�__trzPasswordDialog.__tr�����~�~�m�Q��2�2rE)NNrr�TrN)	�__name__�
__module__�__qualname__rrLrQrTr4rY�rErDrrPs"��'A�R;�8�8�;�3rErc�@�	t|d�}t||�y#wxYwrN)r�	FailureUI)r"�dlgs  rD�FailureMessageUIrm�s$��
��V�T�*���#�v�����s��c���	t|d�}|dk7r|j||�|j�tjk(r |j�|j
�fS		y#wxYw)N)�ro)rrL�exec_r�AcceptedrQrT)r"�userNamerKrls    rD�showPasswordUIrs�so��

��V�T�*���t���"�"�8�->�?��9�9�;�'�*�*�*��O�O�%�s���'8�9�	
�	+�	
���	
�s�A#A)�)A+c��eZdZd�Zy)�DeviceTableWidgetItemc�\�tj||tj�||_yrN)�QTableWidgetItemr�UserType�
device_uri)r>rOrys   rDrzDeviceTableWidgetItem.__init__�s"���!�!�$��.>�.G�.G�H�$��rEN)rfrgrhrrirErDruru�s��%rEruc�x�eZdZd=d�Zd�Zd�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�Zd�Z d �Z!d!�Z"d"�Z#d#�Z$d$�Z%d%�Z&d&�Z'd'�Z(d(�Z)d)�Z*d*�Z+d+�Z,d,�Z-d-�Z.d.�Z/d/�Z0d0�Z1d>d1�Z2d2�Z3d3�Z4d4�Z5d5�Z6d6�Z7d7�Z8d8�Z9d9�Z:e;fd:�Z<d;�Z=d?d<�Z>y)@r\Nc��tj||�|j|�||_||_||_||_|rtjd|z�|j�|jr!tjd|j�nT|jr(d|_tjd|j�n tjd|j �t#j$t&�y)NzUsing device: %sr)rr�setupUi�param�jd_portry�remove�log�info�initUi�QTimer�
singleShot�showRemovePage�skip_discovery�discovery_method�showDevicesPage�showDiscoveryPager�setPasswordCallbackrs)r>r?r}r~ryrs      rDrzSetupDialog.__init__�s�������v�&����T����
����$��������H�H�'�*�4�5����
��;�;����a��!4�!4�5��"�"�()��%��!�!�!�T�%9�%9�:��!�!�!�T�%;�%;�<�� � ��0rEc��|jttdd���|jjj|j�|jjj|j�|jjj|j�|jjj|j�tjtjtj�d|_d|_|j$r|j'�d|_y|j+�|j-�|j/�t0|_y)NrrFr	)rr r!�CancelButtonr9r:�CancelButton_clicked�
BackButton�BackButton_clicked�
NextButton�NextButton_clicked�ManualGroupBox�ManualGroupBox_clicked�signal�SIGINT�SIG_DFL�faxnumberChanged�faxCompanyNameChangedr�initRemovePage�max_page�initDiscoveryPage�initDevicesPage�initAddPrinterPage�PAGE_ADD_PRINTERrPs rDr�zSetupDialog.initUi�s�����5��Y�	�!B�C�D�	
���!�!�)�)�$�*C�*C�D������'�'��(?�(?�@������'�'��(?�(?�@����#�#�+�+�D�,G�,G�H��
�
�f�m�m�V�^�^�4� %���%*��"��;�;����!��D�M��"�"�$�� � �"��#�#�%�,�D�MrEc	�
�|jjd�|jd�|jjd�d|_d|_d|_d|_|jjtj�|jjtj�|jjtj�i|_d|_d|_d|_d|_d|_t*|_|j.�rt0j3d�d|_d|_|j4j7|j.�|j8j;|j<�|jjd�|j>jd�|jA�r	d|_�nmtC||jEd	��tFjHjK|j.�}|�.|jjd�|jd��n�tFjLjK|j.�}|�>tjr.|jjd�|jOd��n�tFjPjK|j.�}|�>tjr.|jjd�|jSd��n'tC||jEd
���n
|jTr�	tGjV|jT�\	}}|_}}}}}}	|}
|j dk(rF	t0jYd�t[j\|�d}
t0jYd
|
z�|jT|||
fi|_d|_nZtjsJtjs:d|_d|_|jjd�|jd�tjdrqtjfra|jhjkdt*�|jhjkdtl�|jhjkdtn�n|jhjd�|jpjrju|jv�|jjxju|jz�|jjxju|j|�|jjxju|j~�|jjxju|j��|j�j�ju|j��|j�j�ju|j��|jjxju|j��|j��y#tZj^$rt0jYd�Y���wxYw#t`$r&t0jcd|jTz�Y���wxYw)NTFr�usb��rozSearching for device...z_<b>Device not found.</b> <p>Please make sure your printer is properly connected and powered-on.z*<b>Invalid manual discovery parameter.</b>�netz$Trying to get hostname for device...zHost name=%szFailed.z Invalid device URI specified: %szAll devices/printerszSingle function printers onlyzAll-in-one/MFP devices only)H�UsbRadioButton�
setChecked�setUsbRadioButtonr��advanced�manualr�r��NetworkRadioButton�
setEnabled�prop�	net_build�WirelessButton�ParallelRadioButton�	par_build�devices�bus�timeout�ttl�search�print_test_page�DEVICE_DESC_ALL�device_descr}r�r��ManualParamLineEditrG�JetDirectSpinBox�setValuer~�DiscoveryOptionsGroupBox�manualDiscoveryrk�_SetupDialog__trr�usb_pat�match�dev_pat�setParallelRadioButton�ip_pat�setNetworkRadioButtonry�parseDeviceURI�debug�socket�
gethostbyaddr�herror�Error�error�	fax_build�
scan_build�DeviceTypeComboBox�addItem�DEVICE_DESC_SINGLE_FUNC�DEVICE_DESC_MULTI_FUNC�AdvancedButtonr9r:�AdvancedButton_clicked�toggled�UsbRadioButton_toggled�NetworkRadioButton_toggled�WirelessButton_toggled�ParallelRadioButton_toggled�NetworkTTLSpinBox�valueChanged�NetworkTTLSpinBox_valueChanged�NetworkTimeoutSpinBox�"NetworkTimeoutSpinBox_valueChanged�ManualGroupBox_toggled�showAdvanced)r>r��back_end�is_hp�model�serial�dev_file�host�zc�portr@s           rDr�zSetupDialog.initDiscoveryPage�s!�����&�&�t�,����t�$����&�&�u�-���
����#��� !������*�*�4�>�>�:����&�&�t�~�~�6�� � �+�+�D�N�N�;����������������$���*����:�:��H�H�.�/��D�K� �D�M��$�$�,�,�T�Z�Z�8��!�!�*�*�4�<�<�8����*�*�4�0��)�)�4�4�U�;��#�#�%�&*��#��$��	�	�u�!w�x����,�,�T�Z�Z�8���$��'�'�2�2�4�8��*�*�4�0�#�N�N�0�0����<�E��(�T�^�^��0�0�;�;�D�A��3�3�D�9�!'�
�
� 3� 3�D�J�J� ?�� �,���� �3�3�>�>�t�D� �6�6�t�<�&�d�D�I�I� L�-N�O��_�_�
+��)�)�$�/�/�:�S��%���5�&�(�D�"�d����8�8�u�$�9��	�	�"H�I�%�3�3�D�9�!�<���	�	�.�4�"7�8� $���%���1E�F���&*��#�������"&�D���D�H����*�*�4�0��"�"�4�(��>�>�d�o�o��#�#�+�+�&��
9��#�#�+�+�/�1H�
J��#�#�+�+�-�/E�
G�
�#�#�.�.�u�5����#�#�+�+�D�,G�,G�H����#�#�+�+�D�,G�,G�H����'�'�/�/��+�+�	-����#�#�+�+�D�,G�,G�H�� � �(�(�0�0��,�,�	.����+�+�3�3��/�/�	1��"�"�/�/�7�7��3�3�	5����#�#�+�+�D�,G�,G�H������M"�=�=�-��	�	�)�,�-���
P��	�	�<�t���N�O�
P�s$�
.Z�
-Y/�/(Z�Z�+[
�[
c�<�|jj|�yrN)r�r��r>�checkeds  rDr�z"SetupDialog.ManualGroupBox_toggledWs���%�%�0�0�W��=rEc	�X�tj|j|j�\}}}|�rPtjd|z�tj|�\	}}}}}}	}
}}|
}
|dk(rP	tjj|
��0tjd|
z�tj|
�d}
||||
fi|_|dk(r-|jj!d�|j#d�y|dk(r=t$j&r-|j(j!d�|j+d�y|dk(r<t$j,r,|j.j!d�|j1d�yy#tjtjf$rY��wxYw)	NzFound device: %sr�z&Getting host name from IP address (%s)rr�T�parF)r�makeURIr}r~r�r�r�r�r�r�r�r�r��gaierrorr�r�r�r�r�r�r�r�r�r�r�)r>ry�sane_uri�fax_urir�r�r�r�r�r�r�r�r�r@s              rDr�zSetupDialog.manualDiscoveryZs���(.����J�J����)&�%�
�H�g���H�H�'�*�4�5��%�%�j�1�
J�H�e�S�%���4��T��D��e�|���}�}�+�+�D�1�=��	�	�D�t�K�M�%�3�3�D�9�!�<��'���t�(<�=�D�L��e�|��#�#�.�.�t�4��&�&�t�,�����$�.�.��'�'�2�2�4�8��*�*�4�0��	���$�.�.��(�(�3�3�D�9��+�+�D�1����'�
�
�v���7����s�1AF�#F)�(F)c�h�||_|jj�}|j|�yrN)r�r��	isChecked�setJetDirect)r>r��networks   rDr�z"SetupDialog.ManualGroupBox_clicked�s+������)�)�3�3�5�����'�"rEc���|jjd�|jjd�|jt�|jt�y�NFT)r�r�r��
setNextButton�BUTTON_NEXT�displayPage�PAGE_DISCOVERYrPs rDr�zSetupDialog.showDiscoveryPage�sB�����"�"�5�)����"�"�4�(����;�'�����(rEc�H�|j|_|j�yrN)r�r�rPs rDr�z"SetupDialog.AdvancedButton_clicked�s�� �M�M�)��
����rEc��|jrx|jjt�|jj|j
d��|jjttdd���y|jjt�|jj|j
d��|jjttdd���y)NzHide Advanced Options�minus�16x16zShow Advanced Options�plus)r��AdvancedStackedWidget�setCurrentIndex�
ADVANCED_SHOWr�rGr��setIconr r!�
ADVANCED_HIDErPs rDr�zSetupDialog.showAdvanced�s����=�=��&�&�6�6�}�E����'�'��	�	�2I�(J�K����'�'��k�'�7�.K�(L�M��&�&�6�6�}�E����'�'��	�	�2I�(J�K����'�'��k�&�'�.J�(K�LrEc��|jj|xr|j�|jj|xr|j�yrN)�JetDirectLabelr�r�r��r>�enableds  rDr�zSetupDialog.setJetDirect�s<�����&�&�w�'>�4�;�;�?����(�(��)@�T�[�[�ArEc���|jj|�|jj|�|jj|�|jj|�yrN)�NetworkTimeoutLabelr�r��NetworkTTLLabelr�rs  rD�setNetworkOptionszSetupDialog.setNetworkOptions�sR��� � �+�+�G�4��"�"�-�-�g�6����'�'��0����)�)�'�2rEc��|jj|�|jj|�|jj|�yrN)�SearchLineEditr�r��DeviceTypeLabelrs  rD�setSearchOptionszSetupDialog.setSearchOptions�s>�����&�&�w�/����*�*�7�3����'�'��0rEc�:�|jj|�yrN)r�r�rs  rD�setManualDiscoveryzSetupDialog.setManualDiscovery�s�����&�&�w�/rEc��|jj|�|jj|�|jjd�y�Nr)�NetworkDiscoveryMethodLabelr��NetworkDiscoveryMethodComboBoxrrs  rD�setNetworkDiscoveryzSetupDialog.setNetworkDiscovery�s>���(�(�3�3�G�<��+�+�6�6�w�?��+�+�;�;�A�>rEc�&�|j|�yrN)r��r>�
radio_enableds  rDr�z"SetupDialog.UsbRadioButton_toggled�������}�-rEc��|j|�|j|�|j|�|j|�|j	|�|r2|j
j
|jd��d|_yy)NzUSB bus ID:device ID (bbb:ddd):r��	rr�rrr�ManualParamLabelrGr�r�r�s  rDr�zSetupDialog.setUsbRadioButton�s~��� � �W��-����g�+�&����7�{�+����g�&�����(���!�!�)�)��	�	�;�<�
>��D�H�rEc�&�|j|�yrN)r�rs  rDr�z&SetupDialog.NetworkRadioButton_toggled�s���"�"�=�1rEc��|j|�|j|�|j|�|j|�|j	|�|r2|j
j
|jd��d|_yy�NzIP Address or network name:r�rr�s  rDr�z!SetupDialog.setNetworkRadioButton�sx��� � ��)����'�"����w�'����g�&�����(���!�!�)�)��	�	�7�8�
:��D�H�rEc�&�|j|�yrN)�setWirelessButtonrs  rDr�z"SetupDialog.WirelessButton_toggled�rrEc� �|j|�|j|�|j|�|j|�|j	|�|r2|j
j
|jd��d|_yyr rr�s  rDr"zSetupDialog.setWirelessButton�s���� � �W��-����g�+�&����7�{�+����'�k�*����G��,���!�!�)�)��	�	�7�8�
:��D�H�rEc�&�|j|�yrN)r�rs  rDr�z'SetupDialog.ParallelRadioButton_toggled�s���#�#�M�2rEc� �|j|�|j|�|j|�|j|�|j	|�|r2|j
j
|jd��d|_yy)NzDevice node (/dev/...):r�rr�s  rDr�z"SetupDialog.setParallelRadioButton�s��� � �W��-����g�+�&����7�{�+����'�k�*����G��,���!�!�)�)�$�)�)�4M�*N�O��D�H�rEc��||_yrN)r�)r>r�s  rDr�z*SetupDialog.NetworkTTLSpinBox_valueChanged�s	����rEc��||_yrN)r�)r>r�s  rDr�z.SetupDialog.NetworkTimeoutSpinBox_valueChanged�s	����rEc�b�|jjj|j�yrN)�
RefreshButtonr9r:�RefreshButton_clickedrPs rDr�zSetupDialog.initDevicesPage�s"�����"�"�*�*�4�+E�+E�FrEc	�B	�|jjd�|jt�d}tjt
tj��	|j�s|jr|jr|j��n�d}|jdk(r{|jdk(rd}n|jdk(rd}nd}tj!d	|j|j"|j$|j&xsd
|j(|fz�n=tj!d|j|j&xsd
|j(fz�|j(t*k(rdt,j.t0fi}n.|j(t2k(rdt,j4t0fi}ni}|jd
k(r]	ddlm}tj;�|j=t>d�tjt
tj��tEjF|jg|j"|j$||j&|��|_	tj;�|jI�|jr�|jJjd�|jLjOtQdd��tS|j�dk(r+|jTjW|jYd��n@|jTjW|jYdtS|j�z��|j[�n�|jJjd�|jLjOtQdd��tjCd|jz�|jTjW|jYd��|jdk(r?t]j^�r+ta||jYd�|jYd��|jctd�y#t@$rtjCd�Y��^wxYw#tj;�wxYw)NTror�r�mdnsr	�slp�avahizGSearching... (bus=%s, timeout=%d, ttl=%d, search=%s desc=%d, method=%s)z(None)z)Searching... (bus=%s, search=%s, desc=%d)z	scan-typer�)�
smart_install�qt4z+Failed to Import smart_install.py from base)�
net_searchr�r�z5<b>1 device found.</b> Click <i>Next</i> to continue.zX<b>%s devices found.</b> Select the device to install and click <i>Next</i> to continue.Fr�zNo devices found on bus: %szm<b>No devices found.</b><br>Click <i>Back</i> to change discovery options, or <i>Refresh</i> to search again.a�<b>HPLIP cannot detect printers in your network.</b><p>This may be due to existing firewall settings blocking the required ports.
                When you are in a trusted network environment, you may open the ports for network services like mdns and slp in the firewall. For detailed steps follow the link.
                <b>https://developers.hp.com/hp-linux-imaging-and-printing/KnowledgeBase/Troubleshooting/TroubleshootNetwork</b></p>zHP Device Manager)3r�r�r�r��QApplication�setOverrideCursor�QCursor�Qt�
WaitCursorr�r�r}r�r�r�r�r�r�r�r�r�r��operator�le�SCAN_TYPE_NONEr��gt�baser/�restoreOverrideCursor�disable�GUI_MODE�ImportErrorr�r�probeDevices�clearDevicesTabler��DevicesFoundIcon�	setPixmapr!�len�DevicesFoundLabelrGr��loadDevicesTabler�	check_lanrkr��PAGE_DEVICES)r>r��net_search_type�filter_dictr/s     rDr�zSetupDialog.showDevicesPage�s������"�"�4�(����;�'����&�&�w�r�}�}�'=�>�2	1��<�<��;�;�4�:�:��(�(�*�')�O��x�x�5�(��0�0�A�5�.4�O�!�2�2�a�7�.3�O�.5�O����!j�"&�(�(�T�\�\�4�8�8�T�[�[�E\�T\�"&�"2�"2�O�"E�"E�F����!L�"&�(�(�T�[�[�-D�H�d�FV�FV�!W�"X�Y��'�'�+B�B�'�(�+�+�~�)F�'H���)�)�-C�C�'�(�+�+�~�)F�'H��')���x�x�5�(�	8�:�
)�>�>�@�)�1�1�(�E�B�(�:�:� '��
�
� 6�8�$*�#6�#6����z�4�<�<�QU�QY�QY�7B�D�K�K�\k�$m�D�L�
�.�.�0���� ��<�<��O�O�&�&�t�,��!�!�+�+�K���,H�I��4�<�<� �A�%��&�&�.�.��I�I�U�V�X��&�&�.�.�t�y�y�n�ru�vz�wC�wC�sD�E�0F�G�
�!�!�#�
�O�O�&�&�u�-��!�!�+�+�K���,I�J��I�I�3�d�h�h�>�?��"�"�*�*�4�9�9��,A�
B��x�x�5� �U�_�_�%6��$��	�	�+H�!I��)�)�$7�8�:�
	
����&��U +�O��I�I� M�O�O��
�.�.�0�s2� E)R�
Q#�BR�#R�R�R�R�Rc
���|jjt|j��|jdk(rE|jd�|jd�|jd�|jd�g}d}n$|jd�|jd�g}d}|jj
t|��|jj|�tjtjz}t|j�D�]c\}}tj|�\	}}}}	}
}}}
}tj|	�}t!t#|�|�}|j%|�|jj'|d|�t)t#|��}|j%|�|jj'|||�|jdk(s��t)t#|��}|j%|�|jj'|d|�t)t#|j|d	��}|j%|�|jj'|d	|���f|jj+�|jj-d�|jj/d
�|jj1d�y)Nr��Modelz
IP Addressz	Host Name�
Device URIrr	rrT)�DevicesTableWidget�setRowCountrDr�r�r��setColumnCount�setHorizontalHeaderLabelsr5�ItemIsSelectable�
ItemIsEnabled�	enumeraterr�r�normalizeModelUINameru�str�setFlags�setItemrw�resizeColumnsToContents�	selectRow�setSortingEnabled�	sortItems)r>�headers�device_uri_col�flags�row�dr�r�r�r�r�r�r�r�r��model_ui�is                 rDrFzSetupDialog.loadDevicesTableRsM�����+�+�C����,=�>��8�8�u���y�y��)�4�9�9�\�+B�D�I�I�k�DZ�\`�\e�\e�fr�\s�t�G��N��y�y��)�4�9�9�\�+B�C�G��N����.�.�s�7�|�<����9�9�'�B��#�#�b�&6�&6�6������-�	;�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��x�x�5� �$�S��Y�/���
�
�5�!��'�'�/�/��Q��:�$�S����a���);�%<�=���
�
�5�!��'�'�/�/��Q��:�'	;�*	
���7�7�9����)�)�!�,����1�1�$�7����)�)�!�,rEc��|jj�|jjd�|jjd�yr)rN�clearrOrPrPs rDrAzSetupDialog.clearDevicesTablezs<�����%�%�'����+�+�A�.����.�.�q�1rEc�r�|j�g|_tjd|j�yr)rAr�r�r�r�rPs rDr*z!SetupDialog.RefreshButton_clickeds+����� �������!�T�1�1�2rEc��i|_|jjj|j�|j
jj|j�|jjj|j�|jjj|j�|jjt|j��|j
jt|j
��|jjt|j��|j j#t%t'dd���|j jj|j(�|j j+|j-d��d|_d|_d|_d|_d|_d|_y)N�folder_openr�z4Browse for an alternative PPD file for this printer.FroT)�mq�PrinterNameLineEdit�
textEditedr:�PrinterNameLineEdit_textEdited�FaxNameLineEdit�FaxNameLineEdit_textEdited�SetupPrintGroupBoxr9�SetupPrintGroupBox_clicked�SetupFaxGroupBox�SetupFaxGroupBox_clicked�setValidator�PrinterNameValidator�FaxNumberLineEdit�PhoneNumValidator�OtherPPDButtonrr r!�OtherPPDButton_clicked�
setToolTipr��printer_fax_names_same�printer_name�fax_name�fax_setup_ok�	fax_setup�print_setuprPs rDr�zSetupDialog.initAddPrinterPage�s������� � �+�+�3�3��/�/�	1�	
���'�'�/�/��+�+�	-�	
���'�'�/�/��+�+�	-����%�%�-�-�d�.K�.K�L�� � �-�-� ��!9�!9�:�	<����)�)� ��!5�!5�6�	8����+�+��d�4�4�5�	7����#�#�E�+�m�W�*M�$N�O����#�#�+�+�D�,G�,G�H����&�&��I�I�L�M�	O�',��#������
� ������ ��rEc��tj�}|jjdt�}|jjdt
�}|tkDr�|j
�tjk7r�tj|tk(|�\}}|st||jd��y|r!|j
�tjk7r@|tk(rt||jd��yt||jd��|jt�|j!�|_|j"r�|j$j'd�|j$j)d�|j*j'd�|j*j)d�|j-�|j/�nsd|_|j$j'd�|j$j)d�|j*j'd�|j*j)d�t2r�t4j6r�|jjdt8�t8t:fvr�d|_|j>jAd�|j>j)d�|jC�|_|j<r!|jE�|jG�n�d|_|j>jAd�|j>j)d�nR|j>jAd�|j>j)d�d	|_$d|_%d|_d|_&|j"s|j<r&|jO�|jQtR�ytTjWd
�|jY�y)N�pluginz
plugin-reasonzn<b>Unable to find an appropriate su/sudo utiltity to run hp-plugin.</b><p>Install kdesu, gnomesu, or gksu.</p>a	<b>The device you are trying to setup requires a binary plug-in. Some functionalities may not work as expected without plug-ins.<p> Please run 'hp-plugin' as normal user to install plug-ins.</b></p><p>Visit <u>http://hplipopensource.com</u> for more infomation.</p>z�Either you have chosen to skip the installation of the optional plug-in or that installation has failed.  Your printer may not function at optimal performance.TFzfax-typerozExiting the setup...)-r
�PluginHandleri�get�PLUGIN_NONE�PLUGIN_REASON_NONE�	getStatus�PLUGIN_INSTALLEDr�run_plugin_command�PLUGIN_REQUIREDrkr��	WarningUIr��BUTTON_ADD_PRINTER�setDefaultPrinterNamerro�setCheckabler��SendTestPageCheckBox�findPrinterPPD�	updatePPD�	print_ppd�
fax_import_okr�r��
FAX_TYPE_NONE�FAX_TYPE_NOT_SUPPORTEDr~rqr��setDefaultFaxName�
findFaxPPD�readwriteFaxInformationr|�fax_name_okr}�setAddPrinterButtonr�r�r�r��close)r>�	pluginObjr��
plugin_reason�ok�sudo_oks      rD�showAddPrinterPagezSetupDialog.showAddPrinterPage�s��!�.�.�0�	������X�{�3�������O�5G�H�
��K���"�"�$�
�(F�(F�F�"�5�5��o�-�}�>���G���d�D�I�I�I�%J�K���Y�0�0�2�m�6T�6T�T���0�!�$��	�	�3~�)�@��!�$��	�	�~�)�@�	
���-�.��5�5�7�������#�#�0�0��6��#�#�.�.�t�4��%�%�2�2�4�8��%�%�0�0��6����!��N�N��!�D�N��#�#�0�0��7��#�#�.�.�u�5��%�%�2�2�5�9��%�%�0�0��7��T�^�^������J�
�6�}�Nd�>e�e�!�D�N��!�!�,�,�T�2��!�!�,�,�T�2�!�3�3�5�D�N��~�~����!��,�,�.�!&����%�%�0�0��7��%�%�0�0��7�
�!�!�,�,�U�3��!�!�,�,�U�3��D�M�#�D��"�D�N� $�D�����t�~�~��$�$�&����-�.��H�H�+�,��J�J�LrEc�0�|j��tjd|jz�|jj|j
d��	|jjd�|jjtd��y|jj|jd�|jjd�	|jjd�y#t$rY��wxYw#t$rYywxYw)Nz0No appropriate print PPD file found for model %sz6(Not found. Click browse button to select a PPD file.)�background-color: yellowror)r�r�r�r��PPDFileLineEditrGr�rI�AttributeError�PrinterDescriptionLineEditrVrPs rDr�zSetupDialog.updatePPD�s����>�>�!��I�I�H�4�:�:�U�V�� � �(�(����3k�)l�m�
��$�$�2�2�3M�N�
�+�+�3�3�C��G�<�
� � �(�(�����):�;��+�+�3�3�B�7�
��$�$�2�2�2�6��"�
��
��"�
��
�s$�C:�D	�:	D�D�		D�Dc
�h�ttj||jd�tjdd�|jd���}|r]tjj|�r=|tj|�f|_|j�|j�yyy)NzSelect PPD File�dirs�ppdz)PPD Files (*.ppd *.ppd.gz);;All Files (*))r�QFileDialog�getOpenFileNamer��sys_confr��os�path�existsr�getPPDDescriptionr�r�r�)r>�b�ppd_files   rDrxz"SetupDialog.OtherPPDButton_clicked�s����k�9�9�$��	�	�J[�@\�:B�,�,��E�;��I�I�A�B�D�E��
������x�0�&��(>�(>�x�(H�I�D�N��N�N���$�$�&�1�8rEc��tjttj��	tj�|_d|_|jsltj|j�}tj�|_t|jdz|z�|_|jdf|_n:tj|j |j|j�|_d|jvsd|jvrd|_tj#�y#tj#�wxYw)zw
        for ubuntu 20.10 not able get ppd list from cups server.
        so fetching ppds hplip ppds directly
        ro�/�scanjet�digital_senderN)r2r3r4r5r6r�
getSystemPPDs�ppds�ppd_name�
getPpdNamer��getPPDPath1r�rVr��getPPDFile2rir<)r>�ppdNames  rDr�zSetupDialog.findPrinterPPD	s���
	�&�&�w�r�}�}�'=�>�	1��*�*�,�D�I��D�M��9�9��/�/�$�*�*�5�� �,�,�.��	� #�D�I�I��O�g�$=� >��
�"&�-�-��!4���"&�!1�!1��G�G�T�Z�Z����"4����D�J�J�&�*:�d�j�j�*H�!%���
�.�.�0��L�.�.�0�s�C5D8�8Ec�
�tjttj��	tj|j|j�\|_	}}|jrd|_
nbd|_
t||jd|z��d|_
|jjd�|jj!d�tj#�y#tj#�wxYw)NTFz^<b>Unable to locate the HPLIP Fax PPD file:</b><p>%s.ppd.gz</p><p>Fax setup has been disabled.)r2r3r4r5r6r�
getFaxPPDFilerir��fax_ppdr}rkr�r~rqr�r�r<)r>�fax_ppd_name�nicks   rDr�zSetupDialog.findFaxPPD&s����&�&�w�r�}�}�'=�>�
	1�/3�/A�/A�������0%�,�D�L�,���|�|�$(��!�$)��!��$��	�	�t�xD�D�!E�F�!&����%�%�0�0��7��%�%�0�0��7��.�.�0��L�.�.�0�s�B)C,�,Dc
��tjdg�|_tj	|j�tj�D�cgc]}|j��c}|_tj|j�\	}}}}}}}}	}
tj|jdd�jdd�d�}|}tjdg�}
|j|jvr||j|jvs||
vr�|jddj!|
D�cgc]	}||vs�|��c}�z�}t"j%||j'�|t"j(t"j*zt"j,�t"j(k(rQd}	|d
|zz}||
vr<|j|jvs||j|jvr	|d
|zz
}n|dz
}�Nd|_yd	|_|j0j3|�tj	|�||_y	cc}wcc}w)
N�hp�seriesro�Series�_z�<b>One or more print queues already exist for this device: %s</b>.<br> <b>Would you like to install another print queue for this device ?</b>�, rT�_%dr	F)r�getSupportedCUPSDevices�installed_print_devicesr�r�r�getPrintersr@�installed_queuesr�ryr�xstrip�replace�getSupportedCUPSPrinterNamesr��join�QMessageBox�warning�windowTitle�Yes�No�NoButton�printer_name_okrjrGr{)r>�pr�r�r�r�r�r�r�r�r��
default_modelr{�installed_printer_names�printer�	warn_textrc�ts                  rDr�z!SetupDialog.setDefaultPrinterName7sP��'-�'E�'E�t�f�'M��$��	�	�$�.�.�/�15�1A�1A�1C� D�A���� D���HN�H]�H]��O�O�I�E��%��e�V�X�t�R�����U�]�]��b�&�!�'�(�B�/��6�
�%��"(�"E�"E�t�f�"M���O�O�t�;�;�;��PT�Pl�Pl�mq�m|�m|�P}�@}��6�6��	�	�#r�"&�)�)�D[�,w��_k�ov�_v�W�,w�"x�#y�z�I��#�#�D�$(�$4�$4�$6�$-�$/�O�O�$/�N�N�%3�$/�$8�$8�:�
>I�_�_�M����$�u�q�y�0�A��!8�8�t���VZ�Vr�Vr�?r�vw�@D�@\�@\�]a�]l�]l�@m�wm�$���	�1�����F�A��(-��$��#���� � �(�(��6��	�	�,��(�����I!E��-xs�I
�5	I�?Ic
�`�tjdg�|_tj	|j�|j
j
dd�|_tj|j�\	}}}}}}}}}	tj|j
dd�j
dd�d�}
|
dz}tjdg�}|j|jvr||j|jvs||vr�|jd	d
j|D�
cgc]	}
||
vs�|
��c}
�z�}tj||j!�|tj"tj$ztj&�tj"k(rQd}	|d
|zz}||vr<|j|jvs||j|jvr	|d
|zz
}n|dz
}�Nd|_yd|_|j*j-|�||_ycc}
w)N�hpfaxzhp:zhpfax:r�ror�r��_faxz�<b>One or more fax queues already exist for this device: %s</b>.<br> <b>Would you like to install another fax queue for this device ?</b>r�rTr�r	F)rr��installed_fax_devicesr�r�ryr�r�r�rr�r�r�r�r�r�r�r�r�r�r�rmrGr|)r>r�r�r�r�r�r�r�r�r�r�r|�installed_fax_names�
fax_devicer�rcr�s                 rDr�zSetupDialog.setDefaultFaxNameas4��%+�%C�%C�W�I�%N��"��	�	�$�,�,�-����.�.�u�h�?���HN�H]�H]��L�L�I�E��%��e�V�X�t�R�����U�]�]��b�&�!�'�(�B�/��6�
�!�6�)��$�A�A�7�)�L���L�L�D�6�6�6�8�t�Ga�Ga�bf�bn�bn�Go�;o��.�.��	�	�\��	�	�8K�f�*�x�[e�Oe�:�f�g�h�i�I��#�#�D�$(�$4�$4�$6�$-�$/�O�O�$/�N�N�%3�$/�$8�$8�:�
>I�_�_�M���� �5�1�9�,�A��!4�4�4�<�<�t�Oi�Oi�;i�mn�vz�wQ�wQ�RV�R^�R^�w_�n_� �E�A�I�-�����F�A��$)�� ��������$�$�X�.� ��
���+gs�(	H+�2H+c�P�t|�|_d|_|js3|jj	|jd��d|_�n0|j|jk(r]|jd�}|jj	|�|jj	|�d|_d|_d|_	n�|j|jvr2|jj	|jd��d|_np|jrd|j|jk7rKd|_	d|_|jjtd�|jj��|j�|j�y)NTz&You must enter a name for the printer.F�OThe printer name and fax name must be different. Please choose different names.zHA printer already exists with this name. Please choose a different name.ztextEdited(const QString &))rr{r�rjryr�r|rmr�rzr��emit�SIGNALrO�
setIndicatorsr��r>r�ras   rDrlz*SetupDialog.PrinterNameLineEdit_textEdited�sa��&�q�M���#���� � ��$�$�/�/��	�	�B�C�
E�#(�D� �
�]�]�d�/�/�
/��	�	�a�c�A��$�$�/�/��2�� � �+�+�A�.�$�D��#(�D� �*.�D�'�
�
�
�$�"7�"7�
7��$�$�/�/��	�	�Z�1\�
]�#(�D� �
�
(�
(��}�}�� 1� 1�1�.3��+�'+��$��$�$�)�)�&�1N�*O�*.�*>�*>�*C�*C�*E�G�	
����� � �"rEc�P�t|�|_d|_|js3|jj	|jd��d|_�n0|j|jk(r]|jd�}|jj	|�|jj	|�d|_d|_d|_	n�|j|jvr2|jj	|jd��d|_np|jrd|j|jk7rKd|_	d|_|jjtd�|jj��|j�|j�y)NTzYou must enter a fax name.Fr�zDA fax already exists with this name. Please choose a different name.ztextEdited(const QString&))rr|r�rmryr�r{rjr�rzr�r�r�rOr�r�r�s   rDrnz&SetupDialog.FaxNameLineEdit_textEdited�s[��"�1�
��
�����}�}�� � �+�+��	�	�6�7�
9�$�D��
�]�]�d�/�/�
/��	�	�a�c�A��$�$�/�/��2�� � �+�+�A�.�#(�D� �$�D��*.�D�'�
�]�]�d�3�3�
3�� � �+�+�D�I�I�V�-X�
Y�$�D��
�
(�
(��}�}�� 1� 1�1�.3��+�#'�� ��(�(�-�-�f�5Q�.R�.2�.F�.F�.K�.K�.M�O�	
����� � �"rEc�2�|jj�s7|jjd�|jj	d�n6|jjd�|jj	d�|j�yr�)ror�r�r�r�r�rPs rDrpz&SetupDialog.SetupPrintGroupBox_clicked�sp���&�&�0�0�2��%�%�2�2�5�9��%�%�0�0��7��%�%�2�2�4�8��%�%�0�0��6�� � �"rEc�$�|j�yrN)r�rPs rDrrz$SetupDialog.SetupFaxGroupBox_clicked�s��� � �"rEc� �|jrA|jjtd��	|jj	d�n	|jj	d�|jrA|jjtd��	|jj	d�y	|jj	d�y#t
$rY�uwxYw#t
$rY��wxYw#t
$rYywxYw#t
$rYywxYw)Nror�)r�rjryrVrIr�r�rmrPs rDr�zSetupDialog.setIndicators�s�������$�$�/�/��B��8�
��(�(�6�6�r�:�
��(�(�6�6�.�0�
���� � �+�+�C��G�4�
��(�(�6�6�r�:�
��(�(�6�6�.�0��#"�
��
��"�
��
��"�
��
��"�
��
�sG�C�C#�C2�8D�	C �C �#	C/�.C/�2	C>�=C>�	D
�D
c���|jdk(r�tjjd�s�ddlm}ddlm}	|jdd��}tjd	�tj|�|jjd
d�}tjd�tj|�|D]G}||j�|j�k(r tjd
�|d|_
�Gy	|j$j'�s|j(j'�r`|j*j-|j.xr|j0xr|j2duxs|j4xr|j6�y|j*j-d�y#t$r.}|t_tj!d|z�t"�d}~wwxYw)z�
        If the device is on usb and os doesn't supports ipp-usb we assign new ipp uri to the printer.
        this is for driverless usb printer held by ippusbxd service on ubuntu 20 and above.
        For network devices follow the old code.
        r�z/usr/share/ipp-usb/quirksr)�local)�detectLocalDevicesr��
)r�r�z  Detected devices from local.py r�� z current pritner is: z%Assign ipp URI to the current printer�printer_uriNz*An error occured during network probe.[%s]F)r�r�r��isdirr;r��
base.localr�r�r�r�r��lowerryr�r�r��ERROR_INTERNALror�rqr�r�rr�r�r~r�)r>r�r��detected_devices�current_printer�key�socket_errors       rDr�zSetupDialog.setAddPrinterButton�s����8�8�u��R�W�W�]�]�3N�%O�"�5�
%�#(�#;�#;��2�#;�#N� ��	�	�<�=��	�	�*�+�"&�*�*�"4�"4�S�#�">���	�	�1�2��	�	�/�*�+��C�'��,�2�2�4��8M�8M�8O�O��	�	�"I�J�*:�=�*I����
��"�"�,�,�.�$�2G�2G�2Q�2Q�2S��O�O�&�&��(8�(8�(p�T�=Q�=Q�(p�VZ�Vd�Vd�lp�Vp�(M�(,���(K�4�;K�;K�
N�
�O�O�&�&�u�-���
%�+����	�	�@�<�O�Q�$�$��	
%�s�C
F<�
F<�<	G3�)G.�.G3c�R�|jr�|j�}|tjk(s&|tjk(s|tj
k(r	|tjk(r|j�|jr|j�|jr�|j�tjk(r�|jj�|jk7rd|_|j j�|j"k7rd|_|js|j$rat'|j j��|_t'|jj��|_|j)d�|j+�y)NTF)r�setupPrinterr�
IPP_FORBIDDEN�IPP_NOT_AUTHENTICATED�IPP_NOT_AUTHORIZED�IPP_OK�
flashFirmwarer��
printTestPager~�setupFaxrurO�
fax_numberr��NameCompanyLineEdit�fax_name_companyr�rr�r�)r>�	print_stss  rD�
addPrinterzSetupDialog.addPrintersB������)�)�+�I��D�.�.�.�)�t�?Y�?Y�2Y�]f�jn�kB�kB�^B���D�K�K�'��"�"�$��#�#��"�"�$��>�>��}�}��$�+�+�-��)�)�.�.�0�D�O�O�C�,0�D�)��+�+�0�0�2�d�6K�6K�K�15�D�.��(�(�D�,F�,F�,6��0�0�5�5�7�-9�D�)�&0��1G�1G�1L�1L�1N�&O�D�O��0�0��7��
�
�rEc��|jjdd�rr	tj|j�}|j�rtjd�nt||jd��|j�yy#t$r@}t||jd|j�d|j�d���Yd}~yd}~wwxYw)Nzfw-downloadFzFirmware download successful.
z#<b>Firmware download is Failed.</b>z<<b>Error opening device. Firmware download is Failed.</b><p>� (�).)rir�r�Devicery�downloadFirmwarer�r�rkr�r�r��msg�opt�r>ra�es   rDrzSetupDialog.flashFirmware:s����7�7�;�;�}�e�,�
��M�M�$�/�/�2��
�%�%�'��H�H�>�?��d�D�I�I�=�%?�@����	�-���
n��$��	�	�^_�^c�^c�ef�ej�ej�k�!m�n�n��
n�s�B�	C�6C�Cc���tj}tjt	t
j��	tjj|jd�sGt|j�|j|jd|jd|jf}nFt|j�|j|j|jdd|jf}tj tj"t$d|g|���\}}t&j)t+j,dg��|tj.k7r3tj1�t3||j5d|z��n/t7j8t:|j|j�tj1�|S#tj1�wxYw)Nrror0r�z0<b>Printer queue setup failed.</b> <p>Error : %s)r�IPP_BAD_REQUESTr2r3r4r5r6r�r�r�r�r
r{ry�print_location�
print_desc�cups_operationrr>r�r�rr�rr<rkr�r�	sendEvent�EVENT_CUPS_QUEUES_ADDED)r>�status�
add_prnt_args�
status_strs    rDr�zSetupDialog.setupPrinterMsv���%�%���&�&�w�r�}�}�'=�>�	1��7�7�>�>�$�.�.��"3�4�!4�T�5F�5F�!G����!%�!4�!4�b�$�.�.��:K�T�_�_�!^�
�"5�T�5F�5F�!G����!%�!4�!4�d�n�n�Q�6G��T�_�_�!^�
�"&�!4�!4�����5�$�"H�9F�"H��F�J��I�I�f�4�4�d�V�<�=�����$��2�2�4��$��	�	�F��S�!U�V���� 7� $����1B�1B�D�
�.�.�0��
��
�.�.�0�s�FG�G/c��tj}tjt	t
j��	tjj|j�sPtj|j|j|jd|j|j�\}}nOtj|j|j|j|jd|j�\}}t j#t%j&dg��|tj(k7r3tj+�t-||j/d|z��n/t1j2t4|j|j�tj+�|S#tj+�wxYw)Nror�z+<b>Fax queue setup failed.</b><p>Error : %s)rrr2r3r4r5r6r�r�r�r�rr|r��fax_location�fax_descr�r�rr�rr<rkr�rrr)r>rrs   rDrzSetupDialog.setupFaxjsN���%�%���&�&�w�r�}�}�'=�>�	1��7�7�>�>�$�,�,�/�%)�_�_�T�]�]�59�\�\�4�CT�CT�VX�Z^�Zf�Zf�im�iv�iv�&x�"��
�&*�_�_�T�]�]�59�\�\�4�CT�CT�VZ�Vb�Vb�df�hl�hu�hu�&w�"��
�
�I�I�f�4�4�g�Y�?�@�����$��2�2�4��$��	�	�A�J�N�!P�Q���� 7� $���d�m�m�=�
�.�.�0��
��
�.�.�0�s�E&F:�:Gc���	tjttj��tj|jd��}		|j�	d}d}	|dz
}	|r>	t|j��|_t|j��|_
n�|j!�dk(r\d}	t#|�\}}|dk(s|dk(r&	|j%�tj'�y|j)||�}|dk7rd	}�Y	|j*r|j-|j�|j.r|j1|j�d}	|j%�|rL|rJ|jLjO|j�|jPjO|j�	tj'�y#tjd�d|_d|_
Y��xYw#t2$r�|j5d
�}	tj7t|	��t8j;||j=�|	t8j>t8j@zt8jBzt8jDzt8jF�t8jBk(rY��`tHjKd�d}|d
kDrY��YnwxYw���#|j%�wxYw#t2$r�|j5d�}	tj7t|	��t8j;||j=�|	t8j>t8j@zt8jBzt8jDzt8jF�t8jBk(rY���YnwxYw���#tj'�wxYw)NT)�disable_dbusrr	zIO Errorroz/Enter the printer's username password password
��zPInvalid Username or Password!.
Rernter the printer's username password password
zP<b>Device I/O Error</b><p>Could not communicate with device. Device may be busy.r�F�zMUnable to communicate with the device. Please check the device and try again.))r2r3r4r5r6r�getFaxDevicer��openr�getPhoneNumr�getStationNamerr�r��isAuthRequiredrsr�r<�getCDMTokenr��setStationNamer��setPhoneNumr�r�r�r��criticalr��Retry�DefaultrW�Escaper��time�sleeprurGr)
r>�readra�triesr��
promptText�username�password�respCode�
error_texts
          rDr�z#SetupDialog.readwriteFaxInformation�sn��\	1��*�*�7�2�=�=�+A�B�� � ����D�A�A��S��F�F�H�>"� !��!��"�!�Q�J�E�4&�#'�%C�:D�Q�]�]�_�:U���@J�1�K[�K[�K]�@^��(=�()�'7�'7�'9�T�'A�5g�
�.2�AO�0:�B<�,>�H�h�/7�2�~��R��06�H���	�
�.�.�0�Y89�}�}�08�(�8D�H�/7�3��>R�
�08�,1�'+�'A�'A�()�(8�(8��9N�9N�(O�'+�'<�'<�()�
�
�d�o�o�(F�,&*�� %����	��d��.�.�6�6�t���G��0�0�8�8��9N�9N�O��
�.�.�0��s%C�(+�	�	�*�(=�:<���@B��(=��*$)�*�-1�Y�Y�$v�.x�
� #�	�	�*�Z�*@� A�#.�#7�#7��8<�8H�8H�8J�8B�8C�8I�8I�K�L_�L_�8_�8C�8J�8J�9K�MX�M_�M_�9`�8C�8L�8L�$N�
R]�Qc�Qc�$d�%*� $�
�
�1�
�%*��#(�2�:�$)�$.�!*��E#��t���	��W�
�!%���g�"i�J��I�I�j��4�5�"�+�+�D�,0�,<�,<�,>�,6�,7�,=�,=��@S�@S�,S�,7�,>�,>�-?�AL�AS�AS�-T�,7�,@�,@�B�
FQ�EW�EW�X��
X�	
����n
�.�.�0�s��AO�L	�"
K4�-H�0<G!�,/H�O�A)H�*K4�-AO�!%H�H�B?K/�
K4�
K/�)K4�.K/�/K4�4L�O�	B?O�O�
O�O�O)c��	tj|j�}	|j�|j	�r-|j�	|j
|j�yt||jd��|j�y#t$rr}|jtk(rt||jd��n9t||jd|j|jfz��Yd}~yYd}~yd}~wwxYw#t$rt||jd��YywxYw#t$r@}t||jd|j�d|j�d���Yd}~yd}~wwxYw)NzZ<b>No CUPS queue found for device.</b><p>Please install the printer in CUPS and try again.z6<b>Printer Error</b><p>An error occured: %s (code=%d).zn<b>Printer Error.</b><p>Printer is busy, offline, or in an error state. Please check the device and try again.zG<b>Unable to print to printer.</b><p>Please check device and try again.z<b>Device error:</b><p>r
r)rrryr$�isIdleAndNoErrorr�rr{r�r�$ERROR_NO_CUPS_QUEUE_FOUND_FOR_DEVICErkr�rrs   rDrzSetupDialog.printTestPage�se��	��
�
�d�o�o�.�A�
�����
�%�%�'��G�G�I�l�����(9�(9�:��d�D�I�I�I�%J�K��G�G�I��!�l��5�5�$H�H�%�d�D�I�I� |�-~��&�d�D�I�I� X�\]�\a�\a�cd�ch�ch�[i� i�-k�l�l���l���
`��$��	�	�]�!_�`�
`���	E��d�D�I�I�56�U�U�A�E�E�B�D�
E�
E��	E�sA�E�D�B�	D�$A#D�D�$E�?E�	F�6F�Fc��yrNrirPs rDr�zSetupDialog.initRemovePages��rEc
�$�|jt�|jj|j	d��|jt�|jjd�|jjd�|jj�j�tjddg�|_t j#|j�|js,t%||j	d��|j'�y|jj)t+|j��|j	d�|j	d�|j	d�|j	d	�g}|jj-t+|��|jj/|�t0j2t0j4z}d
}|jD�]�}t7|j�}|j8j;|j<�|jj?|d
|�tj@|jB�\	}}}}	}
}}}
}|jB�8|jB|jBk(r|jEt0jF�tItK|jL��}|jO|�|jQt0jR|jL�|jjU|d|�|dk(r|j	d�}n|j	d
�}tI|�}|jO|�|jjU|d|�tItK|jB��}|jO|�|jjU|d|�|dz
}���|jjW�y)NzStep 1 of 1Fr�r�zr<b>No printers or faxes found to remove.</b><p>You must setup a least one printer or fax before you can remove it.�SelectzPrinter (Queue) Name�TyperMrr	�Fax�Printerrr),r��PAGE_REMOVE�StepTextrGr�r��
BUTTON_REMOVEr�r�r��RemoveDevicesTableWidget�verticalHeader�hider�getSupportedCUPSPrinters�installed_printersr�r�rkr�rOrDrPrQr5rRrS�	QCheckBox�stateChangedr:�CheckBox_stateChanged�
setCellWidgetr�ry�
setCheckState�CheckedrwrVr@rW�setData�UserRolerXrY)r>r]r_r`r��widgetr�r�r�r�r�r�r�r�r�rc�typs                 rDr�zSetupDialog.showRemovePage
s������%��
�
���d�i�i�
�6�7����=�)����"�"�5�)����"�"�5�)��%�%�4�4�6�;�;�=�"(�"A�"A�BF��CQ�#R����	�	�$�)�)�*��&�&��d�D�I�I�E�F�
G��J�J�L���%�%�1�1�#�d�6M�6M�2N�O��9�9�X�&��	�	�"�)$�%)�Y�Y�v�%6��	�	�,�8O�Q��	
�%�%�4�4�S��\�B��%�%�?�?��H��#�#�b�&6�&6�6�����(�(�	�A��t�<�<�=�F����'�'��(B�(B�C��)�)�7�7��Q��G��%�%�a�l�l�3�
J�H�e�S�%���4��T����*�t���!�,�,�/N��$�$�R�Z�Z�0� ��Q�V�V��-�A�
�J�J�u��
�I�I�b�k�k�1�6�6�*��)�)�1�1�#�q�!�<��7�"��i�i��&���i�i�	�*�� ��%�A�
�J�J�u���)�)�1�1�#�q�!�<� ��Q�\�\�!2�3�A�
�J�J�u���)�)�1�1�#�q�!�<��1�H�C�;	�>	
�%�%�=�=�?rEc�>�t|jj��D]\}|jj|d�}|j	�t
jk(s�A|jjd�y|jjd�y)NrTF)	�rangerD�rowCount�
cellWidget�
checkStater5rNr�r�)r>rcr`rQs    rDrKz!SetupDialog.CheckBox_stateChangedHs{����6�6�?�?�A�B�	.�C��2�2�=�=�c�1�E�F�� � �"�b�j�j�0����*�*�4�0��		.�
�O�O�&�&�u�-rEc
��|jj�}|tk(�r�|jj	�|_t
|jj��|_	|jj�|_t
|jj��|_t|j j#|j j���d|_|j&j�|_|j*j	�rPt-|dd��}|j/�|j0t2k(rd|_|j4|_	d|_|j*j	�s|j9�yy|t:k(r�|j<j?�}|j<jA|d�jB|_!tEjF|jB�|_$tEjJ|jB�\	}}}}}}	}
}}tMjN|�jQ�|_)|jU�y|tVk(�r2|jXj	�|_-|j\j	�|_/|j`j	�|_1tet
|jfj���|_4tet
|jjj���|_6tet
|jnj���|_8tet
|jrj���|_:|jw�y|txk(�r�t{|j|j��D�]u}|j|j�|d�}
|
j��t�j�k(s�B|j|jA|d�}t
t�|j�t�j����}tEj�|�}t�j�d|z�t�j�t�j�t�d||�\}}|t�j�k7r^t�||j�d	|�d
|����|t�j�k(s(|t�j�k(s|t�j�k(s��Ynt�j�t�||���x|j��yt�j�d�y)NrF)ry�
standaloneTr�r	zRemoving printer: %sr0z<b>Unable to delete 'z' queue. </b><p>Error : �
Invalid page!)Y�
StackedWidget�currentIndexr�r�r�r�rr�rOr}r��valuer~r
r��	value_intr��itemDatar�rr�r�rrp�successr�hnr�r�rHrN�
currentRow�itemryr�queryModelByURIrir�r�normalizeModelNamer�r�r�r�r�r�rorrqr~r
�PrinterLocationLineEditrr�r�FaxDescriptionLineEditr�FaxLocationLineEditrrrArTrDrUrVrWr5rN�	value_str�datarP�getDeviceURIByPrinterNamer�r�rr�
delPrinterr>rrkr�r�r�r�rr�EVENT_CUPS_QUEUES_REMOVEDr�r�)r>r�rlr`r�r�r�r�r�r�r�r�r�rQrcr��urirrs                   rDr�zSetupDialog.NextButton_clickedUs>�����+�+�-������-�-�7�7�9�D�K�#�D�$<�$<�$A�$A�$C�D�D�J��0�0�6�6�8�D�L�$�T�%8�%8�%=�%=�%?�@�D�K�(��)@�)@�)I�)I��'�'�4�4�6�*8� 9�9:� <�D��$(�$G�$G�$T�$T�$V�D�!��"�"�,�,�.�%�d�t��N���	�	���;�;�"3�3�"&�D�K�!$���D�J�$�D�H��&�&�0�0�2��$�$�&�3��,�
��)�)�4�4�6�C�"�5�5�:�:�3��B�M�M�D�O��,�,�T�_�_�=�D�G�LR�La�La����M!�I�H�e�S�%���4��T��2�2�5�9�?�?�A�D�J��#�#�%�
�"�
"�#'�#<�#<�#F�#F�#H�D� �#�6�6�@�@�B�D��!�2�2�<�<�>�D�N�"5��4�7�7�<�<�>�?�#A�D��1��4�:�:�?�?�A�B�D�D�O�/��4�6�6�;�;�=�>�@�D�M� 3��4�3�3�8�8�:�;�!=�D��
�O�O��
�+�
��T�:�:�C�C�E�F�
E���6�6�A�A�#�q�I���$�$�&�"�*�*�4��8�8�=�=�c�1�E�D�(��4�9�9�R�[�[�3I�)J�K�G� �:�:�7�C�C��I�I�4�w�>�?�)-�)<�)<�����5�$��*I�&�F�J�����,�!�$��	�	�SZ�\f�g�)i�j�!�T�%7�%7�7�6�T�E_�E_�;_�ci�mq�nE�nE�dE�!����5�s�G�E�#
E�(
�J�J�L�
�I�I�o�&rEc���|jj�}|tk(ri|_|j	�y|t
k(r|j
�ytjd�y)NrZ)	r[r\rHr�r�r�r�r�r��r>r�s  rDr�zSetupDialog.BackButton_clicked�sT�����+�+�-������D�L��"�"�$�
�"�
"�� � �"�
�I�I�o�&rEc�$�|j�yrN)r�rPs rDr�z SetupDialog.CancelButton_clicked�s���
�
�rEc�\�|jj|�|j|�yrN)r[r�updateStepText)r>�pages  rDr�zSetupDialog.displayPage�s$�����*�*�4�0����D�!rEc��|tk(r+|jj|jd��y|tk(r+|jj|jd��y|t
k(r+|jj|jd��y|tk(r+|jj|jd��yy)NzAdd PrinterzNext >�Finish�Remove)r�r�rGr�r��
BUTTON_FINISHrC)r>rRs  rDr�zSetupDialog.setNextButton�s����$�$��O�O�#�#�D�I�I�m�$<�=�
�K�
��O�O�#�#�D�I�I�h�$7�8�
�M�
!��O�O�#�#�D�I�I�h�$7�8�
�M�
!��O�O�#�#�D�I�I�h�$7�8�"rEc	��|jj|jd|dz�d|jdz����y)NzStep r	z of )rBrGr�r�rps  rDrszSetupDialog.updateStepText�s5���
�
���d�i�i� ��s�D�M�M�!�O�)5�6�	7rEc�0�tjd||�Sr[r]r`s   rDrczSetupDialog.__tr�rdrE)NFrerN)?rfrgrhrr�r�r�r�r�r�r�r�r�rrrrr�r�r�r�r�r"r�r�r�r�r�r�rFrAr*r�r�r�rxr�r�r�r�rlrnrprrr�r�rrr�rr�rr�r�rKr�r�r�r�rxr�rsr�rirErDr\r\�sE��1�:-�0m�^>�$�L#�
)��M�B�3�1�
0�?�
.�
�2�
�.�
�3�	���G�U'�n&-�P2�
3�!�>B�H�&	'�1�:1�"(�T'�R #�D #�D#�#��6".�P�:
�&�:�6]1�~�F
�<@�|.�G'�R
'��"�!.�9�7�3rEr\)NT)7r�r7�
subprocessr��base.gr;rrrr�prntr�
base.codes�ui_utils�	installerr
�base.sixextrrr
�PyQt5.QtCore�PyQt5.QtGuir?�PyQt5.QtWidgets�setupdialog_baser�plugindialogr�wifisetupdialogrrrr�r�r�r�rHr�rAr�rxr�rCrrr�r�r�rrrmrsrwrur\rirErD�<module>r�s��.���
��,�,����#�<�<�"���(�&�?�>���M������������
����
��
��
�������A3�W�A3�H
�
� %�,�%�N3�'�9�N3��U�"���!�"���>��M��K�K�<�=�>�s$�
B.�"C�.C�C�C#�"C#

Zerion Mini Shell 1.0