Sindbad~EG File Manager

Current Path : /usr/share/hplip/ui5/__pycache__/
Upload File :
Current File : //usr/share/hplip/ui5/__pycache__/printtestpagedialog.cpython-310.pyc

o

�/�a�@sVddlTddlmZddlTddlTddlTddlZddlmZGdd�de	e�Z
dS)�)�*)�device�N)�	Ui_Dialogc@sVeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
ddd�ZdS)�PrintTestPageDialogcCs<t�||�||_d|_|�|�|��t�d|j�dS)N�r)	�QDialog�__init__�printer_name�
device_uri�setupUi�initUi�QTimer�
singleShot�updateUi)�self�parentr
�r�+/usr/share/hplip/ui5/printtestpagedialog.pyr	&s
zPrintTestPageDialog.__init__cCs�|j�d�|j�|�d��|jj�|j�|j	j�|j
�|jj�|j
�|jj�|j�t�tjtj�|jrA|j�|j�|�ttdd���dS)NTzPrint Test Page�hp_logo�128x128)�HPLIPTestPageRadioButton�
setChecked�	LoadPaper�
setButtonName�_PrintTestPageDialog__tr�CancelButton�clicked�connect�CancelButton_clicked�PrintTestpageButton�PrintTestpageButton_clicked�PrinterNameCombo�"PrinterNameComboBox_currentChanged�PrinterNameCombo_currentChanged�PrinterNameComboBox_noPrinters�signal�SIGINT�SIG_DFLr
�setInitialPrinter�
setWindowIcon�QIcon�load_pixmap�rrrrr
1szPrintTestPageDialog.initUicCs|j��|j��dS�N)r"rrr-rrrrGs
zPrintTestPageDialog.updateUicCst||�d��|��dS)NzA<b>No printers found.</b><p>Please setup a printer and try again.)�	FailureUIr�closer-rrrr%Msz2PrintTestPageDialog.PrinterNameComboBox_noPrintersc
Cs�t�ttj��|j�d�d}z`z
t�|j	|j
�}Wnty5}zt�
d|j�WYd}~nd}~wwz|��WntyJt�
d�Ynw|��}|j�|�|sft��t||�d|j
��|��Wt��dSt��w)NF�Device error (%s).�>Unable to print to printer. Please check device and try again.zW<b>Unable to communicate with printer %s.</b><p>Please check the printer and try again.)�QApplication�setOverrideCursor�QCursor�Qt�
WaitCursorr �
setEnabledr�Devicerr
�Error�log�error�msg�open�isIdleAndNoError�restoreOverrideCursorr/rr0�r�ok�d�errr�updatePrintButtonRs,���
z%PrintTestPageDialog.updatePrintButtoncCs|��dSr.)r0r-rrrrosz(PrintTestPageDialog.CancelButton_clickedcCs||_||_|��dSr.)r
rrE)rrr
rrrr$ssz3PrintTestPageDialog.PrinterNameCombo_currentChangedc
Cst�ttj��d}zDz
t�|j|j�}Wnt	y/}zt
�d|j�WYd}~nd}~wwz|�
�Wnt	yDt
�d�Ynw|��}Wt��nt��w|rut�ttj��z|�|j�Wt��nt��w|��nt||�d|j��|��dS)NFr1r2ze<b>A error occured sending the test page to printer %s.</b><p>Please check the printer and try again.)r3r4r5r6r7rr9rr
r:r;r<r=r>r?r@�
printTestPager0r/rrArrrr!zs2����
z/PrintTestPageDialog.PrintTestpageButton_clickedNcCst�d||�S)Nr)�qApp�	translate)r�s�crrr�__tr�szPrintTestPageDialog.__trr.)�__name__�
__module__�__qualname__r	r
rr%rErr$r!rrrrrr%s"r)�base.g�baser�ui_utils�PyQt5.QtCore�PyQt5.QtGuir&�printtestpagedialog_baserrrrrrr�<module>s

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists