Skip to content

Commit b8e5d0d

Browse files
committed
qt: Handle exceptions in SendCoinsDialog::sendButtonClicked slot
Also, uic automatic connection replaced with an explicit one.
1 parent 1ac2bc7 commit b8e5d0d

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/qt/sendcoinsdialog.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ SendCoinsDialog::SendCoinsDialog(const PlatformStyle *_platformStyle, QWidget *p
129129
ui->customFee->SetAllowEmpty(false);
130130
ui->customFee->setValue(settings.value("nTransactionFee").toLongLong());
131131
minimizeFeeSection(settings.value("fFeeSectionMinimized").toBool());
132+
133+
GUIUtil::ExceptionSafeConnect(ui->sendButton, &QPushButton::clicked, this, &SendCoinsDialog::sendButtonClicked);
132134
}
133135

134136
void SendCoinsDialog::setClientModel(ClientModel *_clientModel)
@@ -375,7 +377,7 @@ bool SendCoinsDialog::PrepareSendText(QString& question_string, QString& informa
375377
return true;
376378
}
377379

378-
void SendCoinsDialog::on_sendButton_clicked()
380+
void SendCoinsDialog::sendButtonClicked([[maybe_unused]] bool checked)
379381
{
380382
if(!model || !model->getOptionsModel())
381383
return;

src/qt/sendcoinsdialog.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public Q_SLOTS:
8080
void updateCoinControlState(CCoinControl& ctrl);
8181

8282
private Q_SLOTS:
83-
void on_sendButton_clicked();
83+
void sendButtonClicked(bool checked);
8484
void on_buttonChooseFee_clicked();
8585
void on_buttonMinimizeFee_clicked();
8686
void removeEntry(SendCoinsEntry* entry);

src/qt/test/wallettests.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ uint256 SendCoins(CWallet& wallet, SendCoinsDialog& sendCoinsDialog, const CTxDe
7373
if (status == CT_NEW) txid = hash;
7474
}));
7575
ConfirmSend();
76-
bool invoked = QMetaObject::invokeMethod(&sendCoinsDialog, "on_sendButton_clicked");
76+
bool invoked = QMetaObject::invokeMethod(&sendCoinsDialog, "sendButtonClicked", Q_ARG(bool, false));
7777
assert(invoked);
7878
return txid;
7979
}

0 commit comments

Comments
 (0)