File tree Expand file tree Collapse file tree 4 files changed +11
-4
lines changed
Expand file tree Collapse file tree 4 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -570,7 +570,7 @@ bool BitcoinGUI::addWallet(WalletModel *walletModel)
570570 if (!walletFrame)
571571 return false ;
572572 const QString name = walletModel->getWalletName ();
573- QString display_name = name. isEmpty () ? " [ " + tr ( " default wallet " )+ " ] " : name ;
573+ const QString display_name = walletModel-> getDisplayName () ;
574574 setWalletActionsEnabled (true );
575575 m_wallet_selector->addItem (display_name, name);
576576 if (m_wallet_selector->count () == 2 ) {
Original file line number Diff line number Diff line change @@ -700,7 +700,7 @@ void RPCConsole::addWallet(WalletModel * const walletModel)
700700{
701701 const QString name = walletModel->getWalletName ();
702702 // use name for text and internal data object (to allow to move to a wallet id later)
703- QString display_name = name. isEmpty () ? " [ " + tr ( " default wallet " )+ " ] " : name ;
703+ const QString display_name = walletModel-> getDisplayName () ;
704704 ui->WalletSelector ->addItem (display_name, name);
705705 if (ui->WalletSelector ->count () == 2 && !isVisible ()) {
706706 // First wallet added, set to default so long as the window isn't presently visible (and potentially in use)
Original file line number Diff line number Diff line change 1- // Copyright (c) 2011-2018 The Bitcoin Core developers
1+ // Copyright (c) 2011-2019 The Bitcoin Core developers
22// Distributed under the MIT software license, see the accompanying
33// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44
@@ -578,6 +578,12 @@ QString WalletModel::getWalletName() const
578578 return QString::fromStdString (m_wallet->getWalletName ());
579579}
580580
581+ QString WalletModel::getDisplayName () const
582+ {
583+ const QString name = getWalletName ();
584+ return name.isEmpty () ? " [" +tr (" default wallet" )+" ]" : name;
585+ }
586+
581587bool WalletModel::isMultiwallet ()
582588{
583589 return m_node.getWallets ().size () > 1 ;
Original file line number Diff line number Diff line change 1- // Copyright (c) 2011-2018 The Bitcoin Core developers
1+ // Copyright (c) 2011-2019 The Bitcoin Core developers
22// Distributed under the MIT software license, see the accompanying
33// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44
@@ -219,6 +219,7 @@ class WalletModel : public QObject
219219 interfaces::Wallet& wallet () const { return *m_wallet; }
220220
221221 QString getWalletName () const ;
222+ QString getDisplayName () const ;
222223
223224 bool isMultiwallet ();
224225
You can’t perform that action at this time.
0 commit comments