~ubuntu-branches/debian/sid/bitcoin/sid

« back to all changes in this revision

Viewing changes to src/qt/transactiontablemodel.cpp

  • Committer: Package Import Robot
  • Author(s): Scott Howard
  • Date: 2015-07-29 15:45:52 UTC
  • mfrom: (1.1.23)
  • Revision ID: package-import@ubuntu.com-20150729154552-p5t8q38o0ekh1f09
Tags: 0.11.0-1
* New upstream release (Closes: #793622)
  - build on all archs, big endian is now supported
* Updated symbols file
* Added bitcoin-cli.1 manpage from contrib/debian/manpages
* Updated debian/copyright

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Copyright (c) 2011-2014 The Bitcoin developers
2
 
// Distributed under the MIT/X11 software license, see the accompanying
 
1
// Copyright (c) 2011-2014 The Bitcoin Core developers
 
2
// Distributed under the MIT software license, see the accompanying
3
3
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
4
 
5
5
#include "transactiontablemodel.h"
8
8
#include "guiconstants.h"
9
9
#include "guiutil.h"
10
10
#include "optionsmodel.h"
 
11
#include "scicon.h"
11
12
#include "transactiondesc.h"
12
13
#include "transactionrecord.h"
13
14
#include "walletmodel.h"
16
17
#include "sync.h"
17
18
#include "uint256.h"
18
19
#include "util.h"
19
 
#include "wallet.h"
 
20
#include "wallet/wallet.h"
20
21
 
21
22
#include <QColor>
22
23
#include <QDateTime>
93
94
     */
94
95
    void updateWallet(const uint256 &hash, int status, bool showTransaction)
95
96
    {
96
 
        qDebug() << "TransactionTablePriv::updateWallet : " + QString::fromStdString(hash.ToString()) + " " + QString::number(status);
 
97
        qDebug() << "TransactionTablePriv::updateWallet: " + QString::fromStdString(hash.ToString()) + " " + QString::number(status);
97
98
 
98
99
        // Find bounds of this transaction in model
99
100
        QList<TransactionRecord>::iterator lower = qLowerBound(
121
122
        case CT_NEW:
122
123
            if(inModel)
123
124
            {
124
 
                qWarning() << "TransactionTablePriv::updateWallet : Warning: Got CT_NEW, but transaction is already in model";
 
125
                qWarning() << "TransactionTablePriv::updateWallet: Warning: Got CT_NEW, but transaction is already in model";
125
126
                break;
126
127
            }
127
128
            if(showTransaction)
131
132
                std::map<uint256, CWalletTx>::iterator mi = wallet->mapWallet.find(hash);
132
133
                if(mi == wallet->mapWallet.end())
133
134
                {
134
 
                    qWarning() << "TransactionTablePriv::updateWallet : Warning: Got CT_NEW, but transaction is not in wallet";
 
135
                    qWarning() << "TransactionTablePriv::updateWallet: Warning: Got CT_NEW, but transaction is not in wallet";
135
136
                    break;
136
137
                }
137
138
                // Added -- insert at the right position
153
154
        case CT_DELETED:
154
155
            if(!inModel)
155
156
            {
156
 
                qWarning() << "TransactionTablePriv::updateWallet : Warning: Got CT_DELETED, but transaction is not in model";
 
157
                qWarning() << "TransactionTablePriv::updateWallet: Warning: Got CT_DELETED, but transaction is not in model";
157
158
                break;
158
159
            }
159
160
            // Removed -- remove entire transaction from table
226
227
        priv(new TransactionTablePriv(wallet, this)),
227
228
        fProcessingQueuedTransactions(false)
228
229
{
229
 
    columns << QString() << QString() << tr("Date") << tr("Type") << tr("Address") << BitcoinUnits::getAmountColumnTitle(walletModel->getOptionsModel()->getDisplayUnit());
 
230
    columns << QString() << QString() << tr("Date") << tr("Type") << tr("Label") << BitcoinUnits::getAmountColumnTitle(walletModel->getOptionsModel()->getDisplayUnit());
230
231
    priv->refreshWallet();
231
232
 
232
233
    connect(walletModel->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));
504
505
 
505
506
    switch(role)
506
507
    {
507
 
    case Qt::DecorationRole:
 
508
    case RawDecorationRole:
508
509
        switch(index.column())
509
510
        {
510
511
        case Status:
515
516
            return txAddressDecoration(rec);
516
517
        }
517
518
        break;
 
519
    case Qt::DecorationRole:
 
520
    {
 
521
        QIcon icon = qvariant_cast<QIcon>(index.data(RawDecorationRole));
 
522
        return TextColorIcon(icon);
 
523
    }
518
524
    case Qt::DisplayRole:
519
525
        switch(index.column())
520
526
        {
620
626
            case Watchonly:
621
627
                return tr("Whether or not a watch-only address is involved in this transaction.");
622
628
            case ToAddress:
623
 
                return tr("Destination address of transaction.");
 
629
                return tr("User-defined intent/purpose of the transaction.");
624
630
            case Amount:
625
631
                return tr("Amount removed from or added to balance.");
626
632
            }
658
664
    void invoke(QObject *ttm)
659
665
    {
660
666
        QString strHash = QString::fromStdString(hash.GetHex());
661
 
        qDebug() << "NotifyTransactionChanged : " + strHash + " status= " + QString::number(status);
 
667
        qDebug() << "NotifyTransactionChanged: " + strHash + " status= " + QString::number(status);
662
668
        QMetaObject::invokeMethod(ttm, "updateTransaction", Qt::QueuedConnection,
663
669
                                  Q_ARG(QString, strHash),
664
670
                                  Q_ARG(int, status),