mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-19 06:30:45 +02:00
Merge #17965: qt: Revert changes of pr17943
70e4706093
Revert "refactor: Remove never used default parameter" (Hennadii Stepanov)219417b388
Revert "refactor: Simplify connection syntax" (Hennadii Stepanov) Pull request description: The code, the `bool* ret = nullptr` parameter in the `BitcoinGUI::message()` slot, removed in #17943 is not dead actually. It is used in `ThreadSafeMessageBox()` function:a654626f07/src/qt/bitcoingui.cpp (L1363-L1368)
Now in master (a654626f07
): ``` $ ./src/qt/bitcoin-qt -prune=-1 Error: Prune cannot be configured with a negative value. bitcoin-qt: qt/bitcoingui.cpp:1369: bool ThreadSafeMessageBox(BitcoinGUI*, const string&, const string&, unsigned int): Assertion `invoked' failed. Aborted (core dumped) ``` This PR reverts all commits of #17943 Additional notes: the bug was missed due to dynamic function call `QMetaObject::invokeMethod()` which cannot be checked at compile time. See #16348 for more discussion. Sorry for introducing a bug. ACKs for top commit: Sjors: ACK70e4706093
laanwj: ACK70e4706093
Tree-SHA512: b968a026eaa4f5f39fd36ddc715d8e233f3c6420e6580f11d4ca422a5ff5d1d9d3df9ac11b353c3d4f434d67d6a69e37d2e26b8248d72bedd14ecba0a545a327
This commit is contained in:
commit
0038e536de
@ -361,7 +361,9 @@ void BitcoinApplication::initializeResult(bool success)
|
|||||||
if (paymentServer) {
|
if (paymentServer) {
|
||||||
connect(paymentServer, &PaymentServer::receivedPaymentRequest, window, &BitcoinGUI::handlePaymentRequest);
|
connect(paymentServer, &PaymentServer::receivedPaymentRequest, window, &BitcoinGUI::handlePaymentRequest);
|
||||||
connect(window, &BitcoinGUI::receivedURI, paymentServer, &PaymentServer::handleURIOrFile);
|
connect(window, &BitcoinGUI::receivedURI, paymentServer, &PaymentServer::handleURIOrFile);
|
||||||
connect(paymentServer, &PaymentServer::message, window, &BitcoinGUI::message);
|
connect(paymentServer, &PaymentServer::message, [this](const QString& title, const QString& message, unsigned int style) {
|
||||||
|
window->message(title, message, style);
|
||||||
|
});
|
||||||
QTimer::singleShot(100, paymentServer, &PaymentServer::uiReady);
|
QTimer::singleShot(100, paymentServer, &PaymentServer::uiReady);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -564,7 +564,9 @@ void BitcoinGUI::setClientModel(ClientModel *_clientModel)
|
|||||||
connect(_clientModel, &ClientModel::numBlocksChanged, this, &BitcoinGUI::setNumBlocks);
|
connect(_clientModel, &ClientModel::numBlocksChanged, this, &BitcoinGUI::setNumBlocks);
|
||||||
|
|
||||||
// Receive and report messages from client model
|
// Receive and report messages from client model
|
||||||
connect(_clientModel, &ClientModel::message, this, &BitcoinGUI::message);
|
connect(_clientModel, &ClientModel::message, [this](const QString &title, const QString &message, unsigned int style){
|
||||||
|
this->message(title, message, style);
|
||||||
|
});
|
||||||
|
|
||||||
// Show progress dialog
|
// Show progress dialog
|
||||||
connect(_clientModel, &ClientModel::showProgress, this, &BitcoinGUI::showProgress);
|
connect(_clientModel, &ClientModel::showProgress, this, &BitcoinGUI::showProgress);
|
||||||
@ -1025,7 +1027,7 @@ void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVer
|
|||||||
progressBar->setToolTip(tooltip);
|
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).
|
// Default title. On macOS, the window title is ignored (as required by the macOS Guidelines).
|
||||||
QString strTitle{PACKAGE_NAME};
|
QString strTitle{PACKAGE_NAME};
|
||||||
@ -1079,7 +1081,9 @@ void BitcoinGUI::message(const QString& title, QString message, unsigned int sty
|
|||||||
showNormalIfMinimized();
|
showNormalIfMinimized();
|
||||||
QMessageBox mBox(static_cast<QMessageBox::Icon>(nMBoxIcon), strTitle, message, buttons, this);
|
QMessageBox mBox(static_cast<QMessageBox::Icon>(nMBoxIcon), strTitle, message, buttons, this);
|
||||||
mBox.setTextFormat(Qt::PlainText);
|
mBox.setTextFormat(Qt::PlainText);
|
||||||
mBox.exec();
|
int r = mBox.exec();
|
||||||
|
if (ret != nullptr)
|
||||||
|
*ret = r == QMessageBox::Ok;
|
||||||
} else {
|
} else {
|
||||||
notificator->notify(static_cast<Notificator::Class>(nNotifyIcon), strTitle, message);
|
notificator->notify(static_cast<Notificator::Class>(nNotifyIcon), strTitle, message);
|
||||||
}
|
}
|
||||||
|
@ -219,8 +219,9 @@ public Q_SLOTS:
|
|||||||
@param[in] message the displayed text
|
@param[in] message the displayed text
|
||||||
@param[in] style modality and style definitions (icon and used buttons - buttons only for message boxes)
|
@param[in] style modality and style definitions (icon and used buttons - buttons only for message boxes)
|
||||||
@see CClientUIInterface::MessageBoxFlags
|
@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
|
#ifdef ENABLE_WALLET
|
||||||
void setCurrentWallet(WalletModel* wallet_model);
|
void setCurrentWallet(WalletModel* wallet_model);
|
||||||
|
@ -97,7 +97,9 @@ void WalletView::setBitcoinGUI(BitcoinGUI *gui)
|
|||||||
connect(sendCoinsPage, &SendCoinsDialog::coinsSent, gui, &BitcoinGUI::gotoHistoryPage);
|
connect(sendCoinsPage, &SendCoinsDialog::coinsSent, gui, &BitcoinGUI::gotoHistoryPage);
|
||||||
|
|
||||||
// Receive and report messages
|
// Receive and report messages
|
||||||
connect(this, &WalletView::message, gui, &BitcoinGUI::message);
|
connect(this, &WalletView::message, [gui](const QString &title, const QString &message, unsigned int style) {
|
||||||
|
gui->message(title, message, style);
|
||||||
|
});
|
||||||
|
|
||||||
// Pass through encryption status changed signals
|
// Pass through encryption status changed signals
|
||||||
connect(this, &WalletView::encryptionStatusChanged, gui, &BitcoinGUI::updateWalletStatus);
|
connect(this, &WalletView::encryptionStatusChanged, gui, &BitcoinGUI::updateWalletStatus);
|
||||||
|
Loading…
Reference in New Issue
Block a user