From 50736ecf1d0924b6455bf4268b9282e067060bcf Mon Sep 17 00:00:00 2001 From: Dmitry Mikheev Date: Wed, 3 May 2017 13:55:24 +0500 Subject: [PATCH] What about this one? --- aqt/utils.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/aqt/utils.py b/aqt/utils.py index 24127e710..cb5fe6c46 100644 --- a/aqt/utils.py +++ b/aqt/utils.py @@ -184,13 +184,18 @@ class GetTextDialog(QDialog): def helpRequested(self): openHelp(self.help) -def getText(prompt, parent=None, help=None, edit=None, default="", title="Anki"): +def getText(prompt, parent=None, help=None, edit=None, default="", + title="Anki", geomKey=None, **kwargs): if not parent: parent = aqt.mw.app.activeWindow() or aqt.mw d = GetTextDialog(parent, prompt, help=help, edit=edit, - default=default, title=title) + default=default, title=title, **kwargs) d.setWindowModality(Qt.WindowModal) + if geomKey: + restoreGeom(d, geomKey) ret = d.exec_() + if geomKey and ret: + saveGeom(d, geomKey) return (str(d.l.text()), ret) def getOnlyText(*args, **kwargs): @@ -224,7 +229,8 @@ def getTag(parent, deck, question, tags="user", **kwargs): from aqt.tagedit import TagEdit te = TagEdit(parent) te.setCol(deck) - ret = getText(question, parent, edit=te, **kwargs) + ret = getText(question, parent, edit=te, + geomKey='getTag', **kwargs) te.hideCompleter() return ret