Escape ampersands (&) in wallet names in Open Wallet menu
This commit is contained in:
parent
2c530ea2ad
commit
ad52f054f6
1 changed files with 2 additions and 0 deletions
|
@ -375,6 +375,8 @@ void BitcoinGUI::createActions()
|
||||||
for (const std::pair<const std::string, bool>& i : m_wallet_controller->listWalletDir()) {
|
for (const std::pair<const std::string, bool>& i : m_wallet_controller->listWalletDir()) {
|
||||||
const std::string& path = i.first;
|
const std::string& path = i.first;
|
||||||
QString name = path.empty() ? QString("["+tr("default wallet")+"]") : QString::fromStdString(path);
|
QString name = path.empty() ? QString("["+tr("default wallet")+"]") : 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) {
|
||||||
|
|
Loading…
Reference in a new issue