Skip to content

Commit

Permalink
Qt: Enable searching by transaction id
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-jr committed Nov 10, 2017
1 parent c407c61 commit eac2abc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/qt/transactionfilterproxy.cpp
Expand Up @@ -38,6 +38,7 @@ bool TransactionFilterProxy::filterAcceptsRow(int sourceRow, const QModelIndex &
bool involvesWatchAddress = index.data(TransactionTableModel::WatchonlyRole).toBool();
QString address = index.data(TransactionTableModel::AddressRole).toString();
QString label = index.data(TransactionTableModel::LabelRole).toString();
QString txid = index.data(TransactionTableModel::TxIDRole).toString();
qint64 amount = llabs(index.data(TransactionTableModel::AmountRole).toLongLong());
int status = index.data(TransactionTableModel::StatusRole).toInt();

Expand All @@ -51,8 +52,11 @@ bool TransactionFilterProxy::filterAcceptsRow(int sourceRow, const QModelIndex &
return false;
if(datetime < dateFrom || datetime > dateTo)
return false;
if (!address.contains(m_search_string, Qt::CaseInsensitive) && !label.contains(m_search_string, Qt::CaseInsensitive))
if (!address.contains(m_search_string, Qt::CaseInsensitive) &&
! label.contains(m_search_string, Qt::CaseInsensitive) &&
! txid.contains(m_search_string, Qt::CaseInsensitive)) {
return false;
}
if(amount < minAmount)
return false;

Expand Down
2 changes: 1 addition & 1 deletion src/qt/transactionview.cpp
Expand Up @@ -97,7 +97,7 @@ TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *pa

search_widget = new QLineEdit(this);
#if QT_VERSION >= 0x040700
search_widget->setPlaceholderText(tr("Enter address or label to search"));
search_widget->setPlaceholderText(tr("Enter address, transaction id, or label to search"));
#endif
hlayout->addWidget(search_widget);

Expand Down

0 comments on commit eac2abc

Please sign in to comment.