| 41 | } |
| 42 | |
| 43 | bool WalletFrame::addWallet(WalletModel *walletModel) |
| 44 | { |
| 45 | if (!gui || !clientModel || !walletModel) { |
| 46 | return false; |
| 47 | } |
| 48 | |
| 49 | const QString name = walletModel->getWalletName(); |
| 50 | if (mapWalletViews.count(name) > 0) { |
| 51 | return false; |
| 52 | } |
| 53 | |
| 54 | WalletView *walletView = new WalletView(platformStyle, this); |
| 55 | walletView->setBitcoinGUI(gui); |
| 56 | walletView->setClientModel(clientModel); |
| 57 | walletView->setWalletModel(walletModel); |
| 58 | walletView->showOutOfSyncWarning(bOutOfSync); |
| 59 | |
| 60 | WalletView* current_wallet_view = currentWalletView(); |
| 61 | if (current_wallet_view) { |
| 62 | walletView->setCurrentIndex(current_wallet_view->currentIndex()); |
| 63 | } else { |
| 64 | walletView->gotoOverviewPage(); |
| 65 | } |
| 66 | |
| 67 | walletStack->addWidget(walletView); |
| 68 | mapWalletViews[name] = walletView; |
| 69 | |
| 70 | // Ensure a walletView is able to show the main window |
| 71 | connect(walletView, SIGNAL(showNormalIfMinimized()), gui, SLOT(showNormalIfMinimized())); |
| 72 | |
| 73 | connect(walletView, SIGNAL(outOfSyncWarningClicked()), this, SLOT(outOfSyncWarningClicked())); |
| 74 | |
| 75 | return true; |
| 76 | } |
| 77 | |
| 78 | bool WalletFrame::setCurrentWallet(const QString& name) |
| 79 | { |
nothing calls this directly
no test coverage detected