%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/share/system-config-printer/__pycache__/
Upload File :
Create Path :
Current File : //usr/share/system-config-printer/__pycache__/printerproperties.cpython-312.pyc

�

Hfu8�� �ddlZddlZddlZddlmZddlZddlZddlZejejej��ddlZddlZddlm
Z
ddlmZddlmZddlZddlmZddl�ddlZddl�ddlZddlZddlZddlZddlZdd	lmZmZddlZej>Z d
�Z!d�Z"Gd�d
e�Z#e$dk(r�ddl%Z%e&e%jN�dkre(d�e%jRd�e*d�dejVd<ejXejZd�ej\�e
j^�Z0d�Z1e#�Z2e2jgde1�e2jie%jNd�e0jk�yy)�N)�Gtk)�domain�	localedir)�GObject)�GLib)�GtkGUI)�OptionWidget)�*)�busy�readyc�@�tj�}|ddk(ry|S)Nr�/�	localhost)�cups�	getServer)�hosts �5/usr/share/system-config-printer/printerproperties.py�CUPS_server_hostnamer5s!���>�>��D��A�w�#�~���K�c�$�|j�y)NT)�hide)�widget�events  r�on_delete_just_hider;s��
�K�K�N�rc
��eZdZejj
ddfejj
ddfd�Zeje	d�eje	d�eje	d�eje	d�iZ
d�Zd	�Zd
�ZdEd�Zd�Zd
�Zd�ZdFd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d�Z"dGd�Z#		dHd�Z$d�Z%d �Z&d!�Z'd"�Z(d#�Z)dId$�Z*d%�Z+d&�Z,d'�Z-d(�Z.d)�Z/d*�Z0d+�Z1d,�Z2dEd-�Z3dFd.�Z4d/�Z5d0�Z6d1�Z7d2�Z8d3�Z9d4�Z:d5�Z;d6�Z<d7�Z=d8�Z>d9�Z?dGd:�Z@d;�ZAd<�ZBd=�ZCd>�ZDd?�ZEd@�ZFdA�ZGdB�ZHdC�ZIdD�ZJy)J�PrinterPropertiesDialogN�)�destroy�
dialog-closed�Idle�
Processing�Busy�Stoppedc#��tjj|�	tjtj�|_tjtj�|_d|_
dx|_|_t!�|_t!�|_t'�|_d|_|j-dgd�it.j0��|j2|_|j4j7d|j8�|j:|j<|j>|j@fD]K}tCjD�}|jG�|jI|d	�|jK|d
d��M|jL}|j7d|jN�tCjPtSd
��}tCjT�}|jI|d�tCjD�}|jI|d�|jW||jXd�|jW||jZd�|j]d	�|j^ja|�|j^jc�}|jetBjfjh�tCjjtltn�}|j^jq|�|j2j7dtr�d|_:tSd�|jvftSd�|jxftSd�|jzffD]�\}	}
tCjjtn�}tCjD�}tCjP|	|d��}|
jq|�|
ja|�|
jc�jetBjfj|���|j4j7d|j~�tCjPdtCjD�d��}|j�ja|�|j�jc�}
|
j7d|j��|
jetBjfj��|j�tSd�gtSd�gtSd�gtSd�ggf|j�dgdgdgdgdgdggf|j�tSd �gtSd!�gtSd"�gtSd#�gtSd$�gtSd%�gtSd&�gtSd'�ggf|j�tSd(�gtSd)�gtSd*�gtSd+�gtSd,�gtSd-�gtSd.�gtSd/�gtSd0�gtSd1�gtSd2�gtSd3�gtSd4�gtSd5�gtSd6�gtSd7�gtSd8�gtSd9�gtSd:�gtSd;�gtSd<�gtSd=�gtSd>�gtSd?�gtSd@�gtSdA�gtSdB�gtSdC�ggf|j�gf|j�tSdD�gtSdE�gtSdF�ggf|j�gf|j�tSdG�gtSdH�ggf|j�tSdI�gtSdG�gtSdJ�ggf|j�gff
D]�\}}tCjjtn�}|D]}|j�|�K��tCjD�}|jI|d	�|jK|d
d�|jq|���t�j�dLtldM|j�|j��t�j�dNtld|j�|j�gdO�tSdP��Q�t�j�dRt�d|j�|j��t�j�dStldM|j�|j�gdT�d	�U�t�j�dVtndW|j�|j�gdX��Y�t�j�dZtld[|j�|j��t�j�d\tld|j�|j�gd]�d	�U�t�j�d^tld_|j�|j��t�j�d`tnda|j�|j�d	�b�t�j�dctndd|j�|j�gde�d	�U�t�j�dftndg|j�|j�d	�b�t�j�dhtndi|j�|j�didjg�Y�t�j�dktld|j�|j�gdl�d	�U�t�j�dmt�j�t�j�dn�|j�|j�d	�b�t�j�dotndp|j�|j�d	�b�t�j�dqt�d|j�|j��t�j�drtld[|j�|j��t�j�dstld[|j�|j��t�j�dttld|j�|j��t�j�dutldv|j�|j��t�j�dwt�dx|j�|j��t�j�dyt�dz|j�|j��t�j�d{tld|j�|j��t�j�d|tld|j�|j��t�j�d}tld|j�|j��t�j�d~tld|j�|j��t�j�dt�d|j�|j��t�j�d�t�d|�j|�j�t�j�d�tldM|�j|�j�g}i|_�i|_�|D]8}||�j|�j<||�j
|�j<�:d|_�d|_�|�j��td�|z�y#t�dtjd<tjtjd�tjtj�|_tjtj�|_Y��ixYw)�N�C�LC_ALL�Fr)pr�tvPrinterProperties�btnPrinterPropertiesCancel�btnPrinterPropertiesOK�btnPrinterPropertiesApply�btnPrinterPropertiesClose�ntbkPrinter�entPDescription�entPLocation�
entPMakeModel�lblPMakeModel2�	entPState�
entPDevice�lblPDevice2�btnSelectDevice�btnChangePPD�chkPEnabled�
chkPAccepting�
chkPShared�lblNotPublished�btnPrintTestPage�btnSelfTest�
btnCleanHeads�btnConflict�cmbPStartBanner�
cmbPEndBanner�cmbPErrorPolicy�cmbPOperationPolicy�
rbtnPAllow�	rbtnPDeny�tvPUsers�entPUser�btnPAddUser�btnPDelUser�lblPInstallOptions�swPInstallOptions�vbPInstallOptions�
swPOptions�lblPOptions�
vbPOptions�vbClassMembers�lblClassMembers�tvClassMembers�tvClassNotMembers�btnClassAddMember�btnClassDelMember�btnRefreshMarkerLevels�tvPrinterStateReasons�ntbkPrinterStateReasons�
sbJOCopies�btnJOResetCopies�cmbJOOrientationRequested�btnJOResetOrientationRequested�cbJOFitplot�btnJOResetFitplot�
cmbJONumberUp�btnJOResetNumberUp�cmbJONumberUpLayout�btnJOResetNumberUpLayout�sbJOBrightness�btnJOResetBrightness�cmbJOFinishings�btnJOResetFinishings�sbJOJobPriority�btnJOResetJobPriority�
cmbJOMedia�btnJOResetMedia�
cmbJOSides�btnJOResetSides�cmbJOHoldUntil�btnJOResetHoldUntil�cmbJOOutputOrder�btnJOResetOutputOrder�cmbJOPrintQuality�btnJOResetPrintQuality�cmbJOPrinterResolution�btnJOResetPrinterResolution�cmbJOOutputBin�btnJOResetOutputBin�
cbJOMirror�btnJOResetMirror�sbJOScaling�btnJOResetScaling�sbJOSaturation�btnJOResetSaturation�sbJOHue�
btnJOResetHue�	sbJOGamma�btnJOResetGamma�sbJOCpi�
btnJOResetCpi�sbJOLpi�
btnJOResetLpi�sbJOPageLeft�btnJOResetPageLeft�
sbJOPageRight�btnJOResetPageRight�sbJOPageTop�btnJOResetPageTop�sbJOPageBottom�btnJOResetPageBottom�cbJOPrettyPrint�btnJOResetPrettyPrint�cbJOWrap�btnJOResetWrap�sbJOColumns�btnJOResetColumns�
tblJOOther�entNewJobOption�btnNewJobOption�vboxMarkerLevelsrU)rzdelete-eventT�textr�clicked�Message�zMembers of this class�Others�Users)r��response)�markup�changedzPortrait (no rotation)zLandscape (90 degrees)zReverse landscape (270 degrees)zReverse portrait (180 degrees)�1�2�4�6�9�16zLeft to right, top to bottomzLeft to right, bottom to topzRight to left, top to bottomzRight to left, bottom to topzTop to bottom, left to rightzTop to bottom, right to leftzBottom to top, left to rightzBottom to top, right to left�None�Staple�Punch�Cover�Bindz
Saddle stitchzEdge stitch�Fold�Trim�Balez
Booklet makerz
Job offsetzStaple (top left)zStaple (bottom left)zStaple (top right)zStaple (bottom right)zEdge stitch (left)zEdge stitch (top)zEdge stitch (right)zEdge stitch (bottom)zStaple dual (left)zStaple dual (top)zStaple dual (right)zStaple dual (bottom)zBind (left)z
Bind (top)zBind (right)z
Bind (bottom)z	One-sidedzTwo-sided (long edge)zTwo-sided (short edge)�Normal�Reverse�Draft�High)�row�copies�zorientation-requested)r����zAutomatic rotation)�combobox_map�special_choice�fitplotz	number-up)r��r�r��	�)r��
use_supportedznumber-up-layout�lrtb)r��lrbt�rltb�rlbt�tblr�tbrl�btlr�btrl)r��
brightness�d�
finishings)r�r�r�r���r��
���
��������������2�3�4�5zjob-priorityr��media�A4)r��sides�	one-sided)r�ztwo-sided-long-edgeztwo-sided-short-edgezjob-hold-untilzno-hold�outputorder�normal�reversez
print-quality)r�r�r�zprinter-resolution)�,r�r�z
output-binzface-up�mirror�scaling�
saturation�hue�gammai��cpig$@�lpig@z	page-leftz
page-rightzpage-topzpage-bottom�prettyprint�wrap�columnsz+%s)�r�__init__�locale�	getlocale�LC_MESSAGES�language�LC_CTYPE�encoding�nonfatalException�os�environ�	setlocaler&�parent�printer�ppd�set�	conflictsr��dict�
signal_ids�updating_widgets�
getWidgets�config�PACKAGEr�dialog�connect�	on_deleter?r@rArBr�CellRendererText�clear�
pack_start�
add_attributerU�!on_btnRefreshMarkerLevels_clicked�TreeViewColumn�_�CellRendererPixbuf�set_cell_data_func�set_printer_state_reason_icon�set_printer_state_reason_text�
set_resizablerV�
append_column�
get_selection�set_mode�
SelectionMode�NONE�	ListStore�int�str�	set_modelr�static_tabsrQrRrE�MULTIPLE�printer_properties_responser(�(on_tvPrinterProperties_selection_changed�SINGLErZr^r`rdrhrjrlrnrprt�append�options�OptionAlwaysShownrXrY�OptionAlwaysShownSpecialr[�boolr\r]r_rarbrcrerfrgrirkrmrorq�
IPPResolutionrrrsrurvrwrxryrzr{r|r}r~r�floatr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r��job_options_widgets�job_options_buttonsr�button�_monitor�	_ppdcache�connect_signals�
debugprint)�self�combobox�cell�btn�column�iconr��	selection�store�name�treeview�model�col�selr�optsr��options                  rr�z PrinterPropertiesDialog.__init__Os
����� � �$�'�	>�"�,�,�V�-?�-?�@�D�M�"�,�,�V�_�_�=�D�M����"&�&���t�x������u����&���!&������2�Y8�Z9�x &�~�~�y	�\	/�~�2�2���	
�����^�T�^�^�<��-�-��+�+��-�-��1�1�3�	5�H��'�'�*�D��N�N������t�,��"�"�D�&�!�4�	5��)�)�����Y�� F� F�G��#�#�Q�y�\�2���%�%�(�����4��'��#�#�&�����4��'��!�!�4��)K�)K�T�R��!�!�4��)K�)K�T�R����d�#��"�"�0�0�&�9��.�.�<�<�?�	����C�-�-�2�2�3��
�
�s�C�(���"�"�,�,�e�4��$�$�,�,�n�.A�	C�����&�
'��)<�)<�=�
�x�[�$�0�0�1�
�w�Z����'��	J�N�D�(��M�M�#�&�E��'�'�)�D��'�'��d��;�F����u�%��"�"�6�*��"�"�$�-�-�c�.?�.?�.H�.H�I�	J�	
�����Z��)I�)I�J�� � �"�c�&:�&:�&=�a�H��� � �.�.��4��&�&�4�4�7�����Y�� M� M�N����c�'�'�.�.�/��6�6��4�5�6��4�5�6��=�>�?��<�=�>�@�A��*�*������u�s�e�c�U�T�F�C�E��0�0��:�;�<��:�;�<��:�;�<��:�;�<��:�;�<��:�;�<��:�;�<��:�;�<�>�?��,�,��F�)���H�+���G�*���G�*���F�)���O�,�-��M�*�+��F�)���F�)���F�)���O�,�-��L�/�*��/�0�1��2�3�4��0�1�2��3�4�5��0�1�2��/�0�1��1�2�3��2�3�4��0�1�2��/�0�1��1�2�3��2�3�4��M�*�+��L�/�*��N�+�,��O�,�-�7/�0�@����,�����K�.�)��3�4�5��4�5�6�8�9�
�+�+�R�0��-�-��H�+���I�,��)�*��.�.��G�*���H�+���F�)��&�'�
�+�+�R�0�KF�O	%�
�V�
�N�M�M�3�'�E��
'�����#��&�
'��'�'�*�D����t�T�*�� � �$���2����e�$�_O	%�b�*�*�H�c�1�,0�O�O�,0�,A�,A�C��1�1�)�3���0�0��5�5�!-�!"�#7�!8�:��*�*�I�t�U�,0�,<�,<�,0�,B�,B�D��*�*�K��a�,0�,>�,>�,0�,C�,C�9L�<@�	B��*�*�,>��V�,0�,D�,D�,0�,I�,I�<F�
G��*�*�L�#�s�,0�,?�,?�,0�,E�,E�G��*�*�L�#�q�,0�,@�,@�,0�,E�,E�<N�=A�
B��*�*�N�C��,0�,@�,@�,0�,F�,F�H��*�*�G�S�,0�
-1�O�O�,0�,@�,@�<@�B��*�*�G�S�+�,0�O�O�,0�,@�,@�-G�=A�B��*�*�,<�c�,5�,0�,?�,?�,0�,D�,D�<@�	B��*�*�M�3�,4�,0�,A�,A�,0�,F�,F�.6�.7�-:�;��*�*�O�S�!�,0�,B�,B�,0�,G�,G�;F�<@�	B��*�*�,@�,3�,A�,A�,3�,A�,A�+�,N�,0�,G�,G�,0�,L�,L�<@�B��*�*�L�#�,5�,0�,?�,?�,0�,D�,D�<@�	B��*�*�H�d�E�,0�O�O�,0�,A�,A�C��*�*�I�s�C�,0�,<�,<�,0�,B�,B�D��*�*�L�#�s�,0�,?�,?�,0�,E�,E�G��*�*�E�3��,0�L�L�,0�,>�,>�@��*�*�G�S�$�,0�N�N�,0�,@�,@�B��*�*�E�5�$�,0�L�L�$�:L�:L�N��*�*�E�5�#�,0�L�L�$�:L�:L�N��*�*�K��a�,0�,=�,=�,0�,C�,C�E��*�*�L�#�q�,0�,>�,>�,0�,D�,D�F��*�*�J��Q�,0�,<�,<�,0�,B�,B�D��*�*�M�3��,0�,?�,?�,0�,E�,E�G��*�*�M�4��,0�,@�,@�,0�,F�,F�H��*�*�F�D�%����,0�,?�,?�A��*�*�I�s�A�,0�,<�,<�,0�,B�,B�D�u]��|$&�� �#%�� ��	=�F�6<�D�$�$�V�]�]�3�6<�D�$�$�V�]�]�3�	=���
���������E�D�L�!��K
	>���#&�B�J�J�x� ����f�m�m�R�0�"�,�,�V�-?�-?�@�D�M�"�,�,�V�_�_�=�D�M�s
�Ay�B{c�$�td|z�|`y)Nz-%s)r2r/�r3s r�__del__zPrinterPropertiesDialog.__del__�s���E�D�L�!��Mrc��|jj|g�}|j||j||�f�||j|<y�N)r�getr%r	)r3�
collection�objr;�handler�cs      r�_connectz PrinterPropertiesDialog._connectsB���O�O����R�0��	���3����T�7�3�4�5�&'����
�#rc���|r|g}n#t|jj��}|D]F}||jvs�|j|D]\}}|j|��|j|=�HyrF)�listr�keys�
disconnect)r3rH�collrI�	signal_ids     r�_disconnectz#PrinterPropertiesDialog._disconnectsu���$��J��d�o�o�2�2�5�6�J��	*�D��t���&�(,����(=�/�$�S�)��N�N�I�.�/��O�O�D�)�	*rc�`�|jr"|jj�d|_yyrF)rrrCs r�
do_destroyz"PrinterPropertiesDialog.do_destroys*���'�'��(�(�0�0�3�+/�D�(�(rc��td|z�|j�d|_d|_d|_|jd�y)NzDESTROY: %sr)r2rSr��	ppd_localr��emitrCs rrzPrinterPropertiesDialog.destroys<���M�D�(�)���������������	�	�9�rc��||_|sy|jjd|j�|jjd|j�|jjd|j�|jjd|j
�|jjd|j�y)Nz
printer-eventzprinter-removedzstate-reason-addedzstate-reason-removedzcups-connection-error)r/r	�on_printer_event�on_printer_removed�on_state_reason_added�on_state_reason_removed�on_cups_connection_error)r3�monitors  r�set_monitorz#PrinterPropertiesDialog.set_monitors�����
����
�
�����0E�0E�F��
�
���0�$�2I�2I�J��
�
���3�T�5O�5O�P��
�
���5�#�;�;�	=��
�
���6�#�<�<�	>rc��||_||_||_|stj�|_|stj
�|_|j�%|jtjd���|jj�|_|jd�tj�|_|j!d|jd|j"�|j!d|jd|j$�|r|j&j)|�|j+||||��|j,sy|j.|j0|j2fD]9}|j,j4r|j7��*|j9��;|j,j4r|j:j9�n|j:j7�|j=�|j>jAtCd��|jDjAtCd��|jF}|jItKjL�dd�tO�}|j&jQtCd	�||fz�|j&j9�y)
NF)�monitor_jobs�
newPrinterGUIzprinter-modifiedzdialog-canceled)r�
encryptionr�zCUPS test pagezyTypically shows whether all jets on a print head are functioning and that the print feed mechanisms are working properly.zPrinter Properties - '%s' on %s))r��_host�_encryptionrr�
getEncryptionr/r`r_�Monitor�get_ppdcacher0rS�
newprinter�
NewPrinterGUIrcrL�on_printer_modified�on_printer_not_modifiedr�set_transient_for�loadr�r)r*r+�
discoveredr�showr,�setDataButtonStater;�set_tooltip_textrr<r(�
set_cursorr�TreePathr�	set_title)r3r;rrdr�r.r<s       rrqzPrinterPropertiesDialog.show,s8�������
�%�������)�D�J��#�1�1�4�D���=�=� ����g�o�o�E�B�C����3�3�6������/�*�'�5�5�8����
�
���(:�(:�)�4�+C�+C�	E��
�
���(:�(:�(�$�*F�*F�	H���K�K�)�)�6�2��	�	�4�d�z�&�	�I��|�|���6�6��2�2��5�5�7�	�F��|�|�&�&���������
	��<�<�"�"��*�*�/�/�2��*�*�/�/�2����"����.�.�q�1A�/B�C����)�)�!�-E�+F�	G��+�+�����S�\�\�^�T�5�9�#�&�������q�".� /�26��� >�	?������rc�*�|jstjj}|tjjk(r�td�}|dz
}|jD]}||jjdzz
}� tj|jddtjjtjj|��}|j�|j!�y|tjj"k(s|tjj$k(rS|tjj"k(rt'|j(�dk(rd}n|j+|j�}|tjj$k(r8s6	|j-|jj.�|j1�|tjj"k(rr|tjjk(rxd|_d|_d|_|j7�|j9d�|j:j<j?d	�r|j:jAd�yyy#Y��xYw)
Nz^There are conflicting options.
Changes can only be applied after
these conflicts are resolved.z

�
T)r��modal�destroy_with_parent�message_type�buttonsr�rFr�visible)!r�r�ResponseType�CANCEL�REJECTrrrAr��
MessageDialogr�MessageType�WARNING�ButtonsType�CLOSE�runr�OK�APPLY�lenr��save_printerror;rrr�rWrrXrc�NewPrinterWindow�get_property�on_NPCancel)r3rr��messagerA�faileds      rr"z3PrinterPropertiesDialog.printer_properties_response_s���|�|��'�'�.�.�H��s�'�'�.�.�.��8�9�G�
�v��G��.�.�
5���6�=�=�-�-��4�4��
5��&�&�d�k�k�-1�t�47�O�O�4K�4K�/2���/D�/D�,3�	5�F�

�J�J�L��N�N�����(�(�+�+�+���(�(�.�.�.��C�,�,�/�/�/�C����4F�!�4K����*�*�D�L�L�9���s�'�'�-�-�-�f�
��	�	�4�<�<�,�,�-�
�#�#�&�
��)�)�,�,�
,�V���(�(�/�/�/��D�H�!�D�N��D�L��K�K�N��I�I��'��!�!�2�2�?�?��K��"�"�.�.��5�L�
0��

��s�$%J�Jc�X�|j|tjj�yrF)r"rr~r)r3rrs   rr
z!PrinterPropertiesDialog.on_delete�s���(�(�&�#�2B�2B�2I�2I�Jrc�Z�t|tj�r|j�}n�t|tj�r|j�}n�t|tj�r|j�}nXt|tj�r3|j�}|j�}|j|d�}ntd��|j}|j|j|j|j |j"|j$|j&|j(|j*|j,|j.|j0|j2|j4|j6|j8|j:|j<|j>|j@|jB|jDi}||}||k(r|jFjI|�n|jFjK|�|jM�y)Nr�zWidget type not supported (yet))'�
isinstancer�CheckButton�
get_active�Entry�get_text�RadioButton�ComboBox�	get_model�get_active_iter�	get_value�
ValueErrorr�r.�infor/�locationr3�
device_urir7�enabledr8�	rejectingr9�	is_sharedr?�job_sheet_startr@�
job_sheet_endrA�error_policyrB�	op_policyrC�
default_allowr��discard�addrr)r3r�valuer=�iter�p�
old_values�	old_values        r�on_printer_changedz*PrinterPropertiesDialog.on_printer_changed�s����f�c�o�o�.��%�%�'�E�
���	�	�
*��O�O�%�E�
�����
0��%�%�'�E�
�����
-��$�$�'�E��)�)�+�D��O�O�T�1�-�E��>�?�?��L�L��� � �1�6�6�����
�
��O�O�a�l�l����q�y�y����Q�[�[���O�O�a�k�k�� � �1�#4�#4�������� � �1�>�>��$�$�q�{�{��O�O�Q�_�_��
��v�&�	�����L�L� � ��(��L�L���V�$����!rc��|j�r|jj|�n|jj|�|jr|jj|�n|jj|�|j�|jrf|jrY||jk(rI|j�dk(r|jj�y|jj�yyyy)N�True)�
is_changedr�r�r�rrr�option_manualfeed�option_inputslot�get_current_value�disable�enable�r3rAs  r�option_changedz&PrinterPropertiesDialog.option_changed�s��������L�L���V�$��L�L� � ��(�����N�N���v�&��N�N�"�"�6�*����!��"�"�t�'<�'<��d�,�,�,��'�'�)�V�3��%�%�-�-�0��%�%�,�,�/�	
-�(=�"rc���|jj�}g�|j�fd�d��j��S)z%return list of usernames from the GUIc�L���j|j|d�d�S�Nr)r%rG)r=�pathr��data�results    �r�<lambda>z3PrinterPropertiesDialog.getPUsers.<locals>.<lambda>�s$����m�m�E�I�I�d�A�$6�q�$9�:�rN)rEr��foreach�sort)r3r=r�s  @r�	getPUsersz!PrinterPropertiesDialog.getPUsers�s=����
�
�'�'�)����
�
�
�;�<@�	B����
��
rc��|jj�}|j�|D]}|j|f��|j	|j
�|j
|j�y)z$write list of usernames into the GUIN)rEr�rr%�on_entPUser_changedrF�on_tvPUsers_cursor_changed)r3�usersr=�users    r�	setPUsersz!PrinterPropertiesDialog.setPUsers�s`���
�
�'�'�)��
���
��	"�D��L�L�$��!�	"�	
� � ����/��'�'��
�
�6rc�X�|jsy|j�|jjk7r&|jj	|j
�n%|jj
|j
�|j|j
�|j�y)zLcheck if users in GUI and printer are different
        and set self.changedN)	r�r��except_usersr�r�rEr�r�rrrCs r�checkPUsersChangedz*PrinterPropertiesDialog.checkPUsersChanged�sq���|�|���>�>��t�|�|�8�8�8��L�L���T�]�]�+��L�L� � ����/��'�'��
�
�6����!rc���|jj�}|rF|jj�j	d|f�|jjd�|j
�y)Nrr')rFr�rEr��insert�set_textr�)r3r.r�s   r�on_btnPAddUser_clickedz.PrinterPropertiesDialog.on_btnPAddUser_clicked�sT���}�}�%�%�'����M�M�#�#�%�,�,�Q���8��M�M�"�"�2�&����!rc�P�|jj�j�\}}|D�cgc]"}tjj||���$}}|D]4}|j
�}|j|�}|j|��6|j�ycc}wrF)
rEr�get_selected_rowsr�TreeRowReference�new�get_path�get_iter�remover�)r3r.r=�rowsr�r�r�s       r�on_btnPDelUser_clickedz.PrinterPropertiesDialog.on_btnPDelUser_clicked�s����m�m�1�1�3�E�E�G���t�AE�F�#��$�$�(�(�%��5�F��F��	�C��<�<�>�D��>�>�$�'�D��L�L���	�	
���!��Gs�'B#c�h�|jjt|j���yrF)rG�
set_sensitiver)r��r3rs  rr�z+PrinterPropertiesDialog.on_entPUser_changed�s"�����&�&�t�F�O�O�,=�'>�?rc��|j�}|�y|j�\}}|jjt	|��yrF)rr�rHr�r))r3rr9r=r�s     rr�z2PrinterPropertiesDialog.on_tvPUsers_cursor_changedsC���(�(�+�	�����1�1�3���t����&�&�t�D�z�2rc�N�|j|}|j�|j|jvr|j|j=|j	�r|j
j
|�n|j
j|�|j�yrF)	r-�resetr;�server_side_optionsr�r�r�r�rr�r3r.rAs   r�on_job_option_resetz+PrinterPropertiesDialog.on_job_option_reset	s{���)�)�&�1�������;�;�$�2�2�2��(�(����5������L�L���V�$��L�L� � ��(����!rc��|jsy|j|}|j�|j�r5||j|j
<|jj
|�nJ|j
|jvr|j|j
=|jj|�|j�yrF)	r�r,r�r�r�r;r�r�rr)r3rrAs   r�on_job_option_changedz-PrinterPropertiesDialog.on_job_option_changeds����|�|���)�)�&�1����������4:�D�$�$�V�[�[�1��L�L���V�$��{�{�d�6�6�6��,�,�V�[�[�9��L�L� � ��(����!rc��t|j�}|dk(r|jj�y|jj	�}|D]}|jj|��d}|jD�]*}|jj
|jd|dd�|jjdd�|jj
|jd|dd�|jj|�tjjtjtjj �}|j#d|j$�||_|j|�|jj
|d|dd�|dz
}��-|jj)�y)Nrr����?r�r�)r��other_job_optionsr�r�get_childrenr��attach�label�
set_alignment�selectorr�r�Button�new_from_icon_name�STOCK_REMOVE�IconSize�BUTTONr	�on_btnJOOtherRemove_clicked�pyobject�show_all)r3�editable�n�children�child�i�optr6s        r�draw_other_job_optionsz.PrinterPropertiesDialog.draw_other_job_options&sc����'�'�(����6��O�O� � �"���?�?�/�/�2���	+�E��O�O�"�"�E�*�	+�
���)�)�	�C��O�O�"�"�C�I�I�q�!�Q��:��I�I�#�#�S�#�.��O�O�"�"�C�L�L�!�Q��1�=��L�L�&�&��1��*�*�/�/��1A�1A�14���1D�1D�F�C��K�K�	�4�#C�#C�D��C�L����x�(��O�O�"�"�3��1�a��3�
��F�A�	�	
��� � �#rc��	tj||||j�}||_|jj|�|j|��||j|<||jvrd|_|jj|�|j�|r|jj�yy#t$r
t	�YywxYw)N�r�F)r&r	r�r�r��is_newr�r%r�r�r�r�rrr��
grab_focus)r3r;r��	supportedr�r�rAs       r�add_job_optionz&PrinterPropertiesDialog.add_job_option@s���	��)�)�$��y�*.�*=�*=�?�F���
����%�%�v�.��#�#�h�#�7�)/�� � ��&��4�<�<��!�F�M������� ����!���O�O�&�&�)����	�� ��	�s�"C�C�Cc�Z�|j}|jj|�|j�|jr|j
j
|�n%|j
j|j�|j|j=|j�yrF)r�r�r�r�r�r�r�r�r;r�rrr�s   rr�z3PrinterPropertiesDialog.on_btnJOOtherRemove_clickedUsz���������%�%�v�.��#�#�&��=�=��L�L� � ��(�
�L�L���V�[�[�)��$�$�V�[�[�1����!rc��|jj�}|j|�|jj	�|jjd�|jjd�|j�y)Nr'F)	r�r�rr�r�r�r�r�rr)r3r.r;s   r�on_btnNewJobOption_clickedz2PrinterPropertiesDialog.on_btnNewJobOption_clickedash���#�#�,�,�.�����D�!���� � �"����%�%�r�*����*�*�E�2����!rc��|jj�}t|�dkDxr||jv}|jj|�yr�)r�r�r�r�r�r�)r3rr��actives    r�on_entNewJobOption_changedz2PrinterPropertiesDialog.on_entNewJobOption_changedisG���#�#�,�,�.���d�)�a�-�I�T��1I�1I�%I�����*�*�6�2rc�&�|j|�yrF)rr�s  r�on_entNewJobOption_activatez3PrinterPropertiesDialog.on_entNewJobOption_activatens���'�'��0rc�
�	|jj}|jdg�}t|j�xr/|jj
xr|jj}	|jd�|}|jj|�|jjxst|j�}|j|jfD]}|j|��d}d}|rm|jjtj zdk7rC	|jd�|jdg�}	|	D]}
|
dk(rd}|s�
n|
d	k(s�d}|s�n||j"f||j$ffD](\}}|r|j'��|j)��*	|j,s�|jj.so|jj0j3d
�s%|jj0j3d�rV|jj0j5d�r1|jjs|jj'�n|jj)�d}d}
|j6rqt9d
�|j:j'�|j6D]<}|j<j?�|j@j?�k(rd}�;d}
�>n|j:j)�tCd�}tCd�}|rd|z}|
rd|z}|j@jE|�|jFjE|�|jHjK�}|r�tM|jNjQ��D]�}|jNjS|�}|jNjU|�j?�}	||j@j?�k(r&|jW|f�}|jY|d|�nB||jFj?�k(r%|jW|f�}|jY|d|���|jZjt]|j�dkDxr
|j6�|j^j|j6�y#t$rd}Y���wxYw#t$rY���wxYw#t+�Y��wxYw#t$rY��vwxYw)Nzdocument-format-supportedzapplication/postscriptFr�application/vnd.cups-commandzprinter-commands�PrintSelfTestPageT�Cleanzdnssd:zmdns:z/cupszConflicts detectedzInstallable OptionszPrinter Options�	<b>%s</b>)0r��other_attributesrGr)r�r�r��indexr�r;r�rpr6r5�typer�CUPS_PRINTER_COMMANDSr<r=rqrr�r��remoter��
startswith�endswithrr2r>�	tab_labelr�rIr�
set_markuprMr(r��ranger-�get_n_pages�get_nth_page�
get_tab_labelr��	set_valuer+r�r*)r3�attrs�formats�	printable�testpage�
adjustabler.�selftest�
cleanheads�commands�command�cond�installablebold�optionsboldrA�installabletext�optionstextr:r��pager�r�s                      rrrz*PrinterPropertiesDialog.setDataButtonStaters���2	 ��L�L�1�1�E��i�i� ;�R�@�G�!�4�<�<�0�0�4����-�-�4�!�\�\�3�3�3�
�
!��
�
�7�8�$��

�!�!�/�/��:�"�l�l�5�5�L��t�|�|�9L�M�J��,�,��/�/�1�
2���$�$�j�1�
2��H��J�����"�"�T�%?�%?�?�A�E���M�M�#A�B� %�y�y�);�R�@�H�#+�	&��"�&9�9�'+�H�)� %�$��/�)-�J�'� %�	&�#+�D�,<�,<�!=�",�d�.@�.@�!A�!C�
#���f���K�K�N��K�K�N�
#��8�8�
�\�\�
 �
 ��|�|�&�&�1�1�(�;��|�|�&�&�1�1�'�:��l�l�%�%�.�.�w�7��L�L�#�#��!�!�&�&�)��!�!�&�&�)������>�>��,�-����!�!�#��.�.�
'���#�#�,�,�/�4�3J�3J�3S�3S�3V�V�&*�O�"&�K�	
'�
���!�!�#��1�2���)�*���)�O�;�O��%��3�K����*�*�O�<����#�#�[�1��(�(�2�2�5����D�,�,�8�8�;�<�

���'�'�4�4�a�8���(�(�6�6��=�F�F�I��
��� 7� 7� @� @� B�B�$�~�~��t�4������q�/�B��$�"2�"2�";�";�">�>�$�~�~��t�4������q�+�>��

�	
�&�&�4�4�c�4�<�<�6H�1�6L�7I�:>�.�.�6H�	J��#�#�1�1�t�~�~�3E�F��{�
!� ��
!��<"�����	 ����Z"����s{�A/T�2S=�B'T�-1T�T�'T�,T�/AT�BT1�=T�T�T�T�	T�T�T�T�T.�1	T>�=T>c�0�|�|j}d}|j}|jr(|jj	td�|z�n'|jj	td�|z�	|js_|jrS|j�|jj�s|r'|jj||j��|j�r�tj|j�}|�s&tjdtjj tj"j$td���}|j'td��|j)tj*tj,j.tj0tj,j2�|j5�}|j7�|tj,j.k(r|jj9�y	d	}|j:dd}	|D]4}
|
|	vr|	j=|
��|jj?|
|��6|	D]}
|jjA|
|�� |jBjE�}|jFjE�}|jHjE�}
|jJjM�}|jNjM�}|jPjM�}||jRk7s|r|jjU||�||jVk7s|r|jjY||�|js-|
|jZk7s|r|jj]||
�||j^k7s|r|ja|�||jbk(s|r|je|�||jfk7s|r|ji|�d
�}||jj�}||jl�}||jn�}||jp�}||jrk7s||jtk7s|r|jw||�||jxk7s|r|j{|�||j|k7s|r|j|�|j�jM�}|j��}||j�k7s||j�k7s|r|j�||�|j�D]"}||j�vs�|j�|��$|j�j��D]�}|j��s%|s�|j��|j��k7s�8t�d|j�d|j�����|j�|j|j�����	|jj9�t��|_R|jj�sld
|j�vr^|jj	td��	|jj��|_V|jj9�|s!	|j��|j��|j�j��y#tj�$r@}|j�\}}t�|||�|jj9�Yd}~y	d}~wwxYw#t��Y��xYw#tj�$rY��wxYw)NFzmodifying class %szmodifying printer %s)r�rzThis will delete this class!)�flagsr{r|r�zProceed anyway?Tc�f�|j�}|j�}|j|d�S�Nr�)r�r�r�)�cmbr=r�s   r�get_combo_valuez=PrinterPropertiesDialog.save_printer.<locals>.get_combo_value!s-���
�
�(���*�*�-������a�0�0rzSet z = �server_settingszfetching server settings)\rr;�is_classr�_begin_operationrr��getPrinterSettings�nondefaultsMarked�
addPrinterrj�getCurrentClassMembersrQrr�r�r�r�r�format_secondary_text�add_buttons�STOCK_CANCELr~�NO�STOCK_DELETE�YESr�r�_end_operation�
class_membersr��addPrinterToClass�deletePrinterFromClassr/r�r.r3r7r�r8r9r��setPrinterInfor��setPrinterLocationr��setPrinterDevicer��
setEnabledr��setAcceptingr��	setSharedr?r@rArBr�r��setJobSheetsr��setErrorPolicyr��setOperationPolicyrCr�r�r��	setAccess�
attributesr��unsetOption�valuesr�r��get_defaultr2�	setOption�IPPError�args�show_IPP_Errorrr��_use_pk�__dict__�adminGetServerSettingsr3r��
getAttributes�updatePrinterPropertiesr/�update)r3r��saveallr��
class_deletedr;�new_membersrr��old_members�memberr�r�r�r��	accepting�sharedr2r�r�r�r�r�r�rA�e�ss                           rr�z$PrinterPropertiesDialog.save_printer�s���>��[�[�F��
��|�|������I�I�&�&��*>�(?�$�(F�G��I�I�&�&��*@�(A�D�(H�I�c	��#�#�����'�'�)��8�8�-�-�/�7��I�I�(�(��4�8�8�(�<����(�?�?��@S�@S�T��"� �.�.�"#�),���)@�)@�$'�O�O�$8�$8�!"�#A�!B�	D�F�
�0�0��3D�1E�F��&�&��(8�(8�#�:J�:J�:M�:M�(+�(8�(8�#�:J�:J�:N�:N�P�#�Z�Z�\�F��N�N�$��s�/�/�2�2�2��	�	�0�0�3�#�$(�M�&�3�3�A�6��)�B�F���,�#�*�*�6�2��	�	�3�3�F�D�A�	B�
*�C�F��I�I�4�4�V�T�B�C��(�(�1�1�3�H��'�'�0�0�2�D����1�1�3�J��&�&�1�1�3�G��*�*�5�5�7�I��_�_�/�/�1�F��W�\�\�!�W��	�	�(�(��t�4���)�)�)�W��	�	�,�,�T�8�<��$�$��W�/�/�/�7��	�	�*�*�4��<��'�/�/�)�W��"�"�7�+��G�-�-�-���$�$�Y�/���*�*�*�g��!�!�&�)�
1�
.�t�/C�/C�D�O�+�T�-?�-?�@�M�*�D�,@�,@�A�L�'��)A�)A�B�I��7�#:�#:�:���!6�!6�6�7��$�$�_�m�D��w�3�3�3�w��&�&�|�4��G�-�-�-���*�*�9�5� �O�O�6�6�8�M��>�>�+�L���!6�!6�6��� 4� 4�4���!�!�-��>�!�,�,�
0����!9�!9�9��'�'��/�
0��2�2�9�9�;�
O���%�%�'���-�-�0�F�4F�4F�4H�H�����17�1I�1I�1K�!M�N��%�%�f�k�k�6�3K�3K�3M�N�

O�	
�	�	� � �#��u����y�y� � �%6�d�m�m�%K�

�I�I�&�&��*D�(E�F�
$�'+�y�y�'G�'G�'I��$�
�I�I�$�$�'��
��%�%�(��,�,�/�	
�
�
������=�}�}�	��V�V�F�Q���1�a��(��I�I�$�$�'���		�� 
$�!�#���=�=�
��
�sR�9F=\�7L<\�4A\�7!\�A\�!].� ]?�]+�+6]&�&]+�.]<�?^�^c�b�|jj�D]}|j��yrF)r&rP�	writebackr�s  rr6z*PrinterPropertiesDialog.getPrinterSettingses*���l�l�)�)�+�	�F�����	rc��|j�\}}|r||_y	|j}|j|�r|j	|�yy#t$rYywxYwrF)�get_selected�%printer_properties_last_iter_selected�AttributeError�
iter_is_valid�select_iter)r3r9r=r�s    rr#z@PrinterPropertiesDialog.on_tvPrinterProperties_selection_changedksf��!�.�.�1�
����9=�D�6�
��A�A��
�"�"�D�)��%�%�t�,�*��	"�
��
�s�A�	A�Ac���|j�\}}|�O|j�}|j|�}|j|d�}|jj|�yyr0)�
get_cursorr�r�r�r-�set_current_page)r3r<r�r7r=r�r�s       r�%on_tvPrinterProperties_cursor_changedz=PrinterPropertiesDialog.on_tvPrinterProperties_cursor_changedzs_��!�,�,�/���v����&�&�)�E��>�>�4�(�D�����q�)�A����-�-�q�1�	rc�8�|jj�yrF)r;r�rCs r�
printTestPagez%PrinterPropertiesDialog.printTestPage�s�����%�%�(rc�,�|j}|syd}|jdk7r\|jjd�}|r?tjjtd|jj�z�}tj�}tjd�	tj|jd|j|j ��}d}|j't)d��	|rKtjj+|�r,t-d|z�|j/|j0|��}n&t-d	�|j/|j0�}|j;�tj|�|�.t=t)d�t)d�|z|j��yy#t"$r!}t%d||j�Yd}~yd}~wwxYw#tj2$r�}|j4\}}	|tj6k(rK|jd
k7r<|jddk7r*t9t)d
�t)d�|j�nt%||	|j�Yd}~�� d}~wwxYw)NF�PageSizeztestpage-%s.psr')�try_as_rootrrdzprinting test pagezPrinting custom test page )�filezPrinting default test pagerrr�Not possible�^The remote server did not accept the print job, most likely because the printer is not shared.�	SubmittedzTest page submitted as job %d�r�)r�r��
findOptionr�r��join�pkgdata�	defchoice�lowerr�getUser�setUser�authconn�
Connectionr�rerf�RuntimeErrorrUr5r�existsr2rrr;rSrT�IPP_NOT_AUTHORIZED�show_error_dialogr@�show_info_dialog)
r3r.r��custom_testpager�r�rKrc�job_id�msgs
          r�on_btnPrintTestPage_clickedz3PrinterPropertiesDialog.on_btnPrintTestPage_clicked�s���,�,�������8�8�u���(�(�%�%�z�2�C��"$�'�'�,�,�w�/?�/2�}�}�/B�/B�/D�0E�#F���|�|������b��	��#�#�T�[�[�e�*.�*�*�04�0@�0@�B�A���	���A�2�3�4�	4��2�7�7�>�>�/�#B��8�?�J�K�������.=�)�?���8�9�������6��	
�������d�����a��n�� ?�@�6�I�%)�[�[�
2���?�	��D�!�T�[�[�1���	���}�}�	4��v�v�H�Q���T�,�,�,��
�
�k�)��
�
�1�
��$�!�1�^�#4�#$�&/�$0�$(�;�;�0��q�#�t�{�{�3���	4�s2�'7G�;A3G1�	G.�
G)�)G.�1J�BJ�Jc�^�|j}|sytjd��5}|jd|z�|j	�|j
j
td��	d}|j
j|j||jtj���}ttd�td�|z|j�	�|j
j%�ddd�y#t
j$r�}|j\}}|t
jk(rC|jjd
k7r*t!td�td�|j�nt#|||j�Yd}~��d}~wwxYw#1swYyxYw)
N�wt)�modez#CUPS-COMMAND
%s
zsending maintenance commandr)�formatrvr�ryz'Maintenance command submitted as job %drzrrwrx)r��tempfile�NamedTemporaryFile�write�flushrr5rrrr;r�r�r�rSrTr�r�rUr@)r3r&r��tmpfiler�r�rcr�s        r�maintenance_commandz+PrinterPropertiesDialog.maintenance_command�sd���,�,����
�
(�
(�d�
3�	(�w��M�M�0�7�:�;��M�M�O��I�I�&�&��*G�(H�I�
8�7�����0�0�'�,�,�9?�7>�|�|�7;�|�|��1�H��!�!�K�.�"#�%-�#.�06�#7�)-���6� 
�I�I�$�$�'�5	(�	(���=�=�
8��6�6���C���0�0�0��L�L�%�%��4�%�q��'8�'(�*3�(4�(,�{�{�4�#�1�c�4�;�;�7���
8��	(�	(�s8�A	F#�0A4D�$F#�F �A<F�F#�F � F#�#F,c�&�|jd�y)Nr
�r��r3r.s  r�on_btnSelfTest_clickedz.PrinterPropertiesDialog.on_btnSelfTest_clicked�s��� � �"5�6rc�&�|jd�y)Nz	Clean allr�r�s  r�on_btnCleanHeads_clickedz0PrinterPropertiesDialog.on_btnCleanHeads_clicked�s��� � �+�.rc�V�|�tj�}tjtt�}|j|�d}t
|�D]@\}}|j|j|�|g�||k(s�.|j|�d}�B|s|jd�yy)NFTr)
�	ppdippstr�TranslationDictrrrr�	enumerater%rG�
set_active)	r3r4rPr��translationdictr=r��nr�vals	         r�fillComboBoxz$PrinterPropertiesDialog.fillComboBox�s����"�'�7�7�:�O��
�
�s�"�$�����E�"��
� ��(�	"�G�B���L�L�O�/�/��5��<�=��e�|��#�#�B�'�!�
�		"������#�rc���t�|_i|_t�|_|st	j
�}|st	j�}tj|j||��}||_tj||j�}||_	|jd}||_|jj }	|j#�|_|j#�|_|j&dk7r|j&j)�|jH|jJ|jLfD]}|jO|��|jP|jR|jT|jV|jX|jZ|j\|j^|j`|jb|jd|jf|jh|jj|jlfD]}|jo|��|jHjq|jr�|jJjq|jt�|jv}|jLjq|�|jjy|jL�|jz|j||jR|j~|jL|jPfD]/}|j�r|j��� |j���1	|j�rB|jr|j�j��n5|j�j��n|j�j��|jZjo|�|j\jo|�|j^jo|�|j`jo|�|jhjqd
�i|_G|j�j��D�]=}
|
j�dk(rD|j$r8|j$j�d�}|r|
j�|j��|}	|jj�|
j�}	|
j�|jj�vr:|jj�|
j�d
}|
j�||��n|
j�|�|
|j�|
j�<|
j�jo|�|r��#|
j�jod���@g|_T|j�|��|jj�j��D]�}
|
|j�vr�|
dk(s|
dk(r�|jj�|
}|
|jj�vr|jj�|
d
}n;t�|t��rddg}tC|�j��}n
d
}tC|�}|j�|
||d|����|j�jqd
�|j�jo|�|j�jod�|j�rW|j�j�|j��}|dk7r|j�j�|�|j�|�n|j�||�|j��|j��|j��t�|_|j��|j��y#t$rY���wxYw#tj*$r�}	|	j,\}	}
|	tj.k7rt1|	|
|j2�|	tj4tj.fvrBt7t9d�t9d�t:j<j>|j2�d|_Yd}	~	��Bd}	~	wt@$rs}	tC|	�jEd�r*tGt9d�t9d�|j2��tGt9d�t9d	�|j2��d}	~	wwxYw#t��|j�j��Y���xYw#t��d}t�d|
j��d|�d��Y��xYw#t$r|
j�d�Y��&wxYw)N)r�rrdzserver-is-sharing-printersFz	Raw Queuez3Unable to get queue details. Treating queue as raw.r��Errorz'The PPD file for this queue is damaged.z2There was a problem connecting to the CUPS server.r'r�rtr�)rzOption 'z
' has value 'z' and cannot be edited.r�zoutput-modez	media-col�true�false)r�rr�r����)hrr�r&rrrrgr�r�r�cupshelpers�Printerr�r�server_is_publishing�KeyErrorrp�getPPDr�rW�localizerSrT�IPP_INTERNAL_ERRORrUr��IPP_SERVICE_UNAVAILABLE�show_dialogrrr��ERRORr�rrr�r.r/r3�set_editabler5r6r7r8r9r?r@rArBrCrDrErFrGrHr�r�r�r�r�r�r1r0r4r4rrqr�r:r�r�r�r,rPr;r{�set_defaultr~rN�possible_attributes�reinitr2rr.r�r�rOr�r)rrr�r�r-�page_numrJ�remove_page�fillClassMembers�fillPrinterOptions�updateMarkerLevels�updateStateReasons�updatePrinterPropertiesTreeViewrZrr)r3r;rrdr�rKr��
publishingr�rc�mr�urirAr��option_editabler�r�tab_nrs                   rrozPrinterPropertiesDialog.load�s����u������������>�>�#�D���+�+�.�J�������&*�,6�
8����	��%�%�t�T�Y�Y�7�����	� �1�1�2N�O�J�(2�D�%��|�|�.�.�.��%	��~�~�'�D�H�$�^�^�-�D�N��~�~��&����'�'�)�F�+�+�T�->�->����(�	*�F�����)�	*��+�+�T�->�->��'�'��);�);�T�_�_��+�+�T�-?�-?��+�+�T�-E�-E��������
�
��}�}�d�&6�&6��8H�8H�J�	+�F�
� � ��*�
	+�	
���%�%�g�l�l�3����"�"�7�#3�#3�4�� � ����� � ��%������T�_�_�-��*�*�D�,>�,>��(�(�$�*:�*:�����(<�(<�>�	�F�������
����
�
	�
	(�� � ��,�,��(�(�-�-�/��(�(�1�1�4��$�$�)�)�+�	
���*�*�8�4����(�(��2�	
���*�*�8�4�� � �.�.�x�8�	
�
�
���r�"�$&�� ��.�.�5�5�8�$	4�F��{�{�g�%�$�(�(��h�h�)�)�:�6����&�&��
�
�6�&�O�
k����/�/����<��k��{�{�d�l�l�&F�&F�F�$(�L�L�$7�$7����%E�EF�%H�	��
�
�u�	�
�B��
�
�u�-�<B�D�,�,�V�[�[�9�

�M�M�'�'��9���
�
�+�+�U�3�I$	4�J"$����#�#�h�#�7��l�l�-�-�2�2�5�	4�F���1�1�1����&�&�K�*?���L�L�+�+�F�3�E�����9�9�9� �L�L�<�<�V�D�Q�G�	��u�d�+�!'�� 1�I���K�-�-�0�E� "�I���K�E�����u�+4�U�*2�
 �
4�#	4�(	
���%�%�r�*����*�*�H�5����*�*�E�2�����%�%�.�.�t�/E�/E�F�F���|�� � �,�,�V�4��!�!�(�+�
�#�#�D�(�3����!����!��,�,�.��u����$�$�'����!��k�	��	���}�}�	��V�V�F�Q���D�+�+�+��q�!�T�[�[�1��T�1�1��,�,�.�.��A�k�N��(�)��O�O�1�1� �K�K�	)��D�H�H���	��A�w�!�!�5�)�!�1�W�:�#$�&3�$4�#'�;�;�0�
�	"�1�W�:�#$�&8�$9�#'�;�;�0�
��	��r	(���� � �%�%�'��Zk�%�'�&+�O��V\�Va�Va�ch� i�j��+�
%��
�
�t�$�
%�se�#^�A^)�'A(c(�#e�5Bd�	^&�%^&�)c%�<B$a&�&c%�2A.c � c%�(&d�*e�e"�!e"c�&�tjtt�}|jjd�t
|jj��D]}}|jj|�}|jj|�}|jd�}|j|d|j��|j|d|��|jj�}|jj|�y)NFrr�)rrrrr-�
set_show_tabsrrrrr%rr�r(rr)r3r:r�r,r�r�r?s       rr�z7PrinterPropertiesDialog.updatePrinterPropertiesTreeView�s����
�
�s�C�(�����&�&��.���(�(�4�4�7�8�	)�A��#�#�0�0�!�4�D��$�$�2�2�D�9�E��<�<��&�D��O�O�T�1�e�n�n�&7�8��O�O�T�1�a�(�	)��&�&�4�4�7��� � �*�*�E�2rc
��|j}|sy|jj�D]}|jj|��t	�}d}dt
fdt
fdt
fdtffD]�\}}|jj|g�}|t
k7rt|�dkDr	||d�|D�	cgc]}	|t
k7r|	dkrdn|	��c}	||<|dk(st|�|ks�|t|�}��d	D]3}t||�|kDs�td
|||d�d|���|||d�=�5ttd�|d|d|d|d��}
t|
�|jtj zdk7}|r|j"j%�n|j"j'�t|
�dk(rbt)j*t-d
���}|j/d�|j1dd�|jj3|ddd��n�d}t|
�}
d|
dz
dzz}|
dkDrd}
t)j4�}|j7d�|j9d�|j;d�|j=d�|jj3|ddd�|
D�]'\}}}}|�d}n.|j>dk7r|j>jA|�}|�|}|dz}|dz}t)jBd��}t)jB�}tEjF||�}|jId|z�|j3|ddd�|j3|ddd�t)j*|��}|jKd�|j/d�|j3|ddd�|jM|||dd�|dz
}��*|jjO�y#t$r3}t|�d|�d|���|D�	cgc]}	d��ncc}	w}}	Yd}~���d}~wwxYwcc}	w)Nr�
marker-colors�marker-names�marker-types�
marker-levelsz value not coercible to z: r�)r�r�r�r�z	Trimming z from c��||||fSrFr)�colorr;r�levels    rr�z<PrinterPropertiesDialog.updateMarkerLevels.<locals>.<lambda>�s��!�4��u�5�rz0Marker levels are not reported for this printer.�r�TFr�r�r�r�r')�spacingz%d%%r�)(r�r�r�r�rrr+rrGr��	TypeErrorr2rN�maprrrrUrqrr�Labelr�
set_line_wrapr�r
�Grid�set_column_homogeneous�set_row_homogeneous�set_column_spacing�set_row_spacingr��localizeMarkerName�Box�gtkinklevel�GtkInkLevelrs�set_width_charsr�r�)r3r�r�marker_info�num_markers�attr�typr�rd�x�markers�can_refreshr��colsr��gridr�r;�marker_typer��localized_namer�r>�vbox�subhbox�inklevels                          rr�z*PrinterPropertiesDialog.updateMarkerLevels�s>���,�,�����+�+�8�8�;�	2�F��!�!�(�(�&�1�	2��f����,�c�2�+�S�1�+�S�1�,�e�4�6�	(�K�T�3��*�*�.�.��b�9�C��c�z�c�3�i�!�m�-���Q��L�/2�!3�)*�*-����A���#$�"%�!3�K����a��3��9�{�#:�!�3�i��#	(�&6�	4�D��K��%�&��4��(��.�{�|�<�d�D�E���%�k�l�3�	4��s�6�"�?�3�"�>�2�"�>�2�"�?�3�5�6��	�G���|�|�d�&@�&@�@�Q�F����'�'�,�,�/��'�'�,�,�/���=�A���I�I�A�'4�%5�6�E�����&�����c�*��!�!�,�,�e�U�E�1�E��K���=�D���q��A�~�%�D��a�x����8�8�:�D��'�'��-��$�$�T�*��#�#�Q�'�� � �"�%��!�!�,�,�d�E�5�!�D�3:�
!�/��t�[�%��<��D��X�X��&�%)�X�X�%@�%@��%F�N�%�1�-��!�A�o��!�A�o���w�w��*���'�'�*��&�2�2�E�5�A���)�)�6�E�>�:��"�"�H�d�E�1�=�����%���:��	�	��-���%�%�r�*��#�#�T�*������u�a�8����T�3��Q��2��q� ��-
!�0	
���&�&�)��S!�-��!%�s�A�!/�0�(+�,�1�3�,��,�C�,��-��
!3s*�.P	�=Q�		Q�Q�)	P3�2Q�Qc�&�|jd�y)N�ReportLevelsr�r�s  rrz9PrinterPropertiesDialog.on_btnRefreshMarkerLevels_clicked6s��� � �.�1rc��|j}|jjdg�}tjt
t
�}d}|D]�}|dk(rn�d}|j
d�}tj|j||j�}|j�dk(rtj}n+tjj|j�}|j|d|�|j!�\}	}
|j|d|
���|j"j%|�d}|rd}|j&j)|�y)Nzprinter-state-reasonsF�noneT�pausedrr�)r�rrGrrrr%�statereason�StateReasonr;r0�
get_reason�STOCK_MEDIA_PAUSE�
LEVEL_ICON�	get_levelr�get_descriptionrVrrWro)r3r��reasonsr:�any�reasonr��rr8�titler�r,s            rr�z*PrinterPropertiesDialog.updateStateReasons9s ���,�,���*�*�.�.�0G��L���
�
�s�C�(�����
	,�F������C��<�<��&�D��'�'����v�t�~�~�N�A��|�|��(�*��,�,��"�.�.�9�9�!�+�+�.�I���O�O�T�1�d�+��-�-�0�M�U�D��O�O�T�1�d�+�
	,�	
�"�"�,�,�e�4�����D��$�$�5�5�t�<rc���|j|d�}tjj�}	|j	|dd�}|jd|�y#tj$rYywxYw)Nrr��pixbuf)r�r�	IconThemerQ�	load_icon�set_propertyr�GError)	r3r7r5r=r�r�r8�themer�s	         rrz5PrinterPropertiesDialog.set_printer_state_reason_iconTsa������a�(���
�
�)�)�,��	��_�_�d�B��2�F����x��0���{�{�	��	�s�%A�A.�-A.c�H�|jd|j|d��y)Nr�r�)rr�)r3r7r5r=r�r�s      rrz5PrinterPropertiesDialog.set_printer_state_reason_text]s�����6�5�?�?�D�!�#<�=rc��td�|j}|jj|j�|j
j|j�|jj|jtd��}|jjdd�}t|�dkDr|d|zz
}|jj|�t|j�dk(�rtd�|jj!|j"�|j$j!|j&�|j(j!|j*�|j-|j.|j0|j2t4j6�|j-|j8|j0|j:t4j6�|j-|j<|j>|j@t4jB�|j-|jD|jF|jHt4jJ�|jLj!|jN�|jPj!|jN�|jS|jT�|jW�|jY�|j[�yy)Nzupdate printer properties�Unknownzprinter-state-messager'rz - z.no changes yet: full printer properties update).r2r�r3r�r�r0�make_and_model�printer_statesrG�staterrr�r2r�r7r�r�r8r�r9r�r�r?�job_sheets_supportedr�r��
job_sheetsr@r�rA�error_policy_supportedr��printer_error_policyrB�op_policy_supportedr��printer_op_policyrCr�rDr�r�r�r�r�)r3r�r
r�s    rrZz/PrinterPropertiesDialog.updatePrinterProperties`sS���/�0��,�,����� � ��!3�!3�4����#�#�G�$:�$:�;��#�#�'�'����)*�9��7���)�)�-�-�/F��K����<�!���U�V�^�#�E�������&�������"��H�I����'�'����8����)�)�g�.?�.?�*?�@��O�O�&�&�w�'8�'8�9�
���d�2�2�%�:�:�%�5�5�'�2�2�
4�
���d�0�0�'�2N�2N�%�3�3�'�2�2�
4�

���d�2�2�%�<�<�%�2�2�'�<�<�
>�
���d�6�6�%�9�9�%�/�/�'�9�9�
;�
�O�O�&�&�w�'<�'<�=��N�N�%�%�'�*?�*?�&?�@��N�N�7�/�/�0�
�#�#�&��#�#�&��0�0�3�G#rc	���|jj|j�}|dk7r|jj|�|jj�D]}|jj
|��|jj�D]}|jj
|��|jj|j�dk(r;|jj|j|j|j�|js�|jj|j�}|dk7r|jj|�|jj|j�}|dk7r|jj|�y|j}|j�|jj�d}|jj D�]�}|j"dk(r�d}|j}|jj|j�}|dk(rO|jj|jt%j&|j(��|j�|j*}	�nt,jj/|j(�}
t%j0dt3j4|
�z��}|j7�j9d�|j;t$j<j>�|jjA|ddd�t$jBjEddd	d	�}|jGd
dd
d�|jI|�|j}	t%jJ�}|jMd
�|jOd
�|jI|�d}
dx|_(|_)tU|jV�D�]|\}}|jXdk(r�|
d
z
}
t[||||	��}|j]|j^d|d
d
�t%j`�}|jbr|t$jBjEddd	d	�}|jGdddd
�|jI|jb�|j]|d
|d
d
�|j]|d|d
d
�n|j]|d
|dd
�|jA|jdddd�||jV|jX<|jdjg|�|jXdk(r	||_(��e|jXdk(s��v||_)�����|sE|jj|j�}|dk7r|jj|�|jVji�D]0}|jk�}|s�|jljI|��2|jjo�|jjo�y)Nr�F�InstallableOptionsTr�rrr�g�?r�r��
PageRegionr�)rr��	InputSlot�
ManualFeed)8r-r�rOr�rKr�r�rNrL�insert_pagerMr r�rJ�markDefaultsrW�optionGroupsr;rr�r�rIr�rG�Frame�html�escape�get_label_widget�set_use_markup�set_shadow_type�
ShadowTyperr
�	Alignmentr��set_paddingr�r�r�r�r�r�r�r&�keywordr	r��conflictIconr�r�r�r�rP�checkConflictsrr�)r3r;r�r�rr��hasInstallableOptions�group�	containerr�
group_name�framer�r�r�rA�o�hbox�ars                    rr�z*PrinterPropertiesDialog.fillPrinterOptions�s!���!�!�*�*�4�+>�+>�?���R�<����(�(��0��,�,�9�9�;�	2�F��"�"�)�)�&�1�	2��o�o�2�2�4�	+�F��O�O�"�"�6�*�	+����$�$�T�_�_�5��;����(�(�����!1�!1�4�3C�3C�
E��x�x��%�%�.�.�t�/E�/E�F�F���|�� � �,�,�V�4��%�%�.�.�t���?�F���|�� � �,�,�V�4���h�h���������#�#�%� %���^�^�0�0�<	/�E��z�z�1�1�(,�%� �2�2�	��)�)�2�2�4�3I�3I�J���R�<��$�$�0�0��1G�1G�14������1L�15�1A�1A�C�!�3�3�	�&�]�]�.�.��
�
�;�
��	�	��d�k�k�:�6N�(N�O���&�&�(�7�7��=��%�%�s�~�~�':�':�;����*�*�E�5�%��C��M�M�-�-�c�3��S�A�	��%�%�q�"�a��3��	�	�9�%� �,�,�	��8�8�:�D��#�#�A�&�� � ��#��M�M�$���D�>B�A�D�!�D�$:�'��
�
�6�
/�
��F��>�>�\�1����	�� ���d�i�H�����A�N�N�A�r�1�a�8��w�w�y���7�7��
�
�)�)�#�s�C��=�A��M�M�1�a��A�.��E�E�1�7�7�O��K�K��1�b�!�Q�/��K�K��a��Q��2��K�K��a��Q��2�����
�
�E�5�!�<�/0����V�^�^�,��
�
�(�(��2��>�>�[�0�,-�D�)��^�^�|�3�-.�D�*�-
/�M<	/�~%��%�%�.�.�t�/E�/E�F�F���|�� � �,�,�V�4��l�l�)�)�+�	+�F��-�-�/�I�����"�"�6�*�	+�
	
���'�'�)���� � �"rc���|jj|�|jj|�|jj	|j
�}|dk7r|jj
|�|jj	|j�dk(r;|jj|j|j|j�|jj�}|jj�}|j�|j�t|j j#��}|j%�|D]�}||j&j(k7s�||j&j*vr|j-|f��H|j&j.t0j2zr�p|j-|f���y)Nr�)rSr�rTr-r�rLr�rOrrPr rQr�rRrrNr/�get_printersr�r�r;rAr%rr�CUPS_PRINTER_CLASS)r3r�r��
model_members�model_not_members�namesr;s       rr�z(PrinterPropertiesDialog.fillClassMemberss~�����,�,�X�6����,�,�X�6��!�!�*�*�4�?�?�;���R�<����(�(��0����$�$�T�%8�%8�9�R�?����(�(��#�#�T�%9�%9�� � �
"��+�+�5�5�7�
� �2�2�<�<�>���������!��d�m�m�0�0�3�4��
�
�
�
��	7�D��t�|�|�(�(�(��4�<�<�5�5�5�!�(�(�$��2����*�*�T�-D�-D�D�%�,�,�d�X�6�	7rc�z�tj|j|j�tj|j�|j
jk7r&|jj|j�n%|jj|j�|j�yrF)rj�moveClassMembersrRrQr9r�rAr�r�r�rrr�s  r�on_btnClassAddMember_clickedz4PrinterPropertiesDialog.on_btnClassAddMember_clickeds����#�#�D�$:�$:�$(�$7�$7�	9��,�,�T�-@�-@�A�T�\�\�E_�E_�_��L�L���T�0�0�1��L�L� � ��!4�!4�5����!rc�z�tj|j|j�tj|j�|j
jk7r&|jj|j�n%|jj|j�|j�yrF)rjr4rQrRr9r�rAr�r�r�rrr�s  r�on_btnClassDelMember_clickedz4PrinterPropertiesDialog.on_btnClassDelMember_clicked's����#�#�D�$7�$7�$(�$:�$:�	<��,�,�T�-@�-@�A�T�\�\�E_�E_�_��L�L���T�0�0�1��L�L� � ��!4�!4�5����!rc���|xr>|jduxr.|jjxst|j�}|j|j
fD]}|j
|��yrF)r�rpr)r�r6r5r�)r3�	sensitiver.s   r�sensitise_new_printer_widgetsz5PrinterPropertiesDialog.sensitise_new_printer_widgets0sv���/��\�\��-�/��,�,�1�1�.�����-�/�	��(�(��+�+�-�	-�F�� � �)�,�	-rc�&�|jd�y�NF�r:rCs r�desensitise_new_printer_widgetsz7PrinterPropertiesDialog.desensitise_new_printer_widgets9s���*�*�E�2rc�f�t|j�|j�|jj	d|j
j|j
j|j|j|j��s|j�t|j�y)N�device)r�r;rrdr�)rrr>rc�initr�r�r;rerfr:rr�s  r�on_btnSelectDevice_clickedz2PrinterPropertiesDialog.on_btnSelectDevice_clicked=s���d�k�k���,�,�/��!�!�&�&�x�D�L�L�<S�<S�,0�L�L�,=�,=�,0�J�J�26�2B�2B�.2�k�k�	'�;�

�.�.�1�
�t�{�{�rc	�|�t|j�|j�|jj	d|j
j|j|j
j|j|j|j��s|j�t|j�y)Nr�)r�r�r;rrdr�)
rrr>rcrAr�r�r�r;rerfr:rr�s  r�on_btnChangePPD_clickedz/PrinterPropertiesDialog.on_btnChangePPD_clickedJs����d�k�k���,�,�/��!�!�&�&�u����9P�9P�+/�8�8�,0�L�L�,=�,=�,0�J�J�26�2B�2B�.2�k�k�'�;�
�.�.�1�
�t�{�{�rc�<�td�|j�|jjd�rM|jr@	|jj�|r|j
|�y|j�yyy#tj$rYywxYw)Nzon_printer_modified calledr})
r2r:rr�r�rYrorZrrS)r3rIr;�ppd_has_changeds    rrlz+PrinterPropertiesDialog.on_printer_modifiedXs����0�1��*�*�-��;�;�#�#�Y�/�D�L�L�
����*�*�-�"��I�I�t�$��0�0�3�
5A�/���=�=�
��
�s�-B�2B�B�Bc�$�|j�yrFr=)r3rIs  rrmz/PrinterPropertiesDialog.on_printer_not_modifiedfs���*�*�-rc�*�|jd|d�yr<)rl)r3�monr��	eventnamers     rrZz(PrinterPropertiesDialog.on_printer_eventjs��� � �$���7rc�F�|jjd�rX|jrL|jj|k(r3|jj	t
jj�|jr"|jj|k(rd|_yyy�Nr})rr�r�r;r�rr~r)r3rIr�s   rr[z*PrinterPropertiesDialog.on_printer_removedmsp���K�K�$�$�i�0��L�L�T�\�\�.�.�'�9��K�K� � �#�"2�"2�"9�"9�:��<�<�D�L�L�-�-��8��D�L�9�<rc�.�|jjd�ra|jrT|jj|j	�k(r,	|jj�|j
�yyyy#tj$rYywxYwrL�	rr�r�r;�get_printerrYrZrrS�r3rIr�s   rr\z-PrinterPropertiesDialog.on_state_reason_addedu�{���K�K�$�$�i�0��L�L�T�\�\�.�.�&�2D�2D�2G�G�
����*�*�-��,�,�/�H�L�
1��
�=�=�
��
���*A>�>B�Bc�.�|jjd�ra|jrT|jj|j	�k(r,	|jj�|j
�yyyy#tj$rYywxYwrLrNrPs   rr]z/PrinterPropertiesDialog.on_state_reason_removed~rQrRc��yrFr)r3rIs  rr^z0PrinterPropertiesDialog.on_cups_connection_error�s��rrF)NNN)T)r'r'TT)FN)K�__name__�
__module__�__qualname__r�SignalFlags�RUN_LAST�__gsignals__r�IPP_PRINTER_IDLEr�IPP_PRINTER_PROCESSING�IPP_PRINTER_BUSY�IPP_PRINTER_STOPPEDr	r�rDrLrSrUrr`rqr"r
r�r�r�r�r�r�r�r�r�r�r�r�rr�rrr
rrr�r6r#rprrr�r�r�r�r�ror�r�rr�rrrZr�r�r5r7r:r>rBrDrlrmrZr[r\r]r^rrrrr?s���#�.�.�7�7��r�B�"�.�.�7�7��r�B�
�L�
�,�,��V�9��2�2��\�?��,�,��V�9��/�/��Y�<�*�N�k"�Z
�(�
*�0�
�>�1�f-6�bK�#"�J0�(�7�"�"�"�@�3�
"�"�"$�4GK� $�*�*
"�"�3�
1�gG�RH�T�
-�2�)�:2�x (�D7�/�$�"J"�X3�^*�@2�=�6�>�.4�`m#�b7�:"�"�-�3�
���.�8� ���
rr�__main__r�zSpecify queue namer�T�ui�SYSTEM_CONFIG_PRINTER_UIr'c�L�|j�tj�yrF)r�loop�quit)rIs r�on_dialog_closedre�s�������	�	�rr)6rr�r��
gi.repositoryrrr��gettext�installrrr�r&rr�guirr�
optionwidgetsr	�debugr��errordialogsr��ppdcacher�r_rjrrr��
pkgdatadirr}rrrrU�sysr��argv�print�exit�
set_debuggingr�r�r&rA�MainLooprcre�
propertiesr	rqr�rrr�<module>rvsE��2����
������v�~�~��1A�1A�B��!����&���������"��
�
�
����J
�f�J
�X:�z���
�C�H�H�~���
�"�#�����!���4��-1�B�J�J�)�*��F���f�m�m�R�(��I�N�N���7����D��)�+�J�����)9�:��O�O�S�X�X�a�[�!��H�H�K�)r

Zerion Mini Shell 1.0