diff --git a/spyder/app/mainwindow.py b/spyder/app/mainwindow.py index 329ad7609fe..fa019da1d49 100644 --- a/spyder/app/mainwindow.py +++ b/spyder/app/mainwindow.py @@ -244,8 +244,6 @@ def signal_handler(signum, frame=None): # Menu bars self.edit_menu = None self.edit_menu_actions = [] - # self.search_menu = None - # self.search_menu_actions = [] # TODO: Move to corresponding Plugins self.file_toolbar = None @@ -821,7 +819,6 @@ def setup(self): ApplicationMenus, FileMenuSections) mainmenu = self.mainmenu self.edit_menu = mainmenu.get_application_menu("edit_menu") - # self.search_menu = mainmenu.get_application_menu("search_menu") # Switcher shortcuts self.file_switcher_action = create_action( @@ -902,7 +899,6 @@ def create_edit_action(text, tr_text, icon): # TODO: Migrate to use the MainMenu Plugin instead of list of actions # Filling out menu/toolbar entries: add_actions(self.edit_menu, self.edit_menu_actions) - # add_actions(self.search_menu, self.search_menu_actions) def __getattr__(self, attr): """ @@ -946,7 +942,6 @@ def pre_visible_setup(self): if isinstance(child, QMenu): try: child.aboutToShow.connect(self.update_edit_menu) - # child.aboutToShow.connect(self.update_search_menu) except TypeError: pass @@ -1193,7 +1188,6 @@ def free_memory(self): def plugin_focus_changed(self): """Focus has changed from one plugin to another""" self.update_edit_menu() - # self.update_search_menu() def show_shortcuts(self, menu): """Show action shortcuts in menu.""" @@ -1295,33 +1289,6 @@ def update_edit_menu(self): for action in self.editor.edit_menu_actions: action.setEnabled(True) - # def update_search_menu(self): - # """Update search menu""" - # # Disabling all actions except the last one - # # (which is Find in files) to begin with - # for child in self.search_menu.actions()[:-1]: - # child.setEnabled(False) - - # widget, textedit_properties = self.get_focus_widget_properties() - # if textedit_properties is None: # widget is not an editor/console - # return - - # # !!! Below this line, widget is expected to be a QPlainTextEdit - # # instance - # console, not_readonly, readwrite_editor = textedit_properties - - # # Find actions only trigger an effect in the Editor - # if not console: - # for action in self.search_menu.actions(): - # try: - # action.setEnabled(True) - # except RuntimeError: - # pass - - # # Disable the replace action for read-only files - # if len(self.search_menu_actions) > 3: - # self.search_menu_actions[3].setEnabled(readwrite_editor) - def set_splash(self, message): """Set splash message""" if self.splash is None: diff --git a/spyder/plugins/editor/plugin.py b/spyder/plugins/editor/plugin.py index 116f79de5ff..073d93a999f 100644 --- a/spyder/plugins/editor/plugin.py +++ b/spyder/plugins/editor/plugin.py @@ -1131,9 +1131,6 @@ def get_plugin_actions(self): self.main.file_toolbar_actions += file_toolbar_actions # ---- Find menu/toolbar construction ---- - # self.main.search_toolbar_actions = [find_action, - # find_next_action, - # replace_action] # ---- Edit menu/toolbar construction ---- self.edit_menu_actions = [self.toggle_comment_action, @@ -1144,12 +1141,6 @@ def get_plugin_actions(self): mainmenu = self.main.get_plugin(Plugins.MainMenu) # ---- Search menu construction ---- - # if not hasattr(self.main, 'search_menu_actions'): - # # This list will not exist in the fast tests. - # self.main.search_menu_actions = [] - - # self.main.search_menu_actions = ( - # search_menu_actions + self.main.search_menu_actions) search_menu_actions = [self.find_action, self.find_next_action, self.find_previous_action, diff --git a/spyder/plugins/editor/tests/test_editor_config_dialog.py b/spyder/plugins/editor/tests/test_editor_config_dialog.py index eeacbecbe41..a2b2931cd96 100644 --- a/spyder/plugins/editor/tests/test_editor_config_dialog.py +++ b/spyder/plugins/editor/tests/test_editor_config_dialog.py @@ -23,8 +23,6 @@ class MainWindowMock(QMainWindow): file_toolbar_actions = [] edit_menu_actions = [] edit_toolbar_actions = [] - # source_toolbar_actions = [] - # search_menu_actions = [] statusbar = Mock() new_instance = Mock() plugin_focus_changed = Mock() diff --git a/spyder/plugins/mainmenu/plugin.py b/spyder/plugins/mainmenu/plugin.py index d8e992dfa17..c7a3b7c6faf 100644 --- a/spyder/plugins/mainmenu/plugin.py +++ b/spyder/plugins/mainmenu/plugin.py @@ -245,8 +245,7 @@ def add_item_to_application_menu(self, item: ItemType, # TODO: For now just add the item to the bottom for non-migrated menus. # Temporal solution while migration is complete app_menu_actions = { - ApplicationMenus.Edit: self._main.edit_menu_actions, - # ApplicationMenus.Search: self._main.search_menu_actions, + ApplicationMenus.Edit: self._main.edit_menu_actions } if menu_id in app_menu_actions: @@ -296,14 +295,11 @@ def remove_item_from_application_menu(self, item_id: str, # Temporal solution while migration is complete app_menu_actions = { ApplicationMenus.Edit: ( - self._main.edit_menu_actions, self._main.edit_menu), - # ApplicationMenus.Search: ( - # self._main.search_menu_actions, self._main.search_menu), + self._main.edit_menu_actions, self._main.edit_menu) } app_menus = { - ApplicationMenus.Edit: self._main.edit_menu, - # ApplicationMenus.Search: self._main.search_menu, + ApplicationMenus.Edit: self._main.edit_menu } menu = self.get_application_menu(menu_id)