151 with contextlib.suppress(TypeError): |
151 with contextlib.suppress(TypeError): |
152 editor.showMenu.disconnect(self.__editorShowMenu) |
152 editor.showMenu.disconnect(self.__editorShowMenu) |
153 menu = editor.getMenu("Main") |
153 menu = editor.getMenu("Main") |
154 if menu is not None and editor in self.__menuActions: |
154 if menu is not None and editor in self.__menuActions: |
155 for act in self.__menuActions[editor]: |
155 for act in self.__menuActions[editor]: |
156 menu.removeAction(act) |
156 with contextlib.suppress(RuntimeError): |
|
157 menu.removeAction(act) |
157 del self.__menuActions[editor] |
158 del self.__menuActions[editor] |
158 |
159 |
159 def __connectMouseClickHandler(self, editor): |
160 def __connectMouseClickHandler(self, editor): |
160 """ |
161 """ |
161 Private method to connect the mouse click handler to an editor. |
162 Private method to connect the mouse click handler to an editor. |