Skip to content

Commit

Permalink
Disconnect console and shortcuts
Browse files Browse the repository at this point in the history
  • Loading branch information
andfoy committed Aug 31, 2021
1 parent ab11e7d commit 4e730e3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion spyder/api/plugins/new_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ def initialize(self):
Notes
-----
This method should be called to initialize the plugin, but it should
not be overriden, since it internally calls `on_initialize` and emits
not be overridden, since it internally calls `on_initialize` and emits
the `sig_plugin_ready` signal.
"""
self.on_initialize()
Expand Down
18 changes: 18 additions & 0 deletions spyder/plugins/application/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,21 @@ def on_preferences_teardown(self):
preferences = self.get_plugin(Plugins.Preferences)
preferences.deregister_plugin_preferences(self)

@on_plugin_teardown(plugin=Plugins.Editor)
def on_editor_teardown(self):
editor = self.get_plugin(Plugins.Editor)
self.get_container().sig_load_log_file.disconnect(editor.load)

@on_plugin_teardown(plugin=Plugins.Console)
def on_console_teardown(self):
if self.is_plugin_available(Plugins.MainMenu):
self.report_action.setVisible(False)

@on_plugin_teardown(plugin=Plugins.Shortcuts)
def on_shortcuts_teardown(self):
if self.is_plugin_available(Plugins.MainMenu):
self._depopulate_help_menu()

def on_close(self, _unused=True):
self.get_container().on_close()

Expand Down Expand Up @@ -194,6 +209,9 @@ def _populate_help_menu_about_section(self):
menu_id=ApplicationMenus.Help,
section=HelpMenuSections.About)

def _depopulate_help_menu(self):
pass

# ---- Public API
# ------------------------------------------------------------------------
def get_application_context_menu(self, parent=None):
Expand Down

0 comments on commit 4e730e3

Please sign in to comment.