Skip to content

Commit

Permalink
Update calls to remove_item_from_application_menu
Browse files Browse the repository at this point in the history
  • Loading branch information
andfoy committed Aug 31, 2021
1 parent 47df2c9 commit cf9f1b7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 3 additions & 2 deletions spyder/plugins/console/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
on_plugin_available, on_plugin_teardown)
from spyder.api.translations import get_translation
from spyder.plugins.application.plugin import ApplicationActions
from spyder.plugins.console.widgets.main_widget import ConsoleWidget
from spyder.plugins.console.widgets.main_widget import (
ConsoleWidget, ConsoleWidgetActions)
from spyder.plugins.mainmenu.api import (
ApplicationMenus, FileMenuSections, HelpMenuSections)

Expand Down Expand Up @@ -131,7 +132,7 @@ def on_main_menu_teardown(self):
widget = self.get_widget()
mainmenu = self.get_plugin(Plugins.MainMenu)
mainmenu.remove_item_from_application_menu(
widget.quit_action,
ConsoleWidgetActions.Quit,
menu_id=ApplicationMenus.File)

def update_font(self):
Expand Down
6 changes: 2 additions & 4 deletions spyder/plugins/findinfiles/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,10 @@ def on_projects_teardon_plugin_teardown(self):
@on_plugin_teardown(plugin=Plugins.MainMenu)
def on_main_menu_teardown(self):
mainmenu = self.get_plugin(Plugins.MainMenu)
findinfiles_action = self.get_action(FindInFilesActions.FindInFiles)

menu = mainmenu.get_application_menu(ApplicationMenus.Search)
mainmenu.remove_item_from_application_menu(
findinfiles_action,
menu=menu,
FindInFilesActions.FindInFiles,
menu_id=ApplicationMenus.Search,
)

def on_close(self, cancelable=False):
Expand Down

0 comments on commit cf9f1b7

Please sign in to comment.