- don't require collection for initial blank content
- defer profile load until initial blank content loaded
- use plain text for blank content to prevent initial flash of white
qtwebengineprocess.exe inherits the current working directory, so if
it is started after the profile is loaded, it prevents the profile
media folder from being renamed/deleted
also, load profile on first run at the same point we normally load
the profile
Extends the AddonManager API with two new methods, setWebExports and
getWebExports. setWebExports expects an add-on module name and a
valid RegEx pattern to match subpaths in the add-on folder against.
Any matching subpaths will be accessible in Anki's web views by
referencing them with /_addons/{addon_id}/{subpath}.
For instance, to allow access to .css and .png files in your add-on's
user_files directory you would call:
> mw.addonManager.setWebExports(__name__, r"user_files/.+(\.png|\.css)")
You could then reference these files in web views as such:
> <img src="/_addons/{addon_id}/user_files/test.png">
Please note that this bypasses the default security policies used
in Anki webviews. You should take care to construct your RegEx
patterns specific enough so that they do not match any sensitive
files of our add-on.
ideally the original code should be correctly cleaning up the hooks,
but if it does not, then we don't want to repeatedly present the user
with confusing errors when they try to check their database is ok.
The application name typically comes at the end of the title. As such, many tools grabs the final string as the application name. What Anki does currently causes the profile name to be grabbed, producing unexpected results.
issue is trying to move to the overview screen before the callbacks
on the deck overview screen complete - "fix" it for now by remaining
on the deck list
some users had mpv lying around from previous installs, and the Windows
implementation seems to hang with the idle hook introduced in the
previous build
- allows translations of filename
- allows users to keep multiple collection exports in the same folder
- provides a clearer distinction between deck and collection packages
- the collection/backup .apkg special cases will continue to work in
future 2.1.x releases
- add-ons can ship default config in a config.json file
- users can edit the config in the add-ons dialog, easily syntax-check
the json, and restore it to the defaults
- an optional config.md contains instructions to the user in markdown
format
- config will be preserved when add-on is updated, instead of being
overwritten as is the case when users are required to edit the source
files
A simple example: in config.json:
{"myvar": 5}
In your add-on's code:
from aqt import mw
config = mw.addonManager.getConfig(__name__)
print("var is", config['myvar'])
Add-ons that manage options in their own GUI can have that GUI
displayed when the config button is clicked:
mw.addonManager.setConfigAction(__name__, myOptionsFunc)