Changeset View
Changeset View
Standalone View
Standalone View
src/qt/bitcoingui.cpp
Show First 20 Lines • Show All 388 Lines • ▼ Show 20 Lines | #endif // ENABLE_WALLET | ||||
openAction = new QAction(platformStyle->TextColorIcon(":/icons/open"), | openAction = new QAction(platformStyle->TextColorIcon(":/icons/open"), | ||||
tr("Open &URI..."), this); | tr("Open &URI..."), this); | ||||
openAction->setStatusTip( | 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->setMenu(new QMenu(this)); | |||||
m_open_wallet_action->setStatusTip(tr("Open a 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 All 30 Lines | if (walletFrame) { | ||||
connect(verifyMessageAction, &QAction::triggered, | connect(verifyMessageAction, &QAction::triggered, | ||||
[this] { gotoVerifyMessageTab(); }); | [this] { gotoVerifyMessageTab(); }); | ||||
connect(usedSendingAddressesAction, &QAction::triggered, walletFrame, | connect(usedSendingAddressesAction, &QAction::triggered, walletFrame, | ||||
&WalletFrame::usedSendingAddresses); | &WalletFrame::usedSendingAddresses); | ||||
connect(usedReceivingAddressesAction, &QAction::triggered, walletFrame, | connect(usedReceivingAddressesAction, &QAction::triggered, walletFrame, | ||||
&WalletFrame::usedReceivingAddresses); | &WalletFrame::usedReceivingAddresses); | ||||
connect(openAction, &QAction::triggered, this, | connect(openAction, &QAction::triggered, this, | ||||
&BitcoinGUI::openClicked); | &BitcoinGUI::openClicked); | ||||
connect(m_open_wallet_action->menu(), &QMenu::aboutToShow, [this] { | |||||
m_open_wallet_action->menu()->clear(); | |||||
for (std::string path : | |||||
m_wallet_controller->getWalletsAvailableToOpen()) { | |||||
QString name = path.empty() | |||||
? QString("[" + tr("default wallet") + "]") | |||||
: QString::fromStdString(path); | |||||
QAction *action = m_open_wallet_action->menu()->addAction(name); | |||||
connect(action, &QAction::triggered, [this, path] { | |||||
setCurrentWallet(m_wallet_controller->openWallet( | |||||
config->GetChainParams(), path)); | |||||
}); | |||||
} | |||||
}); | |||||
} | } | ||||
#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->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); | ||||
file->addSeparator(); | file->addSeparator(); | ||||
▲ Show 20 Lines • Show All 1,008 Lines • Show Last 20 Lines |