aboutsummaryrefslogtreecommitdiff
path: root/src/qt/bitcoingui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qt/bitcoingui.cpp')
-rw-r--r--src/qt/bitcoingui.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index 0bf1d5c55f..92fb3f1904 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -36,6 +36,7 @@
#include <QAction>
#include <QApplication>
+#include <QComboBox>
#include <QDateTime>
#include <QDesktopWidget>
#include <QDragEnterEvent>
@@ -459,6 +460,23 @@ void BitcoinGUI::createToolBars()
toolbar->addAction(receiveCoinsAction);
toolbar->addAction(historyAction);
overviewAction->setChecked(true);
+
+#ifdef ENABLE_WALLET
+ QWidget *spacer = new QWidget();
+ spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+ toolbar->addWidget(spacer);
+
+ m_wallet_selector_label = new QLabel();
+ m_wallet_selector_label->setText(tr("Wallet:") + " ");
+ toolbar->addWidget(m_wallet_selector_label);
+ m_wallet_selector_label->setVisible(false);
+ m_wallet_selector = new QComboBox();
+ toolbar->addWidget(m_wallet_selector);
+ m_wallet_selector->setVisible(false);
+ m_wallet_selector_label->setBuddy(m_wallet_selector);
+
+ connect(m_wallet_selector, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(setCurrentWallet(const QString&)));
+#endif
}
}
@@ -530,6 +548,11 @@ bool BitcoinGUI::addWallet(const QString& name, WalletModel *walletModel)
if(!walletFrame)
return false;
setWalletActionsEnabled(true);
+ m_wallet_selector->addItem(name);
+ if (m_wallet_selector->count() == 2) {
+ m_wallet_selector->setVisible(true);
+ m_wallet_selector->setVisible(true);
+ }
return walletFrame->addWallet(name, walletModel);
}