mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
fix model renaming, add name prompt on add
This commit is contained in:
parent
dcb56ef265
commit
a10bc64822
1 changed files with 5 additions and 1 deletions
|
@ -46,7 +46,7 @@ class Models(QDialog):
|
||||||
maybeHideClose(box)
|
maybeHideClose(box)
|
||||||
|
|
||||||
def onRename(self):
|
def onRename(self):
|
||||||
txt = getText(_("New name:"), default=self.model.name)
|
txt = getText(_("New name:"), default=self.model['name'])
|
||||||
if txt[0]:
|
if txt[0]:
|
||||||
self.model['name'] = txt[0]
|
self.model['name'] = txt[0]
|
||||||
self.mm.save(self.model)
|
self.mm.save(self.model)
|
||||||
|
@ -74,6 +74,10 @@ class Models(QDialog):
|
||||||
def onAdd(self):
|
def onAdd(self):
|
||||||
m = AddModel(self.mw, self).get()
|
m = AddModel(self.mw, self).get()
|
||||||
if m:
|
if m:
|
||||||
|
txt = getText(_("Name:"), default=m['name'])[0]
|
||||||
|
if txt:
|
||||||
|
m['name'] = txt
|
||||||
|
self.mm.save(m)
|
||||||
self.updateModelsList()
|
self.updateModelsList()
|
||||||
|
|
||||||
def onDelete(self):
|
def onDelete(self):
|
||||||
|
|
Loading…
Reference in a new issue