Skip to content

Commit 5b9c8c9

Browse files
committed
qt, rpc: Add "Executing…" message
1 parent 933c646 commit 5b9c8c9

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/qt/rpcconsole.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,6 +958,8 @@ void RPCConsole::on_lineEdit_returnPressed()
958958
#endif
959959

960960
message(CMD_REQUEST, QString::fromStdString(strFilteredCmd));
961+
//: A console message indicating an entered command is currently being executed.
962+
message(CMD_REPLY, tr("Executing…"));
961963
Q_EMIT cmdRequest(cmd, m_last_wallet_model);
962964

963965
cmd = QString::fromStdString(strFilteredCmd);
@@ -1004,7 +1006,12 @@ void RPCConsole::startExecutor()
10041006
executor->moveToThread(&thread);
10051007

10061008
// Replies from executor object must go to this object
1007-
connect(executor, &RPCExecutor::reply, this, qOverload<int, const QString&>(&RPCConsole::message));
1009+
connect(executor, &RPCExecutor::reply, this, [this](int category, const QString& command) {
1010+
// Remove "Executing…" message.
1011+
ui->messagesWidget->undo();
1012+
message(category, command);
1013+
scrollToEnd();
1014+
});
10081015

10091016
// Requests from this object must go to executor
10101017
connect(this, &RPCConsole::cmdRequest, executor, &RPCExecutor::request);

src/qt/test/apptests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void TestRpcCommand(RPCConsole* console)
4040
QTest::keyClicks(lineEdit, "getblockchaininfo");
4141
QTest::keyClick(lineEdit, Qt::Key_Return);
4242
QVERIFY(mw_spy.wait(1000));
43-
QCOMPARE(mw_spy.count(), 2);
43+
QCOMPARE(mw_spy.count(), 4);
4444
QString output = messagesWidget->toPlainText();
4545
UniValue value;
4646
value.read(output.right(output.size() - output.lastIndexOf(QChar::ObjectReplacementCharacter) - 1).toStdString());

0 commit comments

Comments
 (0)