def submit_line(self):
""" Writes the input to the text browser, adds it to the history, and
adds it to the message queue to be sent to the binary """
raw = self._textbox.text()
line = self.decode(raw)
if line is None:
return
if raw not in self.history:
self.history.append(raw)
action = QtWidgets.QAction(str(raw), self)
action.triggered.connect(partial(self.set_text_box_contents, raw))
self._hist_menu.insertAction(self._hist_menu.actions()[0], action)
self._messages.put((line, None))
self._autoscroll()
# self._textBrowser.setTextColor(usercolor)
# self._textBrowser.insertPlainText(line + "\n")
# self._textBrowser.setTextColor(self.palette().color(QPalette.WindowText))
self._textbox.clear()
self._autoscroll()
评论列表
文章目录