mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
Merge pull request #370 from glutanimate/continue-from-addon-config-action
Allow handing config editing back to Anki after calling add-on action
This commit is contained in:
commit
a9d745ab5f
1 changed files with 5 additions and 4 deletions
|
@ -6,7 +6,7 @@ import json
|
||||||
import re
|
import re
|
||||||
import zipfile
|
import zipfile
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from typing import Any, Callable, Dict
|
from typing import Any, Callable, Dict, Optional
|
||||||
from zipfile import ZipFile
|
from zipfile import ZipFile
|
||||||
|
|
||||||
import jsonschema
|
import jsonschema
|
||||||
|
@ -358,7 +358,7 @@ and have been disabled: %(found)s") % dict(name=self.addonName(dir), found=addon
|
||||||
# Add-on Config
|
# Add-on Config
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
_configButtonActions: Dict[str, Callable[[], None]] = {}
|
_configButtonActions: Dict[str, Callable[[], Optional[bool]]] = {}
|
||||||
_configUpdatedActions: Dict[str, Callable[[Any], None]] = {}
|
_configUpdatedActions: Dict[str, Callable[[Any], None]] = {}
|
||||||
|
|
||||||
def addonConfigDefaults(self, dir):
|
def addonConfigDefaults(self, dir):
|
||||||
|
@ -640,7 +640,8 @@ class AddonsDialog(QDialog):
|
||||||
# does add-on manage its own config?
|
# does add-on manage its own config?
|
||||||
act = self.mgr.configAction(addon)
|
act = self.mgr.configAction(addon)
|
||||||
if act:
|
if act:
|
||||||
act()
|
ret = act()
|
||||||
|
if ret is not False:
|
||||||
return
|
return
|
||||||
|
|
||||||
conf = self.mgr.getConfig(addon)
|
conf = self.mgr.getConfig(addon)
|
||||||
|
|
Loading…
Reference in a new issue