mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 15:02:21 -04:00
open with current card focused
This commit is contained in:
parent
e138e44397
commit
11b20b1e09
1 changed files with 9 additions and 0 deletions
|
@ -470,6 +470,8 @@ class Browser(QMainWindow):
|
||||||
if not self.model.cards:
|
if not self.model.cards:
|
||||||
# no row change will fire
|
# no row change will fire
|
||||||
self.onRowChanged(None, None)
|
self.onRowChanged(None, None)
|
||||||
|
elif self.mw.state == "review":
|
||||||
|
self.focusCid(self.mw.reviewer.card.id)
|
||||||
|
|
||||||
def updateTitle(self):
|
def updateTitle(self):
|
||||||
selected = len(self.form.tableView.selectionModel().selectedRows())
|
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):
|
def onCardList(self):
|
||||||
self.form.tableView.setFocus()
|
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
|
# Change model dialog
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue