fix deleting deck configs

This commit is contained in:
Damien Elmes 2020-04-20 13:23:05 +10:00
parent 335815ab9c
commit 683f664d85
2 changed files with 4 additions and 2 deletions

View file

@ -251,6 +251,7 @@ crt=?, mod=?, scm=?, dty=?, usn=?, ls=?""",
raise AnkiError("abortSchemaMod")
self.scm = intTime(1000)
self.setMod()
self.save()
def schemaChanged(self) -> Any:
"True if schema changed since last sync."

View file

@ -131,15 +131,16 @@ class DeckConf(QDialog):
# then reload the conf list
self.loadConfs()
def remGroup(self):
def remGroup(self) -> None:
if int(self.conf["id"]) == 1:
showInfo(_("The default configuration can't be removed."), self)
else:
self.mw.col.modSchema(check=True)
self.mw.col.decks.remove_config(self.conf["id"])
self.deck["conf"] = 1
self.loadConfs()
def renameGroup(self):
def renameGroup(self) -> None:
old = self.conf["name"]
name = getOnlyText(_("New name:"), default=old)
if not name or name == old: