From 4e6ba4df787c932b519051eea6137409a37c9b18 Mon Sep 17 00:00:00 2001 From: BlueGreenMagick <50060875+BlueGreenMagick@users.noreply.github.com> Date: Thu, 11 Jun 2020 12:50:17 +0900 Subject: [PATCH] get deck name after adding deck --- qt/aqt/studydeck.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qt/aqt/studydeck.py b/qt/aqt/studydeck.py index 493f2307a..c049a6e4a 100644 --- a/qt/aqt/studydeck.py +++ b/qt/aqt/studydeck.py @@ -146,8 +146,9 @@ class StudyDeck(QDialog): default = self.names[self.form.list.currentRow()] n = getOnlyText(_("New deck name:"), default=default) if n: - self.mw.col.decks.id(n) - self.name = n + did = self.mw.col.decks.id(n) + # deck name may not be the same as user input. ex: ", :: + self.name = self.mw.col.decks.name(did) # make sure we clean up reset hook when manually exiting gui_hooks.state_did_reset.remove(self.onReset) QDialog.accept(self)