Don't get prompter widget when restoring None context.

This basically did hide #95.
This commit is contained in:
Florian Bruhin 2014-11-12 20:53:47 +01:00
parent 812b100205
commit a10801ef21

View File

@ -114,12 +114,12 @@ class Prompter(QObject):
Return: True if a context was restored, False otherwise. Return: True if a context was restored, False otherwise.
""" """
log.statusbar.debug("Restoring context {}".format(ctx)) log.statusbar.debug("Restoring context {}".format(ctx))
prompt = objreg.get('prompt', scope='window', window=self._win_id)
if ctx is None: if ctx is None:
self.hide_prompt.emit() self.hide_prompt.emit()
self._busy = False self._busy = False
return False return False
self._question = ctx.question self._question = ctx.question
prompt = objreg.get('prompt', scope='window', window=self._win_id)
prompt.txt.setText(ctx.text) prompt.txt.setText(ctx.text)
prompt.lineedit.setText(ctx.input_text) prompt.lineedit.setText(ctx.input_text)
prompt.lineedit.setEchoMode(ctx.echo_mode) prompt.lineedit.setEchoMode(ctx.echo_mode)