| 649 | } |
| 650 | |
| 651 | void BitcoinGUI::addWallet(WalletModel* walletModel) |
| 652 | { |
| 653 | if (!walletFrame) return; |
| 654 | |
| 655 | WalletView* wallet_view = new WalletView(walletModel, platformStyle, walletFrame); |
| 656 | if (!walletFrame->addView(wallet_view)) return; |
| 657 | |
| 658 | rpcConsole->addWallet(walletModel); |
| 659 | if (m_wallet_selector->count() == 0) { |
| 660 | setWalletActionsEnabled(true); |
| 661 | } else if (m_wallet_selector->count() == 1) { |
| 662 | m_wallet_selector_label_action->setVisible(true); |
| 663 | m_wallet_selector_action->setVisible(true); |
| 664 | } |
| 665 | |
| 666 | connect(wallet_view, &WalletView::outOfSyncWarningClicked, this, &BitcoinGUI::showModalOverlay); |
| 667 | connect(wallet_view, &WalletView::transactionClicked, this, &BitcoinGUI::gotoHistoryPage); |
| 668 | connect(wallet_view, &WalletView::coinsSent, this, &BitcoinGUI::gotoHistoryPage); |
| 669 | connect(wallet_view, &WalletView::message, [this](const QString& title, const QString& message, unsigned int style) { |
| 670 | this->message(title, message, style); |
| 671 | }); |
| 672 | connect(wallet_view, &WalletView::encryptionStatusChanged, this, &BitcoinGUI::updateWalletStatus); |
| 673 | connect(wallet_view, &WalletView::incomingTransaction, this, &BitcoinGUI::incomingTransaction); |
| 674 | connect(this, &BitcoinGUI::setPrivacy, wallet_view, &WalletView::setPrivacy); |
| 675 | wallet_view->setPrivacy(isPrivacyModeActivated()); |
| 676 | const QString display_name = walletModel->getDisplayName(); |
| 677 | m_wallet_selector->addItem(display_name, QVariant::fromValue(walletModel)); |
| 678 | } |
| 679 | |
| 680 | void BitcoinGUI::removeWallet(WalletModel* walletModel) |
| 681 | { |
nothing calls this directly
no test coverage detected