mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 01:06:35 -04:00
Use implicit failure handling and self as parent
This commit is contained in:
parent
f97b1559a2
commit
935fbb6289
1 changed files with 2 additions and 3 deletions
|
@ -30,7 +30,6 @@ from aqt.utils import (
|
||||||
saveSplitter,
|
saveSplitter,
|
||||||
shortcut,
|
shortcut,
|
||||||
showInfo,
|
showInfo,
|
||||||
showWarning,
|
|
||||||
tooltip,
|
tooltip,
|
||||||
tr,
|
tr,
|
||||||
)
|
)
|
||||||
|
@ -790,9 +789,9 @@ class CardLayout(QDialog):
|
||||||
gui_hooks.sidebar_should_refresh_notetypes()
|
gui_hooks.sidebar_should_refresh_notetypes()
|
||||||
QDialog.accept(self)
|
QDialog.accept(self)
|
||||||
|
|
||||||
update_notetype_legacy(parent=self.mw, notetype=self.model).success(
|
update_notetype_legacy(parent=self, notetype=self.model).success(
|
||||||
on_done
|
on_done
|
||||||
).failure(lambda e: showWarning(str(e))).run_in_background()
|
).run_in_background()
|
||||||
|
|
||||||
def reject(self) -> None:
|
def reject(self) -> None:
|
||||||
if self.change_tracker.changed():
|
if self.change_tracker.changed():
|
||||||
|
|
Loading…
Reference in a new issue