~ubuntu-branches/debian/stretch/bitcoin/stretch

« back to all changes in this revision

Viewing changes to src/qt/transactiontablemodel.cpp

  • Committer: Package Import Robot
  • Author(s): Anthony Towns
  • Date: 2016-10-21 17:13:13 UTC
  • mfrom: (1.3.2)
  • Revision ID: package-import@ubuntu.com-20161021171313-7eu2ltpbk0xag3q1
Tags: 0.13.0-0.1
* Non-maintainer upload.
* New upstream release.
* Allow compilation with gcc/g++ 6. (Closes: Bug#835963)
* Additional fixes for openssl 1.1 compatibility. (See Bug#828248)
* Check if -latomic is needed (it is on mips*).
* Remove reproducible build patch, since leveldb build system is
  no longer used in 0.13. (See Bug#791834)
* Update description since the blockchain is much more than "several GB"
  now. (Closes: Bug#835809)

Show diffs side-by-side

added added

removed removed

Lines of Context:
312
312
    case TransactionStatus::Unconfirmed:
313
313
        status = tr("Unconfirmed");
314
314
        break;
 
315
    case TransactionStatus::Abandoned:
 
316
        status = tr("Abandoned");
 
317
        break;
315
318
    case TransactionStatus::Confirming:
316
319
        status = tr("Confirming (%1 of %2 recommended confirmations)").arg(wtx->status.depth).arg(TransactionRecord::RecommendedNumConfirmations);
317
320
        break;
468
471
        return COLOR_TX_STATUS_OFFLINE;
469
472
    case TransactionStatus::Unconfirmed:
470
473
        return QIcon(":/icons/transaction_0");
 
474
    case TransactionStatus::Abandoned:
 
475
        return QIcon(":/icons/transaction_abandoned");
471
476
    case TransactionStatus::Confirming:
472
477
        switch(wtx->status.depth)
473
478
        {
573
578
    case Qt::TextAlignmentRole:
574
579
        return column_alignments[index.column()];
575
580
    case Qt::ForegroundRole:
 
581
        // Use the "danger" color for abandoned transactions
 
582
        if(rec->status.status == TransactionStatus::Abandoned)
 
583
        {
 
584
            return COLOR_TX_STATUS_DANGER;
 
585
        }
576
586
        // Non-confirmed (but not immature) as transactions are grey
577
587
        if(!rec->status.countsForBalance && rec->status.status != TransactionStatus::Immature)
578
588
        {
609
619
        return QString::fromStdString(rec->hash.ToString());
610
620
    case TxHexRole:
611
621
        return priv->getTxHex(rec);
 
622
    case TxPlainTextRole:
 
623
        {
 
624
            QString details;
 
625
            QDateTime date = QDateTime::fromTime_t(static_cast<uint>(rec->time));
 
626
            QString txLabel = walletModel->getAddressTableModel()->labelForAddress(QString::fromStdString(rec->address));
 
627
 
 
628
            details.append(date.toString("M/d/yy HH:mm"));
 
629
            details.append(" ");
 
630
            details.append(formatTxStatus(rec));
 
631
            details.append(". ");
 
632
            if(!formatTxType(rec).isEmpty()) {
 
633
                details.append(formatTxType(rec));
 
634
                details.append(" ");
 
635
            }
 
636
            if(!rec->address.empty()) {
 
637
                if(txLabel.isEmpty())
 
638
                    details.append(tr("(no label)") + " ");
 
639
                else {
 
640
                    details.append("(");
 
641
                    details.append(txLabel);
 
642
                    details.append(") ");
 
643
                }
 
644
                details.append(QString::fromStdString(rec->address));
 
645
                details.append(" ");
 
646
            }
 
647
            details.append(formatTxAmount(rec, false, BitcoinUnits::separatorNever));
 
648
            return details;
 
649
        }
612
650
    case ConfirmedRole:
613
651
        return rec->status.countsForBalance;
614
652
    case FormattedAmountRole: