mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-08-04 05:54:48 +02:00
GUI: SendConfirmationDialog: Defer button setup until exec
This commit is contained in:
parent
86c5b4f00a
commit
08ce9ecf45
@ -1055,15 +1055,19 @@ void SendCoinsDialog::coinControlUpdateLabels()
|
||||
}
|
||||
|
||||
SendConfirmationDialog::SendConfirmationDialog(const QString& title, const QString& text, const QString& informative_text, const QString& detailed_text, int _secDelay, bool enable_send, bool always_show_unsigned, QWidget* parent)
|
||||
: QMessageBox(parent), secDelay(_secDelay), m_enable_send(enable_send)
|
||||
: QMessageBox(parent), secDelay(_secDelay), m_enable_save(always_show_unsigned || !enable_send), m_enable_send(enable_send)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
int SendConfirmationDialog::exec()
|
||||
{
|
||||
setStandardButtons(QMessageBox::Yes | QMessageBox::Cancel);
|
||||
if (always_show_unsigned || !enable_send) addButton(QMessageBox::Save);
|
||||
if (m_enable_save) addButton(QMessageBox::Save);
|
||||
setDefaultButton(QMessageBox::Cancel);
|
||||
yesButton = button(QMessageBox::Yes);
|
||||
if (confirmButtonText.isEmpty()) {
|
||||
@ -1071,13 +1075,10 @@ SendConfirmationDialog::SendConfirmationDialog(const QString& title, const QStri
|
||||
}
|
||||
m_psbt_button = button(QMessageBox::Save);
|
||||
updateButtons();
|
||||
connect(&countDownTimer, &QTimer::timeout, this, &SendConfirmationDialog::countDown);
|
||||
}
|
||||
|
||||
int SendConfirmationDialog::exec()
|
||||
{
|
||||
updateButtons();
|
||||
connect(&countDownTimer, &QTimer::timeout, this, &SendConfirmationDialog::countDown);
|
||||
countDownTimer.start(1s);
|
||||
|
||||
return QMessageBox::exec();
|
||||
}
|
||||
|
||||
|
@ -144,6 +144,7 @@ private:
|
||||
QTimer countDownTimer;
|
||||
int secDelay;
|
||||
QString confirmButtonText{tr("Send")};
|
||||
bool m_enable_save;
|
||||
bool m_enable_send;
|
||||
QString m_psbt_button_text{tr("Create Unsigned")};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user