18 std::vector<std::string> vReceiveRequests;
20 BOOST_FOREACH(
const std::string& request, vReceiveRequests)
24 columns << tr(
"Date") << tr(
"Label") << tr(
"Message") << tr(
"Amount");
48 if(!index.isValid() || index.row() >=
list.length())
53 if(role == Qt::DisplayRole || role == Qt::EditRole)
55 switch(index.column())
62 return tr(
"(no label)");
71 return tr(
"(no message)");
79 return tr(
"(no amount)");
94 if(orientation == Qt::Horizontal)
96 if(role == Qt::DisplayRole && section <
columns.size())
108 return createIndex(row, column);
115 if(count > 0 && row >= 0 && (row+count) <=
list.size())
118 for (
int i = 0; i < count; ++i)
125 beginRemoveRows(parent, row, row + count - 1);
126 list.erase(
list.begin() + row,
list.begin() + row + count);
136 return Qt::ItemIsSelectable | Qt::ItemIsEnabled;
144 newEntry.
date = QDateTime::currentDateTime();
159 std::vector<char>
data(recipient.begin(), recipient.end());
177 beginInsertRows(QModelIndex(), 0, 0);
178 list.prepend(recipient);
192 if (
order == Qt::DescendingOrder)
193 std::swap(pLeft, pRight);
198 return pLeft->
date.toTime_t() < pRight->
date.toTime_t();
206 return pLeft->
id < pRight->
id;
void loadReceiveRequests(std::vector< std::string > &vReceiveRequests)
bool setData(const QModelIndex &index, const QVariant &value, int role)
void addNewRequest(const SendCoinsRecipient &recipient)
void sort(int column, Qt::SortOrder order=Qt::AscendingOrder)
int64_t nReceiveRequestsMaxId
QModelIndex index(int row, int column, const QModelIndex &parent) const
~RecentRequestsTableModel()
bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex())
static const int CLIENT_VERSION
QString dateTimeStr(const QDateTime &date)
Double ended buffer combining vector and stream-like interfaces.
RecentRequestsTableModel(CWallet *wallet, WalletModel *parent)
const RecentRequestEntry & entry(int row) const
Qt::ItemFlags flags(const QModelIndex &index) const
QVariant data(const QModelIndex &index, int role) const
QList< RecentRequestEntry > list
int rowCount(const QModelIndex &parent) const
SendCoinsRecipient recipient
bool operator()(RecentRequestEntry &left, RecentRequestEntry &right) const
WalletModel * walletModel
Interface to Bitcoin wallet from Qt view code.
QVariant headerData(int section, Qt::Orientation orientation, int role) const
A CWallet is an extension of a keystore, which also maintains a set of transactions and balances...
int columnCount(const QModelIndex &parent) const
bool saveReceiveRequest(const std::string &sAddress, const int64_t nId, const std::string &sRequest)
static QString format(int unit, qint64 amount, bool plussign=false)
Format as string.
OptionsModel * getOptionsModel()