Also hide existing prompts when showing a new one

Otherwise when a prompt is interrupted, we'd still see the older one.
This commit is contained in:
Florian Bruhin 2016-11-03 23:03:42 +01:00
parent 59b4ccc620
commit 3a79faac16

View File

@ -280,6 +280,12 @@ class PromptContainer(QWidget):
Args:
question: A Question object or None.
"""
item = self._layout.takeAt(0)
if item is not None:
widget = item.widget()
widget.hide()
widget.deleteLater()
if question is None:
self._prompt = None
self.hide()