mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Further tweak messaging depending on Anki's state at installation time
This commit is contained in:
parent
6a7f11b172
commit
7348e9c69e
2 changed files with 12 additions and 4 deletions
|
@ -861,7 +861,8 @@ def installAddonPackages(
|
||||||
paths: List[str],
|
paths: List[str],
|
||||||
parent: Optional[QWidget] = None,
|
parent: Optional[QWidget] = None,
|
||||||
warn: bool = False,
|
warn: bool = False,
|
||||||
strictly_modal: bool = False
|
strictly_modal: bool = False,
|
||||||
|
advise_restart: bool = False,
|
||||||
) -> bool:
|
) -> bool:
|
||||||
|
|
||||||
if warn:
|
if warn:
|
||||||
|
@ -889,6 +890,10 @@ def installAddonPackages(
|
||||||
|
|
||||||
if log:
|
if log:
|
||||||
log_html = "<br>".join(log)
|
log_html = "<br>".join(log)
|
||||||
|
if advise_restart:
|
||||||
|
log_html += "<br><br>" + _(
|
||||||
|
"<b>Please restart Anki to complete the installation.</b>"
|
||||||
|
)
|
||||||
if len(log) == 1 and not strictly_modal:
|
if len(log) == 1 and not strictly_modal:
|
||||||
tooltip(log_html, parent=parent)
|
tooltip(log_html, parent=parent)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -1035,10 +1035,13 @@ QTreeWidget {
|
||||||
def installAddon(self, path: str, startup: bool = False):
|
def installAddon(self, path: str, startup: bool = False):
|
||||||
from aqt.addons import installAddonPackages
|
from aqt.addons import installAddonPackages
|
||||||
|
|
||||||
parent = None if startup else self
|
|
||||||
|
|
||||||
installAddonPackages(
|
installAddonPackages(
|
||||||
self.addonManager, [path], warn=True, strictly_modal=startup, parent=parent
|
self.addonManager,
|
||||||
|
[path],
|
||||||
|
warn=True,
|
||||||
|
advise_restart=not startup,
|
||||||
|
strictly_modal=startup,
|
||||||
|
parent=None if startup else self,
|
||||||
)
|
)
|
||||||
|
|
||||||
# Cramming
|
# Cramming
|
||||||
|
|
Loading…
Reference in a new issue