%PDF- %PDF-
Mini Shell

Mini Shell

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

�

=	f�;��6�ddlZddlZddl�ddlmZmZddlmZddl�ddl	�ddl
mZddl�ddl
�ddl�ddlmZddlmZej(Zer	dd	lmZesej3d�Gd�d
e�Zd�Zdd�ZGd�dee�Zy#e$rd
ZY�;wxYw)�N)�*)�device�utils)�cups�)�
to_unicode)�	Ui_Dialog)�DEVICEURICOMBOBOX_TYPE_FAX_ONLY)�faxFz
Fax disabled.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��i��)!�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/faxsetupdialog.pyrzPasswordDialog.__init__8s)������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)r7�defUser�allowUsernameEdits   r=�setDefaultUsernamez!PasswordDialog.setDefaultUsernameasI�����%�%�g�.� ��!�!�-�-�d�3��!�!�/�/�9�
;�!r>c�H�t|jj��S�N)rr$�text�r7s r=�getUsernamezPasswordDialog.getUsernameh����$�/�/�4�4�6�7�7r>c�H�t|jj��SrG)rr(rHrIs r=�getPasswordzPasswordDialog.getPasswordkrKr>c��|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 r@rr"r'r+r,rIs r=r-zPasswordDialog.languageChangens�������I�I�C�D�	F����$�$�T�Y�Y�t�{�{�%;�<����&�&�t�y�y��'=�>����&�&�t�y�y��'=�>����!�!�$�)�)�D�/�2����%�%�d�i�i��&9�:r>c�0�tjd||�S)N�SetupDialog��qApp�	translate�r7�s�cs   r=�__trzPasswordDialog.__trws���~�~�m�Q��2�2r>)NNrr)TrG)	�__name__�
__module__�__qualname__rrErJrMr-rR�r>r=r
r
7s"��'A�R;�8�8�;�3r>r
c�@�	t|d�}t||�y#wxYwrG)r
�	FailureUI)r�dlgs  r=�FailureMessageUIrc{s$��
��V�T�*���#�v�����s��c���	t|d�}|dk7r|j||�|j�tjk(r |j�|j
�fS		y#wxYw)N)�re)r
rE�exec_r�AcceptedrJrM)r�userNamerDrbs    r=�showPasswordUIri�so��

��V�T�*���t���"�"�8�->�?��9�9�;�'�*�*�*��O�O�%�s���'8�9�	
�	+�	
���	
�s�A#A)�)A+c��eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zdd�Zd�Zd�Zd�Zdd�Zy)�FaxSetupDialogc�~�tj||�|j|�||_|j	�d|_d|_d|_d|_t�|_
|jj�|jj�tjd|j�y)NreTr)rr�setupUi�
device_uri�initUi�dev�
fax_number�fax_company_name�call_password_ui�UserSettings�
user_settings�load�debug�QTimer�
singleShot�updateUi)r7r8rns   r=rzFaxSetupDialog.__init__�s�������v�&����T��$������
������� "��� $���)�^��������!���� � �"����!�T�]�]�+r>c�"�|jjj|j�|jjj|j
�|jjj|j�|jjj|j�|jjt�tjtjtj�|j!t#t%dd���|j&r%|jj)|j&�|j*j-d�|j.j-d�|j.j1t3|j.��|j4j-d�|j4j1t3|j4��|j6j-d�t9|j.j;��|_t9|j*j;��|_	|j4j@j|jB�|j4jDdj|jF�|j6j@j|jH�|j6jDdj|jJ�|jLjNtPj|jR�d|_*d|_+d|_,d|_-y)Nrr�2zconst QString &F).�CancelButtonr2r3�CancelButton_clicked�SaveBtn�SaveBtn_Clicked�FaxComboBox�DeviceUriComboBox_noDevices�FaxComboBox_noDevices� DeviceUriComboBox_currentChanged�FaxComboBox_currentChanged�setTyper
�signal�SIGINT�SIG_DFLrrrrn�setInitialDevice�NameCompanyLineEdit�setMaxLength�FaxNumberLineEdit�setValidator�PhoneNumValidator�VoiceNumberLineEdit�
EmailLineEditrrHrqrr�editingFinished�#VoiceNumberLineEdit_editingFinished�textChanged�VoiceNumberLineEdit_textChanged�EmailLineEdit_editingFinished�EmailLineEdit_textChanged�	tabWidget�currentChanged�int�Tabs_currentChanged�name_company_dirty�fax_number_dirty�voice_number_dirty�email_dirtyrIs r=rozFaxSetupDialog.initUi�s������!�!�)�)�$�*C�*C�D������$�$�T�%9�%9�:����4�4�<�<��&�&�	(����9�9�A�A��+�+�	-���� � �!@�A��
�
�f�m�m�V�^�^�4�	
���5��Y�	�!B�C�D��?�?����-�-�d�o�o�>�� � �-�-�b�1����+�+�B�/����+�+��d�4�4�5�	7�� � �-�-�b�1�� � �-�-��d�6�6�7�	9����'�'��+�$�T�%;�%;�%@�%@�%B�C��� *�4�+C�+C�+H�+H�+J� K���	�	
� � �0�0�8�8��4�4�	6�	
� � �,�,�->�?�G�G��0�0�	2�	
���*�*�2�2��.�.�	0�	
���&�&�'8�9�A�A��*�*�	,�	
���%�%�c�*�2�2�4�3K�3K�L�"'��� %���"'��� ��r>c�r�ts,t||jd��|j�y|jj�|jjd�t|jj��|_t|jj��|_
y)Nz�<b>PC send fax support is not enabled.</b><p>Re-install HPLIP with fax support or use the device front panel to send a fax.</p><p>Click <i>OK</i> to exit.</p>r)�fax_enabledra�_FaxSetupDialog__tr�closer�rzr��setCurrentIndexrr�rHrqr�rrrIs r=rzzFaxSetupDialog.updateUi�s�����d�D�I�I�q�r�
s��J�J�L�����!�!�#����&�&�q�)�$�T�%;�%;�%@�%@�%B�C��� *�4�+C�+C�+H�+H�+J� K��r>c��||_|j�|j�|jj�	t	j
|j�|_|j�y#t$rt|�YywxYwrG)	rn�updateCoverpageTabrpr�r�getFaxDevice�Error�
CheckDeviceUI�updateHeaderTab)r7rns  r=r�z)FaxSetupDialog.FaxComboBox_currentChanged�sr��$������!��8�8���H�H�N�N��	��'�'����8�D�H�
	
�����	�	��$���	�s�$A4�4B�
Bc�Z�t||jd��|j�y)Nz/<b>No devices that require fax setup found.</b>)rar�r�rIs r=r�z$FaxSetupDialog.FaxComboBox_noDevices�s$���$��	�	�=�?�	@��
�
�r>c�h�|jt|jj���yrG)�saveNameCompanyrr�rHrIs r=�#NameCompanyLineEdit_editingFinishedz2FaxSetupDialog.NameCompanyLineEdit_editingFinished�$�����Z��(@�(@�(E�(E�(G�H�Ir>c��d|_y�NT)r��r7rYs  r=�NameCompanyLineEdit_textChangedz.FaxSetupDialog.NameCompanyLineEdit_textChanged�
��"&��r>c��d|_d}t�		tjd|z�|jj�dk(r\|jdk(rMd}	t|�\}}|dk(s|dk(r
	t�|S|jj||�}|dk7rd}�J	|jj|�d}t�|S#t$rt|�Y�"wxYw#t�|ccYSxYw)NFz Saving station name %s to deviceT�/Enter the printer's username password password
re���PInvalid Username or Password!.
Rernter the printer's username password password
)
r��beginWaitCursor�logrwrp�isAuthRequiredrsri�
endWaitCursor�getCDMToken�setStationNamer�r��r7rY�retn�
promptText�username�password�respCodes       r=r�zFaxSetupDialog.saveNameCompanys���"'�������	�
$��	�	�<�q�@�A��8�8�*�*�,��4��9N�9N�RV�9V�!S�J��-;�J�-G�*��(�#�r�>�X��^�#(�
�O��K�$(�8�8�#7�#7��(�#K��#�s�?�)}�J�$�����'�'��*���
�O��K��	�
$��d�#�
$��
�O��K�s+�AC�AC�C'�$C*�&C'�'C*�*C;c�h�|jt|jj���yrG)�
saveFaxNumberrr�rHrIs r=�!FaxNumberLineEdit_editingFinishedz0FaxSetupDialog.FaxNumberLineEdit_editingFinished%s$�����:�d�&<�&<�&A�&A�&C�D�Er>c��d|_yr�)r�r�s  r=�FaxNumberLineEdit_textChangedz,FaxSetupDialog.FaxNumberLineEdit_textChanged(s
�� $��r>c��d|_d}t�		tjd|z�|jj�dk(r^|jdk(rOd}	t|�\}}|dk(s|dk(r|t�|cS|jj||�}|dk7rd}�L	|jj|�d}t�|S#t$rt|�Y�"wxYw#t�|ccYSxYw)NFzSaving fax number %s to deviceTr�rer�r�)
r�r�r�rwrpr�rsrir�r��setPhoneNumr�r�r�s       r=r�zFaxSetupDialog.saveFaxNumber+s��� %�������	�
$��	�	�:�Q�>�?��8�8�*�*�,��4��9N�9N�RV�9V�!S�J��-;�J�-G�*��(�#�r�>�X��^�#'�
�O��K�$(�8�8�#7�#7��(�#K��#�s�?�)}�J�$�����$�$�Q�'���
�O��K��	�
$��d�#�
$��
�O��K�s+�A C�AC�C)�&C,�(C)�)C,�,C=c�h�|jt|jj���yrG)�saveVoiceNumberrr�rHrIs r=r�z2FaxSetupDialog.VoiceNumberLineEdit_editingFinishedIr�r>c��d|_yr�)r�r�s  r=r�z.FaxSetupDialog.VoiceNumberLineEdit_textChangedLr�r>c��tjd|z�d|_||j_|jj�y)Nz/Saving voice number (%s) to ~/.hplip/hplip.confF)r�rwr�ru�voice_phone�saver�s  r=r�zFaxSetupDialog.saveVoiceNumberOs<���	�	�C�a�G�H�"'���)*����&������!r>c�h�|jt|jj���yrG)�	saveEmailrr�rHrIs r=r�z,FaxSetupDialog.EmailLineEdit_editingFinishedZs"�����z�$�"4�"4�"9�"9�";�<�=r>c��d|_yr�)r�r�s  r=r�z(FaxSetupDialog.EmailLineEdit_textChanged]s
����r>c��tjd|z�d|_||j_|jj�y)Nz0Saving email address (%s) to ~/.hplip/hplip.confF)r�rwr�ru�
email_addressr�r�s  r=r�zFaxSetupDialog.saveEmail`s<���	�	�D�q�H�I� ���+,����(������!r>c�$�|j�yrG)r�rIs r=r~z#FaxSetupDialog.CancelButton_clickedks���
�
�r>c��t|jj��x}|_t|jj��}||jk7ri|j|j�dk(r|jj
|�n(t|jj��|_d|_||jk7rj|j|j�dk(r|jj
|�n(t|jj��|_d|_yy)NF)
rr�rHrqr�r�r@rsrrr�)r7�current_fax_num�current_fax_companys   r=r�zFaxSetupDialog.SaveBtn_Clickedns���,6�t�7M�7M�7R�7R�7T�,U�U��$�/�(��)A�)A�)F�)F�)H�I���d�o�o�-��!�!�$�/�/�2�e�;��&�&�.�.��?�",�T�-C�-C�-H�-H�-J�"K���$)�D�!��4�#8�#8�8��#�#�D�$9�$9�:�e�C��(�(�0�0�1D�E�(2�4�3K�3K�3P�3P�3R�(S��%�$)�D�!�
9r>c�\�|dk(r|j�y|dk(r|j�yy)zU Called when the active tab changes.
            Update newly displayed tab.
        rrN)r�r�)r7�tabs  r=r�z"FaxSetupDialog.Tabs_currentChanged�s/���!�8�� � �"�
�A�X��#�#�%�r>c���t�		t|jj��}tjd|z�|jj|�t|jj��}tjd|z�|jj|�t�y#t$rt|�Y�!wxYw#t�wxYw)Nzname_company = '%s'zfax_number = '%s')r�rrp�getStationNamer�rwr�r@�str�getPhoneNumr�r�r�r�)r7�name_companyrqs   r=r�zFaxSetupDialog.updateHeaderTab�s�����	�
$�)�$�(�(�*A�*A�*C�D���	�	�/�,�>�?��(�(�0�0��>� ����!5�!5�!7�8�
��	�	�-�
�:�;��&�&�.�.�z�:�
�O���
$��d�#�
$��
�O�s$�B,C�C�C�C�C�C*c�(�|jj}tjd|z�|jj|�|jj}tjd|z�|jj|�y)Nzvoice_phone = '%s'zemail_address = '%s')rur�r�rwr�r@r�r�)r7r�r�s   r=r�z!FaxSetupDialog.updateCoverpageTab�sp���(�(�4�4���	�	�&��4�5�� � �(�(��5��*�*�8�8�
��	�	�(�=�8�9����"�"�=�1r>c���|jr$|jjj�|jr$|j
jj�|jr$|jjj�|jr$|jjj�|j�|jj�|j�yrG)
r�r�r��emitr�r�r�r�r�r�rpr�r4)r7�es  r=�
closeEventzFaxSetupDialog.closeEvent�s����"�"��$�$�4�4�9�9�;��"�"��$�$�4�4�9�9�;�������.�.�3�3�5�� � ��"�"�2�2�7�7�9��8�8���H�H�N�N��	���
r>Nc�0�tjd||�S)NrkrUrXs   r=r[zFaxSetupDialog.__tr�s���~�~�.��1�5�5r>)rrG)r\r]r^rrorzr�r�r�r�r�r�r�r�r�r�r�r�r�r�r~r�r�r�r�r�r�r_r>r=rkrk�s��
,�9!�v
L�
��J�'��<F�%��<J�'�"�>� �"��*�&&�
�2��$6r>rkr�)�operatorr��base.g�baserr�prntr�
base.codes�ui_utils�base.sixextr�PyQt5.QtCore�PyQt5.QtGui�PyQt5.QtWidgets�faxsetupdialog_baser	�deviceuricomboboxr
�prop�	fax_buildr�r�ImportErrorr��warnrr
rcrirkr_r>r=�<module>r�s���.�
������"����+�>��n�n�������H�H�_��A3�W�A3�H
�
�d6�W�i�d6��G�����s�B�B�B

Zerion Mini Shell 1.0