mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 15:32: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.errors import *
|
||||||
from anki.db import *
|
from anki.db import *
|
||||||
from anki.stats import CardStats
|
from anki.stats import CardStats
|
||||||
from anki.hooks import runHook
|
from anki.hooks import runHook, addHook
|
||||||
|
|
||||||
# Deck editor
|
# Deck editor
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
@ -226,6 +226,7 @@ class EditDeck(QMainWindow):
|
||||||
self.setupFilter()
|
self.setupFilter()
|
||||||
self.setupSort()
|
self.setupSort()
|
||||||
self.setupHeaders()
|
self.setupHeaders()
|
||||||
|
self.setupUndo()
|
||||||
self.setupEditor()
|
self.setupEditor()
|
||||||
self.setupCardInfo()
|
self.setupCardInfo()
|
||||||
self.dialog.filterEdit.setFocus()
|
self.dialog.filterEdit.setFocus()
|
||||||
|
@ -683,17 +684,19 @@ where id in %s""" % ids2str(sf))
|
||||||
# Edit: undo/redo
|
# Edit: undo/redo
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
def onUndo(self):
|
def setupUndo(self):
|
||||||
self.deck.undo()
|
addHook("postUndoRedo", self.postUndoRedo)
|
||||||
|
|
||||||
|
def postUndoRedo(self):
|
||||||
self.updateFilterLabel()
|
self.updateFilterLabel()
|
||||||
self.updateSearch()
|
self.updateSearch()
|
||||||
self.updateAfterCardChange()
|
self.updateAfterCardChange()
|
||||||
|
|
||||||
|
def onUndo(self):
|
||||||
|
self.deck.undo()
|
||||||
|
|
||||||
def onRedo(self):
|
def onRedo(self):
|
||||||
self.deck.redo()
|
self.deck.redo()
|
||||||
self.updateFilterLabel()
|
|
||||||
self.updateSearch()
|
|
||||||
self.updateAfterCardChange()
|
|
||||||
|
|
||||||
# Jumping
|
# Jumping
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
|
@ -180,9 +180,10 @@ Please do not file a bug report with Anki.<br><br>""")
|
||||||
self.views = self.viewsBackup
|
self.views = self.viewsBackup
|
||||||
self.viewsBackup = None
|
self.viewsBackup = None
|
||||||
|
|
||||||
def reset(self, count=True):
|
def reset(self, count=True, refresh=False):
|
||||||
if self.deck:
|
if self.deck:
|
||||||
self.deck.refresh()
|
if refresh:
|
||||||
|
self.deck.refresh()
|
||||||
if count:
|
if count:
|
||||||
self.deck.updateAllPriorities()
|
self.deck.updateAllPriorities()
|
||||||
self.deck.rebuildCounts()
|
self.deck.rebuildCounts()
|
||||||
|
|
Loading…
Reference in a new issue