aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2021-03-20 04:58:04 +0200
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2021-05-31 23:31:32 +0300
commit5b9c8c9cdd8e12d2e477840df9d6ab809a613c12 (patch)
tree6ca0cfc987064a45905656b70de9217afe80804f /src
parent933c6466c2bda3a06d3c5da0de0d8f05111c9f4c (diff)
qt, rpc: Add "Executing…" message
Diffstat (limited to 'src')
-rw-r--r--src/qt/rpcconsole.cpp9
-rw-r--r--src/qt/test/apptests.cpp2
2 files changed, 9 insertions, 2 deletions
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp
index 83a111e9c8..b5d639e46c 100644
--- a/src/qt/rpcconsole.cpp
+++ b/src/qt/rpcconsole.cpp
@@ -958,6 +958,8 @@ void RPCConsole::on_lineEdit_returnPressed()
#endif
message(CMD_REQUEST, QString::fromStdString(strFilteredCmd));
+ //: A console message indicating an entered command is currently being executed.
+ message(CMD_REPLY, tr("Executing…"));
Q_EMIT cmdRequest(cmd, m_last_wallet_model);
cmd = QString::fromStdString(strFilteredCmd);
@@ -1004,7 +1006,12 @@ void RPCConsole::startExecutor()
executor->moveToThread(&thread);
// Replies from executor object must go to this object
- connect(executor, &RPCExecutor::reply, this, qOverload<int, const QString&>(&RPCConsole::message));
+ connect(executor, &RPCExecutor::reply, this, [this](int category, const QString& command) {
+ // Remove "Executing…" message.
+ ui->messagesWidget->undo();
+ message(category, command);
+ scrollToEnd();
+ });
// Requests from this object must go to executor
connect(this, &RPCConsole::cmdRequest, executor, &RPCExecutor::request);
diff --git a/src/qt/test/apptests.cpp b/src/qt/test/apptests.cpp
index c1d5f84be5..cb3dbd2267 100644
--- a/src/qt/test/apptests.cpp
+++ b/src/qt/test/apptests.cpp
@@ -40,7 +40,7 @@ void TestRpcCommand(RPCConsole* console)
QTest::keyClicks(lineEdit, "getblockchaininfo");
QTest::keyClick(lineEdit, Qt::Key_Return);
QVERIFY(mw_spy.wait(1000));
- QCOMPARE(mw_spy.count(), 2);
+ QCOMPARE(mw_spy.count(), 4);
QString output = messagesWidget->toPlainText();
UniValue value;
value.read(output.right(output.size() - output.lastIndexOf(QChar::ObjectReplacementCharacter) - 1).toStdString());