mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
temporary fix for error on deleting (#1374)
This commit is contained in:
parent
66fc9cdbd8
commit
9720592519
1 changed files with 17 additions and 5 deletions
|
@ -9,7 +9,13 @@ import aqt
|
|||
import aqt.forms
|
||||
from anki._legacy import deprecated
|
||||
from anki.cards import Card, CardId
|
||||
from anki.collection import Collection, Config, OpChanges, SearchNode
|
||||
from anki.collection import (
|
||||
Collection,
|
||||
Config,
|
||||
OpChanges,
|
||||
OpChangesWithCount,
|
||||
SearchNode,
|
||||
)
|
||||
from anki.consts import *
|
||||
from anki.errors import NotFoundError
|
||||
from anki.lang import without_unicode_isolation
|
||||
|
@ -54,6 +60,7 @@ from aqt.utils import (
|
|||
saveState,
|
||||
showWarning,
|
||||
skip_if_selection_is_empty,
|
||||
tooltip,
|
||||
tr,
|
||||
)
|
||||
|
||||
|
@ -593,11 +600,16 @@ class Browser(QMainWindow):
|
|||
return
|
||||
|
||||
nids = self.table.get_selected_note_ids()
|
||||
# select the next card if there is one
|
||||
self.focusTo = self.editor.currentField
|
||||
self.table.to_next_row()
|
||||
|
||||
remove_notes(parent=self, note_ids=nids).run_in_background()
|
||||
def after_remove(changes: OpChangesWithCount) -> None:
|
||||
tooltip(tr.browsing_cards_deleted(count=changes.count))
|
||||
# select the next card if there is one
|
||||
self.focusTo = self.editor.currentField
|
||||
self.table.to_next_row()
|
||||
|
||||
remove_notes(parent=self, note_ids=nids).success(
|
||||
after_remove
|
||||
).run_in_background()
|
||||
|
||||
# legacy
|
||||
|
||||
|
|
Loading…
Reference in a new issue