%PDF- %PDF-
Mini Shell

Mini Shell

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

�

=	f����d�ddlZddlZddlmZddlmZddlZddl�ddlm	Z	m
Z
mZddlm
Z
ddl�ddl�ddl�ddl�ddl�ddlmZdd	lmZmZdd
lmZmZddlmZddlmZdZdZ d
Z!dZ"dZ#dZ$dZ%dZ&d
Z'dZ(e)jTZ+e+r	ddl,m,Z,e+se.j_d�dZ0e+r0	ddl1Z1e2e1jf�Z4e4dk\rdZ0ne.j_d�e0se.j_d�e+rddl5m6Z6e0rddl,m7Z7Gd�de8e�Z9y#e-$rdZ+Y��wxYw#e-$re.j_d�Y�UwxYw)�N)�queue)�
to_unicode)�*)�device�utils�pml)�cups�)�	Ui_Dialog)�	FileTable�FILETABLE_TYPE_FAX)�PrinterNameComboBox�!PRINTERNAMECOMBOBOX_TYPE_FAX_ONLY)�PrintSettingsDialog)�FaxSetupDialog���zapplication/hplip-fax-coverpage)�faxFz
Fax disabled.z2.0Tz@Pre-2.0 version of Reportlab installed. Fax coverpages disabled.z1Reportlab not installed. Fax coverpages disabled.z?Please install version 2.0+ of Reportlab for coverpage support.)�	FABWindow)�
coverpagesc��eZdZdEd�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�ZdFd�Zd�Z d �Z!d!�Z"d"�Z#dGd#�Z$d$�Z%d%�Z&dEd&�Z'd'�Z(d(�Z)d)�Z*d*�Z+d+�Z,d,�Z-d-�Z.dHd.�Z/d/�Z0d0�Z1d1�Z2d2�Z3d3�Z4d4�Z5d5�Z6d6�Z7d7�Z8d8�Z9d9�Z:d:�Z;d;�Z<d<�Z=d=�Z>d>�Z?d?�Z@d@�ZAdA�ZBdB�ZCdC�ZDdIdD�ZEy)J�
SendFaxDialogNc�|�tj||�|j|�||_|�||_n$tj|j�|_||_d|_tj�\|_
|_}d|_d|_
g|_g|_|j!�|jrXt"r!t$j'd|j(�y|j+�t$j'd|j,�yt$j'd|j.�y�Nr)�QDialog�__init__�setupUi�printer_name�
device_urir�getDeviceURIByPrinterName�args�dev�	init_dbus�
dbus_avail�service�
CheckTimer�	lock_file�	file_list�recipient_list�initUi�coverpages_enabled�QTimer�
singleShot�displayCoverpagePage�lockAndLoad�displayFilesPage�displaySelectFaxPage)�self�parentrr r"�session_buss      �%/usr/share/hplip/ui5/sendfaxdialog.pyrzSendFaxDialog.__init__ds�������v�&����T��(����!�(�D�O�$�>�>�t�?P�?P�Q�D�O���	����5;�5E�5E�5G�2�����{���������� ������
����!��!�!�!�T�%>�%>�?�� � �"��!�!�!�T�%:�%:�;����a��!:�!:�;�c�j�|jjj|j�|jjj|j
�|jjj|j�tjtjtj�|j�|j�|j�|j�|j�|j!t#t%dd���y)N�hp_logo�128x128)�CancelButton�clicked�connect�CancelButton_clicked�
BackButton�BackButton_clicked�
NextButton�NextButton_clicked�signal�SIGINT�SIG_DFL�initSelectFaxPage�initCoverpagePage�
initFilesPage�initRecipientsPage�initSendFaxPage�
setWindowIcon�QIcon�load_pixmap�r3s r6r+zSendFaxDialog.initUi�s������!�!�)�)�$�*C�*C�D������'�'��(?�(?�@������'�'��(?�(?�@��
�
�f�m�m�V�^�^�4���� ���� ��������!�����	
���5��Y�	�!B�C�Dr7c��|j�Zt|�|_|jjj|j�|jjd�|jr^|j�Qtjd|jzd�\}|_|s#tjd|jz�yyyy)Ni�z
hp-sendfax-%sTz(hp-sendfax is already running for fax %s)r'r-�timeoutr=�CheckTimer_timeout�startrr(r�lock_app�log�error)r3�oks  r6r0zSendFaxDialog.lockAndLoad�s����?�?�"�$�T�l�D�O��O�O�#�#�+�+�D�,C�,C�D��O�O�!�!�$�'�������!7�!&����$�BS�BS�0S�UY�!Z��B�����	�	�D�t�GX�GX�X�Y��"8�r7c��|jjt�|jjj	|j
�|jjj	|j�|jjj	|j�|jjj	|j�|j�&|jj|j�yy�N)�FaxComboBox�setTyper�"PrinterNameComboBox_currentChangedr=�FaxComboBox_currentChanged�PrinterNameComboBox_noPrinters�FaxComboBox_noPrinters�FaxOptionsButtonr<�FaxOptionsButton_clicked�FaxSetupButton�FaxSetupButton_clickedr�setInitialPrinterrNs r6rFzSendFaxDialog.initSelectFaxPage�s������ � �!B�C����;�;�C�C�D�Dc�Dc�d����7�7�?�?��@[�@[�\����%�%�-�-�d�.K�.K�L����#�#�+�+�D�,G�,G�H����(����.�.�t�/@�/@�A�)r7c��|jjd�|jt�ts,t||j
d��|j�y|js,t||j
d��|j�y|jj�|jt�y)NFz�<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>z�<b>PC send fax support requires DBus and hp-systray.</b><p>Please check the HPLIP installation for proper installation of DBus and hp-systray support.</p><p>Click <i>OK</i> to exit.</p>)r?�
setEnabled�updateStepText�PAGE_SELECT_FAX�fax_enabled�	FailureUI�_SendFaxDialog__tr�closer%rY�updateUi�displayPagerNs r6r2z"SendFaxDialog.displaySelectFaxPage�s������"�"�5�)����O�,���d�D�I�I�'G�H�
I��J�J�L������d�D�I�I�'b�c�
d��J�J�L�����!�!�#�����)r7c� �||_||_yrX)rr )r3r rs   r6r\z(SendFaxDialog.FaxComboBox_currentChanged�s��(���$��r7c�Z�t||jd��|j�y)Nz�<b>No installed fax devices found.</b><p>Please setup a fax device and try again (try using 'hp-setup').</p><p>Click <i>OK</i> to exit.</p>)rirjrkrNs r6r^z$SendFaxDialog.FaxComboBox_noPrinters�s)���$���4�f�g�	h��
�
�r7c�T�t||jd��}|j�y)NT)�fax_mode)rr�exec_�r3�dlgs  r6r`z&SendFaxDialog.FaxOptionsButton_clicked�s��!�$��(9�(9�D�I���	�	�r7c�P�t||j�}|j�yrX)rr rrrss  r6rbz$SendFaxDialog.FaxSetupButton_clicked�s���T�4�?�?�3���	�	�r7c��d|_d|_d|_d\|_}d|_d|_|jjttdd���|jjttdd���t�r�ttjj��|_|j j#d�|_t'|j �d	z
|_|j |j$|_|jj,j/|j0�|jj,j/|j2�|j4j6t8j/|j:�|j<j>j/|j@�|jBj>d
j/|jD�|jFj6t8j/|jH�y|j4jKd�y)N�F�NNr�prev�16x16�next�basicr
�const QString &)&�cover_page_message�
cover_page_re�preserve_formatting�cover_page_func�last_job_id�busy�PrevCoverPageButton�setIconrLrM�NextCoverPageButtonr,�listr�
COVERPAGES�keys�cover_page_list�index�cover_page_index�len�cover_page_max�cover_page_namer<r=�PrevCoverPageButton_clicked�NextCoverPageButton_clicked�CoverPageGroupBox�toggled�bool�CoverPageGroupBox_toggled�MessageEdit�textChanged�MessageEdit_textChanged�
RegardingEdit�RegardingEdit_textChanged�PreserveFormattingCheckBox�"PreserveFormattingCheckBox_toggledre)r3�cover_page_pngs  r6rGzSendFaxDialog.initCoverpagePage�s���"$������#(�� �/9�,���n������	�� � �(�(��{�6�7�/K�)L�M�� � �(�(��{�6�7�/K�)L�M��#'�
�(=�(=�(B�(B�(D�#E�D� �$(�$8�$8�$>�$>�w�$G�D�!�"%�d�&:�&:�";�A�"=�D��#'�#7�#7��8M�8M�#N�D� ��$�$�,�,�4�4�T�5U�5U�V��$�$�,�,�4�4�T�5U�5U�V��"�"�*�*�4�0�8�8��9W�9W�X����(�(�0�0��1M�1M�N����*�*�+<�=�E�E�d�Fd�Fd�e��+�+�3�3�D�9�A�A�$�Bi�Bi�j��"�"�-�-�e�4r7c��|jjd�|jjd�|j�|j	�|j�|j
t�y)NFT)r?rerAr0�updateCoverpageButtons�displayCoverpagePreviewrm�PAGE_COVERPAGErNs r6r/z"SendFaxDialog.displayCoverpagePage�sX�����"�"�5�)����"�"�4�(������#�#�%��$�$�&�����(r7c�T�t|jj��|_yrX)rr��toPlainTextr~rNs r6r�z%SendFaxDialog.MessageEdit_textChangeds��",�T�-=�-=�-I�-I�-K�"L��r7c�$�t|�|_yrX)rr)r3�ts  r6r�z'SendFaxDialog.RegardingEdit_textChangeds��'��]��r7c��||_yrX)r��r3�bs  r6r�z0SendFaxDialog.PreserveFormattingCheckBox_toggled
s
��#$�� r7c��|xjdzc_|jdkrd|_y|j�|j�y)Nr
r)r�r�r/rNs r6r�z)SendFaxDialog.PrevCoverPageButton_clickedsA������"��� � �1�$�$%�D�!��'�'�)��%�%�'r7c���|xjdz
c_|j|jkDr|j|_y|j�|j�y)Nr
)r�r�r�r/rNs r6r�z)SendFaxDialog.NextCoverPageButton_clickedsM������"��� � �4�#6�#6�6�$(�$7�$7�D�!��'�'�)��%�%�'r7c���tr�|j|j|_tj
|jd|_|jjtd|jz��|jjttj
|jdd��|jj�r|j�y|j!�y)Nrz<i>"%s"</i>r
�other)r,r�r�r�rr�r��
CoverPageName�setText�str�CoverPagePreview�	setPixmaprMr��	isChecked�addCoverPage�removeCoverPagerNs r6r�z%SendFaxDialog.displayCoverpagePreview s����#'�#7�#7��8M�8M�#N�D� �#-�#8�#8��9M�9M�#N�q�#Q�D� ����&�&�s�=��9M�9M�+M�'N�O��!�!�+�+�K�
�8M�8M�d�Nb�Nb�8c�de�8f�ho�,p�q��!�!�+�+�-������ � �"r7c��|jj�}|jj|xr|jdk7�|j
j|xr|j|jk7�yr)r�r�r�rer�r�r�)r3�enableds  r6r�z$SendFaxDialog.updateCoverpageButtons-sf���(�(�2�2�4��� � �+�+�G�,R��8M�8M�QR�8R�S�� � �+�+�G�,d��8M�8M�QU�Qd�Qd�8d�er7c�j�|j�|r|j�y|j�yrX)r�r�r�r�s  r6r�z'SendFaxDialog.CoverPageGroupBox_toggled3s)���#�#�%������� � �"r7c���|j�|jj|jt|jd|jz�|jd�d�y)NzHP Fax Coverpage: "%s"z
Cover Pager
)r��
FilesTable�addFiler��MIME_TYPE_COVERPAGErjrNs r6r�zSendFaxDialog.addCoverPage;sQ������������ 4� 4�6I� $�	�	�*B�4�CW�CW�*W� X� $�	�	�,� 7��	<r7c�B�|jjt�yrX)r��removeFileByMIMETyper�rNs r6r�zSendFaxDialog.removeCoverPageBs�����,�,�-@�Ar7c��|jjtj|j�|jj|�|jjtj
|j�yrX)r�r�r��
disconnectr��
setCheckedr=r�s  r6�toggleCoverPagezSendFaxDialog.toggleCoverPageFs`�����&�&�t�,�7�7��8V�8V�W����)�)�!�,����&�&�t�,�4�4�T�5S�5S�Tr7c��|jjt�|jj|j�|jj
j
|j�|jjj
|j�|jjj
|j�yrX)r�rZr
�setFaxCallback�FileTable_callback�isEmptyr=�FilesTable_isEmpty�	isNotEmpt�FilesTable_isNotEmpty�fileListChanged�FilesTable_fileListChangedrNs r6rHzSendFaxDialog.initFilesPageQs�������� 2�3����&�&�t�'>�'>�?������'�'��(?�(?�@����!�!�)�)�$�*D�*D�E����'�'�/�/��0O�0O�Pr7c��|jjd�|j��|jD]�}tjjtjj
|��}tjj|�s�_tj|tj�s��|j|���d|_|j�|jj|jj��|jjt �|j"j%|j'd|j(z��|j+t,�y)NFzaNote: You may also add files to the fax by printing from any application to the '%s' fax printer.)r�rlr"�os�path�abspath�
expanduser�exists�access�R_OK�
renderFile�restoreNextButtonrAre�
isNotEmptyr?r,�
FilesPageNoter�rjrrm�
PAGE_FILES)r3�a�fs   r6r1zSendFaxDialog.displayFilesPageYs����� � ��'��9�9� ��Y�Y�
'���G�G�O�O�B�G�G�$6�$6�q�$9�:���7�7�>�>�!�$����1�b�g�g�)>��O�O�A�&�
'�
�D�I���� ����"�"�4�?�?�#=�#=�#?�@����"�"�#5�6����"�"�4�9�9�.Q�RV�Rc�Rc�.c�$d�	e�����$r7c�~�|jj�tk(r|jj	d�yy�NF��
StackedWidget�currentIndexr�rArerNs r6r�z SendFaxDialog.FilesTable_isEmptyks0�����*�*�,�
�:��O�O�&�&�u�-�;r7c�~�|jj�tk(r|jj	d�yy�NTr�rNs r6r�z#SendFaxDialog.FilesTable_isNotEmptyps0�����*�*�,�
�:��O�O�&�&�t�,�;r7c��|jj|_|j|jjt��yrX)r�r)r��isMIMETypeInListr�rNs r6r�z(SendFaxDialog.FilesTable_fileListChangedus1�����2�2������T�_�_�=�=�>Q�R�Sr7c��|jjt|j��tj�|_t
|�|_|jjtj�|jjj|j�|jjdj|j�|j jdj|j"�|j$j&j|j(�|j*j&j|j,�|j.j&j|j0�|j2j&j|j4�|j6j&j|j8�|j:j&j|j<�|j>j&j|j@�|jBjDj|jF�|jBjHdj|jJ�|j*jMtOtQdd���|j.jMtOtQdd���|j2jMtOtQdd���|j6jMtOtQdd���|j:jMtOtQdd���|j>jMtOtQd	d���|j$jMtOtQd
d���|j$jSd�|jUd�|jUd
�|jUd�g|_+y)Nr}zQTableWidgetItem *�fabrz�add_user�	add_users�remove_user�up_user�	down_user�add_user_quickF�Namez
Fax number�Notes),�QuickAddFaxEdit�setValidator�PhoneNumValidatorr�FaxAddressBook�dbrr��setWindowFlags�Qt�Tool�databaseChangedr=�FABWindow_databaseChangedr��QuickAddFaxEdit_textChanged�QuickAddNameEdit�QuickAddNameEdit_textChanged�QuickAddButtonr<�QuickAddButton_clicked�	FABButton�FABButton_clicked�AddIndividualButton�AddIndividualButton_clicked�AddGroupButton�AddGroupButton_clicked�RemoveRecipientButton�RemoveRecipientButton_clicked�MoveRecipientUpButton�MoveRecipientUpButton_clicked�MoveRecipientDownButton�MoveRecipientDownButton_clicked�RecipientsTable�itemSelectionChanged�$RecipientsTable_itemSelectionChanged�itemDoubleClicked�!RecipientsTable_itemDoubleClickedr�rLrMrerj�recipient_headersrNs r6rIz SendFaxDialog.initRecipientsPage~s�����)�)�*;�D�<P�<P�*Q�R��$�$�&����T�?�����������(���� � �(�(��)G�)G�H�
	
���(�(�):�;�C�C�D�Dd�Dd�e�	
���)�)�*;�<�D�D�T�Ef�Ef�g����#�#�+�+�D�,G�,G�H������&�&�t�'=�'=�>�� � �(�(�0�0��1Q�1Q�R����#�#�+�+�D�,G�,G�H��"�"�*�*�2�2�4�3U�3U�V��"�"�*�*�2�2�4�3U�3U�V��$�$�,�,�4�4�T�5Y�5Y�Z�	
���1�1�9�9�$�:c�:c�d�	
���.�.�/C�D�L�L�T�Ms�Ms�t�	
�����u�[���%@�A�B�� � �(�(��{�:�w�/O�)P�Q����#�#�E�+�k�7�*K�$L�M��"�"�*�*�5��]�G�1T�+U�V��"�"�*�*�5��Y��1P�+Q�R��$�$�,�,�U�;�{�G�3T�-U�V����#�#�E�+�6F��*P�$Q�R�	
���&�&�u�-�"&�)�)�F�"3�T�Y�Y�|�5L�d�i�i�X_�N`�!a��r7c��|jj�|tttt
tfvr&tjd�|j�y|tk(rwtjd|z�|jj�}|D�cgc]}||jvs�|��c}|_|j�|j�y|tk(rptjd|�d|�d��t|j�D]+\}}||k(s�||j|<|j�y|j�y|t k(r)tjd|z�|j�yycc}w)NzFax address book has changedz*Fax address book has changed: '%s' removedzFax address book has changed: 'z' renamed to '�'z2Fax address book has changed: '%s' details changed)r��load�FAB_NAME_ADD�
FAB_GROUP_ADD�FAB_GROUP_RENAME�FAB_GROUP_REMOVE�FAB_GROUP_MEMBERSHIP_CHANGEDrT�debug�updateAddressBook�FAB_NAME_REMOVE�
get_all_namesr*�updateRecipientTable�FAB_NAME_RENAME�	enumerate�FAB_NAME_DETAILS_CHANGED)r3�action�s1�s2�	all_names�x�i�ns        r6r�z'SendFaxDialog.FABWindow_databaseChanged�sH���������l�M�3C�&�(D�F�F�
�I�I�4�5��"�"�$�
��
&��I�I�B�R�G�H����-�-�/�I�.7�"T��1��@S�@S�;S�1�"T�D���"�"�$��%�%�'�
��
&��I�I�b�RT�U�V�!�$�"5�"5�6�
)���1���7�-/�D�'�'��*��-�-�/��	
)��&�&�(�
�/�
/��I�I�J�R�O�P��%�%�'�0��#Us�F
�1F
c���|j�|j�|j�|jt�|j�|jjd�yr�)rr�enableQuickAddButtonrm�PAGE_RECIPIENTSr�r?rerNs r6�displayRecipientsPagez#SendFaxDialog.displayRecipientsPage�sR����� ��!�!�#��!�!�#�����)���� ����"�"�4�(r7c��|jj�D�cgc]}|jd�r�|��}}|jj�}|jj�|jj�d}|j�|D]R}||jvs�|jj|�}|ds�3|jj|�|dz
}�T|r7|jjd�|jjd�n6|jjd�|jjd�d}|j�|D]d}|jj|�D]D}|jd�r�||jvs�$|jj|�|dz
}�d�f|r7|jjd�|jjd�y|jjd�|jjd�ycc}w)N�__rrr
TF)r�r�
startswith�get_all_groups�AddIndividualComboBox�clear�AddGroupComboBox�sortr*�get�addItemr�re�
group_membersr)r3r$�names�groupsr#�data�gs       r6rzSendFaxDialog.updateAddressBook�s��� �G�G�1�1�3�N�q�1�<�<��;M��N��N����'�'�)���"�"�(�(�*����#�#�%�
��
�
�
���	�A���+�+�+��w�w�{�{�1�~����;��.�.�6�6�q�9���F�A�	�
��$�$�/�/��5��&�&�1�1�$�7�
�$�$�/�/��6��&�&�1�1�%�8�
�����
��	�A��W�W�*�*�1�-�
���|�|�D�)�a�t�7J�7J�.J��)�)�1�1�!�4���F�A��	
�	�
����*�*�4�0��!�!�,�,�T�2�
���*�*�5�1��!�!�,�,�U�3��QOs
�I�Ic��	|j�}|jj	�|jjd�|jj
d�|j�rYt|j�}|jj
t|j��|jj|j�|jj|�tjtjz}d}t|j�D]�\}}tt!|��}|j#|�|jj%|d|�|�||k(r|}|j&j)|�}|s�ott!|d��}|j#|�|jj%|d|�tt!|d��}|j#|�|jj%|d|���|jj+�|jj-�|�|jj/|�n5|jj/|jj1dd��|j2j5d�y|j7�|j2j5d�y#ttf$rd}Y���wxYw)Nrrr
�notesrTF)�getCurrentRecipient�	TypeError�AttributeErrorrr.�setRowCount�setColumnCountr*r�r
�setHorizontalHeaderLabelsr��ItemIsSelectable�
ItemIsEnabledr�QTableWidgetItemr��setFlags�setItemr�r1�resizeColumnsToContents�resizeRowsToContents�setCurrentItem�itemrAre�enableRecipientListButtons)	r3ry�num_recipients�flags�j�rowr$r#�ks	         r6rz"SendFaxDialog.updateRecipientTablesk��	��+�+�-�D�	
���"�"�$����(�(��+����+�+�A�.���� ��!4�!4�5�N�� � �/�/��D�4J�4J�0K�L�� � �:�:�4�;Q�;Q�R�� � �,�,�^�<��'�'�"�*:�*:�:�E��A�#�D�$7�$7�8�
8���Q�$�S��V�,���
�
�5�!��$�$�,�,�S�!�Q�7��#��T�	��A��G�G�K�K��N����$�S��5��]�3���
�
�5�!��$�$�,�,�S�!�Q�7�$�S��7��_�5���
�
�5�!��$�$�,�,�S�!�Q�7�#
8�&
� � �8�8�:�� � �5�5�7��}��$�$�3�3�A�6��$�$�3�3�D�4H�4H�4M�4M�a�QR�4S�T��O�O�&�&�t�,�
�+�+�-��O�O�&�&�u�-��_�>�*�	��D�	�s�K4�4L	�L	c��|jj�}t|j�}|j	|dkD|dkDxr|dkD|dkDxr||dz
k�y)Nrr
)r�
currentRowr�r*rI)r3�current_rowrJs   r6r
z2SendFaxDialog.RecipientsTable_itemSelectionChanged:sg���*�*�5�5�7���T�0�0�1���'�'���(:�,:�Q�,>�,R�;�QR�?�,:�Q�,>�,c�;�R`�ab�Rb�Cc�	er7c�Z�|r|jjd�n|jjd�|r|jjd�n|jjd�|r|jjd�y|jjd�y�NTF)rrerr)r3�
enable_remove�enable_up_move�enable_down_moves    r6rIz(SendFaxDialog.enableRecipientListButtonsBs�����&�&�1�1�$�7��&�&�1�1�%�8���&�&�1�1�$�7��&�&�1�1�%�8���(�(�3�3�D�9��(�(�3�3�E�:r7c�:�|jdt|��yrX�r&r)r3rs  r6r�z)SendFaxDialog.QuickAddFaxEdit_textChangedSs���!�!�$�
�3��8r7c�8�|jt|��yrXrX)r3�names  r6r�z*SendFaxDialog.QuickAddNameEdit_textChangedWs���!�!�*�T�"2�3r7c��|�#t|jj��}|�#t|jj��}d}|r||jj�v}|r	|jj
d�n	|jj
d�|r |s|r|jjd�y|jjd�y#t$rY�IwxYw#t$rY�XwxYw)NFzbackground-color: yellowrwT)
rr��textr�r�r�
setStyleSheetr<r�re)r3rZr�
existing_names    r6r&z"SendFaxDialog.enableQuickAddButton[s����<��d�3�3�8�8�:�;�D��;��T�1�1�6�6�8�9�C��
�� �D�G�G�$9�$9�$;�;�M��
��%�%�3�3�4N�O�
��%�%�3�3�B�7��
�#����*�*�4�0����*�*�5�1��"�
��
��
"�
��
�s$�.C$�C3�$	C0�/C0�3	C?�>C?c��t|jj��}t|jj��}|jj||�|j
|�|j�|jj�|jj�|jdd�y)Nrw)
rr�r\r�r��addName�addRecipientrr.r&)r3rZrs   r6r�z$SendFaxDialog.QuickAddButton_clickedvs����$�/�/�4�4�6�7����-�-�2�2�4�5��������s�#����$���!�!�#����#�#�%����"�"�$��!�!�"�b�)r7c�h�|jt|jj���yrX)rarr-�currentTextrNs r6r�z)SendFaxDialog.AddIndividualButton_clicked�s$�����*�T�%?�%?�%K�%K�%M�N�Or7c�h�|jt|jj���yrX)�addGrouprr/rcrNs r6rz$SendFaxDialog.AddGroupButton_clicked�s"���
�
�j��!6�!6�!B�!B�!D�E�Fr7c���|j�}|jdd}t|�D]9\}}||k(s�|j|=|j�|j	�yyrX)r:r*rrr)r3rZ�tempr#r$s     r6rz+SendFaxDialog.RemoveRecipientButton_clicked�sg���'�'�)���"�"�1�%���d�O�	�D�A�q��q�y��'�'��*��)�)�+��&�&�(��	r7c��tj|j|j��|j	�yrX)r�list_move_upr*r:rrNs r6rz+SendFaxDialog.MoveRecipientUpButton_clicked�s-��
���4�.�.��0H�0H�0J�K��!�!�#r7c��tj|j|j��|j	�yrX)r�list_move_downr*r:rrNs r6rz-SendFaxDialog.MoveRecipientDownButton_clicked�s-��
���T�0�0�$�2J�2J�2L�M��!�!�#r7c��|jj|jj�d�}|�t|j	��Std�S)Nrrw)rrHrPrr\)r3rHs  r6r:z!SendFaxDialog.getCurrentRecipient�sJ���#�#�(�(��)=�)=�)H�)H�)J�A�N�����d�i�i�k�*�*��b�>�!r7c���||jvrQ|jd�s?|jj|�|r!|j�|j	�yyyy)Nr*)r*r+�appendrr)r3rZ�updates   r6razSendFaxDialog.addRecipient�sX���t�*�*�*�4�?�?�4�3H����&�&�t�,���)�)�+��&�&�(��4I�*r7c��|jj|�D]}|j|d��|j�|j	�yr�)r�r3rarr)r3�groupr$s   r6rezSendFaxDialog.addGroup�sJ�����&�&�u�-�	(�A����a��'�	(�	
�!�!�#���� r7c�8�|jj�yrX)r��showrNs r6r�zSendFaxDialog.FABButton_clicked�s�����
�
�r7c�$�|��|j�|j�}}|dk7r|jj|d�}|jjt
|j���|jj�yyr)	rM�columnrrHr��selectByNamerr\rs)r3rHrM�cols    r6rz/SendFaxDialog.RecipientsTable_itemDoubleClicked�sk�����x�x�z�4�;�;�=��C��a�x��+�+�0�0��a�8���H�H�!�!�*�T�Y�Y�[�"9�:��H�H�M�M�O�
r7c�F�ttdd��|_ttdd��|_ttdd��|_ttdd��|_t
j�|_t
j�|_	d|_
y)N�inforz�warningrUr�F)rLrM�	info_icon�	warn_icon�
error_icon�	busy_iconr�Queue�update_queue�event_queue�send_fax_activerNs r6rJzSendFaxDialog.initSendFaxPage�sr���{�6�7�;�<����{�9�g�>�?�����G�W� =�>����{�6�7�;�<���!�K�K�M��� �;�;�=���$��r7c���|jt�|j|jd�|j�|j
j
|jd��y)NzReady to send fax.zSend Fax)rm�
PAGE_SEND_FAX�addStatusMessagerjr{rAr�rNs r6�displaySendFaxPagez SendFaxDialog.displaySendFaxPage�sI������'����d�i�i�(<�=�t�~�~�N�������	�	�*� 5�6r7c�~�|jjd�|jjd�|jj	�d|_g}t
j|j�}|��tjj|�ret|d�j�jd�dk(r9t||j!d|jz��|j#�yt%�t'j(|j*�}t-j.|j*|jd|d�|_		|j0j�	|j0j;d��|j0j#�tC�|j0j@tDkDrp|j0j@tFtHfvrNt||j!d
|j0jJz��|jjd�yt
jL�|_'|jND]}|jP|jk(s�|jRtjTk(rEt||j!d|jz��|jjd�ynt4jWd�|jXD]O}|jZj]|�}|j_|�t4jWd
|d�d|d����Qt4jWd�|j`D]}t4jW|��|j0jctd|jdd�|j0jg||j`|jh|jj|jl|jn|j|jp|jr�	sft||j!d��|j0jctt|jdd�d|_d|_;|jy�yd|_;|jy�t{|�|_>|j|j~j�|j��|j|j�d�y#t2$r*}t4j7|j8�Yd}~���d}~wwxYw#t2$rB}t4j=d	|j8z�t>|j0_ Yd}~���d}~wwxYw#|j0j#�tC�wxYw)NFT�rbsHP Fax���z�<b>Fax configuration error.</b><p>The CUPS fax queue for '%s' is incorrectly configured.<p>Please make sure that the CUPS fax queue is configured with the 'HPLIP Fax' Model/Driver.zfax-type)�quickzQuery device error (%s).z�<b>Device is busy or in an error state (code=%s)</b><p>Please wait for the device to become idle or clear the error and try again.ze<b>The CUPS queue for '%s' is in a stopped or busy state.</b><p>Please check the queue and try again.zRecipient list:zName=rZz Number=rz
File list:rrwzC<b>Send fax is active.</b><p>Please wait for operation to complete.i�)CrArer?r'�stopr�r	�getPPDrr�r�r��open�read�findrirjrk�beginWaitCursorr�queryModelByURIr r�getFaxDevicer#�ErrorrT�warn�msg�queryDevicerU�ERROR_STATE_ERROR�error_state�
endWaitCursor�ERROR_STATE_MAX_OK�ERROR_STATE_LOW_SUPPLIES�ERROR_STATE_LOW_PAPER�status_code�getPrinters�
cups_printersrZ�state�IPP_PRINTER_STATE_STOPPEDrr*r�r1rnr)�	sendEvent�EVENT_START_FAX_JOB�	sendFaxesr~rr�r�r�r��EVENT_FAX_JOB_FAILr��setCancelCloseButtonr-�SendFaxTimerrPr=�SendFaxTimer_timeoutrR)r3�phone_num_list�ppd_file�mq�e�p�entryr�s        r6�executeSendFaxzSendFaxDialog.executeSendFax�s������"�"�5�)����"�"�5�)���������	����;�;�t�0�0�1����B�G�G�N�N�8�$<��H�d�#�(�(�*�/�/�	�:�b�@��$��	�	�+a�bf�bs�bs�+s�!t�u��
�
�����
�
#�
#�D�O�O�
4���#�#�D�O�O�#'�#4�#4�d�#%�j�>�3���	�
 ����
�
��
9����$�$�4�$�0�
�H�H�N�N���O��8�8���"4�4��H�H� � �)A�CX�(Y�Y��d�D�I�I�'k�lp�lt�lt�l@�l@�'@�A�
B��O�O�&�&�t�,��"�-�-�/����#�#�	�A��v�v��*�*�*��7�7�d�<�<�<��d�D�I�I�/V�W[�Wh�Wh�/h�%i�j��O�O�.�.�u�5���
	�	�	�	�#�$��$�$�	K�A��G�G�K�K��N�E��!�!�%�(��I�I�U�6�]�E�%�L�I�J�	K�
	�	�	�,�����	�A��I�I�a�L�	�	
�����.��0A�0A�1�b�I��x�x�!�!�.�$�.�.�$�BY�BY�"&�"4�"4�d�6J�6J�D�Ld�Ld�"&�"3�"3�T�5F�5F��HX�HX�Z�
�d�D�I�I�&k�l�m��H�H���1�4�3D�3D�a��L��D�I�#(�D� ��%�%�'��#����!�!�#�"�4�L������!�!�)�)�$�*C�*C�D�������%��y�
 ����������
 ��
�
9��	�	�4�q�u�u�<�=�'8����$�$��
9��

�H�H�N�N���O�sN�T�9U�	U�U�:V�U�V�	V�7V�V�V�V�&V<c���|jr+|jj|jd��y|jj|jd��y)NzCancel Send�Close)r�r;r�rjrNs r6r�z"SendFaxDialog.setCancelCloseButton6sE��������%�%�d�i�i�
�&>�?����%�%�d�i�i��&8�9r7c�F�|jr�|j|jd�|j�|jjtjdddf�|jjt|jdd�y|j�y)NzCancelling job...rwr)
r�r�rjr|r��putr�EVENT_FAX_SEND_CANCELEDr#r��EVENT_FAX_JOB_CANCELEDrrkrNs r6r>z"SendFaxDialog.CancelButton_clicked=st������!�!�$�)�)�,?�"@�$�.�.�Q���� � �#�"=�"=�r�2�r�!J�K��H�H���5�t�7H�7H�!�R�P��J�J�Lr7c	���|jj��r?	|jjd�\}}}|t
jk(r:d|_d|_|j�|jj��n�|t
jk(r0|j|jd|z�|j��nr|t
j k(r0|j|jd|z�|j��n/|t
j"k(r0|j|jd|z�|j��n�|t
j$k(r0|j|jd|z�|j��n�|t
j&k(r4|j|jd|�d|�d	��|j��nb|t
j(k(r-|j|jd
�|j��n"|t
j*t
j,t
j.t
j0t
j2t
j4t
j6fv�r�d|_d|_|j�|jj�|t
j*k(r�|j8j;t<j>�\}}|t<j@k(r,|j|jd�|jB�nL|j|jdt<jDj|d
�z�|jB�|j8jGtH|jJdd��n�|t
j0k(rY|j|jd�|jB�|j8jGtH|jJdd��n|t
j2k(rY|j|jd�|jB�|j8jGtH|jJdd��n�|t
j4k(rY|j|jd�|jB�|j8jGtH|jJdd��n@|t
j6k(rX|j|jd�|jB�|j8jGtH|jJdd�n�|t
j,k(rX|j|jd�|jB�|j8jGtH|jJdd�nj|t
j.k(rW|j|jd�|jL�|j8jGtN|jJdd�|jj�r��>yy#tj$rYywxYw)NrFzProcessing page %s...zSending fax to %s...z
Dialing %s...zConnecting to %s...z
Sending page z to z...zCleaning up...z6Fax send error (Possible cause: No answer or dialtone)zFax send error (%s)z
Unknown errorrwz$Fax send error (Error in connecting)z&Fax send error (Error in transmitting)z*Fax send error (Problem with the fax line)z(Fax Job Cancelled)zFax is busy.zSend fax job complete.)(r��qsizer1r�Emptyr�STATUS_IDLEr�r�r�r�r��STATUS_PROCESSING_FILESr�rjr~�STATUS_SENDING_TO_RECIPIENT�STATUS_DIALING�STATUS_CONNECTING�STATUS_SENDING�STATUS_CLEANUP�STATUS_ERROR�STATUS_BUSY�STATUS_COMPLETED�STATUS_ERROR_IN_CONNECTING�STATUS_ERROR_IN_TRANSMITTING�STATUS_ERROR_PROBLEM_IN_FAXLINE�STATUS_JOB_CANCELr#�getPMLr�OID_FAX_DOWNLOAD_ERROR�
DN_ERROR_NONEr}�DN_ERROR_STRr�r�rr{�EVENT_END_FAX_JOB)r3�status�page_num�arg�result_coder�s      r6r�z"SendFaxDialog.SendFaxTimer_timeoutFs������%�%�'�
�(,�(9�(9�(=�(=�a�(@�%���#�����(�!��	�',��$��)�)�+��!�!�&�&�(��3�6�6�6��%�%�d�i�i�0G��0P�&Q�SW�Sa�Sa�b��3�:�:�:��%�%�d�i�i�0F�s�0J�&K�T�^�^�\��3�-�-�-��%�%�d�i�i���0C�&D�d�n�n�U��3�0�0�0��%�%�d�i�i�0E�c�0I�&J�D�N�N�[��3�-�-�-��%�%�d�i�i�H�UX�0Y�&Z�&*�n�n�6��3�-�-�-��%�%�d�i�i�0@�&A�4�>�>�R��C�,�,�c�o�o�s�?S�?S�UX�Us�Us��0�0�#�2U�2U�WZ�Wl�Wl�o�o�!��	�',��$��)�)�+��!�!�&�&�(��S�-�-�-�/3�x�x���s�?Y�?Y�/Z�,�K��"�c�&7�&7�7��-�-�d�i�i�8p�.q�sw�tC�tC�D��-�-�d�i�i�8M�c�N^�N^�Nb�Nb�cn�p�OA�9A�/B�DH�DS�DS�T��H�H�&�&�'9�4�;L�;L�a�QS�T��s�=�=�=��)�)�$�)�)�4Z�*[�]a�]l�]l�m��H�H�&�&�'9�4�;L�;L�a�QS�T��s�?�?�?��)�)�$�)�)�4\�*]�_c�_n�_n�o��H�H�&�&�'9�4�;L�;L�a�QS�T��s�B�B�B��)�)�$�)�)�4`�*a�cg�cr�cr�s��H�H�&�&�'9�4�;L�;L�a�QS�T��s�4�4�4��)�)�$�)�)�4I�*J�D�O�O�\��H�H�&�&�'9�4�;L�;L�a�QS�T��s���.��)�)�$�)�)�N�*C�T�_�_�U��H�H�&�&�'9�4�;L�;L�a�QS�T��s�3�3�3��)�)�$�)�)�4L�*M�t�~�~�^��H�H�&�&�'8�$�:K�:K�Q�PR�S�O���%�%�'�'���;�;�
��
�s�Y�Y2�1Y2c�\�tj|�t|||j�yrX)rTr�QListWidgetItem�
StatusList)r3r\�icons   r6r�zSendFaxDialog.addStatusMessage�s���	�	�$����d�D�O�O�4r7c�V�tjd|z�|j|�y)NzFileTable_callback(%s))rTrr��r3r�s  r6r�z SendFaxDialog.FileTable_callback�s ���	�	�*�Q�.�/�����r7c��d|_t�	tj|j|t
jj|��|_d|_t�y#d|_t�wxYwrS)
r�r�r	�	printFilerr�r��basenamer�r�r�s  r6r�zSendFaxDialog.renderFile�s[����	���	�#�~�~�d�.?�.?��B�G�G�DT�DT�UV�DW�X�D���D�I��O���D�I��O�s�AA(�(A;c�|�|js�	|jj|jtj
|j�\}}}}}}}}|r4d|_tjd|fz�|j|�yyy#t$r$}	tjd|	z�d}Yd}	~	�`d}	~	wwxYw)Nz*Exception caught in CheckTimer_timeout: %srzA new fax has arrived: %s (%d))r�r&�CheckForWaitingFaxr �prop�usernamer��	ExceptionrTr�addFileFromJob)
r3r r�
event_coder��job_id�title�timedate�fax_filer�s
          r6rQz SendFaxDialog.CheckTimer_timeout�s����y�y�
 ��L�L�3�3�D�O�O�T�]�]�TX�Td�Td�e�b�
�L�*�h���x�Ya��#$�� ��	�	�:�h��=O�O�P��#�#�H�e�4����
�
 ��	�	�F��J�K����
 �s�AB�	B;�B6�6B;c���d|_	|j|�\}}}}}}}	|r|jj|dd||�d|_t	�y#d|_t	�wxYw)NTzapplication/hplip-faxz	HPLIP FaxF)r��getFileInfor�r�r�)
r3r�r�rV�	num_pages�hort_dpi�vert_dpi�	page_size�
resolution�encodings
          r6r�zSendFaxDialog.addFileFromJob�sn����	�	�� � ��*�
O�B�	�8�X�y�*�h�����'�'��2I�;�X]�_h�i��D�I��O���D�I��O�s�:A�A(c��t|d�}|jtj�}|j	�t|�tjk7rtjd�ytjd|dtj�\
}}}}}}	}
}}}
tjd||||||	|
|fz�d||||	|
|fS)Nr�z/Invalid fax file! (truncated header or no data))Frrrrrrz>8sBIHHBBBIIz>Magic=%s Ver=%d Pages=%d hDPI=%d vDPI=%d Size=%d Res=%d Enc=%dT)r�r�r�FILE_HEADER_SIZErkr�rTrU�struct�unpackr)r3r�r��header�mg�versionr�r�r�r�r�r��	reserved1�	reserved2s              r6r�zSendFaxDialog.getFileInfo�s�����4� ������,�,�-��	���	��v�;�#�.�.�.��I�I�G�H�,�
�M�M�.�&�1F�#�2F�2F�*G�H�	7��G�Y��(�I���)�Y�	�	�	�R��w�	�8�X�y�*�V^�_�`�	a��i��8�Y�
�H�U�Ur7c�z�|j�tj|j�|j�yrX)r(r�unlock�accept)r3r�s  r6�
closeEventzSendFaxDialog.closeEvent�s%���>�>�%��L�L����(�	���
r7c�\�|j|�|jj|�yrX)rfr��setCurrentIndex)r3�pages  r6rmzSendFaxDialog.displayPage�s$�����D�!����*�*�4�0r7c�
�|jj�}|tk(rtj	d�y|t
k(rtj	d�y|tk(r0|jjt
�|j�y|tk(r0|jjt�|j�y|tk(r0|jjt�|j�yy)NzInvalid!)
r�r�rgrTrUr�r�r�r/r'r1r�r(�r3r�s  r6r@z SendFaxDialog.BackButton_clicked�s������+�+�-������I�I�j�!�
�.�
 ��I�I�j�!�
�*�_����.�.�~�>��%�%�'�
�/�
!����.�.�z�:��!�!�#�
�-�
����.�.��?��&�&�(� r7c�4�|jj�}|tk(r0|jjt�|j�y|tk(r0|jjt�|j�y|tk(r0|jjt�|j�y|tk(r0|jjt�|j�y|tk(r|j�yyrX)
r�r�rgr�r�r/r�r1r'r(r�r�r�r�s  r6rBz SendFaxDialog.NextButton_clickeds������+�+�-��������.�.�~�>��%�%�'�
�.�
 ����.�.�z�:��!�!�#�
�*�_����.�.��?��&�&�(�
�/�
!����.�.�}�=��#�#�%�
�-�
����!� r7c	�x�|jj|jd|dz�dtdz����y)NzStep r
z of )�StepTextr�rj�PAGE_MAXr�s  r6rfzSendFaxDialog.updateStepTexts*���
�
���d�i�i��1��X�a�Z�(H�I�Jr7c�X�|jj|jd��y)NzNext >)rAr�rjrNs r6r�zSendFaxDialog.restoreNextButtons��������	�	�(� 3�4r7c�N�tjd|jd�|�S)Nrzutf-8)�qApp�	translate�encode)r3�s�cs   r6�__trzSendFaxDialog.__tr!s���~�~�o�a�h�h�w�.?��B�Br7rx)rwrw)FFF)TrX)F�__name__�
__module__�__qualname__rr+r0rFr2r\r^r`rbrGr/r�r�r�r�r�r�r�r�r�r�r�rHr1r�r�r�rIr�r(rrr
rIr�r�r&r�r�rrrrr:rarer�rrJr�r�r�r>r�r�r�r�rQr�r�r�rmr@rBrfr�rj�r7r6rrcsj��<�@E�"Z�&B�*�$%�
��
�5�4)�M�+�%�(�(�
#�f�#�<�B�U�Q�%�$.�
-�
T�/b�d(�>)�)4�Z2.�je�;�"9�4�2�6*�P�G��$�
$�
"�)�!���%�7�V&�r:��HT�V5���
5� �V�.�1�)�*"�,K�5�Cr7r):�operatorr��base.sixext.movesr�base.sixextrrC�base.g�baserrr�prntr	�
base.codes�ui_utils�PyQt5.QtCore�PyQt5.QtGui�PyQt5.QtWidgets�sendfaxdialog_baser�	filetablerr
�printernamecomboboxrr�printsettingsdialogr�faxsetupdialogrrgr�r�r'r�r�STATUS_INFORMATION�STATUS_WARNINGr�r�r��	fax_buildrhr�ImportErrorrTr�r,�	reportlabr��Version�ver�	fabwindowrrrrr
r7r6�<module>r&sE��.�
�#�"�
��#�#�������*�4�W�4�*�����
�
����
���������7���n�n�������H�H�_�����
F���)�#�#�$���%�<�!%���H�H�W�X�
��H�H�
N�O��$���C�G�Y�C��A������&�F����D�E�F�s$�D	�*/D�	D�D�D/�.D/

Zerion Mini Shell 1.0