open with current card focused

This commit is contained in:
Damien Elmes 2012-05-28 21:36:36 +09:00
parent e138e44397
commit 11b20b1e09

View file

@ -470,6 +470,8 @@ class Browser(QMainWindow):
if not self.model.cards:
# no row change will fire
self.onRowChanged(None, None)
elif self.mw.state == "review":
self.focusCid(self.mw.reviewer.card.id)
def updateTitle(self):
selected = len(self.form.tableView.selectionModel().selectedRows())
@ -1240,6 +1242,13 @@ update cards set usn=?, mod=?, did=? where odid=0 and id in """ + ids2str(
def onCardList(self):
self.form.tableView.setFocus()
def focusCid(self, cid):
try:
row = self.model.cards.index(cid)
except:
return
self.form.tableView.selectRow(row)
# Change model dialog
######################################################################