Anki setting overwritten by plugin setting

When I use cmd + , to open Anki setting, the plugin Anki Note Linker take the place of Anki setting window. That’s the one and only plugin I installed. Reinstall and update didn’t work.

Anyone got this bug?

1 Like

This problem occurs because the Mac automatically assigns “Option”, “About”, etc. to the app’s menu. If adding “.setMenuRole(QAction.MenuRole.NoRole)” to “QAction”, it should work correctly, like this:

#__init__.py 235
    def addMenu(self, parent, child, function, shortcut=None):
        menubar = [i for i in mw.form.menubar.actions()]
        if parent in [i.text() for i in menubar]:
            menu = [i.parent() for i in menubar][[i.text() for i in menubar].index(parent)]
        else:
            menu = mw.form.menubar.addMenu(parent)
        item = QAction(child, menu)
        
        item.setMenuRole(QAction.MenuRole.NoRole)# 🟢add
        item.triggered.connect(function)
        if shortcut:
            item.setShortcut(QKeySequence(shortcut))
        menu.addAction(item)
#__init__.py 7324
test_action13 = QAction("About and License", mw)
test_action13.setMenuRole(QAction.MenuRole.NoRole)# 🟢add
test_action13.triggered.connect(license.show_window)
mw.pokemenu.addAction(test_action13
2 Likes

I add a line and test, it does work! Amazing! :scream:

openConfigAction.setMenuRole(QAction.MenuRole.NoRole)

Thank you so much, I’ll report this to the plugin author and update the issue.

2 Likes