
    Je                     n    d Z ddlmZmZ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e	      Zy	)
z!File explorer configuration page.    )
QTabWidgetQVBoxLayoutQWidget	QGroupBoxQLabelQPushButton)PluginConfigPage)_)NAME_FILTERS)FileAssociationsWidgetc                       e Zd Zd Zd Zd Zy)ExplorerConfigPagec                    | j                   }t               }t        t        d            } |t        d      d      } |t        d      d      }t	               }|j                  |       |j                  |       |j                  |       t        t        d            }t        t        d            }|j                  d       |j                  d       | j                  d	d
dt              | _        | j                  j                  d       t        t        d            }	|	j                  j!                  | j"                         t	               }
|
j                  |       |
j                  | j                         |
j                  |	       |j                  |
       t               }| j                  d	dt$              | _        t)               }|j+                  | j-                  di              | j&                  j/                  d       t	               }|j                  |       |j                  |       |j                  |       t	               }|j                  |       |j                  | j&                         |j                  |       t1               | _        | j2                  j5                  | j7                  |      t        d             | j2                  j5                  | j7                  |      t        d             t	               }|j                  | j2                         | j                  |       |j8                  j!                  | j:                         y )NzGeneral optionszShow hidden filesshow_hiddenzSingle click to open filessingle_click_to_openzFilter settingszFilter files by name, extension, or more using <a href="https://en.wikipedia.org/wiki/Glob_(programming)">glob patterns.</a> Please enter the glob patterns of the files you want to show, separated by commas.T name_filtersz Enter values separated by commas)tipcontent_typezReset to default valuesfile_associations)r   FGeneralzFile associations)create_checkboxr   r   r
   r   	addWidget	setLayoutr   setOpenExternalLinkssetWordWrapcreate_texteditlistedit_filename_filters
setEnabledr   clickedconnectreset_to_defaultdictedit_file_associationsr   load_values
get_option
setVisibler   tabsaddTab
create_tabsig_data_changedupdate_associations)selfnewcbgeneral_widgetbasic_groupcheck_show_hidden_filescheck_single_clickbasic_layoutfilter_groupdescription_label	reset_btnfilter_layoutassociations_widgetr   layoutlayout_file
tab_layouts                   B/usr/lib/python3/dist-packages/spyder/plugins/explorer/confpage.py
setup_pagezExplorerConfigPage.setup_page   s   $$ !  "3 45"'*=(>"N"*+-CE"}6712l+ !#4!56" 3 45
 	..t4%%d+%)%9%93	 &: &
" 	""--d3"; <=	!!$"7"78# 12 : :;	*}-%i&*&:&: '; '
#
 34 	%%doo6I2&NO##..u5%&  (!m/0d99:%%k2L			8!I,G		)<=./	1 !]
TYY'z" 	**2243K3KL    c                 d    | j                   j                  }|j                  t        |             y)zT
        Update the content of the text edit used to store the config data.
        N)r%   textboxsetPlainTextstr)r.   datatextedits      r=   r-   z&ExplorerConfigPage.update_associationsf   s'     ..66c$i(r?   c                     | j                  dt               | j                  j                  }|j	                  dj                  t                     y)z%Reset the filter settings to default.r   z, N)
set_optionr   r   rA   rB   join)r.   rE   s     r=   r#   z#ExplorerConfigPage.reset_to_defaultm   s8    5--55dii56r?   N)__name__
__module____qualname__r>   r-   r#    r?   r=   r   r      s    MM^)7r?   r   N)__doc__qtpy.QtWidgetsr   r   r   r   r   r   spyder.api.preferencesr	   spyder.api.translationsr
   spyder.config.mainr   0spyder.plugins.explorer.widgets.fileassociationsr   r   rL   r?   r=   <module>rS      s3    (1 1 4 % +\7) \7r?   