
    G@dG                         d Z ddlmZ ddlmZmZ ddlmZm	Z	m
Z
mZ ddlmZ ddlmZ ddlmZ ddlmZ  G d	 d
          Z G d de          Z G d de          Zd Zedk    r e             dS dS )Project Explorer    N)QtSignal)QHBoxLayoutQLabelQVBoxLayoutQWidget)PluginMainWidget_)DirViewActions)ProjectExplorerTreeWidgetc                       e Zd ZdZdS )"ProjectExplorerOptionsMenuSectionsmainN)__name__
__module____qualname__Main     Klib/python3.11/site-packages/spyder/plugins/projects/widgets/main_widget.pyr   r      s        DDDr   r   c                   `     e Zd ZdZ ee          Z	 d
 fd	Zd Zd Z	d Z
d Zd Zd	 Z xZS )ProjectExplorerWidgetr   Nc                    t                                          |||           |                     d          | _        |                     d          | _        t          | | j                  | _        | j                                         | j                                         | j        	                                 | j        j
                            | j
                   t          |           | _        t                      }|                    | j                   |                    | j                   |                     |           |                     d           d S )N)pluginparentname_filtersshow_hscrollbar   )super__init__get_confr   r   r   
treewidgetsetup
setup_viewhidesig_open_file_requestedconnectemptywidgetr   	addWidget	setLayoutsetMinimumWidth)selfnamer   r   layout	__class__s        r   r"   zProjectExplorerWidget.__init__+   s2   fV<<< MM.99#}}->??3D$:NOO""$$$/77(	* 	* 	* 5T::)***)))vS!!!!!r   c                     |                                  }|                     t          j                  }|                     t          j                  }||fD ]$}|                     ||t          j                   %dS )zSetup the widget.)menusectionN)get_options_menu
get_actionr   ToggleHiddenFilesToggleSingleClickadd_item_to_menur   r   )r.   r3   hidden_actionsingle_click_actionactions        r   r%   zProjectExplorerWidget.setup?   s    $$&&(HII"oon.NOO$&9: 	A 	AF!!:? " A A A A	A 	Ar   c                     d S Nr   r.   s    r   update_actionsz$ProjectExplorerWidget.update_actionsL   s    r   c                      t          d          S )NProjectr   r?   s    r   	get_titlezProjectExplorerWidget.get_titleO   s    ||r   c                    |Y| j                             t          j        |                     | j                             t          j        |          g           | j                                          | j                             |          }|5| j                             | j                             |          d           dS dS )zSet the project directoryNT)	r$   set_root_pathospdirnameset_folder_namesbasenamesetup_project_view	get_indexsetExpanded)r.   	directoryindexs      r   set_project_dirz%ProjectExplorerWidget.set_project_dirR   s     O))#+i*@*@AAAO,,cl9.E.E-FGGG**,,,)))44O''(A(A)(L(L(,. . . . . r   c                 j    | j                                          | j                                         dS )zShow an empty viewN)r$   r'   r*   showr?   s    r   clearzProjectExplorerWidget.clear^   s1    r   c                     | j                                          | j                                         |                     |           dS )zSetup projectN)r*   r'   r$   rQ   rO   )r.   rM   s     r   setup_projectz#ProjectExplorerWidget.setup_projectc   sG     	Y'''''r   r>   )r   r   r   __doc__r   strr(   r"   r%   r@   rC   rO   rR   rT   __classcell__)r1   s   @r   r   r      s        $fSkk" " " " " "(A A A    
. 
. 
.     
( ( ( ( ( ( (r   r   c                       e Zd ZddZdS )ProjectExplorerTestNc                 2   t          j        |            d| _        t                      }|                     |           t          d | |           | _        ||| _        n0t          j	        t          j
        t                              | _        | j                            | j                   |                    | j                   t                      }|                    |           t!          d          }|                    t$          j                   |                    |           t!                      | _        |                    | j                   | j        j                            | j        j                   t                      }|                    |           t!          d          }|                    t$          j                   |                    |           t!                      | _        |                    | j                   d S )Nproject_explorerz<b>Open file:</b>z<b>Option changed:</b>)r	   r"   CONF_SECTIONr   r,   r   explorerrM   rF   rG   abspath__file__rT   r+   r   	addLayoutr   setAlignmentr   
AlignRightlabel1r(   r)   setTextlabel3)r.   rM   vlayouthlayout1labelhlayout3s         r   r"   zProjectExplorerTest.__init__p   s   .--w-dD$?? &DNN [X)>)>??DN##DN333$-(((==(###*++2=)))5!!!hh4;'''-55dk6IJJJ==(###/002=)))5!!!hh4;'''''r   r>   )r   r   r   r"   r   r   r   rY   rY   o   s(        ( ( ( ( ( (r   rY   c                      ddl m}   |             }t                      }|                    dd           |                                 |                                 d S )Nr   )qapplication   i  )spyder.utils.qthelpersrk   rY   resizerQ   exec_)rk   apptests      r   rq   rq      s\    333333
,..C  DKKSIIKKKIIKKKKKr   __main__)rU   os.pathpathrF   qtpy.QtCorer   r   qtpy.QtWidgetsr   r   r   r	   spyder.api.widgets.main_widgetr
   spyder.api.translationsr   spyder.plugins.explorer.apir   /spyder.plugins.projects.widgets.projectexplorerr   r   r   rY   rq   r   r   r   r   <module>r{      so    
       # " " " " " " " D D D D D D D D D D D D < ; ; ; ; ; % % % % % % 6 6 6 6 6 6            K( K( K( K( K(, K( K( K(b( ( ( ( (' ( ( (B   zDFFFFF r   