Master Core  v0.0.9 - 49a5c0d97abf09ef2911ddfe8d9551df59f9efd3-dirty
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Types | Public Slots | Public Member Functions | Private Attributes
RecentRequestsTableModel Class Reference

Model for list of recently generated payment requests / bitcoin: URIs. More...

#include <recentrequeststablemodel.h>

+ Inheritance diagram for RecentRequestsTableModel:
+ Collaboration diagram for RecentRequestsTableModel:

Public Types

enum  ColumnIndex {
  Date = 0,
  Label = 1,
  Message = 2,
  Amount = 3,
  NUMBER_OF_COLUMNS
}
 

Public Slots

void sort (int column, Qt::SortOrder order=Qt::AscendingOrder)
 

Public Member Functions

 RecentRequestsTableModel (CWallet *wallet, WalletModel *parent)
 
 ~RecentRequestsTableModel ()
 
const RecentRequestEntryentry (int row) const
 
void addNewRequest (const SendCoinsRecipient &recipient)
 
void addNewRequest (const std::string &recipient)
 
void addNewRequest (RecentRequestEntry &recipient)
 
Methods overridden from QAbstractTableModel
int rowCount (const QModelIndex &parent) const
 
int columnCount (const QModelIndex &parent) const
 
QVariant data (const QModelIndex &index, int role) const
 
bool setData (const QModelIndex &index, const QVariant &value, int role)
 
QVariant headerData (int section, Qt::Orientation orientation, int role) const
 
QModelIndex index (int row, int column, const QModelIndex &parent) const
 
bool removeRows (int row, int count, const QModelIndex &parent=QModelIndex())
 
Qt::ItemFlags flags (const QModelIndex &index) const
 

Private Attributes

WalletModelwalletModel
 
QStringList columns
 
QList< RecentRequestEntrylist
 
int64_t nReceiveRequestsMaxId
 

Detailed Description

Model for list of recently generated payment requests / bitcoin: URIs.

Part of wallet model.

Definition at line 59 of file recentrequeststablemodel.h.

Member Enumeration Documentation

Enumerator
Date 
Label 
Message 
Amount 
NUMBER_OF_COLUMNS 

Definition at line 67 of file recentrequeststablemodel.h.

Constructor & Destructor Documentation

RecentRequestsTableModel::RecentRequestsTableModel ( CWallet wallet,
WalletModel parent 
)
explicit

Definition at line 11 of file recentrequeststablemodel.cpp.

References addNewRequest(), columns, WalletModel::loadReceiveRequests(), and nReceiveRequestsMaxId.

+ Here is the call graph for this function:

RecentRequestsTableModel::~RecentRequestsTableModel ( )

Definition at line 27 of file recentrequeststablemodel.cpp.

Member Function Documentation

void RecentRequestsTableModel::addNewRequest ( const SendCoinsRecipient recipient)

Definition at line 140 of file recentrequeststablemodel.cpp.

References SendCoinsRecipient::address, CLIENT_VERSION, RecentRequestEntry::date, RecentRequestEntry::id, nReceiveRequestsMaxId, RecentRequestEntry::recipient, WalletModel::saveReceiveRequest(), SER_DISK, CDataStream::str(), and walletModel.

Referenced by addNewRequest(), ReceiveCoinsDialog::on_receiveButton_clicked(), and RecentRequestsTableModel().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void RecentRequestsTableModel::addNewRequest ( const std::string &  recipient)

Definition at line 157 of file recentrequeststablemodel.cpp.

References addNewRequest(), CLIENT_VERSION, data(), entry(), nReceiveRequestsMaxId, and SER_DISK.

+ Here is the call graph for this function:

void RecentRequestsTableModel::addNewRequest ( RecentRequestEntry recipient)

Definition at line 175 of file recentrequeststablemodel.cpp.

References list.

int RecentRequestsTableModel::columnCount ( const QModelIndex &  parent) const

Definition at line 39 of file recentrequeststablemodel.cpp.

References columns.

QVariant RecentRequestsTableModel::data ( const QModelIndex &  index,
int  role 
) const

Definition at line 46 of file recentrequeststablemodel.cpp.

References SendCoinsRecipient::amount, Amount, RecentRequestEntry::date, Date, GUIUtil::dateTimeStr(), BitcoinUnits::format(), OptionsModel::getDisplayUnit(), WalletModel::getOptionsModel(), SendCoinsRecipient::label, Label, list, SendCoinsRecipient::message, Message, RecentRequestEntry::recipient, and walletModel.

Referenced by addNewRequest(), and ReceiveCoinsDialog::copyColumnToClipboard().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const RecentRequestEntry& RecentRequestsTableModel::entry ( int  row) const
inline

Definition at line 87 of file recentrequeststablemodel.h.

Referenced by addNewRequest(), and ReceiveCoinsDialog::on_recentRequestsView_doubleClicked().

+ Here is the caller graph for this function:

Qt::ItemFlags RecentRequestsTableModel::flags ( const QModelIndex &  index) const

Definition at line 134 of file recentrequeststablemodel.cpp.

QVariant RecentRequestsTableModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role 
) const

Definition at line 92 of file recentrequeststablemodel.cpp.

References columns.

QModelIndex RecentRequestsTableModel::index ( int  row,
int  column,
const QModelIndex &  parent 
) const

Definition at line 104 of file recentrequeststablemodel.cpp.

Referenced by sort().

+ Here is the caller graph for this function:

bool RecentRequestsTableModel::removeRows ( int  row,
int  count,
const QModelIndex &  parent = QModelIndex() 
)

Definition at line 111 of file recentrequeststablemodel.cpp.

References SendCoinsRecipient::address, RecentRequestEntry::id, list, RecentRequestEntry::recipient, WalletModel::saveReceiveRequest(), and walletModel.

Referenced by ReceiveCoinsDialog::on_removeRequestButton_clicked().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int RecentRequestsTableModel::rowCount ( const QModelIndex &  parent) const

Definition at line 32 of file recentrequeststablemodel.cpp.

References list.

bool RecentRequestsTableModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role 
)

Definition at line 87 of file recentrequeststablemodel.cpp.

void RecentRequestsTableModel::sort ( int  column,
Qt::SortOrder  order = Qt::AscendingOrder 
)
slot

Definition at line 182 of file recentrequeststablemodel.cpp.

References index(), list, and NUMBER_OF_COLUMNS.

Referenced by ReceiveCoinsDialog::setModel().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

QStringList RecentRequestsTableModel::columns
private

Definition at line 97 of file recentrequeststablemodel.h.

Referenced by columnCount(), headerData(), and RecentRequestsTableModel().

QList<RecentRequestEntry> RecentRequestsTableModel::list
private

Definition at line 98 of file recentrequeststablemodel.h.

Referenced by addNewRequest(), data(), removeRows(), rowCount(), and sort().

int64_t RecentRequestsTableModel::nReceiveRequestsMaxId
private

Definition at line 99 of file recentrequeststablemodel.h.

Referenced by addNewRequest(), and RecentRequestsTableModel().

WalletModel* RecentRequestsTableModel::walletModel
private

Definition at line 96 of file recentrequeststablemodel.h.

Referenced by addNewRequest(), data(), and removeRows().


The documentation for this class was generated from the following files: