File tree Expand file tree Collapse file tree 5 files changed +15
-4
lines changed Expand file tree Collapse file tree 5 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -398,7 +398,7 @@ void BitcoinGUI::createActions()
398
398
m_open_wallet_menu->clear ();
399
399
for (const auto & [path, info] : m_wallet_controller->listWalletDir ()) {
400
400
const auto & [loaded, _] = info;
401
- QString name = path. empty () ? QString ( " [ " + tr ( " default wallet " )+ " ] " ) : QString::fromStdString (path);
401
+ QString name = GUIUtil::WalletDisplayName (path);
402
402
// An single ampersand in the menu item's text sets a shortcut for this item.
403
403
// Single & are shown when && is in the string. So replace & with &&.
404
404
name.replace (QChar (' &' ), QString (" &&" ));
Original file line number Diff line number Diff line change @@ -1008,4 +1008,13 @@ void ShowModalDialogAsynchronously(QDialog* dialog)
1008
1008
dialog->show ();
1009
1009
}
1010
1010
1011
+ QString WalletDisplayName (const QString& name)
1012
+ {
1013
+ return name.isEmpty () ? " [" + QObject::tr (" default wallet" ) + " ]" : name;
1014
+ }
1015
+
1016
+ QString WalletDisplayName (const std::string& name)
1017
+ {
1018
+ return WalletDisplayName (QString::fromStdString (name));
1019
+ }
1011
1020
} // namespace GUIUtil
Original file line number Diff line number Diff line change @@ -436,6 +436,9 @@ namespace GUIUtil
436
436
return false ;
437
437
}
438
438
439
+ QString WalletDisplayName (const std::string& name);
440
+ QString WalletDisplayName (const QString& name);
441
+
439
442
} // namespace GUIUtil
440
443
441
444
#endif // BITCOIN_QT_GUIUTIL_H
Original file line number Diff line number Diff line change @@ -343,7 +343,7 @@ void OpenWalletActivity::finish()
343
343
344
344
void OpenWalletActivity::open (const std::string& path)
345
345
{
346
- QString name = path. empty () ? QString ( " [ " + tr ( " default wallet " )+ " ] " ) : QString::fromStdString (path);
346
+ QString name = GUIUtil::WalletDisplayName (path);
347
347
348
348
showProgressDialog (
349
349
// : Title of window indicating the progress of opening of a wallet.
Original file line number Diff line number Diff line change @@ -594,8 +594,7 @@ QString WalletModel::getWalletName() const
594
594
595
595
QString WalletModel::getDisplayName () const
596
596
{
597
- const QString name = getWalletName ();
598
- return name.isEmpty () ? " [" +tr (" default wallet" )+" ]" : name;
597
+ return GUIUtil::WalletDisplayName (getWalletName ());
599
598
}
600
599
601
600
bool WalletModel::isMultiwallet () const
You can’t perform that action at this time.
0 commit comments