Changeset View
Changeset View
Standalone View
Standalone View
src/qt/bitcoingui.cpp
Show First 20 Lines • Show All 392 Lines • ▼ Show 20 Lines | openAction->setStatusTip( | ||||
tr("Open a %1: URI or payment request") | tr("Open a %1: URI or payment request") | ||||
.arg(QString::fromStdString( | .arg(QString::fromStdString( | ||||
config->GetChainParams().CashAddrPrefix()))); | config->GetChainParams().CashAddrPrefix()))); | ||||
m_open_wallet_action = new QAction(tr("Open Wallet"), this); | m_open_wallet_action = new QAction(tr("Open Wallet"), this); | ||||
m_open_wallet_action->setMenu(new QMenu(this)); | m_open_wallet_action->setMenu(new QMenu(this)); | ||||
m_open_wallet_action->setStatusTip(tr("Open a wallet")); | m_open_wallet_action->setStatusTip(tr("Open a wallet")); | ||||
m_close_wallet_action = new QAction(tr("Close Wallet..."), this); | |||||
m_close_wallet_action->setStatusTip(tr("Close wallet")); | |||||
showHelpMessageAction = | showHelpMessageAction = | ||||
new QAction(platformStyle->TextColorIcon(":/icons/info"), | new QAction(platformStyle->TextColorIcon(":/icons/info"), | ||||
tr("&Command-line options"), this); | tr("&Command-line options"), this); | ||||
showHelpMessageAction->setMenuRole(QAction::NoRole); | showHelpMessageAction->setMenuRole(QAction::NoRole); | ||||
showHelpMessageAction->setStatusTip( | showHelpMessageAction->setStatusTip( | ||||
tr("Show the %1 help message to get a list with possible Bitcoin " | tr("Show the %1 help message to get a list with possible Bitcoin " | ||||
"command-line options") | "command-line options") | ||||
.arg(PACKAGE_NAME)); | .arg(PACKAGE_NAME)); | ||||
▲ Show 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | if (walletFrame) { | ||||
}); | }); | ||||
} | } | ||||
if (wallets.empty()) { | if (wallets.empty()) { | ||||
QAction *action = m_open_wallet_action->menu()->addAction( | QAction *action = m_open_wallet_action->menu()->addAction( | ||||
tr("No wallets available")); | tr("No wallets available")); | ||||
action->setEnabled(false); | action->setEnabled(false); | ||||
} | } | ||||
}); | }); | ||||
connect(m_close_wallet_action, &QAction::triggered, [this] { | |||||
m_wallet_controller->closeWallet(walletFrame->currentWalletModel(), | |||||
this); | |||||
}); | |||||
} | } | ||||
#endif // ENABLE_WALLET | #endif // ENABLE_WALLET | ||||
connect(new QShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_C), this), | connect(new QShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_C), this), | ||||
&QShortcut::activated, this, | &QShortcut::activated, this, | ||||
&BitcoinGUI::showDebugWindowActivateConsole); | &BitcoinGUI::showDebugWindowActivateConsole); | ||||
connect(new QShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_D), this), | connect(new QShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_D), this), | ||||
&QShortcut::activated, this, &BitcoinGUI::showDebugWindow); | &QShortcut::activated, this, &BitcoinGUI::showDebugWindow); | ||||
} | } | ||||
void BitcoinGUI::createMenuBar() { | void BitcoinGUI::createMenuBar() { | ||||
#ifdef Q_OS_MAC | #ifdef Q_OS_MAC | ||||
// Create a decoupled menu bar on Mac which stays even if the window is | // Create a decoupled menu bar on Mac which stays even if the window is | ||||
// closed | // closed | ||||
appMenuBar = new QMenuBar(); | appMenuBar = new QMenuBar(); | ||||
#else | #else | ||||
// Get the main window's menu bar on other platforms | // Get the main window's menu bar on other platforms | ||||
appMenuBar = menuBar(); | appMenuBar = menuBar(); | ||||
#endif | #endif | ||||
// Configure the menus | // Configure the menus | ||||
QMenu *file = appMenuBar->addMenu(tr("&File")); | QMenu *file = appMenuBar->addMenu(tr("&File")); | ||||
if (walletFrame) { | if (walletFrame) { | ||||
file->addAction(m_open_wallet_action); | file->addAction(m_open_wallet_action); | ||||
file->addAction(m_close_wallet_action); | |||||
file->addSeparator(); | file->addSeparator(); | ||||
file->addAction(openAction); | file->addAction(openAction); | ||||
file->addAction(backupWalletAction); | file->addAction(backupWalletAction); | ||||
file->addAction(signMessageAction); | file->addAction(signMessageAction); | ||||
file->addAction(verifyMessageAction); | file->addAction(verifyMessageAction); | ||||
file->addSeparator(); | file->addSeparator(); | ||||
file->addAction(usedSendingAddressesAction); | file->addAction(usedSendingAddressesAction); | ||||
file->addAction(usedReceivingAddressesAction); | file->addAction(usedReceivingAddressesAction); | ||||
▲ Show 20 Lines • Show All 222 Lines • ▼ Show 20 Lines | void BitcoinGUI::setWalletActionsEnabled(bool enabled) { | ||||
encryptWalletAction->setEnabled(enabled); | encryptWalletAction->setEnabled(enabled); | ||||
backupWalletAction->setEnabled(enabled); | backupWalletAction->setEnabled(enabled); | ||||
changePassphraseAction->setEnabled(enabled); | changePassphraseAction->setEnabled(enabled); | ||||
signMessageAction->setEnabled(enabled); | signMessageAction->setEnabled(enabled); | ||||
verifyMessageAction->setEnabled(enabled); | verifyMessageAction->setEnabled(enabled); | ||||
usedSendingAddressesAction->setEnabled(enabled); | usedSendingAddressesAction->setEnabled(enabled); | ||||
usedReceivingAddressesAction->setEnabled(enabled); | usedReceivingAddressesAction->setEnabled(enabled); | ||||
openAction->setEnabled(enabled); | openAction->setEnabled(enabled); | ||||
m_close_wallet_action->setEnabled(enabled); | |||||
} | } | ||||
void BitcoinGUI::createTrayIcon() { | void BitcoinGUI::createTrayIcon() { | ||||
assert(QSystemTrayIcon::isSystemTrayAvailable()); | assert(QSystemTrayIcon::isSystemTrayAvailable()); | ||||
#ifndef Q_OS_MAC | #ifndef Q_OS_MAC | ||||
if (QSystemTrayIcon::isSystemTrayAvailable()) { | if (QSystemTrayIcon::isSystemTrayAvailable()) { | ||||
trayIcon = | trayIcon = | ||||
▲ Show 20 Lines • Show All 771 Lines • Show Last 20 Lines |