B
    nôb\í  ã               @   s|   d Z ddlmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ ddlmZmZ dd	lmZ ed
dƒZG dd„ deeƒZdS )zBreakpoint Pluginé    N)Úget_translation)Úicon_manager)Úcreate_action)ÚSpyderPluginMixin)Úto_text_stringÚis_text_stringé   )ÚBreakpointWidgetÚbreakpointsZspyder_breakpointsc               @   sp   e Zd ZdZdZddd„Zdd„ Zdd	„ Zd
d„ Zdd„ Z	dd„ Z
dd„ Zdd„ Zddd„Zdd„ Zdd„ ZdS )ÚBreakpointszBreakpoint listr
   Nc             C   s.   t j| |d t | |¡ |  ¡  |  ¡  d S )N)Úparent)r	   Ú__init__r   Zinitialize_pluginÚset_data)Úselfr   © r   ú=lib/python3.7/site-packages/spyder_breakpoints/breakpoints.pyr   "   s    zBreakpoints.__init__c             C   s   t dƒS )zReturn widget titler   )Ú_)r   r   r   r   Úget_plugin_title+   s    zBreakpoints.get_plugin_titlec             C   s   t  | j| j¡}tjd|dS )zReturn widget iconZprofiler)Z	icon_path)ÚospÚjoinZPLUGIN_PATHZIMG_PATHÚimaZicon)r   Úpathr   r   r   Úget_plugin_icon/   s    zBreakpoints.get_plugin_iconc             C   s   | j S )zq
        Return the widget to give focus to when
        this plugin's dockwidget is raised on top-level
        )Z
dictwidget)r   r   r   r   Úget_focus_widget4   s    zBreakpoints.get_focus_widgetc             C   s   g S )z*Return a list of actions related to pluginr   )r   r   r   r   Úget_plugin_actions;   s    zBreakpoints.get_plugin_actionsc             C   s   | j  | j j| ¡ dS )z3Action to be performed on first plugin registrationN)ÚmainZtabify_pluginsÚhelp)r   r   r   r   Úon_first_registration?   s    z!Breakpoints.on_first_registrationc             C   sº   | j  | jjj¡ | j | jjj¡ | j | jjj¡ | jjj | j¡ | j	 | jjj	¡ | j 
| ¡ t| tdƒ| jd}| d¡ | jj d¡}| jj ||¡ | jj j|g7  _dS )z'Register plugin in Spyder's main windowzList breakpoints)Z	triggeredTZlist_breakpointsN)Z	edit_gotoZconnectr   ZeditorÚloadZclear_all_breakpointsZclear_breakpointZbreakpoints_savedr   Z"set_or_edit_conditional_breakpointZadd_dockwidgetr   r   ÚshowZ
setEnabledZdebug_menu_actionsÚindexÚinsertZpythonfile_dependent_actions)r   Zlist_actionÚposr   r   r   Úregister_pluginC   s    


zBreakpoints.register_pluginc             C   s   dS )zRefresh widgetNr   )r   r   r   r   Úrefresh_pluginW   s    zBreakpoints.refresh_pluginFc             C   s   dS )z3Perform actions before parent main window is closedTr   )r   Z
cancelabler   r   r   Úclosing_plugin[   s    zBreakpoints.closing_pluginc             C   s   dS )z*Apply configuration file's plugin settingsNr   )r   Zoptionsr   r   r   Úapply_plugin_settings_   s    z!Breakpoints.apply_plugin_settingsc             C   s   |   ¡  dS )zShow the breakpoints dockwidgetN)Zswitch_to_plugin)r   r   r   r   r   c   s    zBreakpoints.show)N)F)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ZCONF_SECTIONr   r   r   r   r   r   r#   r$   r%   r&   r   r   r   r   r   r      s   
	
r   )r*   Úos.pathr   r   Zspyder.config.baser   Zspyder.utilsr   r   Zspyder.utils.qthelpersr   Zspyder.pluginsr   Zspyder.py3compatr   r   Zwidgets.breakpointsguir	   r   r   r   r   r   r   Ú<module>   s   
