|
36 | 36 |
|
37 | 37 | #include <QAction>
|
38 | 38 | #include <QApplication>
|
| 39 | +#include <QComboBox> |
39 | 40 | #include <QDateTime>
|
40 | 41 | #include <QDesktopWidget>
|
41 | 42 | #include <QDragEnterEvent>
|
@@ -459,6 +460,23 @@ void BitcoinGUI::createToolBars()
|
459 | 460 | toolbar->addAction(receiveCoinsAction);
|
460 | 461 | toolbar->addAction(historyAction);
|
461 | 462 | overviewAction->setChecked(true);
|
| 463 | + |
| 464 | +#ifdef ENABLE_WALLET |
| 465 | + QWidget *spacer = new QWidget(); |
| 466 | + spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
| 467 | + toolbar->addWidget(spacer); |
| 468 | + |
| 469 | + m_wallet_selector_label = new QLabel(); |
| 470 | + m_wallet_selector_label->setText(tr("Wallet:") + " "); |
| 471 | + toolbar->addWidget(m_wallet_selector_label); |
| 472 | + m_wallet_selector_label->setVisible(false); |
| 473 | + m_wallet_selector = new QComboBox(); |
| 474 | + toolbar->addWidget(m_wallet_selector); |
| 475 | + m_wallet_selector->setVisible(false); |
| 476 | + m_wallet_selector_label->setBuddy(m_wallet_selector); |
| 477 | + |
| 478 | + connect(m_wallet_selector, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(setCurrentWallet(const QString&))); |
| 479 | +#endif |
462 | 480 | }
|
463 | 481 | }
|
464 | 482 |
|
@@ -530,6 +548,11 @@ bool BitcoinGUI::addWallet(const QString& name, WalletModel *walletModel)
|
530 | 548 | if(!walletFrame)
|
531 | 549 | return false;
|
532 | 550 | setWalletActionsEnabled(true);
|
| 551 | + m_wallet_selector->addItem(name); |
| 552 | + if (m_wallet_selector->count() == 2) { |
| 553 | + m_wallet_selector->setVisible(true); |
| 554 | + m_wallet_selector->setVisible(true); |
| 555 | + } |
533 | 556 | return walletFrame->addWallet(name, walletModel);
|
534 | 557 | }
|
535 | 558 |
|
|
0 commit comments