
    G@d                        d Z ddlmZ ddlZddlZddlmZ ddlmZ ddl	m
Z
mZmZmZmZ ddlm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mZ ddlm Z m!Z!m"Z" ddl#m$Z$m%Z% ddl&m'Z' ddl(m)Z) ddl*m+Z+m,Z, ddl-m.Z.m/Z/m0Z0 ddl1m2Z2m3Z3m4Z4 ddl5m6Z6m7Z7 ddl8m9Z9  ej:        e;          Z< G d d          Z= G d d          Z> G d dee%e$          Z?d Z@e;dk    r e@             dS dS )z
Main plugin widget.

SpyderDockablePlugin plugins must provide a WIDGET_CLASS attribute that is a
subclass of PluginMainWidget.
    )OrderedDictN)Optional)PYQT5)
QByteArrayQSizeQtSignalSlot)QIcon)QApplicationQHBoxLayoutQSizePolicyQToolButtonQVBoxLayoutQWidget)SpyderAPIError)_)MainCornerWidgetSpyderWindowWidget)MainWidgetMenuOptionsMenuSectionsPluginMainWidgetMenus)SpyderToolbarMixinSpyderWidgetMixin)MainWidgetToolbar)qbytearray_to_str)create_waitspinnerset_menu_icons)ACTION_REGISTRYTOOLBAR_REGISTRYMENU_REGISTRY)APP_STYLESHEETPANES_TABBAR_STYLESHEETPANES_TOOLBAR_STYLESHEET)DockTitleBarSpyderDockWidget)Tabsc                       e Zd ZdZdZdZdZdS )PluginMainWidgetWidgetscorner_widgetmain_toolbar_widgetoptions_button_widgetspinner_widgetN)__name__
__module____qualname__CornerWidgetMainToolbarOptionsToolButtonSpinner     >lib/python3.11/site-packages/spyder/api/widgets/main_widget.pyr)   r)   2   s#        "L'K/GGGr6   r)   c                       e Zd ZdZdZdZdZdS )PluginMainWidgetActions
close_pane	dock_paneundock_panelock_unlock_positionN)r.   r/   r0   	ClosePaneDockPane
UndockPaneLockUnlockPositionr5   r6   r7   r9   r9   9   s%        IHJ/r6   r9   c                       e Zd ZdZdZ	 dZ	  e            Z	  e            Z	  e            Z		  ee
          Z	  ee          Z	  ee
          Z	  e            Z	  edef          Z	 d3 fd	Zd Zd Z ee
          d             Z ee
          d	             Z fd
Z fdZd Z	 	 d4dee         dee         fdZd3dZd Zd Z d Z!d Z"d5dZ#d Z$d Z%d Z&d Z'd Z(d Z)d Z*d3dZ+d Z,d  Z-d! Z.d" Z/d# Z0d$ Z1 e            d%             Z2 e            d6d&            Z3d3d'Z4d( Z5d) Z6 e            d*             Z7d+ Z8d, Z9d- Z:d. Z;d/ Z<d0 Z=d1 Z>d2 Z? xZ@S )7PluginMainWidgetay  
    Spyder plugin main widget class.

    This class handles both a dockwidget pane and a floating window widget
    (undocked pane).

    Notes
    -----
    All Spyder dockable plugins define a main widget that must subclass this.

    This widget is a subclass of QMainWindow that consists of a single,
    central widget and a set of toolbars that are stacked above or below
    that widget.

    The toolbars are not moveable nor floatable and must occupy the entire
    horizontal space available for the plugin. This mean that toolbars must be
    stacked vertically and cannot be placed horizontally next to each other.
    FNr5   c                    t           r$t                                          ||           n+t          j        | |           t	          j        | |           d| _        || _        || _        || _        d | _	        d | _
        d | _        d | _        d | _        d| _        d| _        || _        d | _        t%                      | _        t%                      | _        d | _        d | _        t/                      | _        d | _        | j        rt7          d|           | _        t9          | t:          j                  | _        d| j        _         tC          | tE          d          	          | _#        d
| j#        _         tI          j%        | j#        | j#        j         | j        | j&                   tC          | tE          d          	          | _'        d| j'        _         tI          j%        | j'        | j'        j         | j        | j&                   | j'        (                    tR          j*        tR          j+                   | ,                    tZ          j.        tE          d                    | _/        d| _0        d| _1        te                      | _3        te                      | _4        tk                      | _6        | j4        7                    | j0        d| j1        d           | j4        8                    d           | j6        7                    dddd           | j6        8                    d           | j3        7                    dddd           | j3        8                    d           | j6        9                    | j#        d           | j6        9                    | j'        d           | j4        :                    | j6                   | j3        :                    | j4        d           d S )N)parentclass_parent)rF   F   )sizerE   )rE   namemain_cornerzMain widget toolbar)rE   titlemain_toolbarzMain widget corner toolbar)corner_toolbarzOptions menu)rK      r   i'  stretch);r   super__init__r   r   _is_tab_name_plugin_parent_default_margins
is_visibledock_actionundock_actionclose_action_toolbars_already_rendered_is_maximizedPLUGIN_NAMEtoggle_view_actionr   	_toolbars_auxiliary_toolbarswindowwidget
dockwidgetr   _icon_spinnerENABLE_SPINNERr   r   r)   r1   _corner_widgetIDr   r   _main_toolbarr    register_referenceCONTEXT_NAME_corner_toolbarsetSizePolicyr   Minimum	Expandingcreate_menur   Options_options_menu_margin_left_margin_rightr   _main_layout_toolbars_layoutr   _main_toolbar_layoutsetContentsMargins
setSpacing	addWidget	addLayout)selfrI   pluginrE   	__class__s       r7   rR   zPluginMainWidget.__init__   s    	BGGF@@@@T6***&t&AAAA 
 $! */'"   #'$#.==  !WW
 	E.BtDDDDM.(5
 
 
 "/.)**
 
 
 !/+ 2 5d/	1 	1 	1  1011 
  
  
 #4+ $"6"9d/	1 	1 	1 	**;+>+6+@	B 	B 	B!--!)N## . 
 
 'MM +$/MM!00q$"4a	9 	9 	9((+++!44Q1a@@@!,,Q///,,Q1a888$$Q''' 	!++D,>+NNN!++D,@!+LLL''(ABBB##D$91#EEEEEr6   c                                           t                    }|rR|D ]O}d _        |                     j                    j                            t          t                                                     t          j
        t          d                               d                     _         j        r%                     t          j         j                                        t          j
         j                    j                             j                     j                             j                     j                            t,          j                                        t2          j        t          d          t          d                               d           j                   _                             t2          j        t          d	          t          d
                               d           j                   _                             t2          j         t          d          t          d                               d           j!                   _"                             t2          j#        t          d          t          d                               d           j$                   _%                             d j&        z    '                                 fdtP          j)        d           _*         j         j"         j%         j        fD ])} +                    | j,        tZ          j.                   * j        /                     j,                    j,        j0        1                     j2                   tf          j4        dk    r' j,        j5        1                     j,        fd            j        sN 6                     j         j        d            j                            t          tn                                8                     '                                           dS )zR
        Setup default actions, create options menu, and connect signals.
        Trq   tooloptions)texticonDockzDock the panedock)rI   r   tipr   	triggeredUnlock position'Unlock to move pane to another positiondrag_dock_widgetUndockzUndock the paneundockClosezClose the paner:   z
switch to c                 .                         |           S Ntoggle_view)checkedr|   s    r7   <lambda>z)PluginMainWidget._setup.<locals>.<lambda>x  s    D$4$4W$=$= r6   r   )rI   r   toggledcontextshortcut_context)sectiondarwinc                 "    t          | d          S )NF)r   )menus    r7   r   z)PluginMainWidget._setup.<locals>.<lambda>  s    tU0K0K r6   corner)toolbarr   N)9findChildrenr'   rS   setCornerWidgetrg   setStyleSheetstrr#   create_toolbuttonr)   r3   r   create_icon_options_buttonrf   add_corner_widgetr4   re   ri   
setVisiblerl   setPopupModer   InstantPopupcreate_actionr9   r?   close_windowrY   rA   r=   lock_unlock_actionr@   create_windowrZ   r>   
close_dockr[   rT   	get_titler   WidgetWithChildrenShortcutr_   add_item_to_menurr   r   BottomsetMenuaboutToShowconnect_update_actionssysplatformaboutToHideadd_item_to_toolbarr$   setWindowTitle)r|   childrenchilditems   `   r7   _setupzPluginMainWidget._setup1  s=   
 $$T** 	!  # %%d&9:::#11#6M2N2NOOO#55#59!!-00  6  
  
  	""'/  
 	#5 	
 	
 	
 	%%$,&6777''DL(8999))+*BCCC  --(16/""!!&))' . 
 
 #'"4"4(;$%%;<<!!"455/ #5 #
 #
 "//(38#$$!!(++( 0 
 
 !..(27"##!!,//o / 
 
 #'"4"4
*!!====1  #5 #
 #
 ,d.@&(8: 	 	D!!"+2 "     	$$T%7888&..t/CDDD <8##*22 .KKKM M M
 | 	M$$#,  %   
 --c2J.K.KLLL 	DNN,,-----r6   c                    | j         du }| j                            |           | j                            |           | j                            |           | j                            |            t          j        dk    r?	 t          | 	                    t          j                  d           n# t          $ r Y nw xY w|                                  dS )z'
        Refresh Options menu.
        Nr   T)rb   rZ   r   r[   r   rY   r   r   r   get_menur   rq   KeyErrorupdate_actions)r|   show_dock_actionss     r7   r   z PluginMainWidget._update_actions  s     !-5%%&7888$$%6777**+<===##(9$9:::<8##MM"7"?@@$H H H H    	s   -B2 2
B?>B?c                     | j                             |           |r t          j        t          j                   dS t          j                     dS )zK
        Actions to perform when a plugin is undocked to be moved.
        N)rZ   setDisabledr   setOverrideCursorr   ClosedHandCursorrestoreOverrideCursor)r|   	top_levels     r7   _on_top_level_changez%PluginMainWidget._on_top_level_change  sT    
 	&&y111  	1*2+>?????.00000r6   c                 &   |r| j                             t          d                     | j                             |                     d                     dD ]/}t          | j         |          } |t          d                     0dS | j                             t          d                     | j                             |                     d                     dD ]/}t          | j         |          } |t          d                     0dS )	zH
        Actions to perform when the title bar is shown/hidden.
        zLock position	lock_open)
setToolTipsetStatusTipz!Lock pane to the current positionr   r   r   N)r   setTextr   setIconr   getattr)r|   visiblemethod_namemethods       r7   _on_title_bar_shownz$PluginMainWidget._on_title_bar_shown  s2   
  	E#++Ao,>,>???#++D,<,<[,I,IJJJ= ? ? !8+FFq<==>>>>? ? #++A.?,@,@AAA#++  !3446 6 6= E E !8+FFqBCCDDDDE Er6   c                     | j                             |d           t                                          | j                    |                    | j        d| j        d           |                    d           dS )z?
        Set layout of the main widget of this plugin.
        i@B rO   r   N)ru   r{   rQ   	setLayoutrx   rs   rt   ry   )r|   layoutr~   s     r7   r   zPluginMainWidget.setLayout  sv     	##FG#<<<$+,,,!!$"3Q8JANNN!r6   c                 r    |                                   t                                          |           d S r   )on_closerQ   
closeEvent)r|   eventr~   s     r7   r   zPluginMainWidget.closeEvent  s.    5!!!!!r6   c                     | j         S )z+
        Return the parent plugin.
        )rU   r|   s    r7   
get_pluginzPluginMainWidget.get_plugin  s     |r6   r   r}   c                 Z    || j         n|}|| j        n|}t          j        |||          S )z(
        Return action by name.
        )r^   rk   r   get_reference)r|   rI   r   r}   s       r7   
get_actionzPluginMainWidget.get_action  s;    
 &,^!!'.$##G,T67CCCr6   c                 <    | j                             ||           dS )ae  
        Add widget to corner, that is to the left of the last added widget.

        Parameters
        ----------
        widget_id: str
            Unique name of the widget.
        widget: QWidget
            Any QWidget to add in the corner widget.
        before: QWidget
            Insert the widget before this widget.

        Notes
        -----
        By default widgets are added to the left of the last corner widget.

        The central widget provides an options menu button and a spinner so any
        additional widgets will be placed to the left of the spinner,
        if visible.
        N)rg   
add_widget)r|   	widget_idwidgetbefores       r7   r   z"PluginMainWidget.add_corner_widget  s#    * 	&&y&99999r6   c                 6    | j                             |          S )z
        Return the a widget inside the corner widget by name.

        Parameters
        ----------
        name: str
            Unique name of the widget.
        )rg   
get_widgetr|   rI   s     r7   get_corner_widgetz"PluginMainWidget.get_corner_widget  s     "--d333r6   c                 J    | j         r| j                                         dS dS )z/
        Start default status spinner.
        N)rf   re   startr   s    r7   start_spinnerzPluginMainWidget.start_spinner  s3      	"M!!!!!	" 	"r6   c                 J    | j         r| j                                         dS dS )z.
        Stop default status spinner.
        N)rf   re   stopr   s    r7   stop_spinnerzPluginMainWidget.stop_spinner  s3      	!M     	! 	!r6   c                     t          |           }||_        t          j        ||| j        | j                   || j        |<   | j                            |           |S )a[  
        Create and add an auxiliary toolbar to the top of the plugin.

        Parameters
        ----------
        toolbar_id: str
            Unique toolbar string identifier.

        Returns
        -------
        SpyderPluginToolbar
            The auxiliary toolbar that was created and added to the plugin
            interface.
        )rE   )	r   rh   r    rj   r^   rk   ra   rv   rz   )r|   
toolbar_idr   s      r7   create_toolbarzPluginMainWidget.create_toolbar!  sm     $4000
+Z!143D	F 	F 	F 07 ,''000r6    c                    t          | dd          }|t                      | _        || j        v r"t          d                    |                    t          | ||          }t          j        ||| j        | j	                   |<|
                                                    d           |                    |           || j        |<   |S )a  
        Override SpyderMenuMixin method to use a different menu class.

        Parameters
        ----------
        menu_id: str
            Unique toolbar string identifier.
        title: str
            Toolbar localized title.
        icon: QIcon or None
            Icon to use for the menu.

        Returns
        -------
        MainWidgetMenu
            The main widget menu.
        _menusNzMenu name "{}" already in use!)rE   rK   menu_idT)r   r   r   r   formatr   r!   rj   r^   rk   
menuActionsetIconVisibleInMenur   )r|   r   rK   r   menusr   s         r7   rp   zPluginMainWidget.create_menu;  s    $ h--=%--DKdk!! 077@@   THHH('4+T->	@ 	@ 	@ OO224888LL#Gr6   c                     | j         S )z=
        Return the main options menu of the widget.
        )rr   r   s    r7   get_options_menuz!PluginMainWidget.get_options_menub  s     !!r6   c                     | j         S )zD
        Return the main options menu button of the widget.
        )r   r   s    r7   get_options_menu_buttonz(PluginMainWidget.get_options_menu_buttonh  s     ##r6   c                     | j         S )z
        Return the main toolbar of the plugin.

        Returns
        -------
        QToolBar
            The main toolbar of the widget that contains the options button.
        )ri   r   s    r7   get_main_toolbarz!PluginMainWidget.get_main_toolbarn  s     !!r6   c                     | j         S )z
        Return the auxiliary toolbars of the plugin.

        Returns
        -------
        OrderedDict
            A dictionary of wirh toolbar IDs as keys and auxiliary toolbars as
            values.
        )ra   r   s    r7   get_auxiliary_toolbarsz'PluginMainWidget.get_auxiliary_toolbarsy  s     ''r6   c                 d    || _         | j                            t          ||                     dS )z
        Set the icon size of the plugin's toolbars.

        Parameters
        ----------
        iconsize: int
            An integer corresponding to the size in pixels to which the icons
            of the plugin's toolbars need to be set.
        N)
_icon_sizeri   set_icon_sizer   )r|   	icon_sizes     r7   r  zPluginMainWidget.set_icon_size  s2     $((y))D)DEEEEEr6   c                     |                                  }|                                r|                    ||           dS dS )z=
        Show a status message in the Spyder widget.
        N)	statusBar	isVisibleshowMessage)r|   messagetimeout
status_bars       r7   show_status_messagez$PluginMainWidget.show_status_message  sM     ^^%%
!! 	5""7G44444	5 	5r6   c                     | S )z
        Get the widget to give focus to.

        Returns
        -------
        QWidget
            QWidget to give focus to.

        Notes
        -----
        This is applied when the plugin's dockwidget is raised to the top.
        r5   r   s    r7   get_focus_widgetz!PluginMainWidget.get_focus_widget  s	     r6   c                     |                                  }| j        |                                | _        ||                    ||||           dS  |j        | j          dS )z0
        Update central widget margins.
        N)r   rW   getContentsMarginsrx   )r|   marginr   s      r7   update_marginszPluginMainWidget.update_margins  sm      ($*$=$=$?$?D!%%ffffEEEEE%F%t'<====r6   c                     | j         | j         }n| j        | j        }ndS |                    |                                            dS )z>
        Update title of dockwidget or plugin window.
        N)rc   rb   undocked_windowr   r   )r|   r   s     r7   update_titlezPluginMainWidget.update_title  sQ     ?&_FF*)FFFdnn../////r6   c                     || _         dS )z0
        Set widget name (plugin.NAME).
        NrT   r   s     r7   set_namezPluginMainWidget.set_name       


r6   c                     | j         S )z3
        Return widget name (plugin.NAME).
        r  r   s    r7   get_namezPluginMainWidget.get_name       zr6   c                     || _         dS )z"
        Set widget icon.
        Nrd   )r|   r   s     r7   set_iconzPluginMainWidget.set_icon  r  r6   c                     | j         S )z%
        Return widget icon.
        r   r   s    r7   get_iconzPluginMainWidget.get_icon  r  r6   c                     | j                                          | j                                         | j                                        D ]\  }}|                                 dS )z
        Render all the toolbars of the widget.

        Notes
        -----
        This action can only be performed once.
        N)ri   _renderrl   ra   items)r|   __r   s      r7   render_toolbarsz PluginMainWidget.render_toolbars  sm     	""$$$$$&&&399;; 	 	KBOO	 	r6   c                    t                               d           t          |           x| _        }| j        j                            | j                   |                    t          j	                   |
                    |            |                    |                                            |                    |                                            |                    |                                            |                     dd          }|rf	 |                    t'                                          t+          |                              d                               n# t.          $ r Y nw xY w| j        r4| j                            d           | j                            d           |                     |           |                                  |                                 dS )zG
        Create a QMainWindow instance containing this widget.
        zUndocking pluginwindow_geometryr   )defaultzutf-8FN)loggerdebugr   rb   
sig_closedr   r   setAttributer   WA_DeleteOnClosesetCentralWidgetsetWindowIconr#  r   r   resizerH   get_confrestoreGeometryr   fromHexr   encode	Exceptionrc   setFloatingr   set_ancestorr   show)r|   windowgeometrys      r7   r   zPluginMainWidget.create_window  s   
 	'((( &8%=%==F 	$,,T->??? 	B/000%%%T]]__---dnn..///diikk""" ==!2B=?? 	&&LL((X)=)=g)F)FGG        ? 	.O''...O&&u---&!!!s   AE- -
E:9E:c                 f   t                               d           | j        x| j                                        }|                     dt          |                     |r|                     dd           | j        | _        | j                                         | j                                         d| _        | j	        
                    d           | j        
                    d           | j        | j                                         |                                                                  | j                            |            | j                            d           | j                                         |                                  dS dS |                     dd           dS )a  
        Close QMainWindow instance that contains this widget.

        Parameters
        ----------
        save_undocked : bool, optional
            True if the undocked state needs to be saved. The default is False.

        Returns
        -------
        None.
        z&Docking plugin back to the main windowNr*  undocked_on_window_closeTF)r,  r-  rb   saveGeometryset_confr    _PluginMainWidget__unsafe_windowdeleteLatercloserZ   r   r[   rc   sig_update_ancestor_requestedemitr   switch_to_plugin	setWidgetr   raise_r   )r|   save_undockedr=  s      r7   r   zPluginMainWidget.close_window  s    	=>>>( (5577HMM+->x-H-HIII  @8$??? $(#4D  ,,...##%%% $D **5111))%000*277999!!22444))$///**4000&&((($$&&&&& +* MM4e<<<<<r6   c                    | j         dS |rM| j                             d           | j                                          | j                             d           t          | dd          }|/|r,|r*|                                 }|r|                                 n4|du r+|                                 }|r|                                 n|du r	 || _        dS )z#Dock widget visibility has changed.NTFRAISE_AND_FOCUS)rc   blockSignalsrI  r   r  setFocusrX   )r|   enableforce_focusraise_and_focusfocus_widgets        r7   change_visibilityz"PluginMainWidget.change_visibilityC  s    ?"F 	0O((...O""$$$O((///!$(94@@ ,6 ,#4466 , ))+++D  0022L (%%'''E!! r6   c                     | j         sdS | j        |                     d           |r:| j                                          | j                                          d| _        n | j                                          d| _        | j                                        |k    rD| 	                    d           | j        
                    |           | 	                    d           | j                            |           dS )a  
        Toggle dockwidget's visibility when its entry is selected in
        the menu `View > Panes`.

        Parameters
        ----------
        checked: bool
            Is the entry in `View > Panes` checked or not?

        Notes
        -----
        If you need to attach some functionality when this changes, use
        sig_toggle_view_changed. For an example, please see
        `spyder/plugins/ipythonconsole/plugin.py`
        NT)rJ  F)rc   rb   r   r;  rI  rX   hider_   	isCheckedrM  
setCheckedsig_toggle_view_changedrF  )r|   r   s     r7   r   zPluginMainWidget.toggle_viewc  s      	F (D111 	$O  """O""$$$"DOOO  """#DO ",,..'99d####..w777e$$$$))'22222r6   c                    |                                  }t          ||          x| _        }|                    | j        j        dz              |                    |            |j                            | j	                   |j
                            | j                   |j                            | j                   ||j        fS )z=
        Add to parent QMainWindow as a dock widget.
        _dw)r   r&   rc   setObjectNamer~   r.   rH  visibilityChangedr   rS  topLevelChangedr   sig_title_bar_shownr   LOCATION)r|   
mainwindowrK   r   s       r7   create_dockwidgetz"PluginMainWidget.create_dockwidget  s    
   !1%!D!DD$ 	4>2U:;;;t 	&&t'=>>>$$T%>??? (()ABBBdm$$r6   c                 0    |                      d           dS )z'
        Close the dockwidget.
        FNr   r   s    r7   r   zPluginMainWidget.close_dock  s    
 	r6   c                     t          | j                                        t                    r| j                                         dS | j                                         dS )z<
        Show/hide title bar to move/lock position.
        N)
isinstancerc   titleBarWidgetr%   remove_title_barset_title_barr   s    r7   r=   z%PluginMainWidget.lock_unlock_position  sX     do4466EE 	,O,,.....O))+++++r6   c                     | j         S )z!Get dockwidget's maximized state.)r]   r   s    r7   get_maximized_statez$PluginMainWidget.get_maximized_state  s    !!r6   c                 ,    || _         || j        _        dS )z
        Set internal attribute that holds dockwidget's maximized state.

        Parameters
        ----------
        state: bool
            True if the plugin is maximized, False otherwise.
        N)r]   rU   _ismaximized)r|   states     r7   set_maximized_statez$PluginMainWidget.set_maximized_state  s     # %*!!!r6   c                      t          d          )zX
        Return the title that will be displayed on dockwidget or window title.
        z)PluginMainWidget must define `get_title`!)NotImplementedErrorr   s    r7   r   zPluginMainWidget.get_title  s     ""MNNNr6   c                     dS )zW
        Needed to update the ancestor/parent of child widgets when undocking.
        Nr5   )r|   ancestors     r7   r:  zPluginMainWidget.set_ancestor  s	     	r6   c                 @    t          t          |            d          )zR
        Create widget actions, add to menu and other setup requirements.
        z must define a `setup` method!ro  typer   s    r7   setupzPluginMainWidget.setup  s(     "Dzz999; ; 	;r6   c                 B    t          dt          |            d          )z
        Update the state of exposed actions.

        Exposed actions are actions created by the self.create_action method.
        zJA PluginMainWidget subclass must define an `update_actions` method! Hint: z" should implement `update_actions`rs  r   s    r7   r   zPluginMainWidget.update_actions  s:     "L!$ZZL L LM M 	Mr6   c                     dS )z~
        Perform actions before the widget is closed.

        This method **must** only operate on local attributes.
        Nr5   r   s    r7   r   zPluginMainWidget.on_close  s	     	r6   r   )NN)r   N)F)Ar.   r/   r0   __doc__rf   rk   r	   sig_free_memory_requestedsig_quit_requestedsig_restart_requestedboolsig_redirect_stdio_requesteddictsig_exception_occurredrX  rE  objectsig_unmaximize_plugin_requestedrR   r   r   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   rp   r   r   r   r  r  r  r  r  r  r  r  r!  r#  r(  r   r   rS  r   ra  r   r=   ri  rm  r   r:  ru  r   r   __classcell__)r~   s   @r7   rC   rC   @   sX        * N$ L !'
   #FHH $*6$<<  $VD\\8 %fTll %+FHH!
 '-fR&&;&;#aF aF aF aF aF aFJg. g. g.R  , 
T$ZZ
1 
1 Z
1 
T$ZZE E ZE(    " " " " "   9=+/D D D#C=D D D D: : : :.	4 	4 	4" " "! ! !  4% % % %N" " "$ $ $	" 	" 	"
( 
( 
(F F F5 5 5  > > > >0 0 0          $ 
TVV$ $ V$L 
TVV,= ,= ,= V,=\! ! ! !@%3 %3 %3N% % %& 
TVV    V , , ," " "* * * O O O  ; ; ;M M M      r6   rC   c                  B   ddl m} m}m} ddlm}  |            } |            }t          d|          }dd|_        |                                  |             }|	                     |                       |
                    |           |                                 |                    |          \  }}	|                    |	|           |                    t          t                                |                                 |                                 d S )Nr   )r   QTableWidgetQMainWindow)qapplicationtestc                     dS )Nz
Test titler5   )xs    r7   r   zrun_test.<locals>.<lambda>  s    l r6   r   )qtpy.QtWidgetsr   r  r  spyder.utils.qthelpersr  rC   r   r   rz   r   r   ra  addDockWidgetr   r   r"   r;  exec_)
r   r  r  r  appmainr   r   r   locations
             r7   run_testr    s&   EEEEEEEEEE 433333
,..C;==Dfd++F222F
MMOOO[]]F
\\^^$$$
V
--d33ND(x&&&s>**+++IIKKKIIKKKKKr6   __main__)Arx  collectionsr   loggingr   typingr   qtpyr   qtpy.QtCorer   r   r   r	   r
   
qtpy.QtGuir   r  r   r   r   r   r   r   spyder.api.exceptionsr   spyder.api.translationsr   $spyder.api.widgets.auxiliary_widgetsr   r   spyder.api.widgets.menusr   r   r   spyder.api.widgets.mixinsr   r   spyder.api.widgets.toolbarsr   spyder.py3compatr   r  r   r   spyder.utils.registriesr   r    r!   spyder.utils.stylesheetr"   r#   r$   spyder.widgets.dockr%   r&   spyder.widgets.tabsr'   	getLoggerr.   r,  r)   r9   rC   r  r5   r6   r7   <module>r     s+    $ # # # # #  



             ; ; ; ; ; ; ; ; ; ; ; ; ; ;      ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 1 0 0 0 0 0 % % % % % %F F F F F F F F= = = = = = = = = = K K K K K K K K 9 9 9 9 9 9 . . . . . . E E E E E E E E6 6 6 6 6 6 6 6 6 6G G G G G G G G G G > > > > > > > > $ $ $ $ $ $ 
	8	$	$       0 0 0 0 0 0 0 0d d d d dw 13E d d dN  . zHJJJJJ r6   