qt, rpc: Do not accept command while executing another one

This commit is contained in:
Hennadii Stepanov committed 2021-05-31 23:34:04 +03:00
1 parent 0c32b9c527
commit 38eb37c0bd
2 files changed
+7

No files matched your search

+6
View File
@@ -949,6 +949,10 @@ void RPCConsole::on_lineEdit_returnPressed()
return;
}
if (m_is_executing) {
return;
}
ui->lineEdit->clear();
#ifdef ENABLE_WALLET
@@ -967,6 +971,7 @@ void RPCConsole::on_lineEdit_returnPressed()
message(CMD_REQUEST, QString::fromStdString(strFilteredCmd));
//: A console message indicating an entered command is currently being executed.
message(CMD_REPLY, tr("Executing…"));
m_is_executing = true;
Q_EMIT cmdRequest(cmd, m_last_wallet_model);
cmd = QString::fromStdString(strFilteredCmd);
@@ -1018,6 +1023,7 @@ void RPCConsole::startExecutor()
ui->messagesWidget->undo();
message(category, command);
scrollToEnd();
m_is_executing = false;
});
// Requests from this object must go to executor
+1
View File
@@ -166,6 +166,7 @@ private:
QCompleter *autoCompleter = nullptr;
QThread thread;
WalletModel* m_last_wallet_model{nullptr};
bool m_is_executing{false};
/** Update UI with latest network info from model. */
void updateNetworkState();