From 8ee606bf3f3083b34d5ee29a821cea9781f59589 Mon Sep 17 00:00:00 2001 From: Atsushi Watanabe Date: Thu, 2 May 2019 17:07:11 +0900 Subject: [PATCH] Add local echo of interpreter command (#5) --- ypspur_gui.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ypspur_gui.cpp b/ypspur_gui.cpp index a9d674e..80a2d95 100644 --- a/ypspur_gui.cpp +++ b/ypspur_gui.cpp @@ -238,6 +238,13 @@ void YPSpurGUI::on_interpreterCommand_returnPressed() str.append("\n"); interpreter_.write(str.toLocal8Bit()); ui_->interpreterCommand->setText(""); + + QString data = str; + mutex_interpreter_output_.lock(); + data.replace(QRegExp(" "), " "); + data.replace(QRegExp("\n"), "
"); + printTextEdit(ui_->interpreterOut, data); + mutex_interpreter_output_.unlock(); } bool YPSpurGUI::eventFilter(QObject* obj, QEvent* event)