mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
[Qt] Add column Watch-only to transactions list
This commit is contained in:
@@ -22,6 +22,7 @@ TransactionFilterProxy::TransactionFilterProxy(QObject *parent) :
|
||||
dateTo(MAX_DATE),
|
||||
addrPrefix(),
|
||||
typeFilter(ALL_TYPES),
|
||||
watchOnlyFilter(WatchOnlyFilter_All),
|
||||
minAmount(0),
|
||||
limitRows(-1),
|
||||
showInactive(true)
|
||||
@@ -34,6 +35,7 @@ bool TransactionFilterProxy::filterAcceptsRow(int sourceRow, const QModelIndex &
|
||||
|
||||
int type = index.data(TransactionTableModel::TypeRole).toInt();
|
||||
QDateTime datetime = index.data(TransactionTableModel::DateRole).toDateTime();
|
||||
bool involvesWatchAddress = index.data(TransactionTableModel::WatchonlyRole).toBool();
|
||||
QString address = index.data(TransactionTableModel::AddressRole).toString();
|
||||
QString label = index.data(TransactionTableModel::LabelRole).toString();
|
||||
qint64 amount = llabs(index.data(TransactionTableModel::AmountRole).toLongLong());
|
||||
@@ -43,6 +45,10 @@ bool TransactionFilterProxy::filterAcceptsRow(int sourceRow, const QModelIndex &
|
||||
return false;
|
||||
if(!(TYPE(type) & typeFilter))
|
||||
return false;
|
||||
if (involvesWatchAddress && watchOnlyFilter == WatchOnlyFilter_No)
|
||||
return false;
|
||||
if (!involvesWatchAddress && watchOnlyFilter == WatchOnlyFilter_Yes)
|
||||
return false;
|
||||
if(datetime < dateFrom || datetime > dateTo)
|
||||
return false;
|
||||
if (!address.contains(addrPrefix, Qt::CaseInsensitive) && !label.contains(addrPrefix, Qt::CaseInsensitive))
|
||||
@@ -78,6 +84,12 @@ void TransactionFilterProxy::setMinAmount(qint64 minimum)
|
||||
invalidateFilter();
|
||||
}
|
||||
|
||||
void TransactionFilterProxy::setWatchOnlyFilter(WatchOnlyFilter filter)
|
||||
{
|
||||
this->watchOnlyFilter = filter;
|
||||
invalidateFilter();
|
||||
}
|
||||
|
||||
void TransactionFilterProxy::setLimit(int limit)
|
||||
{
|
||||
this->limitRows = limit;
|
||||
|
||||
Reference in New Issue
Block a user