Get rid of message_bridge.set_cmd_text

This commit is contained in:
Florian Bruhin 2016-10-03 20:25:09 +02:00
parent 523369882a
commit 756564ebff
4 changed files with 2 additions and 19 deletions

View File

@ -265,9 +265,8 @@ class HintActions:
if text[0] not in modeparsers.STARTCHARS:
raise HintingError("Invalid command text '{}'.".format(text))
bridge = objreg.get('message-bridge', scope='window',
window=self._win_id)
bridge.set_cmd_text(text)
cmd = objreg.get('status-command', scope='window', window=self._win_id)
cmd.set_cmd_text(text)
def download(self, elem, context):
"""Download a hint URL.

View File

@ -420,7 +420,6 @@ class MainWindow(QWidget):
message_bridge.s_set_text.connect(status.set_text)
message_bridge.s_maybe_reset_text.connect(status.txt.maybe_reset_text)
message_bridge.s_set_cmd_text.connect(cmd.set_cmd_text)
message_bridge.s_question.connect(self._prompt_container.ask_question,
Qt.DirectConnection)

View File

@ -77,7 +77,6 @@ class Command(misc.MinimalLineEditMixin, misc.CommandLineEdit):
else:
return ''
@pyqtSlot(str)
def set_cmd_text(self, text):
"""Preset the statusbar to some text.

View File

@ -164,8 +164,6 @@ class MessageBridge(QObject):
arg: The text to set.
s_maybe_reset_text: Reset the text if it hasn't been changed yet.
arg: The expected text.
s_set_cmd_text: Pre-set a text for the commandline prompt.
arg: The text to set.
s_question: Ask a question to the user in the statusbar.
arg 0: The Question object to ask.
@ -177,23 +175,11 @@ class MessageBridge(QObject):
s_set_text = pyqtSignal(str)
s_maybe_reset_text = pyqtSignal(str)
s_set_cmd_text = pyqtSignal(str)
s_question = pyqtSignal(usertypes.Question, bool)
def __repr__(self):
return utils.get_repr(self)
def set_cmd_text(self, text, *, log_stack=False):
"""Set the command text of the statusbar.
Args:
text: The text to set.
log_stack: ignored
"""
text = str(text)
log.message.debug(text)
self.s_set_cmd_text.emit(text)
def set_text(self, text, *, log_stack=False):
"""Set the normal text of the statusbar.