Changeset View
Changeset View
Standalone View
Standalone View
src/qt/coincontroldialog.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/coincontroldialog.h> | #include <qt/coincontroldialog.h> | ||||
#include <qt/forms/ui_coincontroldialog.h> | #include <qt/forms/ui_coincontroldialog.h> | ||||
#include <cashaddrenc.h> | |||||
#include <dstencode.h> | #include <dstencode.h> | ||||
#include <interfaces/node.h> | #include <interfaces/node.h> | ||||
#include <policy/policy.h> | #include <policy/policy.h> | ||||
#include <qt/addresstablemodel.h> | #include <qt/addresstablemodel.h> | ||||
#include <qt/bitcoinunits.h> | #include <qt/bitcoinunits.h> | ||||
#include <qt/guiutil.h> | #include <qt/guiutil.h> | ||||
#include <qt/optionsmodel.h> | #include <qt/optionsmodel.h> | ||||
#include <qt/platformstyle.h> | #include <qt/platformstyle.h> | ||||
▲ Show 20 Lines • Show All 669 Lines • ▼ Show 20 Lines | QFlags<Qt::ItemFlag> flgTristate = | ||||
Qt::ItemIsTristate; | Qt::ItemIsTristate; | ||||
int nDisplayUnit = model->getOptionsModel()->getDisplayUnit(); | int nDisplayUnit = model->getOptionsModel()->getDisplayUnit(); | ||||
for (const auto &coins : model->wallet().listCoins()) { | for (const auto &coins : model->wallet().listCoins()) { | ||||
CCoinControlWidgetItem *itemWalletAddress = | CCoinControlWidgetItem *itemWalletAddress = | ||||
new CCoinControlWidgetItem(); | new CCoinControlWidgetItem(); | ||||
itemWalletAddress->setCheckState(COLUMN_CHECKBOX, Qt::Unchecked); | itemWalletAddress->setCheckState(COLUMN_CHECKBOX, Qt::Unchecked); | ||||
QString sWalletAddress = | QString sWalletAddress = QString::fromStdString( | ||||
QString::fromStdString(EncodeDestination(coins.first)); | EncodeCashAddr(coins.first, model->getChainParams())); | ||||
QString sWalletLabel = | QString sWalletLabel = | ||||
model->getAddressTableModel()->labelForAddress(sWalletAddress); | model->getAddressTableModel()->labelForAddress(sWalletAddress); | ||||
if (sWalletLabel.isEmpty()) { | if (sWalletLabel.isEmpty()) { | ||||
sWalletLabel = tr("(no label)"); | sWalletLabel = tr("(no label)"); | ||||
} | } | ||||
if (treeMode) { | if (treeMode) { | ||||
// wallet address | // wallet address | ||||
Show All 25 Lines | for (const auto &coins : model->wallet().listCoins()) { | ||||
} | } | ||||
itemOutput->setFlags(flgCheckbox); | itemOutput->setFlags(flgCheckbox); | ||||
itemOutput->setCheckState(COLUMN_CHECKBOX, Qt::Unchecked); | itemOutput->setCheckState(COLUMN_CHECKBOX, Qt::Unchecked); | ||||
// address | // address | ||||
CTxDestination outputAddress; | CTxDestination outputAddress; | ||||
QString sAddress = ""; | QString sAddress = ""; | ||||
if (ExtractDestination(out.txout.scriptPubKey, outputAddress)) { | if (ExtractDestination(out.txout.scriptPubKey, outputAddress)) { | ||||
sAddress = | sAddress = QString::fromStdString( | ||||
QString::fromStdString(EncodeDestination(outputAddress)); | EncodeCashAddr(outputAddress, model->getChainParams())); | ||||
// if listMode or change => show bitcoin address. In tree mode, | // if listMode or change => show bitcoin address. In tree mode, | ||||
// address is not shown again for direct wallet address outputs | // address is not shown again for direct wallet address outputs | ||||
if (!treeMode || (!(sAddress == sWalletAddress))) { | if (!treeMode || (!(sAddress == sWalletAddress))) { | ||||
itemOutput->setText(COLUMN_ADDRESS, sAddress); | itemOutput->setText(COLUMN_ADDRESS, sAddress); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 84 Lines • Show Last 20 Lines |