mirror of
https://github.com/feather-wallet/feather.git
synced 2024-12-22 11:39:25 +00:00
send: disable send button during tx broadcast
This commit is contained in:
parent
f8bf233600
commit
55a8955377
5 changed files with 20 additions and 13 deletions
|
@ -1577,7 +1577,7 @@ void MainWindow::onKeysCorrupted() {
|
|||
if (!m_criticalWarningShown) {
|
||||
m_criticalWarningShown = true;
|
||||
Utils::showError(this, "Wallet keys are corrupted", "WARNING!\n\nTo prevent LOSS OF FUNDS do NOT continue to use this wallet file.\n\nRestore your wallet from seed.\n\nPlease report this incident to the Feather developers.\n\nWARNING!");
|
||||
m_sendWidget->disableSendButton();
|
||||
m_sendWidget->disallowSending();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -32,8 +32,10 @@ SendWidget::SendWidget(Wallet *wallet, QWidget *parent)
|
|||
QValidator *validator = new QRegularExpressionValidator(rx, this);
|
||||
ui->lineAmount->setValidator(validator);
|
||||
|
||||
connect(m_wallet, &Wallet::initiateTransaction, this, &SendWidget::onInitiateTransaction);
|
||||
connect(m_wallet, &Wallet::transactionCreated, this, &SendWidget::onEndTransaction);
|
||||
connect(m_wallet, &Wallet::initiateTransaction, this, &SendWidget::disableSendButton);
|
||||
connect(m_wallet, &Wallet::transactionCreated, this, &SendWidget::enableSendButton);
|
||||
connect(m_wallet, &Wallet::beginCommitTransaction, this, &SendWidget::disableSendButton);
|
||||
connect(m_wallet, &Wallet::transactionCommitted, this, &SendWidget::enableSendButton);
|
||||
|
||||
connect(WalletManager::instance(), &WalletManager::openAliasResolved, this, &SendWidget::onOpenAliasResolved);
|
||||
|
||||
|
@ -349,18 +351,19 @@ void SendWidget::payToMany() {
|
|||
ui->lineAddress->payToMany();
|
||||
}
|
||||
|
||||
void SendWidget::onInitiateTransaction() {
|
||||
void SendWidget::disableSendButton() {
|
||||
ui->btnSend->setEnabled(false);
|
||||
}
|
||||
|
||||
void SendWidget::onEndTransaction() {
|
||||
if (!m_sendDisabled) {
|
||||
ui->btnSend->setEnabled(true);
|
||||
void SendWidget::enableSendButton() {
|
||||
if (m_disallowSending) {
|
||||
return;
|
||||
}
|
||||
ui->btnSend->setEnabled(true);
|
||||
}
|
||||
|
||||
void SendWidget::disableSendButton() {
|
||||
m_sendDisabled = true;
|
||||
void SendWidget::disallowSending() {
|
||||
m_disallowSending = true;
|
||||
ui->btnSend->setEnabled(false);
|
||||
}
|
||||
|
||||
|
|
|
@ -38,11 +38,12 @@ public slots:
|
|||
void updateConversionLabel();
|
||||
void onOpenAliasResolved(const QString &openAlias, const QString &address, bool dnssecValid);
|
||||
void onPreferredFiatCurrencyChanged();
|
||||
void disableSendButton();
|
||||
void setWebsocketEnabled(bool enabled);
|
||||
|
||||
void onInitiateTransaction();
|
||||
void onEndTransaction();
|
||||
void disableSendButton();
|
||||
void enableSendButton();
|
||||
|
||||
void disallowSending();
|
||||
|
||||
private slots:
|
||||
void onDataPasted(const QString &data);
|
||||
|
@ -57,7 +58,7 @@ private:
|
|||
|
||||
QScopedPointer<Ui::SendWidget> ui;
|
||||
Wallet *m_wallet;
|
||||
bool m_sendDisabled = false;
|
||||
bool m_disallowSending = false;
|
||||
};
|
||||
|
||||
#endif // FEATHER_SENDWIDGET_H
|
||||
|
|
|
@ -834,6 +834,8 @@ void Wallet::onTransactionCreated(Monero::PendingTransaction *mtx, const QVector
|
|||
// Phase 3: Commit or dispose
|
||||
|
||||
void Wallet::commitTransaction(PendingTransaction *tx, const QString &description) {
|
||||
emit beginCommitTransaction();
|
||||
|
||||
// Clear list of selected transfers
|
||||
this->setSelectedInputs({});
|
||||
|
||||
|
|
|
@ -431,6 +431,7 @@ signals:
|
|||
void deviceButtonPressed();
|
||||
void deviceError(const QString &message);
|
||||
void walletPassphraseNeeded(bool onDevice);
|
||||
void beginCommitTransaction();
|
||||
void transactionCommitted(bool status, PendingTransaction *t, const QStringList& txid, const QMap<QString, QString> &txHexMap);
|
||||
void deviceShowAddressShowed();
|
||||
void transactionProofVerified(TxProofResult result);
|
||||
|
|
Loading…
Reference in a new issue