Changeset View
Changeset View
Standalone View
Standalone View
src/qt/bitcoingui.cpp
Show First 20 Lines • Show All 450 Lines • ▼ Show 20 Lines | if (walletFrame) { | ||||
connect(m_open_wallet_menu, &QMenu::aboutToShow, [this] { | connect(m_open_wallet_menu, &QMenu::aboutToShow, [this] { | ||||
m_open_wallet_menu->clear(); | m_open_wallet_menu->clear(); | ||||
for (const std::pair<const std::string, bool> &i : | for (const std::pair<const std::string, bool> &i : | ||||
m_wallet_controller->listWalletDir()) { | m_wallet_controller->listWalletDir()) { | ||||
const std::string &path = i.first; | const std::string &path = i.first; | ||||
QString name = path.empty() | QString name = path.empty() | ||||
? QString("[" + tr("default wallet") + "]") | ? QString("[" + tr("default wallet") + "]") | ||||
: QString::fromStdString(path); | : QString::fromStdString(path); | ||||
// Menu items remove single &. Single & are shown when && is in | |||||
// the string, but only the first occurrence. So replace only | |||||
// the first & with && | |||||
name.replace(name.indexOf(QChar('&')), 1, QString("&&")); | |||||
QAction *action = m_open_wallet_menu->addAction(name); | QAction *action = m_open_wallet_menu->addAction(name); | ||||
if (i.second) { | if (i.second) { | ||||
// This wallet is already loaded | // This wallet is already loaded | ||||
action->setEnabled(false); | action->setEnabled(false); | ||||
continue; | continue; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,152 Lines • Show Last 20 Lines |