mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-03 09:56:38 -05:00
gui: correct replacement of amp character in the wallet name for QMenu
The comment in the code regarding the use of an "&" on a menu item is misleading. If a wallet name has an "&" in it, it is not supposed to be interpreted as a hot-key, but it should be shown as it is without replacing it to an underscore.
This commit is contained in:
parent
c4d45b695e
commit
8233ee41ab
1 changed files with 3 additions and 4 deletions
|
@ -399,10 +399,9 @@ void BitcoinGUI::createActions()
|
|||
for (const std::pair<const std::string, bool>& i : m_wallet_controller->listWalletDir()) {
|
||||
const std::string& path = i.first;
|
||||
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("&&"));
|
||||
// An single ampersand in the menu item's text sets a shortcut for this item.
|
||||
// Single & are shown when && is in the string. So replace & with &&.
|
||||
name.replace(QChar('&'), QString("&&"));
|
||||
QAction* action = m_open_wallet_menu->addAction(name);
|
||||
|
||||
if (i.second) {
|
||||
|
|
Loading…
Add table
Reference in a new issue