-
Notifications
You must be signed in to change notification settings - Fork 38.7k
[Qt] Add delay before filtering transactions #11015
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
Conversation
promag
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the interval be configurable? At least it's duplicated so have a const variable?
src/qt/transactionview.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Connect to start QTimer::start() slot instead, and configure the interval above.
src/qt/transactionview.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Connect to start QTimer::start() slot instead, and configure the interval above.
src/qt/transactionview.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be removed.
|
Nit, reword commit and PR title to |
|
Concept ACK |
|
Thanks a lot for the fast review and suggestions for improvement @promag. I've updated the commit accordingly.
I don't think many people want to change that. If we see 200ms is not optimal we can still change it later. |
|
Don't make things configurable if there is no advice for what to set it to. |
promag
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with @sipa. A variable is enough to add meaning to the duration.
src/qt/transactionview.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to .cpp?
src/qt/transactionview.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The convention is to prefix with m_ in new code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also like the m_ convention but I don't see it in any of the other Qt code.
Is the plan to slowly change to m_ over time or maybe take the effort to change (part of) the full source code at ones? Two different styles in the same file is not so nice I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lclc unfortunately there's mixed styles all over the place. Last time that was discussed, that I know of, is to use the defined convention in new or "touched" code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thanks. I'll update.
|
Improved as suggested by @promag. |
benma
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 0587d2e36a0a64535e8d296fb97fcb7a258637fe
I tested that the issue existed and that this PR fixes it.
src/qt/transactionview.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use snake_case as per developer notes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To also drop my opinion here (though I don't care): Use the scheme of the surrounding code to not confuse new developers. New classes or complete rewrites may be different.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the developer notes:
When writing patches, favor the new style over attempting to mimick the surrounding style, except for move-only commits.
and about symbol naming:
These are preferred in new code, but are not required when doing so would need changes to significant pieces of existing code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm.. I see. My advice is against the developer notes then. It just looked confusing to have two single instance variables with sneak case where the rest is without m_ and camel case. But I guess we have to start somewhere to adopt the style rules.
src/qt/transactionview.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be moved to the private Q_SLOTS section. All the others can as well, mabye in a separate commit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I plan to look at Q_SLOTS in general in a separate PR. There are a few other cases in different files where some slots are public that wouldn't need to be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, all is done in this PR context.
|
Concept ACK, thanks!
Indeed, just make a choice, there's no use in making this configurable. No one will bother and it will just add more things to test. |
|
Thanks a lot for clarifying, review and testing @benma. I changed the commit according to the developer notes. |
|
ACK 6d073a2d1c85ecc523d13c5f47514daa5de4757c |
src/qt/transactionview.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need to have these here..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove.
|
utACK 6d073a2. |
|
I couldn't really test this (all the machines where to fast). The delay seems very short (with 200ms). Will the timer be reset when entering the next char <200ms (I think so otherwise this would not work)?. |
|
@jonasschnelli yes start() resets. |
promag
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/qt/transactionview.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use snake case. Comment to indicate unit?
FWIW there is this global constant cc @sipa.
src/qt/transactionview.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after if. Move below { to this line.
src/qt/transactionview.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove.
src/qt/transactionview.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
src/qt/transactionview.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, all is done in this PR context.
src/qt/transactionview.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit, I would sort the slots.
src/qt/transactionview.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit, change to QTimer* amount_typing_delay = new QTimer(this);
src/qt/transactionview.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments is this file are // ....
|
I'll do it on Tuesday night.
Am 07.09.2017 17:52 schrieb "Jonas Schnelli" <[email protected]>:
… @lclc <https://github.com/lclc>, could you address @promag
<https://github.com/promag>'s points? I'd like to get this in soon.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#11015 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABwrESCkYZHmbXMwSNGUFJuiEzuXFc7Rks5sgBEigaJpZM4OxrEB>
.
|
47145f6 to
a82976d
Compare
|
Updated. Thanks for the reviews @promag - this version is now quite a bit simpler and cleaner by now than the first one :) |
|
utACK a82976d. Will test in a couple of hours. |
|
Tested ACK a82976d. |
|
If the motivation is to make filtering large data sets easier, why not apply the delay only when the data set is sufficiently large? For other cases, it just reduces responsiveness. Or is the size of the data set not known when the UI is constructed? |
|
200ms is very reasonable. See https://ux.stackexchange.com/a/38545. |
|
Tested ACK a82976d96009680ab61bcea763f15c7594b9afb0 |
src/qt/transactionview.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: comment (before before)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed.
|
Tested ACK 7b137ac. |
7b137ac [Qt] Add delay before filtering transactions Fixes 3141 (Lucas Betschart) Pull request description: As discussed in #3141. This adds a QTimer pause of 200ms before start to filter so it should be possible to filter big data sets easier. Tree-SHA512: ee599367794eac2c5b8bc7ecac47f44295e40c0ff543ff2f2c4860590f917b59b1cfb273fa564e6eb4c44016c0ef412d49f1a8f1b36b07e034022f51bb76653c
Fixes 3141 Github-Pull: bitcoin#11015 Rebased-From: 7b137ac
Summary: 7b137ac [Qt] Add delay before filtering transactions Fixes 3141 (Lucas Betschart) Pull request description: As discussed in bitcoin/bitcoin#3141. This adds a QTimer pause of 200ms before start to filter so it should be possible to filter big data sets easier. Tree-SHA512: ee599367794eac2c5b8bc7ecac47f44295e40c0ff543ff2f2c4860590f917b59b1cfb273fa564e6eb4c44016c0ef412d49f1a8f1b36b07e034022f51bb76653c Backport of Core PR11015 bitcoin/bitcoin#11015 Test Plan: make check ./bitcoin-qt -> transactions -> enter a filter Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc Reviewed By: Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc Differential Revision: https://reviews.bitcoinabc.org/D3832
7b137ac [Qt] Add delay before filtering transactions Fixes 3141 (Lucas Betschart) Pull request description: As discussed in bitcoin#3141. This adds a QTimer pause of 200ms before start to filter so it should be possible to filter big data sets easier. Tree-SHA512: ee599367794eac2c5b8bc7ecac47f44295e40c0ff543ff2f2c4860590f917b59b1cfb273fa564e6eb4c44016c0ef412d49f1a8f1b36b07e034022f51bb76653c
Summary: 7b137aced [Qt] Add delay before filtering transactions Fixes 3141 (Lucas Betschart) Pull request description: As discussed in bitcoin/bitcoin#3141. This adds a QTimer pause of 200ms before start to filter so it should be possible to filter big data sets easier. Tree-SHA512: ee599367794eac2c5b8bc7ecac47f44295e40c0ff543ff2f2c4860590f917b59b1cfb273fa564e6eb4c44016c0ef412d49f1a8f1b36b07e034022f51bb76653c Backport of Core PR11015 bitcoin/bitcoin#11015 Test Plan: make check ./bitcoin-qt -> transactions -> enter a filter Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc Reviewed By: Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc Differential Revision: https://reviews.bitcoinabc.org/D3832
Summary: 7b137aced [Qt] Add delay before filtering transactions Fixes 3141 (Lucas Betschart) Pull request description: As discussed in bitcoin/bitcoin#3141. This adds a QTimer pause of 200ms before start to filter so it should be possible to filter big data sets easier. Tree-SHA512: ee599367794eac2c5b8bc7ecac47f44295e40c0ff543ff2f2c4860590f917b59b1cfb273fa564e6eb4c44016c0ef412d49f1a8f1b36b07e034022f51bb76653c Backport of Core PR11015 bitcoin/bitcoin#11015 Test Plan: make check ./bitcoin-qt -> transactions -> enter a filter Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc Reviewed By: Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc Differential Revision: https://reviews.bitcoinabc.org/D3832
Summary: 7b137aced [Qt] Add delay before filtering transactions Fixes 3141 (Lucas Betschart) Pull request description: As discussed in bitcoin/bitcoin#3141. This adds a QTimer pause of 200ms before start to filter so it should be possible to filter big data sets easier. Tree-SHA512: ee599367794eac2c5b8bc7ecac47f44295e40c0ff543ff2f2c4860590f917b59b1cfb273fa564e6eb4c44016c0ef412d49f1a8f1b36b07e034022f51bb76653c Backport of Core PR11015 bitcoin/bitcoin#11015 Test Plan: make check ./bitcoin-qt -> transactions -> enter a filter Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc Reviewed By: Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc Differential Revision: https://reviews.bitcoinabc.org/D3832
As discussed in #3141.
This adds a QTimer pause of 200ms before start to filter so it should be possible to filter big data sets easier.