|
|
@ -35,6 +35,15 @@ QList<CAmount> CoinControlDialog::payAmounts;
|
|
|
|
CCoinControl* CoinControlDialog::coinControl = new CCoinControl();
|
|
|
|
CCoinControl* CoinControlDialog::coinControl = new CCoinControl();
|
|
|
|
bool CoinControlDialog::fSubtractFeeFromAmount = false;
|
|
|
|
bool CoinControlDialog::fSubtractFeeFromAmount = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool CCoinControlWidgetItem::operator<(const QTreeWidgetItem &other) const {
|
|
|
|
|
|
|
|
int column = treeWidget()->sortColumn();
|
|
|
|
|
|
|
|
if (column == CoinControlDialog::COLUMN_AMOUNT_INT64 || column == CoinControlDialog::COLUMN_AMOUNT_INT64)
|
|
|
|
|
|
|
|
return data(CoinControlDialog::COLUMN_AMOUNT_INT64, Qt::DisplayRole).toULongLong() < other.data(CoinControlDialog::COLUMN_AMOUNT_INT64, Qt::DisplayRole).toULongLong();
|
|
|
|
|
|
|
|
if (column == CoinControlDialog::COLUMN_DATE || column == CoinControlDialog::COLUMN_DATE_INT64)
|
|
|
|
|
|
|
|
return data(CoinControlDialog::COLUMN_DATE_INT64, Qt::DisplayRole).toULongLong() < other.data(CoinControlDialog::COLUMN_DATE_INT64, Qt::DisplayRole).toULongLong();
|
|
|
|
|
|
|
|
return QTreeWidgetItem::operator<(other);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CoinControlDialog::CoinControlDialog(const PlatformStyle *_platformStyle, QWidget *parent) :
|
|
|
|
CoinControlDialog::CoinControlDialog(const PlatformStyle *_platformStyle, QWidget *parent) :
|
|
|
|
QDialog(parent),
|
|
|
|
QDialog(parent),
|
|
|
|
ui(new Ui::CoinControlDialog),
|
|
|
|
ui(new Ui::CoinControlDialog),
|
|
|
@ -658,7 +667,7 @@ void CoinControlDialog::updateView()
|
|
|
|
model->listCoins(mapCoins);
|
|
|
|
model->listCoins(mapCoins);
|
|
|
|
|
|
|
|
|
|
|
|
BOOST_FOREACH(const PAIRTYPE(QString, std::vector<COutput>)& coins, mapCoins) {
|
|
|
|
BOOST_FOREACH(const PAIRTYPE(QString, std::vector<COutput>)& coins, mapCoins) {
|
|
|
|
QTreeWidgetItem *itemWalletAddress = new QTreeWidgetItem();
|
|
|
|
CCoinControlWidgetItem *itemWalletAddress = new CCoinControlWidgetItem();
|
|
|
|
itemWalletAddress->setCheckState(COLUMN_CHECKBOX, Qt::Unchecked);
|
|
|
|
itemWalletAddress->setCheckState(COLUMN_CHECKBOX, Qt::Unchecked);
|
|
|
|
QString sWalletAddress = coins.first;
|
|
|
|
QString sWalletAddress = coins.first;
|
|
|
|
QString sWalletLabel = model->getAddressTableModel()->labelForAddress(sWalletAddress);
|
|
|
|
QString sWalletLabel = model->getAddressTableModel()->labelForAddress(sWalletAddress);
|
|
|
@ -686,9 +695,9 @@ void CoinControlDialog::updateView()
|
|
|
|
nSum += out.tx->vout[out.i].nValue;
|
|
|
|
nSum += out.tx->vout[out.i].nValue;
|
|
|
|
nChildren++;
|
|
|
|
nChildren++;
|
|
|
|
|
|
|
|
|
|
|
|
QTreeWidgetItem *itemOutput;
|
|
|
|
CCoinControlWidgetItem *itemOutput;
|
|
|
|
if (treeMode) itemOutput = new QTreeWidgetItem(itemWalletAddress);
|
|
|
|
if (treeMode) itemOutput = new CCoinControlWidgetItem(itemWalletAddress);
|
|
|
|
else itemOutput = new QTreeWidgetItem(ui->treeWidget);
|
|
|
|
else itemOutput = new CCoinControlWidgetItem(ui->treeWidget);
|
|
|
|
itemOutput->setFlags(flgCheckbox);
|
|
|
|
itemOutput->setFlags(flgCheckbox);
|
|
|
|
itemOutput->setCheckState(COLUMN_CHECKBOX,Qt::Unchecked);
|
|
|
|
itemOutput->setCheckState(COLUMN_CHECKBOX,Qt::Unchecked);
|
|
|
|
|
|
|
|
|
|
|
@ -721,11 +730,11 @@ void CoinControlDialog::updateView()
|
|
|
|
|
|
|
|
|
|
|
|
// amount
|
|
|
|
// amount
|
|
|
|
itemOutput->setText(COLUMN_AMOUNT, BitcoinUnits::format(nDisplayUnit, out.tx->vout[out.i].nValue));
|
|
|
|
itemOutput->setText(COLUMN_AMOUNT, BitcoinUnits::format(nDisplayUnit, out.tx->vout[out.i].nValue));
|
|
|
|
itemOutput->setText(COLUMN_AMOUNT_INT64, strPad(QString::number(out.tx->vout[out.i].nValue), 15, " ")); // padding so that sorting works correctly
|
|
|
|
itemOutput->setData(COLUMN_AMOUNT_INT64, Qt::DisplayRole, QVariant((qlonglong)out.tx->vout[out.i].nValue)); // padding so that sorting works correctly
|
|
|
|
|
|
|
|
|
|
|
|
// date
|
|
|
|
// date
|
|
|
|
itemOutput->setText(COLUMN_DATE, GUIUtil::dateTimeStr(out.tx->GetTxTime()));
|
|
|
|
itemOutput->setText(COLUMN_DATE, GUIUtil::dateTimeStr(out.tx->GetTxTime()));
|
|
|
|
itemOutput->setText(COLUMN_DATE_INT64, strPad(QString::number(out.tx->GetTxTime()), 20, " "));
|
|
|
|
itemOutput->setData(COLUMN_DATE_INT64, Qt::DisplayRole, QVariant((qlonglong)out.tx->GetTxTime()));
|
|
|
|
|
|
|
|
|
|
|
|
// confirmations
|
|
|
|
// confirmations
|
|
|
|
itemOutput->setText(COLUMN_CONFIRMATIONS, strPad(QString::number(out.nDepth), 8, " "));
|
|
|
|
itemOutput->setText(COLUMN_CONFIRMATIONS, strPad(QString::number(out.nDepth), 8, " "));
|
|
|
|