Skip to content

Commit

Permalink
Merge pull request #256 from jitseniesen/options-menu
Browse files Browse the repository at this point in the history
PR: Use _options_menu instead of options_menu in plugin
  • Loading branch information
jitseniesen authored Mar 14, 2020
2 parents aff0d1a + 6499fd8 commit 76504f2
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions spyder_notebook/notebookplugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ def __init__(self, parent, testing=False):
self.untitled_num = 0
self.recent_notebooks = self.get_option('recent_notebooks', default=[])
self.recent_notebook_menu = QMenu(_("Open recent"), self)
self.options_menu = QMenu(self)

layout = QVBoxLayout()

Expand All @@ -80,10 +79,10 @@ def __init__(self, parent, testing=False):
menu_btn = create_toolbutton(self, icon=ima.icon('tooloptions'),
tip=_('Options'))

menu_btn.setMenu(self.options_menu)
menu_btn.setMenu(self._options_menu)
menu_btn.setPopupMode(menu_btn.InstantPopup)
corner_widgets = {Qt.TopRightCorner: [new_notebook_btn, menu_btn]}
self.tabwidget = Tabs(self, menu=self.options_menu,
self.tabwidget = Tabs(self, menu=self._options_menu,
actions=self.menu_actions,
corner_widgets=corner_widgets)

Expand Down Expand Up @@ -239,13 +238,9 @@ def update_notebook_actions(self):
if client.get_filename() != WELCOME:
self.save_as_action.setEnabled(True)
self.open_console_action.setEnabled(True)
self.options_menu.clear()
add_actions(self.options_menu, self.menu_actions)
return
self.save_as_action.setEnabled(False)
self.open_console_action.setEnabled(False)
self.options_menu.clear()
add_actions(self.options_menu, self.menu_actions)

def add_to_recent(self, notebook):
"""
Expand Down

0 comments on commit 76504f2

Please sign in to comment.