Changeset View
Changeset View
Standalone View
Standalone View
src/qt/walletframe.cpp
// Copyright (c) 2011-2016 The Bitcoin Core developers | // Copyright (c) 2011-2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#include "walletframe.h" | #include "walletframe.h" | ||||
#include "walletmodel.h" | |||||
#include "bitcoingui.h" | #include "bitcoingui.h" | ||||
#include "walletview.h" | #include "walletview.h" | ||||
#include <cstdio> | #include <cstdio> | ||||
#include <QHBoxLayout> | #include <QHBoxLayout> | ||||
#include <QLabel> | #include <QLabel> | ||||
Show All 14 Lines | |||||
} | } | ||||
WalletFrame::~WalletFrame() {} | WalletFrame::~WalletFrame() {} | ||||
void WalletFrame::setClientModel(ClientModel *_clientModel) { | void WalletFrame::setClientModel(ClientModel *_clientModel) { | ||||
this->clientModel = _clientModel; | this->clientModel = _clientModel; | ||||
} | } | ||||
bool WalletFrame::addWallet(const QString &name, WalletModel *walletModel) { | bool WalletFrame::addWallet(WalletModel *walletModel) { | ||||
if (!gui || !clientModel || !walletModel || mapWalletViews.count(name) > 0) | if (!gui || !clientModel || !walletModel) { | ||||
return false; | return false; | ||||
} | |||||
const QString name = walletModel->getWalletName(); | |||||
if (mapWalletViews.count(name) > 0) { | |||||
return false; | |||||
} | |||||
WalletView *walletView = new WalletView(platformStyle, config, this); | WalletView *walletView = new WalletView(platformStyle, config, this); | ||||
walletView->setBitcoinGUI(gui); | walletView->setBitcoinGUI(gui); | ||||
walletView->setClientModel(clientModel); | walletView->setClientModel(clientModel); | ||||
walletView->setWalletModel(walletModel); | walletView->setWalletModel(walletModel); | ||||
walletView->showOutOfSyncWarning(bOutOfSync); | walletView->showOutOfSyncWarning(bOutOfSync); | ||||
/* TODO we should goto the currently selected page once dynamically adding | /* TODO we should goto the currently selected page once dynamically adding | ||||
▲ Show 20 Lines • Show All 124 Lines • Show Last 20 Lines |