mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-08-06 15:04:52 +02:00
qt, refactor: Drop BitcoinGUI::{send,receive}CoinsMenuAction members
This commit is contained in:
parent
fd667e73cd
commit
58e16035c1
@ -261,10 +261,6 @@ void BitcoinGUI::createActions()
|
|||||||
sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2));
|
sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2));
|
||||||
tabGroup->addAction(sendCoinsAction);
|
tabGroup->addAction(sendCoinsAction);
|
||||||
|
|
||||||
sendCoinsMenuAction = new QAction(sendCoinsAction->text(), this);
|
|
||||||
sendCoinsMenuAction->setStatusTip(sendCoinsAction->statusTip());
|
|
||||||
sendCoinsMenuAction->setToolTip(sendCoinsMenuAction->statusTip());
|
|
||||||
|
|
||||||
receiveCoinsAction = new QAction(platformStyle->SingleColorIcon(":/icons/receiving_addresses"), tr("&Receive"), this);
|
receiveCoinsAction = new QAction(platformStyle->SingleColorIcon(":/icons/receiving_addresses"), tr("&Receive"), this);
|
||||||
receiveCoinsAction->setStatusTip(tr("Request payments (generates QR codes and bitcoin: URIs)"));
|
receiveCoinsAction->setStatusTip(tr("Request payments (generates QR codes and bitcoin: URIs)"));
|
||||||
receiveCoinsAction->setToolTip(receiveCoinsAction->statusTip());
|
receiveCoinsAction->setToolTip(receiveCoinsAction->statusTip());
|
||||||
@ -272,10 +268,6 @@ void BitcoinGUI::createActions()
|
|||||||
receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_3));
|
receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_3));
|
||||||
tabGroup->addAction(receiveCoinsAction);
|
tabGroup->addAction(receiveCoinsAction);
|
||||||
|
|
||||||
receiveCoinsMenuAction = new QAction(receiveCoinsAction->text(), this);
|
|
||||||
receiveCoinsMenuAction->setStatusTip(receiveCoinsAction->statusTip());
|
|
||||||
receiveCoinsMenuAction->setToolTip(receiveCoinsMenuAction->statusTip());
|
|
||||||
|
|
||||||
historyAction = new QAction(platformStyle->SingleColorIcon(":/icons/history"), tr("&Transactions"), this);
|
historyAction = new QAction(platformStyle->SingleColorIcon(":/icons/history"), tr("&Transactions"), this);
|
||||||
historyAction->setStatusTip(tr("Browse transaction history"));
|
historyAction->setStatusTip(tr("Browse transaction history"));
|
||||||
historyAction->setToolTip(historyAction->statusTip());
|
historyAction->setToolTip(historyAction->statusTip());
|
||||||
@ -290,12 +282,8 @@ void BitcoinGUI::createActions()
|
|||||||
connect(overviewAction, &QAction::triggered, this, &BitcoinGUI::gotoOverviewPage);
|
connect(overviewAction, &QAction::triggered, this, &BitcoinGUI::gotoOverviewPage);
|
||||||
connect(sendCoinsAction, &QAction::triggered, [this]{ showNormalIfMinimized(); });
|
connect(sendCoinsAction, &QAction::triggered, [this]{ showNormalIfMinimized(); });
|
||||||
connect(sendCoinsAction, &QAction::triggered, [this]{ gotoSendCoinsPage(); });
|
connect(sendCoinsAction, &QAction::triggered, [this]{ gotoSendCoinsPage(); });
|
||||||
connect(sendCoinsMenuAction, &QAction::triggered, [this]{ showNormalIfMinimized(); });
|
|
||||||
connect(sendCoinsMenuAction, &QAction::triggered, [this]{ gotoSendCoinsPage(); });
|
|
||||||
connect(receiveCoinsAction, &QAction::triggered, [this]{ showNormalIfMinimized(); });
|
connect(receiveCoinsAction, &QAction::triggered, [this]{ showNormalIfMinimized(); });
|
||||||
connect(receiveCoinsAction, &QAction::triggered, this, &BitcoinGUI::gotoReceiveCoinsPage);
|
connect(receiveCoinsAction, &QAction::triggered, this, &BitcoinGUI::gotoReceiveCoinsPage);
|
||||||
connect(receiveCoinsMenuAction, &QAction::triggered, [this]{ showNormalIfMinimized(); });
|
|
||||||
connect(receiveCoinsMenuAction, &QAction::triggered, this, &BitcoinGUI::gotoReceiveCoinsPage);
|
|
||||||
connect(historyAction, &QAction::triggered, [this]{ showNormalIfMinimized(); });
|
connect(historyAction, &QAction::triggered, [this]{ showNormalIfMinimized(); });
|
||||||
connect(historyAction, &QAction::triggered, this, &BitcoinGUI::gotoHistoryPage);
|
connect(historyAction, &QAction::triggered, this, &BitcoinGUI::gotoHistoryPage);
|
||||||
#endif // ENABLE_WALLET
|
#endif // ENABLE_WALLET
|
||||||
@ -747,9 +735,7 @@ void BitcoinGUI::setWalletActionsEnabled(bool enabled)
|
|||||||
{
|
{
|
||||||
overviewAction->setEnabled(enabled);
|
overviewAction->setEnabled(enabled);
|
||||||
sendCoinsAction->setEnabled(enabled);
|
sendCoinsAction->setEnabled(enabled);
|
||||||
sendCoinsMenuAction->setEnabled(enabled);
|
|
||||||
receiveCoinsAction->setEnabled(enabled);
|
receiveCoinsAction->setEnabled(enabled);
|
||||||
receiveCoinsMenuAction->setEnabled(enabled);
|
|
||||||
historyAction->setEnabled(enabled);
|
historyAction->setEnabled(enabled);
|
||||||
encryptWalletAction->setEnabled(enabled);
|
encryptWalletAction->setEnabled(enabled);
|
||||||
backupWalletAction->setEnabled(enabled);
|
backupWalletAction->setEnabled(enabled);
|
||||||
@ -790,9 +776,11 @@ void BitcoinGUI::createTrayIconMenu()
|
|||||||
trayIconMenu->addSeparator();
|
trayIconMenu->addSeparator();
|
||||||
#endif // Q_OS_MAC
|
#endif // Q_OS_MAC
|
||||||
|
|
||||||
|
QAction* send_action{nullptr};
|
||||||
|
QAction* receive_action{nullptr};
|
||||||
if (enableWallet) {
|
if (enableWallet) {
|
||||||
trayIconMenu->addAction(sendCoinsMenuAction);
|
send_action = trayIconMenu->addAction(sendCoinsAction->text(), sendCoinsAction, &QAction::trigger);
|
||||||
trayIconMenu->addAction(receiveCoinsMenuAction);
|
receive_action = trayIconMenu->addAction(receiveCoinsAction->text(), receiveCoinsAction, &QAction::trigger);
|
||||||
trayIconMenu->addSeparator();
|
trayIconMenu->addSeparator();
|
||||||
trayIconMenu->addAction(signMessageAction);
|
trayIconMenu->addAction(signMessageAction);
|
||||||
trayIconMenu->addAction(verifyMessageAction);
|
trayIconMenu->addAction(verifyMessageAction);
|
||||||
@ -826,11 +814,15 @@ void BitcoinGUI::createTrayIconMenu()
|
|||||||
// Using QSystemTrayIcon::Context is not reliable.
|
// Using QSystemTrayIcon::Context is not reliable.
|
||||||
// See https://bugreports.qt.io/browse/QTBUG-91697
|
// See https://bugreports.qt.io/browse/QTBUG-91697
|
||||||
trayIconMenu.get(), &QMenu::aboutToShow,
|
trayIconMenu.get(), &QMenu::aboutToShow,
|
||||||
[this, show_hide_action] {
|
[this, show_hide_action, send_action, receive_action] {
|
||||||
if (show_hide_action) show_hide_action->setText(
|
if (show_hide_action) show_hide_action->setText(
|
||||||
(!isHidden() && !isMinimized() && !GUIUtil::isObscured(this)) ?
|
(!isHidden() && !isMinimized() && !GUIUtil::isObscured(this)) ?
|
||||||
tr("&Hide") :
|
tr("&Hide") :
|
||||||
tr("S&how"));
|
tr("S&how"));
|
||||||
|
if (enableWallet) {
|
||||||
|
send_action->setEnabled(sendCoinsAction->isEnabled());
|
||||||
|
receive_action->setEnabled(receiveCoinsAction->isEnabled());
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,7 +137,6 @@ private:
|
|||||||
QAction* historyAction = nullptr;
|
QAction* historyAction = nullptr;
|
||||||
QAction* quitAction = nullptr;
|
QAction* quitAction = nullptr;
|
||||||
QAction* sendCoinsAction = nullptr;
|
QAction* sendCoinsAction = nullptr;
|
||||||
QAction* sendCoinsMenuAction = nullptr;
|
|
||||||
QAction* usedSendingAddressesAction = nullptr;
|
QAction* usedSendingAddressesAction = nullptr;
|
||||||
QAction* usedReceivingAddressesAction = nullptr;
|
QAction* usedReceivingAddressesAction = nullptr;
|
||||||
QAction* signMessageAction = nullptr;
|
QAction* signMessageAction = nullptr;
|
||||||
@ -146,7 +145,6 @@ private:
|
|||||||
QAction* m_load_psbt_clipboard_action = nullptr;
|
QAction* m_load_psbt_clipboard_action = nullptr;
|
||||||
QAction* aboutAction = nullptr;
|
QAction* aboutAction = nullptr;
|
||||||
QAction* receiveCoinsAction = nullptr;
|
QAction* receiveCoinsAction = nullptr;
|
||||||
QAction* receiveCoinsMenuAction = nullptr;
|
|
||||||
QAction* optionsAction = nullptr;
|
QAction* optionsAction = nullptr;
|
||||||
QAction* encryptWalletAction = nullptr;
|
QAction* encryptWalletAction = nullptr;
|
||||||
QAction* backupWalletAction = nullptr;
|
QAction* backupWalletAction = nullptr;
|
||||||
|
Loading…
Reference in New Issue
Block a user