From 70e4706093fd7b08a32f9638dace178852a9d249 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Sun, 19 Jan 2020 09:38:51 +0200 Subject: [PATCH] Revert "refactor: Remove never used default parameter" This reverts commit 7d0a8f4f530885cbf3870291f10f667326373bd1. --- src/qt/bitcoingui.cpp | 6 ++++-- src/qt/bitcoingui.h | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index eb680743019..f22d33bf0aa 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -1027,7 +1027,7 @@ void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVer progressBar->setToolTip(tooltip); } -void BitcoinGUI::message(const QString& title, QString message, unsigned int style) +void BitcoinGUI::message(const QString& title, QString message, unsigned int style, bool* ret) { // Default title. On macOS, the window title is ignored (as required by the macOS Guidelines). QString strTitle{PACKAGE_NAME}; @@ -1081,7 +1081,9 @@ void BitcoinGUI::message(const QString& title, QString message, unsigned int sty showNormalIfMinimized(); QMessageBox mBox(static_cast(nMBoxIcon), strTitle, message, buttons, this); mBox.setTextFormat(Qt::PlainText); - mBox.exec(); + int r = mBox.exec(); + if (ret != nullptr) + *ret = r == QMessageBox::Ok; } else { notificator->notify(static_cast(nNotifyIcon), strTitle, message); } diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index 45fbb03aa4f..809cf8b4edf 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -219,8 +219,9 @@ public Q_SLOTS: @param[in] message the displayed text @param[in] style modality and style definitions (icon and used buttons - buttons only for message boxes) @see CClientUIInterface::MessageBoxFlags + @param[in] ret pointer to a bool that will be modified to whether Ok was clicked (modal only) */ - void message(const QString& title, QString message, unsigned int style); + void message(const QString& title, QString message, unsigned int style, bool* ret = nullptr); #ifdef ENABLE_WALLET void setCurrentWallet(WalletModel* wallet_model);