mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Apply some fixes from Abdo
https://github.com/ankitects/anki/pull/2612#issuecomment-1712320801
This commit is contained in:
parent
71028207e0
commit
89854ac2b9
2 changed files with 5 additions and 2 deletions
|
@ -3,6 +3,8 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
|
||||
import aqt
|
||||
import aqt.deckconf
|
||||
import aqt.main
|
||||
|
@ -48,9 +50,9 @@ class ImportDialog(QDialog):
|
|||
self.setLayout(layout)
|
||||
restoreGeom(self, self.TITLE, default_size=(800, 800))
|
||||
|
||||
escaped_path = path.replace("'", r"\'")
|
||||
escaped_path = json.dumps(path.replace("'", r"\'"))
|
||||
self.web.evalWithCallback(
|
||||
f"anki.{self.SETUP_FUNCTION_NAME}('{escaped_path}');",
|
||||
f"anki.{self.SETUP_FUNCTION_NAME}({escaped_path});",
|
||||
lambda _: self.web.setFocus(),
|
||||
)
|
||||
self.setWindowTitle(tr.decks_import_file())
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
@import "bootstrap/scss/modal";
|
||||
@import "bootstrap/scss/carousel";
|
||||
@import "sass/bootstrap-forms";
|
||||
@import "sass/bootstrap-tooltip";
|
||||
|
||||
.night-mode {
|
||||
@include bootstrap-dark.night-mode;
|
||||
|
|
Loading…
Reference in a new issue