mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 08:46:37 -04:00
consistent nomenclature
This commit is contained in:
parent
f793b8a695
commit
a9a0b1752d
4 changed files with 7 additions and 25 deletions
|
@ -738,25 +738,6 @@ class Browser(QMainWindow):
|
|||
border: 1px solid #000; padding: 3px; '>%s</div>""" % rep
|
||||
return rep, cs
|
||||
|
||||
def onCardLink(self, url):
|
||||
if url == "sort":
|
||||
self.onChangeSortField()
|
||||
else:
|
||||
self.onRevlog()
|
||||
|
||||
def onChangeSortField(self):
|
||||
from aqt.utils import chooseList
|
||||
m = self.card.model()
|
||||
fields = [f['name'] for f in m['flds']]
|
||||
mm = self.col.models
|
||||
idx = chooseList(_("Choose field to sort this model by:"),
|
||||
fields, mm.sortIdx(m))
|
||||
if idx != mm.sortIdx(m):
|
||||
self.mw.progress.start()
|
||||
mm.setSortIdx(m, idx)
|
||||
self.mw.progress.finish()
|
||||
self.onSearch()
|
||||
|
||||
def onRevlog(self):
|
||||
data = self._revlogData()
|
||||
d = QDialog(self)
|
||||
|
|
|
@ -23,14 +23,14 @@ class CardLayout(QDialog):
|
|||
self.col = self.mw.col
|
||||
self.mm = self.mw.col.models
|
||||
self.model = note.model()
|
||||
self.mw.checkpoint(_("Card Layout"))
|
||||
self.mw.checkpoint(_("Card Types"))
|
||||
self.addMode = addMode
|
||||
if addMode:
|
||||
# save it to DB temporarily
|
||||
note.flush()
|
||||
self.setupTabs()
|
||||
self.setupButtons()
|
||||
self.setWindowTitle(_("%s Layout") % self.model['name'])
|
||||
self.setWindowTitle(_("Card Types for %s") % self.model['name'])
|
||||
v1 = QVBoxLayout()
|
||||
v1.addWidget(self.tabs)
|
||||
v1.addLayout(self.buttons)
|
||||
|
@ -98,12 +98,12 @@ class CardLayout(QDialog):
|
|||
self.tabs.addTab(w, t['name'])
|
||||
|
||||
def onRemoveTab(self, idx):
|
||||
if not askUser(_("Remove template and all its cards?")):
|
||||
if not askUser(_("Remove all cards of this type?")):
|
||||
return
|
||||
if not self.mm.remTemplate(self.model, self.cards[idx].template()):
|
||||
return showWarning(_("""\
|
||||
Removing this card would cause one or more notes to be deleted. \
|
||||
Please create a new card first."""))
|
||||
Removing this card type would cause one or more notes to be deleted. \
|
||||
Please create a new card type first."""))
|
||||
self.redraw()
|
||||
|
||||
# Buttons
|
||||
|
|
|
@ -488,7 +488,7 @@ class Editor(object):
|
|||
contents = self.note.fields[0]
|
||||
browser = aqt.dialogs.open("Browser", self.mw)
|
||||
browser.form.searchEdit.setText(
|
||||
"'model:%s' '%s:%s'" % (
|
||||
"'ntype:%s' '%s:%s'" % (
|
||||
self.note.model()['name'],
|
||||
self.note.model()['flds'][0]['name'],
|
||||
contents))
|
||||
|
|
|
@ -20,6 +20,7 @@ class FieldDialog(QDialog):
|
|||
self.mw.checkpoint(_("Fields"))
|
||||
self.form = aqt.forms.fields.Ui_Dialog()
|
||||
self.form.setupUi(self)
|
||||
self.setWindowTitle(_("Fields for %s") % self.model['name'])
|
||||
self.form.buttonBox.button(QDialogButtonBox.Help).setAutoDefault(False)
|
||||
self.form.buttonBox.button(QDialogButtonBox.Close).setAutoDefault(False)
|
||||
self.currentIdx = None
|
||||
|
|
Loading…
Reference in a new issue