New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt: Enable searching by transaction id #11395

Merged
merged 3 commits into from Nov 29, 2017

Conversation

Projects
None yet
6 participants
@luke-jr
Member

luke-jr commented Sep 25, 2017

No description provided.

@fanquake fanquake added the GUI label Sep 25, 2017

@MeshCollider

utACK 3b35414

nit: use snake_case since you are refactoring the variable names anyway

Show outdated Hide outdated src/qt/transactionfilterproxy.cpp Outdated
Show outdated Hide outdated src/qt/transactionfilterproxy.cpp Outdated
Show outdated Hide outdated src/qt/transactionfilterproxy.cpp Outdated
Show outdated Hide outdated src/qt/transactionfilterproxy.cpp Outdated
Show outdated Hide outdated src/qt/transactionfilterproxy.cpp Outdated
Show outdated Hide outdated src/qt/transactionview.cpp Outdated
Show outdated Hide outdated src/qt/transactionview.cpp Outdated
Show outdated Hide outdated src/qt/transactionfilterproxy.cpp Outdated
@@ -51,8 +52,11 @@ bool TransactionFilterProxy::filterAcceptsRow(int sourceRow, const QModelIndex &
return false;
if(datetime < dateFrom || datetime > dateTo)
return false;
if (!address.contains(addrPrefix, Qt::CaseInsensitive) && !label.contains(addrPrefix, Qt::CaseInsensitive))
if (!address.contains(m_search_string, Qt::CaseInsensitive) &&
! label.contains(m_search_string, Qt::CaseInsensitive) &&

This comment has been minimized.

@promag

promag Sep 25, 2017

Member

clang-format will remove these whitespaces.

@promag

promag Sep 25, 2017

Member

clang-format will remove these whitespaces.

This comment has been minimized.

@luke-jr

luke-jr Sep 26, 2017

Member

I consider this a shortcoming of clang-format, then. I don't consider the remaining nits as things that should be changed.

@luke-jr

luke-jr Sep 26, 2017

Member

I consider this a shortcoming of clang-format, then. I don't consider the remaining nits as things that should be changed.

@@ -66,9 +66,9 @@ void TransactionFilterProxy::setDateRange(const QDateTime &from, const QDateTime
invalidateFilter();
}
void TransactionFilterProxy::setAddressPrefix(const QString &_addrPrefix)
void TransactionFilterProxy::setSearchString(const QString &search_string)

This comment has been minimized.

@promag

promag Sep 25, 2017

Member

const QString& search_string.

@promag

promag Sep 25, 2017

Member

const QString& search_string.

@@ -35,7 +35,7 @@ class TransactionFilterProxy : public QSortFilterProxyModel
};
void setDateRange(const QDateTime &from, const QDateTime &to);
void setAddressPrefix(const QString &addrPrefix);
void setSearchString(const QString &);

This comment has been minimized.

@promag

promag Sep 25, 2017

Member

const QString&.

@promag

promag Sep 25, 2017

Member

const QString&.

This comment has been minimized.

@MeshCollider

MeshCollider Nov 13, 2017

Member

Nit: I prefer having the variable names in the header (all others in this header do too). Unsure if there's a general preference though

@MeshCollider

MeshCollider Nov 13, 2017

Member

Nit: I prefer having the variable names in the header (all others in this header do too). Unsure if there's a general preference though

Show outdated Hide outdated src/qt/transactionview.cpp Outdated
@@ -66,7 +66,7 @@ class TransactionView : public QWidget
QComboBox *dateWidget;
QComboBox *typeWidget;
QComboBox *watchOnlyWidget;
QLineEdit *addressWidget;
QLineEdit *search_widget;

This comment has been minimized.

@promag

promag Sep 25, 2017

Member

Nit, QLineEdit* m_search_widget.

@promag

promag Sep 25, 2017

Member

Nit, QLineEdit* m_search_widget.

Show outdated Hide outdated src/qt/transactionview.h Outdated
@@ -51,8 +52,11 @@ bool TransactionFilterProxy::filterAcceptsRow(int sourceRow, const QModelIndex &
return false;
if(datetime < dateFrom || datetime > dateTo)
return false;
if (!address.contains(addrPrefix, Qt::CaseInsensitive) && !label.contains(addrPrefix, Qt::CaseInsensitive))
if (!address.contains(m_search_string, Qt::CaseInsensitive) &&

This comment has been minimized.

@promag

promag Sep 25, 2017

Member

BTW, back to if (!m_search_string.isEmpty()) { ... }, it can also save querying the model for those properties:

if (!m_search_string_lowered_case.isEmpty()) {
    QString address = ...toLowerCase();
    ...
    return ...;

}
@promag

promag Sep 25, 2017

Member

BTW, back to if (!m_search_string.isEmpty()) { ... }, it can also save querying the model for those properties:

if (!m_search_string_lowered_case.isEmpty()) {
    QString address = ...toLowerCase();
    ...
    return ...;

}

This comment has been minimized.

@luke-jr

luke-jr Sep 26, 2017

Member

Sounds like more complication for little value.

@luke-jr

luke-jr Sep 26, 2017

Member

Sounds like more complication for little value.

This comment has been minimized.

@promag

promag Sep 26, 2017

Member

Probably, maybe @lclc can bench the change in #11015 for his use case.

@promag

promag Sep 26, 2017

Member

Probably, maybe @lclc can bench the change in #11015 for his use case.

@promag

This comment has been minimized.

Show comment
Hide comment
@promag

promag Sep 26, 2017

Member

I don't consider the remaining nits as things that should be changed.

These aren't significant changes so why not comply with developer notes?

Member

promag commented Sep 26, 2017

I don't consider the remaining nits as things that should be changed.

These aren't significant changes so why not comply with developer notes?

@luke-jr

This comment has been minimized.

Show comment
Hide comment
@luke-jr

luke-jr Sep 26, 2017

Member

The developer notes don't say anything about which side * and & should hug, or the rest. Nitpicking such minor details seems like just a waste of time.

Member

luke-jr commented Sep 26, 2017

The developer notes don't say anything about which side * and & should hug, or the rest. Nitpicking such minor details seems like just a waste of time.

@jonasschnelli

This comment has been minimized.

Show comment
Hide comment
@jonasschnelli

jonasschnelli Sep 26, 2017

Member

Concept ACK (haven't looked at the code so far).

Member

jonasschnelli commented Sep 26, 2017

Concept ACK (haven't looked at the code so far).

@promag

This comment has been minimized.

Show comment
Hide comment
@promag

promag Oct 7, 2017

Member

Needs rebase.

Member

promag commented Oct 7, 2017

Needs rebase.

@Sjors

This comment has been minimized.

Show comment
Hide comment
@Sjors

Sjors Nov 9, 2017

Member

Concept ACK. It's a bit strange to search for a field that's not visible in the table. Adding (part of) the transaction hash as a column would be more consistent, but obviously a bigger change and perhaps a waste of horizontal space. However that could all be added later.

It works for me:
schermafbeelding 2017-11-09 om 14 40 31

Member

Sjors commented Nov 9, 2017

Concept ACK. It's a bit strange to search for a field that's not visible in the table. Adding (part of) the transaction hash as a column would be more consistent, but obviously a bigger change and perhaps a waste of horizontal space. However that could all be added later.

It works for me:
schermafbeelding 2017-11-09 om 14 40 31

@promag

This comment has been minimized.

Show comment
Hide comment
@promag

promag Nov 9, 2017

Member

@luke-jr ping.

Member

promag commented Nov 9, 2017

@luke-jr ping.

@promag

This comment has been minimized.

Show comment
Hide comment
@promag

promag Nov 9, 2017

Member

It's a bit strange to search for a field that's not visible in the table

It is also strange to not have the txid in the "Transactions" view. 🙄 Agree it can be improved later.

Member

promag commented Nov 9, 2017

It's a bit strange to search for a field that's not visible in the table

It is also strange to not have the txid in the "Transactions" view. 🙄 Agree it can be improved later.

@luke-jr

This comment has been minimized.

Show comment
Hide comment
@luke-jr

luke-jr Nov 10, 2017

Member

Rebased

Member

luke-jr commented Nov 10, 2017

Rebased

@promag

This comment has been minimized.

Show comment
Hide comment
@promag

promag Nov 12, 2017

Member

Restarted travis job due to unrelated error.

Member

promag commented Nov 12, 2017

Restarted travis job due to unrelated error.

@promag

This comment has been minimized.

Show comment
Hide comment
@promag

promag Nov 12, 2017

Member

utACK.

Member

promag commented Nov 12, 2017

utACK.

@@ -35,7 +35,7 @@ class TransactionFilterProxy : public QSortFilterProxyModel
};
void setDateRange(const QDateTime &from, const QDateTime &to);
void setAddressPrefix(const QString &addrPrefix);
void setSearchString(const QString &);

This comment has been minimized.

@MeshCollider

MeshCollider Nov 13, 2017

Member

Nit: I prefer having the variable names in the header (all others in this header do too). Unsure if there's a general preference though

@MeshCollider

MeshCollider Nov 13, 2017

Member

Nit: I prefer having the variable names in the header (all others in this header do too). Unsure if there's a general preference though

@jonasschnelli

Tested ACK c407c61

@jonasschnelli jonasschnelli merged commit eac2abc into bitcoin:master Nov 29, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

jonasschnelli added a commit that referenced this pull request Nov 29, 2017

Merge #11395: Qt: Enable searching by transaction id
eac2abc Qt: Enable searching by transaction id (Luke Dashjr)
c407c61 Qt: Avoid invalidating the search filter, when it doesn't really change (Luke Dashjr)
b1f6342 Qt: Rename confusingly-named "address prefix" to "search string" (Luke Dashjr)

Pull request description:

Tree-SHA512: 1c67037d19689fbaff21d15ed7848ac86188e5de34728312e1f9758dada759cab50d913a5bc09e413ecaa3e07557cf253809b95b5637ff79f2e3cf24d86dd3ed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment