mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
Allow cloze/image occlusion notetypes to be restored to defaults
This commit is contained in:
parent
55f4ccdcbe
commit
ed334fa45d
1 changed files with 13 additions and 10 deletions
|
@ -14,7 +14,7 @@ import aqt.operations
|
||||||
from anki import stdmodels
|
from anki import stdmodels
|
||||||
from anki.collection import OpChanges
|
from anki.collection import OpChanges
|
||||||
from anki.consts import *
|
from anki.consts import *
|
||||||
from anki.lang import without_unicode_isolation
|
from anki.lang import with_collapsed_whitespace, without_unicode_isolation
|
||||||
from anki.notes import Note
|
from anki.notes import Note
|
||||||
from anki.notetypes_pb2 import StockNotetype
|
from anki.notetypes_pb2 import StockNotetype
|
||||||
from aqt import AnkiQt, gui_hooks
|
from aqt import AnkiQt, gui_hooks
|
||||||
|
@ -713,7 +713,10 @@ class CardLayout(QDialog):
|
||||||
return
|
return
|
||||||
|
|
||||||
if not askUser(
|
if not askUser(
|
||||||
tr.card_templates_restore_to_default_confirmation(), defaultno=True
|
with_collapsed_whitespace(
|
||||||
|
tr.card_templates_restore_to_default_confirmation()
|
||||||
|
),
|
||||||
|
defaultno=True,
|
||||||
):
|
):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -743,18 +746,18 @@ class CardLayout(QDialog):
|
||||||
def onMore(self) -> None:
|
def onMore(self) -> None:
|
||||||
m = QMenu(self)
|
m = QMenu(self)
|
||||||
|
|
||||||
|
a = m.addAction(
|
||||||
|
tr.actions_with_ellipsis(action=tr.card_templates_restore_to_default())
|
||||||
|
)
|
||||||
|
qconnect(
|
||||||
|
a.triggered,
|
||||||
|
lambda: self.on_restore_to_default(), # pylint: disable=unnecessary-lambda
|
||||||
|
)
|
||||||
|
|
||||||
if not self._isCloze():
|
if not self._isCloze():
|
||||||
a = m.addAction(tr.card_templates_add_card_type())
|
a = m.addAction(tr.card_templates_add_card_type())
|
||||||
qconnect(a.triggered, self.onAddCard)
|
qconnect(a.triggered, self.onAddCard)
|
||||||
|
|
||||||
a = m.addAction(
|
|
||||||
tr.actions_with_ellipsis(action=tr.card_templates_restore_to_default())
|
|
||||||
)
|
|
||||||
qconnect(
|
|
||||||
a.triggered,
|
|
||||||
lambda: self.on_restore_to_default(), # pylint: disable=unnecessary-lambda
|
|
||||||
)
|
|
||||||
|
|
||||||
a = m.addAction(tr.card_templates_remove_card_type())
|
a = m.addAction(tr.card_templates_remove_card_type())
|
||||||
qconnect(a.triggered, self.onRemove)
|
qconnect(a.triggered, self.onRemove)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue