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()
398398 m_open_wallet_menu->clear ();
399399 for (const auto & [path, info] : m_wallet_controller->listWalletDir ()) {
400400 const auto & [loaded, _] = info;
401- QString name = path. empty () ? QString ( " [ " + tr ( " default wallet " )+ " ] " ) : QString::fromStdString (path);
401+ QString name = GUIUtil::WalletDisplayName (path);
402402 // Menu items remove single &. Single & are shown when && is in
403403 // the string, but only the first occurrence. So replace only
404404 // the first & with &&.
Original file line number Diff line number Diff line change @@ -1007,4 +1007,13 @@ void ShowModalDialogAsynchronously(QDialog* dialog)
10071007 dialog->show ();
10081008}
10091009
1010+ QString WalletDisplayName (const QString& name)
1011+ {
1012+ return name.isEmpty () ? " [" + QObject::tr (" default wallet" ) + " ]" : name;
1013+ }
1014+
1015+ QString WalletDisplayName (const std::string& name)
1016+ {
1017+ return WalletDisplayName (QString::fromStdString (name));
1018+ }
10101019} // namespace GUIUtil
Original file line number Diff line number Diff line change @@ -436,6 +436,9 @@ namespace GUIUtil
436436 return false ;
437437 }
438438
439+ QString WalletDisplayName (const std::string& name);
440+ QString WalletDisplayName (const QString& name);
441+
439442} // namespace GUIUtil
440443
441444#endif // BITCOIN_QT_GUIUTIL_H
Original file line number Diff line number Diff line change @@ -342,7 +342,7 @@ void OpenWalletActivity::finish()
342342
343343void OpenWalletActivity::open (const std::string& path)
344344{
345- QString name = path. empty () ? QString ( " [ " + tr ( " default wallet " )+ " ] " ) : QString::fromStdString (path);
345+ QString name = GUIUtil::WalletDisplayName (path);
346346
347347 showProgressDialog (
348348 // : Title of window indicating the progress of opening of a wallet.
Original file line number Diff line number Diff line change @@ -593,8 +593,7 @@ QString WalletModel::getWalletName() const
593593
594594QString WalletModel::getDisplayName () const
595595{
596- const QString name = getWalletName ();
597- return name.isEmpty () ? " [" +tr (" default wallet" )+" ]" : name;
596+ return GUIUtil::WalletDisplayName (getWalletName ());
598597}
599598
600599bool WalletModel::isMultiwallet () const
You can’t perform that action at this time.
0 commit comments