Add checkpoints for sidebar drag & drop routines
Also save note and reset browser model
This commit is contained in:
parent
4330ab58f5
commit
2754464147
@ -399,12 +399,19 @@ class SidebarTreeView(QTreeView):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
def on_done(fut: Future) -> None:
|
def on_done(fut: Future) -> None:
|
||||||
|
self.browser.model.endReset()
|
||||||
fut.result()
|
fut.result()
|
||||||
self.refresh()
|
self.refresh()
|
||||||
|
self.mw.deckBrowser.refresh()
|
||||||
|
|
||||||
self.mw.taskman.with_progress(
|
def on_save() -> None:
|
||||||
lambda: self.col.decks.drag_drop_decks(source_ids, target.id), on_done
|
self.mw.checkpoint(tr(TR.ACTIONS_RENAME_DECK))
|
||||||
)
|
self.browser.model.beginReset()
|
||||||
|
self.mw.taskman.with_progress(
|
||||||
|
lambda: self.col.decks.drag_drop_decks(source_ids, target.id), on_done
|
||||||
|
)
|
||||||
|
|
||||||
|
self.browser.editor.saveNow(on_save)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def _handle_drag_drop_tags(
|
def _handle_drag_drop_tags(
|
||||||
@ -419,6 +426,8 @@ class SidebarTreeView(QTreeView):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
def on_done(fut: Future) -> None:
|
def on_done(fut: Future) -> None:
|
||||||
|
self.mw.requireReset(reason=ResetReason.BrowserAddTags, context=self)
|
||||||
|
self.browser.model.endReset()
|
||||||
fut.result()
|
fut.result()
|
||||||
self.refresh()
|
self.refresh()
|
||||||
|
|
||||||
@ -427,9 +436,14 @@ class SidebarTreeView(QTreeView):
|
|||||||
else:
|
else:
|
||||||
target_name = target.full_name
|
target_name = target.full_name
|
||||||
|
|
||||||
self.mw.taskman.with_progress(
|
def on_save() -> None:
|
||||||
lambda: self.col.tags.drag_drop(source_ids, target_name), on_done
|
self.mw.checkpoint(tr(TR.ACTIONS_RENAME_TAG))
|
||||||
)
|
self.browser.model.beginReset()
|
||||||
|
self.mw.taskman.with_progress(
|
||||||
|
lambda: self.col.tags.drag_drop(source_ids, target_name), on_done
|
||||||
|
)
|
||||||
|
|
||||||
|
self.browser.editor.saveNow(on_save)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def onClickCurrent(self) -> None:
|
def onClickCurrent(self) -> None:
|
||||||
|
Loading…
Reference in New Issue
Block a user