Skip to content

Commit 654e419

Browse files
committed
Make SendConfirmationDialog fully fledged
The property-based API has been used. Added support for the `informativeText` and `detailedText` properties.
1 parent 40a720a commit 654e419

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/qt/sendcoinsdialog.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,7 @@ void SendCoinsDialog::on_sendButton_clicked()
364364
questionString.append(QString("<br /><span style='font-size:10pt; font-weight:normal;'>(=%1)</span>")
365365
.arg(alternativeUnits.join(" " + tr("or") + " ")));
366366

367-
SendConfirmationDialog confirmationDialog(tr("Confirm send coins"),
368-
questionString.arg(formatted.join("<br />")), SEND_CONFIRM_DELAY, this);
367+
SendConfirmationDialog confirmationDialog(tr("Confirm send coins"), questionString.arg(formatted.join("<br />")), "", "", SEND_CONFIRM_DELAY, this);
369368
confirmationDialog.exec();
370369
QMessageBox::StandardButton retval = static_cast<QMessageBox::StandardButton>(confirmationDialog.result());
371370

@@ -881,10 +880,15 @@ void SendCoinsDialog::coinControlUpdateLabels()
881880
}
882881
}
883882

884-
SendConfirmationDialog::SendConfirmationDialog(const QString &title, const QString &text, int _secDelay,
885-
QWidget *parent) :
886-
QMessageBox(QMessageBox::Question, title, text, QMessageBox::Yes | QMessageBox::Cancel, parent), secDelay(_secDelay)
883+
SendConfirmationDialog::SendConfirmationDialog(const QString& title, const QString& text, const QString& informative_text, const QString& detailed_text, int _secDelay, QWidget* parent)
884+
: QMessageBox(parent), secDelay(_secDelay)
887885
{
886+
setIcon(QMessageBox::Question);
887+
setWindowTitle(title); // On macOS, the window title is ignored (as required by the macOS Guidelines).
888+
setText(text);
889+
setInformativeText(informative_text);
890+
setDetailedText(detailed_text);
891+
setStandardButtons(QMessageBox::Yes | QMessageBox::Cancel);
888892
setDefaultButton(QMessageBox::Cancel);
889893
yesButton = button(QMessageBox::Yes);
890894
updateYesButton();

src/qt/sendcoinsdialog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class SendConfirmationDialog : public QMessageBox
108108
Q_OBJECT
109109

110110
public:
111-
SendConfirmationDialog(const QString &title, const QString &text, int secDelay = SEND_CONFIRM_DELAY, QWidget *parent = nullptr);
111+
SendConfirmationDialog(const QString& title, const QString& text, const QString& informative_text = "", const QString& detailed_text = "", int secDelay = SEND_CONFIRM_DELAY, QWidget* parent = nullptr);
112112
int exec();
113113

114114
private Q_SLOTS:

0 commit comments

Comments
 (0)