%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__/optionwidgets.cpython-312.pyc

�

Hf�#����ddlZddlmZddlZddlZej
ejej��ddlZd
d�Z	Gd�d�Z
Gd�de
�ZGd	�d
e
�ZGd�de�Z
y)�N)�Gtk)�domain�	localedirc��|j}|tjk(r@t|j�dk7r(td|jz�tj}|tjk(rt||||��S|tjk(rt||||��S|tjk(rt||||��Sy)zFactory function�z%Treating Boolean option %s as PickOne��	tab_labelN)�ui�cups�PPD_UI_BOOLEAN�len�choices�print�keyword�PPD_UI_PICKONE�
OptionBool�
OptionPickOne�PPD_UI_PICKMANY�OptionPickMany)�option�ppd�guir	r
s     �1/usr/share/system-config-printer/optionwidgets.py�OptionWidgetrs���	���B�
�d�!�!�!��V�^�^���!�	�5����F�G�
�
 �
 ��	�T�
 �
 � ��&�#�s�i�@�@�	�t�"�"�	"��V�S�#��C�C�	�t�#�#�	#��f�c�3�)�D�D�
$�c�N�eZdZdd�Zd
d�Zd�Zd�Zd�Zd�Zd�Z	d
d	�Z
d
�Zd�Zy)�OptionNc�$�||_||_||_d|_||_tj�}tj�|_t
jjt
jt
jj�}|jj|�|jjd�|j|j�||_|jj#d|j$�|j'�|j(D�cgc]6}|j*|j,k(s|j.|j,k(r|��8c}|_t1�|_d|_ycc}w)NT�clicked�)rrr�enabledr	r�VBox�Button�btnConflict�Image�new_from_icon_name�STOCK_DIALOG_WARNING�IconSize�
SMALL_TOOLBAR�add�set_no_show_all�conflictIcon�connect�on_btnConflict_clicked�show�constraints�option1r�option2�set�	conflicts�conflict_message)�selfrrrr	�vbox�icon�cs        r�__init__zOption.__init__0s%��������������"����x�x�z���:�:�<����y�y�+�+�C�,D�,D�,/�L�L�,F�,F�H�������T�"����(�(��.�����!�!�"� ������ � ��D�,G�,G�H��	�	��'*���>�!� !�	�	�V�^�^� ;� !�	�	�V�^�^� ;��>������� "����>s�3;F
c�H�|jj|�||_y�N)�selector�
set_sensitiver!)r6r!s  r�enablez
Option.enableOs���
�
�#�#�W�-���rc�&�|jd�y)NF)r?�r6s r�disablezOption.disableSs�����U�rc��|jSr<)r!rAs r�
is_enabledzOption.is_enabledVs���|�|�rc��t�r<)�NotImplementedrAs r�get_current_valuezOption.get_current_valueY����rc�P�|j�|jjk7Sr<)rGr�	defchoicerAs r�
is_changedzOption.is_changed\s ���%�%�'�$�+�+�*?�*?�?�?rc��|jr?|jj|jj|j��yyr<)r!r�
markOptionrrrGrAs r�	writebackzOption.writeback_s5���<�<��H�H������ 3� 3�T�5K�5K�5M�N�rc���|j�}|jD�]L}|j|jjk(rI|j
jj|jd�}|j}|j}nH|j
jj|jd�}|j}|j}|���d�}|||�rI|||j��r2|jj|�|s��|jd����||jvs�� |jj|�|jd����Otd�g}t!�}	|jD]�}
|
j|jjk(r0|j
jj|
j�}n/|j
jj|
j�}||	|jj<��|	j#�D]�}|jj$}|j�}
|jj&D]-}|d|
k(s�t(j*j|d�}
�/|j-|�d|
�����dj/|�}||_|jr6|j2j5|�|j2j7�n|j2j9�|j
j;|�|jS)	Nc��|dk7r||k(S|dvS)Nr ��None�False�Off�)�constraint_choice�values  r�matchesz&Option.checkConflicts.<locals>.matchesrs!��$��*�,��5�5��$<�<�<rF)�
update_otherszConflicts with:�choice�textz: �
)rGr0r1rrr�options�getr2�choice1�choice2r4r*�checkConflicts�remove�_�dict�valuesr[r�	ppdippstrr�append�joinr5r$�set_tooltip_textr/�hide�option_changed)r6rYrW�
constraintr2r_r`rX�tooltip�conflicting_optionsr9r�opt�valrZs               rrazOption.checkConflictsds����&�&�(���*�*�	<�J��!�!�T�[�[�%8�%8�8��(�(�*�*�.�.�z�/A�/A�4�H��$�,�,��$�,�,���(�(�*�*�.�.�z�/A�/A�4�H��$�,�,��$�,�,�����
=�
��%�(���'�";�";�"=�>����"�"�:�.� ��*�*��*�?��t�~�~�-����%�%�j�1��&�&�U�&�;�5	<�:�&�'�(��"�f�����	@�A��y�y�D�K�K�/�/�/����)�)�-�-�a�i�i�8�����)�)�-�-�a�i�i�8��9?���
�
� 5� 5�6�
	@�*�0�0�3�	3�F��-�-�$�$�C��*�*�-�C� �-�-�/�/�
=���(�#�s�*�#�-�-�+�+�V�F�^�<�C�
=�
�N�N��S�1�2�	3��)�)�G�$�� '����>�>����-�-�w�7����!�!�#����!�!�#�������%��~�~�rc�$�|j�yr<)ra)r6�widgets  r�	on_changezOption.on_change�s�����rc��|j}|�Gt|tj�s-|j	�}|�t|tj�s�-tj
|ddtjjtjj|j��}|j�|j�y)NT)�parent�modal�destroy_with_parent�message_type�buttonsr[)
r$�
isinstancer�Window�
get_parent�
MessageDialog�MessageType�WARNING�ButtonsType�CLOSEr5�run�destroy)r6�buttonru�dialogs    rr.zOption.on_btnConflict_clicked�s����!�!��� ��V�S�Z�Z�)H��&�&�)�F�� ��V�S�Z�Z�)H��"�"�6�*.�D�14���1H�1H�,/�O�O�,A�,A�)-�)>�)>�	@��
	�
�
�����rr<)T)
�__name__�
__module__�__qualname__r:r?rBrDrGrKrNrarsr.rUrrrr/s7��#�>����@�O�
=�~�
rrc��eZdZdd�Zd�Zy)rNc�H�tjjtjj|j��|_d|_d|_	d|_
|jD]%}|ddvr
|d|_	|ddvs�|d|_
�'|jj|j|jk(�|jjdd�|jjd|j �t"j%|||||�	�y)
NrS�TruerZrQ)r��On���?�toggledr)r�CheckButton�new_with_labelrfrr^r[r=�label�false�truer�
set_activerJ�
set_alignmentr-rsrr:)r6rrrr	r9s      rr:zOptionBool.__init__�s������6�6�,5�M�M�,=�,=�v�{�{�,K�M��
���
���
���	����	(�A���{�6�6��x�[��
���{�n�,��h�K��	�		(�
	
�
�
� � ��!1�!1�T�Y�Y�!>�?��
�
�#�#�C��-��
�
���i����8�����f�c�3�)��Drc�h�|j|jf|jj�Sr<)r�r�r=�
get_activerAs rrGzOptionBool.get_current_value�s'���
�
�D�I�I�&�t�}�}�'?�'?�'A�B�Brr<)r�r�r�r:rGrUrrrr�s��E� Crrc��eZdZdZdd�Zd�Zy)rNc��tj�|_tjj|j�}|jd�s|dz
}tj|��|_	|jjdd�d}t|j�D]U\}}|jjtjj|d��|j|dk(s�T|}�W|�|jj|�n!t!|jd|j�|jj#d|j$�t&j)|||||�	�y)
N�:)r�r�r�r[rZzunknown value:�changedr)r�ComboBoxTextr=rfrr^r[�endswith�Labelr�r��	enumerater�append_textrJr�rr-rsrr:)	r6rrrr	r��selected�nrrZs	         rr:zOptionPickOne.__init__�s"���(�(�*��
��
�
�!�!�6�;�;�/���~�~�s�#��S�L�E��Y�Y�U�+��
��
�
� � ��c�*���#�F�N�N�3�	�J�B���M�M�%�%�i�m�m�&7�&7����&H�I����6�(�#3�3���	����M�M�$�$�X�.��&�+�+�/��1A�1A�B��
�
���i����8�����f�c�3�)��Drc�j�|jj|jj�dS)NrZ)rrr=r�rAs rrGzOptionPickOne.get_current_value�s)���{�{�"�"�4�=�=�#;�#;�#=�>�x�H�Hrr<)r�r�r��widget_namer:rGrUrrrr�s��!�K�E�.Irrc��eZdZdZdd�Zy)rNc��t�r<)rFrr:)r6rrrr	s     rr:zOptionPickMany.__init__�rHrr<)r�r�r�r�r:rUrrrr�s
��"�K�Errr<)�config�
gi.repositoryrr�gettext�install�PACKAGErrfrrrrrrUrr�<module>r�sm��*��������v�~�~��1A�1A�B��E�&A�A�JC��C�.I�F�I�>E�]�Er

Zerion Mini Shell 1.0