fix: missing changes from bitcoin#14123

This commit is contained in:
Konstantin Akimov 2024-07-15 00:27:34 +07:00
parent f675fcbd25
commit f1f5723fcf
No known key found for this signature in database
GPG Key ID: 2176C4A5D01EA524

View File

@ -369,9 +369,9 @@ void BitcoinGUI::createActions()
#ifdef ENABLE_WALLET
// These showNormalIfMinimized are needed because Send Coins and Receive Coins
// can be triggered from the tray menu, and need to show the GUI to be useful.
connect(sendCoinsMenuAction, &QAction::triggered, this, static_cast<void (BitcoinGUI::*)()>(&BitcoinGUI::showNormalIfMinimized));
connect(coinJoinCoinsMenuAction, &QAction::triggered, this, static_cast<void (BitcoinGUI::*)()>(&BitcoinGUI::showNormalIfMinimized));
connect(receiveCoinsMenuAction, &QAction::triggered, this, static_cast<void (BitcoinGUI::*)()>(&BitcoinGUI::showNormalIfMinimized));
connect(sendCoinsMenuAction, &QAction::triggered, [this]{ showNormalIfMinimized(); });
connect(coinJoinCoinsMenuAction, &QAction::triggered, [this]{ showNormalIfMinimized(); });
connect(receiveCoinsMenuAction, &QAction::triggered, [this]{ showNormalIfMinimized(); });
connect(sendCoinsMenuAction, &QAction::triggered, [this]{ gotoSendCoinsPage(); });
connect(coinJoinCoinsMenuAction, &QAction::triggered, [this]{ gotoCoinJoinCoinsPage(); });
connect(receiveCoinsMenuAction, &QAction::triggered, this, &BitcoinGUI::gotoReceiveCoinsPage);
@ -506,11 +506,11 @@ void BitcoinGUI::createActions()
connect(changePassphraseAction, &QAction::triggered, walletFrame, &WalletFrame::changePassphrase);
connect(unlockWalletAction, &QAction::triggered, walletFrame, &WalletFrame::unlockWallet);
connect(lockWalletAction, &QAction::triggered, walletFrame, &WalletFrame::lockWallet);
connect(signMessageAction, &QAction::triggered, this, static_cast<void (BitcoinGUI::*)()>(&BitcoinGUI::showNormalIfMinimized));
connect(signMessageAction, &QAction::triggered, [this]{ showNormalIfMinimized(); });
connect(signMessageAction, &QAction::triggered, [this]{ gotoSignMessageTab(); });
connect(m_load_psbt_action, &QAction::triggered, [this]{ gotoLoadPSBT(); });
connect(m_load_psbt_clipboard_action, &QAction::triggered, [this]{ gotoLoadPSBT(true); });
connect(verifyMessageAction, &QAction::triggered, this, static_cast<void (BitcoinGUI::*)()>(&BitcoinGUI::showNormalIfMinimized));
connect(verifyMessageAction, &QAction::triggered, [this]{ showNormalIfMinimized(); });
connect(verifyMessageAction, &QAction::triggered, [this]{ gotoVerifyMessageTab(); });
connect(usedSendingAddressesAction, &QAction::triggered, walletFrame, &WalletFrame::usedSendingAddresses);
connect(usedReceivingAddressesAction, &QAction::triggered, walletFrame, &WalletFrame::usedReceivingAddresses);
@ -730,7 +730,7 @@ void BitcoinGUI::createToolBars()
connect(historyButton, &QToolButton::clicked, this, &BitcoinGUI::gotoHistoryPage);
// Give the selected tab button a bolder font.
connect(tabGroup, static_cast<void (QButtonGroup::*)(QAbstractButton *, bool)>(&QButtonGroup::buttonToggled), this, &BitcoinGUI::highlightTabButton);
connect(tabGroup, qOverload<QAbstractButton *, bool>(&QButtonGroup::buttonToggled), this, &BitcoinGUI::highlightTabButton);
for (auto button : tabGroup->buttons()) {
GUIUtil::setFont({button}, GUIUtil::FontWeight::Normal, 16);
@ -799,7 +799,7 @@ void BitcoinGUI::setClientModel(ClientModel *_clientModel, interfaces::BlockAndH
// Note: ignore this on Mac - this is not the way tray should work there
connect(trayIcon, &QSystemTrayIcon::activated, this, &BitcoinGUI::trayIconActivated);
#else
// Note: On Mac, the dock icon is also used to provide menu functionality
// Note: on macOS, the Dock icon is also used to provide menu functionality
// similar to one for tray icon
MacDockIconHandler *dockIconHandler = MacDockIconHandler::instance();
connect(dockIconHandler, &MacDockIconHandler::dockIconClicked, this, &BitcoinGUI::macosDockIconActivated);
@ -1019,7 +1019,7 @@ void BitcoinGUI::createIconMenu(QMenu *pmenu)
{
// Configuration of the tray icon (or dock icon) icon menu
#ifndef Q_OS_MAC
// Note: On Mac, the dock icon's menu already has show / hide action.
// Note: On macOS, the Dock icon is used to provide the tray's functionality.
trayIconMenu->addAction(toggleHideAction);
trayIconMenu->addSeparator();
#endif
@ -1045,7 +1045,7 @@ void BitcoinGUI::createIconMenu(QMenu *pmenu)
if (enableWallet) {
pmenu->addAction(showBackupsAction);
}
#ifndef Q_OS_MAC // This is built-in on Mac
#ifndef Q_OS_MAC // This is built-in on macOS
pmenu->addSeparator();
pmenu->addAction(quitAction);
#endif
@ -1617,7 +1617,7 @@ void BitcoinGUI::message(const QString& title, QString message, unsigned int sty
void BitcoinGUI::changeEvent(QEvent *e)
{
QMainWindow::changeEvent(e);
#ifndef Q_OS_MAC // Ignored on Mac
#ifndef Q_OS_MAC // Ignored on macOS
if(e->type() == QEvent::WindowStateChange)
{
if(clientModel && clientModel->getOptionsModel() && clientModel->getOptionsModel()->getMinimizeToTray())
@ -1649,7 +1649,7 @@ void BitcoinGUI::changeEvent(QEvent *e)
void BitcoinGUI::closeEvent(QCloseEvent *event)
{
#ifndef Q_OS_MAC // Ignored on Mac
#ifndef Q_OS_MAC // Ignored on macOS
if(clientModel && clientModel->getOptionsModel())
{
if(!clientModel->getOptionsModel()->getMinimizeOnClose())