@@ -476,7 +476,7 @@ void BitcoinGUI::createToolBars()
476476 toolbar->addWidget (spacer);
477477
478478 m_wallet_selector = new QComboBox ();
479- connect (m_wallet_selector, SIGNAL (currentIndexChanged (const QString& )), this , SLOT (setCurrentWallet ( const QString& )));
479+ connect (m_wallet_selector, SIGNAL (currentIndexChanged (int )), this , SLOT (setCurrentWalletBySelectorIndex ( int )));
480480#endif
481481 }
482482}
@@ -552,8 +552,9 @@ bool BitcoinGUI::addWallet(WalletModel *walletModel)
552552 if (!walletFrame)
553553 return false ;
554554 const QString name = walletModel->getWalletName ();
555+ QString display_name = name.isEmpty () ? " [" +tr (" default wallet" )+" ]" : name;
555556 setWalletActionsEnabled (true );
556- m_wallet_selector->addItem (name);
557+ m_wallet_selector->addItem (display_name, name);
557558 if (m_wallet_selector->count () == 2 ) {
558559 m_wallet_selector_label = new QLabel ();
559560 m_wallet_selector_label->setText (tr (" Wallet:" ) + " " );
@@ -572,6 +573,12 @@ bool BitcoinGUI::setCurrentWallet(const QString& name)
572573 return walletFrame->setCurrentWallet (name);
573574}
574575
576+ bool BitcoinGUI::setCurrentWalletBySelectorIndex (int index)
577+ {
578+ QString internal_name = m_wallet_selector->itemData (index).toString ();
579+ return setCurrentWallet (internal_name);
580+ }
581+
575582void BitcoinGUI::removeAllWallets ()
576583{
577584 if (!walletFrame)
0 commit comments