
    ce(                     `    d Z dgZddlZddlmZ  G d dej        ej                           ZdS )z@Collection of additional helper utilities for dialog management.WidgetGroup    N)	QtWidgetsc                      e Zd ZdZdZdej        ej        ej	        ej                 f         ddfdZ
ddeddfd	Zddeddfd
Zdej        ej        gej        f         ddfdZddeddfdZdej        ej        gef         dd fdZddZddZddZddZddeddfdZd dZej        deddfd            Zej        dedd fd            Zdej        eef         dej        d         fdZdefdZdS )!r   z<Collection of widgets, with ability for synchronous control.)	__contentargsreturnNc                     g | _         |D ]Q}t          |t          j                  r| j                             |           7| j                             |           RdS )z.Initialize new :class:`~WidgetGroup` instance.N)_WidgetGroup__content
isinstancer   QWidgetappendextend)selfr   args      Llib/python3.11/site-packages/anaconda_navigator/widgets/dialogs/utilities.py__init__zWidgetGroup.__init__   sk    GI  	+ 	+C#y011 +%%c****%%c****		+ 	+    Tstatec                 :    |                      fd           dS )z/Set disabled state to all widgets in the group.c                 .    |                                S N)setDisableditemr   s    r   <lambda>z%WidgetGroup.disable.<locals>.<lambda>   s    $*:*:5*A*A r   actionNfor_eachr   r   s    `r   disablezWidgetGroup.disable   s'    AAAABBBBBr   c                 :    |                      fd           dS )z.Set enabled state to all widgets in the group.c                 .    |                                S r   )
setEnabledr   s    r   r   z$WidgetGroup.enable.<locals>.<lambda>!       $//%*@*@ r   r   Nr   r    s    `r   enablezWidgetGroup.enable   '    @@@@AAAAAr   r   c                 0    | j         D ]} ||           dS )z3Preform same `action` for each widget in the group.N)r
   )r   r   r   s      r   r   zWidgetGroup.for_each#   s.     N 	 	DF4LLLL	 	r   c                 :    |                      fd           dS )z-Set hidden state to all widgets in the group.c                 .    |                                S r   )	setHiddenr   s    r   r   z"WidgetGroup.hide.<locals>.<lambda>+   s    $..*?*? r   r   Nr   r    s    `r   hidezWidgetGroup.hide)   s'    ????@@@@@r   	predicatec                 D    t          fd| j        D                       S )z%Filter widgets in group by predicate.c              3   2   K   | ]} |          |V  d S r    ).0r   r-   s     r   	<genexpr>z#WidgetGroup.only.<locals>.<genexpr>/   sE       
 
y

 
 
 
 
 
r   )r   r
   )r   r-   s    `r   onlyzWidgetGroup.only-   s=     
 
 
 

 
 
 
 
 	
r   c                 0    |                      d           S )z!Select widgets that are disabled.c                 ,    |                                   S r   	isEnabledr   s    r   r   z+WidgetGroup.only_disabled.<locals>.<lambda>7       DNN4D4D0D r   r-   r3   r   s    r   only_disabledzWidgetGroup.only_disabled5       yy#D#DyEEEr   c                 0    |                      d           S )z Select widgets that are enabled.c                 *    |                                  S r   r6   r8   s    r   r   z*WidgetGroup.only_enabled.<locals>.<lambda>;       0@0@ r   r:   r;   r<   s    r   only_enabledzWidgetGroup.only_enabled9       yy#@#@yAAAr   c                 0    |                      d           S )zSelect widgets that are hidden.c                 ,    |                                   S r   	isVisibler8   s    r   r   z)WidgetGroup.only_hidden.<locals>.<lambda>?   r9   r   r:   r;   r<   s    r   only_hiddenzWidgetGroup.only_hidden=   r>   r   c                 0    |                      d           S )z Select widgets that are visible.c                 *    |                                  S r   rF   r8   s    r   r   z*WidgetGroup.only_visible.<locals>.<lambda>C   rA   r   r:   r;   r<   s    r   only_visiblezWidgetGroup.only_visibleA   rC   r   c                 :    |                      fd           dS )z+Set visible state to all widgets in cgroup.c                 .    |                                S r   )
setVisibler   s    r   r   z"WidgetGroup.show.<locals>.<lambda>G   r%   r   r   Nr   r    s    `r   showzWidgetGroup.showE   r'   r   otherc                 Z    t          |t                    st          S t          | |          S )zConcatenate two widget groups.)r   r   NotImplemented)r   rP   s     r   __add__zWidgetGroup.__add__I   s*    %-- 	"!!4'''r   indexQtWidgets.QWidgetc                     dS )z$Retrieve single widget by its index.Nr0   r   rT   s     r   __getitem__zWidgetGroup.__getitem__O         r   c                     dS )zRetrieve subset of widgets.Nr0   rW   s     r   rX   zWidgetGroup.__getitem__S   rY   r   )rU   r   c                 z    t          |t                    r| j        |         S t          | j        |                   S )z#Retrieve content of the collection.)r   intr
   r   rW   s     r   rX   zWidgetGroup.__getitem__W   s6    eS!! 	)>%((4>%0111r   c                 *    t          | j                  S )z1Retrieve total number of items in the collection.)lenr
   r<   s    r   __len__zWidgetGroup.__len__]   s    4>"""r   )T)r   r   )rP   r   r   r   )__name__
__module____qualname____doc__	__slots__typingUnionr   r   Iterabler   boolr!   r&   CallableAnyr   r,   r3   r=   rB   rH   rK   rO   rS   overloadr\   rX   slicer_   r0   r   r   r   r      s       FFI	+fl9+<foiN_>`+`a 	+fj 	+ 	+ 	+ 	+C CT CT C C C CB BD BD B B B Bv	0A/BFJ/NO TX    A A$ A$ A A A A
foy/@.A4.GH 
] 
 
 
 
F F F FB B B BF F F FB B B BB B$ B$ B B B B( ( ( ( _3 3)< 3 3 3 _3 _* *= * * * _*2c5j!9 2flKm>n 2 2 2 2# # # # # # #r   )rc   __all__re   qtpyr   Sequencer   r   r0   r   r   <module>rp      sx    G F/       T# T# T# T# T#&/)"34 T# T# T# T# T#r   