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();
}
}
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);
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);
}
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);
QScopedPointer<Ui::SendWidget> ui;
Wallet *m_wallet;
- bool m_sendDisabled = false;
+ bool m_disallowSending = false;
};
#endif // FEATHER_SENDWIDGET_H
// Phase 3: Commit or dispose
void Wallet::commitTransaction(PendingTransaction *tx, const QString &description) {
+ emit beginCommitTransaction();
+
// Clear list of selected transfers
this->setSelectedInputs({});
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);