Changeset View
Changeset View
Standalone View
Standalone View
src/qt/walletmodel.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/walletmodel.h> | #include <qt/walletmodel.h> | ||||
#include <config.h> | #include <cashaddrenc.h> | ||||
#include <dstencode.h> | #include <dstencode.h> | ||||
#include <interfaces/handler.h> | #include <interfaces/handler.h> | ||||
#include <interfaces/node.h> | #include <interfaces/node.h> | ||||
#include <qt/addresstablemodel.h> | #include <qt/addresstablemodel.h> | ||||
#include <qt/guiconstants.h> | #include <qt/guiconstants.h> | ||||
#include <qt/paymentserver.h> | #include <qt/paymentserver.h> | ||||
#include <qt/recentrequeststablemodel.h> | #include <qt/recentrequeststablemodel.h> | ||||
#include <qt/transactiontablemodel.h> | #include <qt/transactiontablemodel.h> | ||||
▲ Show 20 Lines • Show All 329 Lines • ▼ Show 20 Lines | QMetaObject::invokeMethod(walletmodel, "updateStatus", | ||||
Qt::QueuedConnection); | Qt::QueuedConnection); | ||||
} | } | ||||
static void NotifyAddressBookChanged(WalletModel *walletmodel, | static void NotifyAddressBookChanged(WalletModel *walletmodel, | ||||
const CTxDestination &address, | const CTxDestination &address, | ||||
const std::string &label, bool isMine, | const std::string &label, bool isMine, | ||||
const std::string &purpose, | const std::string &purpose, | ||||
ChangeType status) { | ChangeType status) { | ||||
QString strAddress = QString::fromStdString(EncodeDestination(address)); | QString strAddress = QString::fromStdString( | ||||
EncodeCashAddr(address, walletmodel->getChainParams())); | |||||
QString strLabel = QString::fromStdString(label); | QString strLabel = QString::fromStdString(label); | ||||
QString strPurpose = QString::fromStdString(purpose); | QString strPurpose = QString::fromStdString(purpose); | ||||
qDebug() << "NotifyAddressBookChanged: " + strAddress + " " + strLabel + | qDebug() << "NotifyAddressBookChanged: " + strAddress + " " + strLabel + | ||||
" isMine=" + QString::number(isMine) + | " isMine=" + QString::number(isMine) + | ||||
" purpose=" + strPurpose + | " purpose=" + strPurpose + | ||||
" status=" + QString::number(status); | " status=" + QString::number(status); | ||||
QMetaObject::invokeMethod(walletmodel, "updateAddressBook", | QMetaObject::invokeMethod(walletmodel, "updateAddressBook", | ||||
▲ Show 20 Lines • Show All 106 Lines • ▼ Show 20 Lines | QString WalletModel::getWalletName() const { | ||||
return QString::fromStdString(m_wallet->getWalletName()); | return QString::fromStdString(m_wallet->getWalletName()); | ||||
} | } | ||||
bool WalletModel::isMultiwallet() { | bool WalletModel::isMultiwallet() { | ||||
return m_node.getWallets().size() > 1; | return m_node.getWallets().size() > 1; | ||||
} | } | ||||
const CChainParams &WalletModel::getChainParams() const { | const CChainParams &WalletModel::getChainParams() const { | ||||
return GetConfig().GetChainParams(); | return Params(); | ||||
} | } |