fix: Deck creation UI on Anki qt6 on MacOS #799
Merged
+13
−7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On Anki versions higher than 2.1.66 on Qt6 it’s not possible to create an AnkiHub deck. When the user selects a deck and confirms, nothing happens.
The forum post linked below includes a video that shows when the problem happens.
This PR attempts to fix this problem.
Related issues
Fix UI for creating deck on Anki ≥ 21.66 Qt6
Report on the forum: https://community.ankihub.net/t/cant-upload-new-collaborative-decks-on-qt6/2340
Proposed changes
StudyDeck.exec()
is likely causing the problem. (StudyDeck
is the deck chooser dialog). To solve this problem acallback
argument was added toStudyDeck
. When thiscallback
argument is passed,show()
is used instead ofexec()
to show the dialog.https://github.com/ankitects/anki/blob/ae6a03942f651790c40f8d8479f90eb7715bf2af/qt/aqt/studydeck.py#L98-L101
Our code is now also using this
callback
argument. This should fix the problem.How to reproduce
The bug was reported by users who were using the Qt6 version of Anki >= 2.1.60 on MacOS.