Changeset View
Changeset View
Standalone View
Standalone View
src/qt/transactiontablemodel.h
// 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. | ||||
#ifndef BITCOIN_QT_TRANSACTIONTABLEMODEL_H | #ifndef BITCOIN_QT_TRANSACTIONTABLEMODEL_H | ||||
#define BITCOIN_QT_TRANSACTIONTABLEMODEL_H | #define BITCOIN_QT_TRANSACTIONTABLEMODEL_H | ||||
#include "bitcoinunits.h" | #include <qt/bitcoinunits.h> | ||||
#include <QAbstractTableModel> | #include <QAbstractTableModel> | ||||
#include <QStringList> | #include <QStringList> | ||||
#include <memory> | |||||
namespace interfaces { | |||||
class Handler; | |||||
} | |||||
class PlatformStyle; | class PlatformStyle; | ||||
class TransactionRecord; | class TransactionRecord; | ||||
class TransactionTablePriv; | class TransactionTablePriv; | ||||
class WalletModel; | class WalletModel; | ||||
class CWallet; | |||||
/** | /** | ||||
* UI model for the transaction table of a wallet. | * UI model for the transaction table of a wallet. | ||||
*/ | */ | ||||
class TransactionTableModel : public QAbstractTableModel { | class TransactionTableModel : public QAbstractTableModel { | ||||
Q_OBJECT | Q_OBJECT | ||||
public: | public: | ||||
explicit TransactionTableModel(const PlatformStyle *platformStyle, | explicit TransactionTableModel(const PlatformStyle *platformStyle, | ||||
CWallet *wallet, WalletModel *parent = 0); | WalletModel *parent = 0); | ||||
~TransactionTableModel(); | ~TransactionTableModel(); | ||||
enum ColumnIndex { | enum ColumnIndex { | ||||
Status = 0, | Status = 0, | ||||
Watchonly = 1, | Watchonly = 1, | ||||
Date = 2, | Date = 2, | ||||
Type = 3, | Type = 3, | ||||
ToAddress = 4, | ToAddress = 4, | ||||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | QVariant headerData(int section, Qt::Orientation orientation, | ||||
int role) const override; | int role) const override; | ||||
QModelIndex index(int row, int column, | QModelIndex index(int row, int column, | ||||
const QModelIndex &parent = QModelIndex()) const override; | const QModelIndex &parent = QModelIndex()) const override; | ||||
bool processingQueuedTransactions() const { | bool processingQueuedTransactions() const { | ||||
return fProcessingQueuedTransactions; | return fProcessingQueuedTransactions; | ||||
} | } | ||||
private: | private: | ||||
CWallet *wallet; | |||||
WalletModel *walletModel; | WalletModel *walletModel; | ||||
std::unique_ptr<interfaces::Handler> m_handler_transaction_changed; | |||||
std::unique_ptr<interfaces::Handler> m_handler_show_progress; | |||||
QStringList columns; | QStringList columns; | ||||
TransactionTablePriv *priv; | TransactionTablePriv *priv; | ||||
bool fProcessingQueuedTransactions; | bool fProcessingQueuedTransactions; | ||||
const PlatformStyle *platformStyle; | const PlatformStyle *platformStyle; | ||||
void subscribeToCoreSignals(); | void subscribeToCoreSignals(); | ||||
void unsubscribeFromCoreSignals(); | void unsubscribeFromCoreSignals(); | ||||
Show All 40 Lines |