consistent nomenclature

This commit is contained in:
Damien Elmes 2012-04-06 16:36:47 +09:00
parent f793b8a695
commit a9a0b1752d
4 changed files with 7 additions and 25 deletions

View file

@ -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)

View file

@ -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

View file

@ -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))

View file

@ -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