mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Make SendConfirmationDialog fully fledged
The property-based API has been used. Added support for the `informativeText` and `detailedText` properties.
This commit is contained in:
@@ -364,8 +364,7 @@ void SendCoinsDialog::on_sendButton_clicked()
|
|||||||
questionString.append(QString("<br /><span style='font-size:10pt; font-weight:normal;'>(=%1)</span>")
|
questionString.append(QString("<br /><span style='font-size:10pt; font-weight:normal;'>(=%1)</span>")
|
||||||
.arg(alternativeUnits.join(" " + tr("or") + " ")));
|
.arg(alternativeUnits.join(" " + tr("or") + " ")));
|
||||||
|
|
||||||
SendConfirmationDialog confirmationDialog(tr("Confirm send coins"),
|
SendConfirmationDialog confirmationDialog(tr("Confirm send coins"), questionString.arg(formatted.join("<br />")), "", "", SEND_CONFIRM_DELAY, this);
|
||||||
questionString.arg(formatted.join("<br />")), SEND_CONFIRM_DELAY, this);
|
|
||||||
confirmationDialog.exec();
|
confirmationDialog.exec();
|
||||||
QMessageBox::StandardButton retval = static_cast<QMessageBox::StandardButton>(confirmationDialog.result());
|
QMessageBox::StandardButton retval = static_cast<QMessageBox::StandardButton>(confirmationDialog.result());
|
||||||
|
|
||||||
@@ -881,10 +880,15 @@ void SendCoinsDialog::coinControlUpdateLabels()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SendConfirmationDialog::SendConfirmationDialog(const QString &title, const QString &text, int _secDelay,
|
SendConfirmationDialog::SendConfirmationDialog(const QString& title, const QString& text, const QString& informative_text, const QString& detailed_text, int _secDelay, QWidget* parent)
|
||||||
QWidget *parent) :
|
: QMessageBox(parent), secDelay(_secDelay)
|
||||||
QMessageBox(QMessageBox::Question, title, text, QMessageBox::Yes | QMessageBox::Cancel, parent), secDelay(_secDelay)
|
|
||||||
{
|
{
|
||||||
|
setIcon(QMessageBox::Question);
|
||||||
|
setWindowTitle(title); // On macOS, the window title is ignored (as required by the macOS Guidelines).
|
||||||
|
setText(text);
|
||||||
|
setInformativeText(informative_text);
|
||||||
|
setDetailedText(detailed_text);
|
||||||
|
setStandardButtons(QMessageBox::Yes | QMessageBox::Cancel);
|
||||||
setDefaultButton(QMessageBox::Cancel);
|
setDefaultButton(QMessageBox::Cancel);
|
||||||
yesButton = button(QMessageBox::Yes);
|
yesButton = button(QMessageBox::Yes);
|
||||||
updateYesButton();
|
updateYesButton();
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ class SendConfirmationDialog : public QMessageBox
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SendConfirmationDialog(const QString &title, const QString &text, int secDelay = SEND_CONFIRM_DELAY, QWidget *parent = nullptr);
|
SendConfirmationDialog(const QString& title, const QString& text, const QString& informative_text = "", const QString& detailed_text = "", int secDelay = SEND_CONFIRM_DELAY, QWidget* parent = nullptr);
|
||||||
int exec();
|
int exec();
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
|
|||||||
Reference in New Issue
Block a user