Anki/qt/aqt/forms
Aristotelis e9dfb7a13d Fix AnkiWebPage not being initialized for default web view kinds (e.g. in add-ons) (#3933)
* add AnkiWebView subclasses for stats, empty cards and find dupes ui

* update ui files to use subclassed webviews instead

* remove superfluous calls to AnkiWebView.set_kind

* Avoid set_kind() race condition in legacy stats webview

Replacing the web view is a hacky workaround, but likely a reasonable compromise for a legacy view that we do not want to maintain a separate Qt form for.

* Slightly refactor AnkiWebView subclass creation and tweak inline comment

+ Extend create_ankiwebview_subclass() with the ability to set any
  init time AnkiWebView argument
+ Introduce some nice-to-haves in terms of static type checking support
  and IDE autocompletion
+ Mark helper function as private to discourage add-on use

* Drop `AnkiWebView.set_kind` completely

There no longer is an Anki-internal use case for changing the web view kind after initializing a web view, and add-ons almost certainly do not have any use for it either.

Given that setting the kind after web view construction can lead  to known race conditions with `domDone` signals, we should remove this method to discourage uses like this in both Anki code and add-on consumers.

There currenty only seems to be one add-on calling `set_kind()`, so this seem like a justifiable API change.

---------

Co-authored-by: llama <100429699+iamllama@users.noreply.github.com>
(cherry picked from commit 5b0f371791)
2025-04-23 16:23:02 +10:00
..
__init__.py Adjust HTML editor / add-on config editor font (#3054) 2024-03-05 07:29:05 +00:00
about.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
about.ui update TR references in .ui files 2021-03-26 15:03:51 +10:00
addcards.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
addcards.ui Use a simple menubar for addcards on macOS 2025-01-26 17:05:09 +11:00
addfield.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
addfield.ui update TR references in .ui files 2021-03-26 15:03:51 +10:00
addmodel.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
addmodel.ui update TR references in .ui files 2021-03-26 15:03:51 +10:00
addonconf.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
addonconf.ui Use a webview to show add-on's config help (#2281) 2022-12-21 16:55:31 +10:00
addons.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
addons.ui Increase initial add-on dialog size 2022-12-09 12:36:28 +10:00
browser.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
browser.ui Allow burying cards in browser (#2351) 2023-01-30 19:21:06 +10:00
browserdisp.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
browserdisp.ui update TR references in .ui files 2021-03-26 15:03:51 +10:00
browseropts.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
browseropts.ui update TR references in .ui files 2021-03-26 15:03:51 +10:00
changemap.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
changemap.ui update TR references in .ui files 2021-03-26 15:03:51 +10:00
changemodel.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
changemodel.ui update TR references in .ui files 2021-03-26 15:03:51 +10:00
clayout_top.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
clayout_top.ui Add minimumContentsLength property to templatesBox (#1781) 2022-04-09 13:55:03 +10:00
customstudy.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
customstudy.ui Redesign deck options inputs (#2082) 2022-09-27 12:16:45 +10:00
dconf.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
dconf.ui Improve hover feedback on various widgets (#2079) 2022-09-20 16:34:15 +10:00
debug.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
debug.ui Start debug console with text area focused 2023-03-22 15:52:55 +10:00
editcurrent.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
editcurrent.ui Give editcurrent its own menubar too 2025-02-06 18:57:59 +07:00
edithtml.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
edithtml.ui update TR references in .ui files 2021-03-26 15:03:51 +10:00
emptycards.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
emptycards.ui Fix AnkiWebPage not being initialized for default web view kinds (e.g. in add-ons) (#3933) 2025-04-23 16:23:02 +10:00
exporting.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
exporting.ui Allow im-/exporting with or without deck configs (#2804) 2023-11-13 13:54:41 +10:00
fields.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
fields.ui Add option to exclude fields from search (#2394) 2023-03-20 07:46:03 +10:00
filtered_deck.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
filtered_deck.ui Use seconds instead of minutes for preview delay 2023-12-21 11:02:29 +10:00
finddupes.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
finddupes.ui Fix AnkiWebPage not being initialized for default web view kinds (e.g. in add-ons) (#3933) 2025-04-23 16:23:02 +10:00
findreplace.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
findreplace.ui fixed and tested issue #2608 (#2611) 2023-08-16 07:26:50 +10:00
forget.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
forget.ui Improve hover feedback on various widgets (#2079) 2022-09-20 16:34:15 +10:00
getaddons.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
getaddons.ui update TR references in .ui files 2021-03-26 15:03:51 +10:00
importing.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
importing.ui Improve hover feedback on various widgets (#2079) 2022-09-20 16:34:15 +10:00
main.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
main.ui Add revert to backup option to file menu (#3434) 2024-09-25 20:21:59 +10:00
modelopts.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
modelopts.ui Improve hover feedback on various widgets (#2079) 2022-09-20 16:34:15 +10:00
models.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
models.ui update TR references in .ui files 2021-03-26 15:03:51 +10:00
preferences.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
preferences.ui Remove legacy import option (#3536) 2024-11-05 18:25:06 +10:00
preview.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
preview.ui Redesign deck options inputs (#2082) 2022-09-27 12:16:45 +10:00
profiles.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
profiles.ui update TR references in .ui files 2021-03-26 15:03:51 +10:00
progress.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
progress.ui update designer references 2020-11-17 19:55:18 +10:00
reposition.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
reposition.ui Improve hover feedback on various widgets (#2079) 2022-09-20 16:34:15 +10:00
setgroup.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
setgroup.ui update TR references in .ui files 2021-03-26 15:03:51 +10:00
setlang.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
setlang.ui Revamp Preferences, implement Minimalist Mode and Qt widget gallery to test GUI changes (#2289) 2023-01-18 21:24:16 +10:00
stats.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
stats.ui Fix AnkiWebPage not being initialized for default web view kinds (e.g. in add-ons) (#3933) 2025-04-23 16:23:02 +10:00
studydeck.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
studydeck.ui update TR references in .ui files 2021-03-26 15:03:51 +10:00
synclog.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
synclog.ui Refactor media sync handling (#2647) 2023-09-10 13:22:20 +10:00
taglimit.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
taglimit.ui Improve hover feedback on various widgets (#2079) 2022-09-20 16:34:15 +10:00
template.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
template.ui Add separate styling for template editor QGroupBoxes (#2337) 2023-01-19 21:14:52 +10:00
widgets.py Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
widgets.ui Revamp Preferences, implement Minimalist Mode and Qt widget gallery to test GUI changes (#2289) 2023-01-18 21:24:16 +10:00