20 std::vector<std::string> vReceiveRequests;
22 BOOST_FOREACH(
const std::string& request, vReceiveRequests)
52 if(!index.isValid() || index.row() >=
list.length())
57 if(role == Qt::DisplayRole || role == Qt::EditRole)
59 switch(index.column())
66 return tr(
"(no label)");
75 return tr(
"(no message)");
83 return tr(
"(no amount)");
98 if(orientation == Qt::Horizontal)
100 if(role == Qt::DisplayRole && section <
columns.size())
118 QString amountTitle = tr(
"Amount");
130 return createIndex(row, column);
137 if(count > 0 && row >= 0 && (row+count) <=
list.size())
140 for (
int i = 0; i < count; ++i)
147 beginRemoveRows(parent, row, row + count - 1);
148 list.erase(
list.begin() + row,
list.begin() + row + count);
158 return Qt::ItemIsSelectable | Qt::ItemIsEnabled;
166 newEntry.
date = QDateTime::currentDateTime();
181 std::vector<char>
data(recipient.begin(), recipient.end());
199 beginInsertRows(QModelIndex(), 0, 0);
200 list.prepend(recipient);
219 if (
order == Qt::DescendingOrder)
220 std::swap(pLeft, pRight);
225 return pLeft->
date.toTime_t() < pRight->
date.toTime_t();
233 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 QString name(int unit)
Short name.
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
static QString format(int unit, qint64 amount, bool plussign=false)
Format as string.
QList< RecentRequestEntry > list
int rowCount(const QModelIndex &parent) const
SendCoinsRecipient recipient
bool operator()(RecentRequestEntry &left, RecentRequestEntry &right) const
WalletModel * walletModel
Interface to Anoncoin wallet from Qt view code.
void updateAmountColumnTitle()
Updates the column title to "Amount (DisplayUnit)" and emits headerDataChanged() signal for table hea...
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)
QString getAmountTitle()
Gets title for amount column including current display unit if optionsModel reference available...
OptionsModel * getOptionsModel()