mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-27 03:33:27 -03:00
qt, rpc: Do not accept command while executing another one
This commit is contained in:
parent
0c32b9c527
commit
38eb37c0bd
2 changed files with 7 additions and 0 deletions
|
@ -949,6 +949,10 @@ void RPCConsole::on_lineEdit_returnPressed()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_is_executing) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ui->lineEdit->clear();
|
ui->lineEdit->clear();
|
||||||
|
|
||||||
#ifdef ENABLE_WALLET
|
#ifdef ENABLE_WALLET
|
||||||
|
@ -967,6 +971,7 @@ void RPCConsole::on_lineEdit_returnPressed()
|
||||||
message(CMD_REQUEST, QString::fromStdString(strFilteredCmd));
|
message(CMD_REQUEST, QString::fromStdString(strFilteredCmd));
|
||||||
//: A console message indicating an entered command is currently being executed.
|
//: A console message indicating an entered command is currently being executed.
|
||||||
message(CMD_REPLY, tr("Executing…"));
|
message(CMD_REPLY, tr("Executing…"));
|
||||||
|
m_is_executing = true;
|
||||||
Q_EMIT cmdRequest(cmd, m_last_wallet_model);
|
Q_EMIT cmdRequest(cmd, m_last_wallet_model);
|
||||||
|
|
||||||
cmd = QString::fromStdString(strFilteredCmd);
|
cmd = QString::fromStdString(strFilteredCmd);
|
||||||
|
@ -1018,6 +1023,7 @@ void RPCConsole::startExecutor()
|
||||||
ui->messagesWidget->undo();
|
ui->messagesWidget->undo();
|
||||||
message(category, command);
|
message(category, command);
|
||||||
scrollToEnd();
|
scrollToEnd();
|
||||||
|
m_is_executing = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
// Requests from this object must go to executor
|
// Requests from this object must go to executor
|
||||||
|
|
|
@ -166,6 +166,7 @@ private:
|
||||||
QCompleter *autoCompleter = nullptr;
|
QCompleter *autoCompleter = nullptr;
|
||||||
QThread thread;
|
QThread thread;
|
||||||
WalletModel* m_last_wallet_model{nullptr};
|
WalletModel* m_last_wallet_model{nullptr};
|
||||||
|
bool m_is_executing{false};
|
||||||
|
|
||||||
/** Update UI with latest network info from model. */
|
/** Update UI with latest network info from model. */
|
||||||
void updateNetworkState();
|
void updateNetworkState();
|
||||||
|
|
Loading…
Add table
Reference in a new issue