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 <qt/walletframe.h> | #include <qt/walletframe.h> | ||||
#include <qt/bitcoingui.h> | #include <qt/bitcoingui.h> | ||||
#include <qt/walletmodel.h> | #include <qt/walletmodel.h> | ||||
#include <qt/walletview.h> | #include <qt/walletview.h> | ||||
#include <QHBoxLayout> | #include <QHBoxLayout> | ||||
#include <QLabel> | #include <QLabel> | ||||
#include <cassert> | #include <cassert> | ||||
#include <cstdio> | #include <cstdio> | ||||
WalletFrame::WalletFrame(const PlatformStyle *_platformStyle, | WalletFrame::WalletFrame(const PlatformStyle *_platformStyle, BitcoinGUI *_gui) | ||||
const Config *configIn, BitcoinGUI *_gui) | : QFrame(_gui), gui(_gui), platformStyle(_platformStyle) { | ||||
: QFrame(_gui), gui(_gui), platformStyle(_platformStyle), config(configIn) { | |||||
// Leave HBox hook for adding a list view later | // Leave HBox hook for adding a list view later | ||||
QHBoxLayout *walletFrameLayout = new QHBoxLayout(this); | QHBoxLayout *walletFrameLayout = new QHBoxLayout(this); | ||||
setContentsMargins(0, 0, 0, 0); | setContentsMargins(0, 0, 0, 0); | ||||
walletStack = new QStackedWidget(this); | walletStack = new QStackedWidget(this); | ||||
walletFrameLayout->setContentsMargins(0, 0, 0, 0); | walletFrameLayout->setContentsMargins(0, 0, 0, 0); | ||||
walletFrameLayout->addWidget(walletStack); | walletFrameLayout->addWidget(walletStack); | ||||
QLabel *noWallet = new QLabel(tr("No wallet has been loaded.")); | QLabel *noWallet = new QLabel(tr("No wallet has been loaded.")); | ||||
Show All 12 Lines | if (!gui || !clientModel || !walletModel) { | ||||
return false; | return false; | ||||
} | } | ||||
const QString name = walletModel->getWalletName(); | const QString name = walletModel->getWalletName(); | ||||
if (mapWalletViews.count(name) > 0) { | if (mapWalletViews.count(name) > 0) { | ||||
return false; | return false; | ||||
} | } | ||||
WalletView *walletView = new WalletView(platformStyle, config, this); | WalletView *walletView = new WalletView(platformStyle, 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 | ||||
* wallets is supported */ | * wallets is supported */ | ||||
walletView->gotoOverviewPage(); | walletView->gotoOverviewPage(); | ||||
▲ Show 20 Lines • Show All 123 Lines • Show Last 20 Lines |