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
// Menu items remove single &. Single & are shown when && is in
403
403
// the string, but only the first occurrence. So replace only
404
404
// the first & with &&.
Original file line number Diff line number Diff line change @@ -1007,4 +1007,13 @@ void ShowModalDialogAsynchronously(QDialog* dialog)
1007
1007
dialog->show ();
1008
1008
}
1009
1009
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
+ }
1010
1019
} // 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 @@ -342,7 +342,7 @@ void OpenWalletActivity::finish()
342
342
343
343
void OpenWalletActivity::open (const std::string& path)
344
344
{
345
- QString name = path. empty () ? QString ( " [ " + tr ( " default wallet " )+ " ] " ) : QString::fromStdString (path);
345
+ QString name = GUIUtil::WalletDisplayName (path);
346
346
347
347
showProgressDialog (
348
348
// : 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
593
593
594
594
QString WalletModel::getDisplayName () const
595
595
{
596
- const QString name = getWalletName ();
597
- return name.isEmpty () ? " [" +tr (" default wallet" )+" ]" : name;
596
+ return GUIUtil::WalletDisplayName (getWalletName ());
598
597
}
599
598
600
599
bool WalletModel::isMultiwallet () const
You can’t perform that action at this time.
0 commit comments