Open talkael opened 1 year ago
Could you please describe more detailed what the problem is? Are you referring to Anki's preferences or the leaderboard settings? And what exactly doesn't work?
@ThoreBor The problem is when when clicking Anki's preferences, it opens the leaderboard settings. It basically prevents you from accessing the anki preferences without disabling the add on.
So going to Tools>Preferences opens the Leaderboard options? How about the shortcut (Ctrl+P)? I can't reproduce this error on my devices, so I don't know what the problem is at the moment. If other people also have the problem, please report it here. Thank you for letting me know!
So on mac its different. You go Anki>Preferences. I have talked to a few people on macbooks and they have similar issues.
Okay that's weird. This might be related to #89. Some people on mac apparently don't see the Leaderboard config. So maybe there's some connection. I don't understand why though, because the add-on doesn't modify Anki's preferences in any way. This might be a longshot, but if you can, could you (or somebody else with the same problem) do the following things?
__init__.py
file in the folder with a text editor (something like notepad would work, sublime or an IDE would be easier)self.addMenu('&Leaderboard', "&Config", self.invokeSetup, "Alt+C")
(
here's the line on GitHub)"&Config"
to some other word like "&Test"
for exampleDoes this fix the issue? If this is too complicated you don't have to do it, but if somebody else reads this and knows how to do it, it would help a lot since I don't own a mac and can't debug this alone.
I am also having this issue, whenever I try to open the Anki preferences it automatically opens the leaderboard preferences then I have to disable the add-on in order to actually open the Anki preferences. on 2.1.57 qt6 Mac apple silicone
On my Mac I have the same issue.
@ThoreBor
Does this fix the issue? If this is too complicated you don't have to do it, but if somebody else reads this and knows how to do it, it would help a lot since I don't own a mac and can't debug this alone.
Following your instructions fixed the issue for me. 👍🏻
Does this fix the issue? If this is too complicated you don't have to do it, but if somebody else reads this and knows how to do it, it would help a lot since I don't own a mac and can't debug this alone.
This worked for me as well
Thank you @andreaskienle and @nealp97, that's super helpful! Could you check if changing it to something like "&Settings"
or "&Options"
also works? Then I could update it, so it works for everyone.
Thank you @andreaskienle and @nealp97, that's super helpful! Could you check if changing it to something like
"&Settings"
or"&Options"
also works? Then I could update it, so it works for everyone.
Neither of them works for me. I have the same behaviour as before.
Is this menu item necessary? Even without it, I can access the Leaderboard settings from the Add-ons screen via the Config button.
Okay, thanks. How about "Set-up", "Preferences" or "Set-up and Options"? Could you try that?
I guess if it doesn't work I could just remove it (or at least remove it on mac), but I think it's more intuitive there.
@andreaskienle
Same issue here
Hello! I ran into this issue today and I think I've figured out what's going on. By default when you construct a QAction in PyQt, it's given a menu role of TextHeuristicAction
. This role has a special behavior on Mac where it's used to determine if the action should appear in the application menu. I haven't been able to find a list of mappings but from testing it seems like all of the below strings are mapped to QAction.PreferencesRole
:
As a result, the "Config" action defined by the Leaderboard add-on overrides the original "Preferences" action defined by the base Anki app, causing the triggered
callback to use Leaderboard's invokeSetup
. This also explains why "config" isn't showing up in the Leaderboard menu (per #89).
I think the fix is to explicitly call item.setMenuRole(QAction.NoRole)
when creating the items in the addMenu
function in this file.
(Also happy to open a PR if that would be convenient for you!)
I was suspecting something like that. Thank you! I'll fix it when I have some time
Describe the bug A clear and concise description of what the bug is.
Screenshots If applicable, add screenshots to help explain your problem.
Steps to reproduce bug If possible, step by step instructions for how to reproduce the bug
Info
New updates broke it add-on was fine a few updates before