mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Adjust type annotations, format string, and remove tooltip on cancel
Other areas of Anki don't confirm cancelling actions with tooltips, so after further consideration, the tooltip felt out of the place and might have actually confused users into thinking some action was being performed.
This commit is contained in:
parent
1b236acb3d
commit
392938f20c
1 changed files with 4 additions and 5 deletions
|
@ -666,7 +666,7 @@ class AddonsDialog(QDialog):
|
|||
def onGetAddons(self):
|
||||
GetAddons(self)
|
||||
|
||||
def onInstallFiles(self, paths: List[str] = None, external: bool = False):
|
||||
def onInstallFiles(self, paths: Optional[List[str]] = None, external: bool = False):
|
||||
if not paths:
|
||||
key = _("Packaged Anki Add-on") + " (*{})".format(self.mgr.ext)
|
||||
paths = getFile(
|
||||
|
@ -864,14 +864,14 @@ def installAddonPackages(
|
|||
) -> bool:
|
||||
|
||||
if external:
|
||||
names_str = ",<br>".join(f"<b>{os.path.basename(p)}</b>" for p in paths)
|
||||
names = ",<br>".join(f"<b>{os.path.basename(p)}</b>" for p in paths)
|
||||
q = _(
|
||||
"<b>Important</b>: As add-ons are programs downloaded from the internet, "
|
||||
"they are potentially malicious."
|
||||
"<b>You should only install add-ons you trust.</b><br><br>"
|
||||
"Are you sure you want to proceed with the installation of the "
|
||||
f"following add-on(s)?<br><br>{names_str}<i>"
|
||||
)
|
||||
"following add-on(s)?<br><br>%(names)s"
|
||||
) % dict(names=names)
|
||||
if (
|
||||
not showInfo(
|
||||
q,
|
||||
|
@ -882,7 +882,6 @@ def installAddonPackages(
|
|||
)
|
||||
== QMessageBox.Yes
|
||||
):
|
||||
tooltip(_("Add-on installation aborted"), parent=parent)
|
||||
return False
|
||||
|
||||
log, errs = addonsManager.processPackages(paths, parent=parent)
|
||||
|
|
Loading…
Reference in a new issue