Merge pull request #887 from BlueGreenMagick/deck-rename-checkpoint
don't set checkpoint when deck rename is cancelled
This commit is contained in:
commit
03b10b0d44
@ -93,13 +93,13 @@ class NewSidebarTreeView(SidebarTreeViewBase):
|
||||
m.exec_(QCursor.pos())
|
||||
|
||||
def rename_deck(self, item: "aqt.browser.SidebarItem") -> None:
|
||||
self.mw.checkpoint(tr(TR.ACTIONS_RENAME_DECK))
|
||||
deck = self.mw.col.decks.get(item.id)
|
||||
old_name = deck["name"]
|
||||
new_name = getOnlyText(tr(TR.DECKS_NEW_DECK_NAME), default=old_name)
|
||||
new_name = new_name.replace('"', "")
|
||||
if not new_name or new_name == old_name:
|
||||
return
|
||||
self.mw.checkpoint(tr(TR.ACTIONS_RENAME_DECK))
|
||||
try:
|
||||
self.mw.col.decks.rename(deck, new_name)
|
||||
except DeckRenameError as e:
|
||||
|
Loading…
Reference in New Issue
Block a user