Merge pull request #388 from UdjinM6/v0.12.0.x_sum_tx

V0.12.0.x sum tx separator and negative value highlight
This commit is contained in:
evan82 2015-06-28 14:01:05 -07:00
commit faf150d9d3

View File

@ -449,7 +449,6 @@ void TransactionView::showDetails()
/** Compute sum of all selected transactions */
void TransactionView::computeSum()
{
QString amountText;
qint64 amount = 0;
int nDisplayUnit = model->getOptionsModel()->getDisplayUnit();
if(!transactionView->selectionModel())
@ -460,7 +459,8 @@ void TransactionView::computeSum()
foreach (QModelIndex index, selection){
amount += index.data(TransactionTableModel::AmountRole).toLongLong();
}
QString strAmount(BitcoinUnits::formatWithUnit(nDisplayUnit, amount, true));
QString strAmount(BitcoinUnits::formatWithUnit(nDisplayUnit, amount, true, BitcoinUnits::separatorAlways));
if (amount < 0) strAmount = "<span style='color:red;'>" + strAmount + "</span>";
emit trxAmount(strAmount);
}
}