mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-10 09:06:15 +01:00
qt, rpc: Add "Executing…" message
This commit is contained in:
parent
933c6466c2
commit
5b9c8c9cdd
2 changed files with 9 additions and 2 deletions
|
@ -958,6 +958,8 @@ void RPCConsole::on_lineEdit_returnPressed()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
message(CMD_REQUEST, QString::fromStdString(strFilteredCmd));
|
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);
|
Q_EMIT cmdRequest(cmd, m_last_wallet_model);
|
||||||
|
|
||||||
cmd = QString::fromStdString(strFilteredCmd);
|
cmd = QString::fromStdString(strFilteredCmd);
|
||||||
|
@ -1004,7 +1006,12 @@ void RPCConsole::startExecutor()
|
||||||
executor->moveToThread(&thread);
|
executor->moveToThread(&thread);
|
||||||
|
|
||||||
// Replies from executor object must go to this object
|
// 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
|
// Requests from this object must go to executor
|
||||||
connect(this, &RPCConsole::cmdRequest, executor, &RPCExecutor::request);
|
connect(this, &RPCConsole::cmdRequest, executor, &RPCExecutor::request);
|
||||||
|
|
|
@ -40,7 +40,7 @@ void TestRpcCommand(RPCConsole* console)
|
||||||
QTest::keyClicks(lineEdit, "getblockchaininfo");
|
QTest::keyClicks(lineEdit, "getblockchaininfo");
|
||||||
QTest::keyClick(lineEdit, Qt::Key_Return);
|
QTest::keyClick(lineEdit, Qt::Key_Return);
|
||||||
QVERIFY(mw_spy.wait(1000));
|
QVERIFY(mw_spy.wait(1000));
|
||||||
QCOMPARE(mw_spy.count(), 2);
|
QCOMPARE(mw_spy.count(), 4);
|
||||||
QString output = messagesWidget->toPlainText();
|
QString output = messagesWidget->toPlainText();
|
||||||
UniValue value;
|
UniValue value;
|
||||||
value.read(output.right(output.size() - output.lastIndexOf(QChar::ObjectReplacementCharacter) - 1).toStdString());
|
value.read(output.right(output.size() - output.lastIndexOf(QChar::ObjectReplacementCharacter) - 1).toStdString());
|
||||||
|
|
Loading…
Add table
Reference in a new issue