mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 07:22:23 -04:00
refresh after undo/redo, don't reset session on active tag change
This commit is contained in:
parent
1caa9c4d6f
commit
0af13cb550
2 changed files with 12 additions and 8 deletions
|
@ -16,7 +16,7 @@ from ankiqt.ui.utils import saveGeom, restoreGeom, saveSplitter, restoreSplitter
|
|||
from anki.errors import *
|
||||
from anki.db import *
|
||||
from anki.stats import CardStats
|
||||
from anki.hooks import runHook
|
||||
from anki.hooks import runHook, addHook
|
||||
|
||||
# Deck editor
|
||||
##########################################################################
|
||||
|
@ -226,6 +226,7 @@ class EditDeck(QMainWindow):
|
|||
self.setupFilter()
|
||||
self.setupSort()
|
||||
self.setupHeaders()
|
||||
self.setupUndo()
|
||||
self.setupEditor()
|
||||
self.setupCardInfo()
|
||||
self.dialog.filterEdit.setFocus()
|
||||
|
@ -683,17 +684,19 @@ where id in %s""" % ids2str(sf))
|
|||
# Edit: undo/redo
|
||||
######################################################################
|
||||
|
||||
def onUndo(self):
|
||||
self.deck.undo()
|
||||
def setupUndo(self):
|
||||
addHook("postUndoRedo", self.postUndoRedo)
|
||||
|
||||
def postUndoRedo(self):
|
||||
self.updateFilterLabel()
|
||||
self.updateSearch()
|
||||
self.updateAfterCardChange()
|
||||
|
||||
def onUndo(self):
|
||||
self.deck.undo()
|
||||
|
||||
def onRedo(self):
|
||||
self.deck.redo()
|
||||
self.updateFilterLabel()
|
||||
self.updateSearch()
|
||||
self.updateAfterCardChange()
|
||||
|
||||
# Jumping
|
||||
######################################################################
|
||||
|
|
|
@ -180,9 +180,10 @@ Please do not file a bug report with Anki.<br><br>""")
|
|||
self.views = self.viewsBackup
|
||||
self.viewsBackup = None
|
||||
|
||||
def reset(self, count=True):
|
||||
def reset(self, count=True, refresh=False):
|
||||
if self.deck:
|
||||
self.deck.refresh()
|
||||
if refresh:
|
||||
self.deck.refresh()
|
||||
if count:
|
||||
self.deck.updateAllPriorities()
|
||||
self.deck.rebuildCounts()
|
||||
|
|
Loading…
Reference in a new issue