[Qt] Add delay before filtering transactions#11015
[Qt] Add delay before filtering transactions#11015jonasschnelli merged 1 commit intobitcoin:masterfrom
Conversation
promag
left a comment
There was a problem hiding this comment.
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.
Connect to start QTimer::start() slot instead, and configure the interval above.
src/qt/transactionview.cpp
Outdated
There was a problem hiding this comment.
Connect to start QTimer::start() slot instead, and configure the interval above.
src/qt/transactionview.cpp
Outdated
|
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. |
src/qt/transactionview.h
Outdated
src/qt/transactionview.h
Outdated
There was a problem hiding this comment.
The convention is to prefix with m_ in new code.
There was a problem hiding this comment.
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.
@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.
|
Improved as suggested by @promag. |
benma
left a comment
There was a problem hiding this comment.
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.
please use snake_case as per developer notes.
There was a problem hiding this comment.
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.
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.
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.
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.
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.
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.
There is no need to have these here..
|
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.
For reference https://wiki.qt.io/Delay_action_to_wait_for_user_interaction.
src/qt/transactionview.cpp
Outdated
There was a problem hiding this comment.
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.
Missing space after if. Move below { to this line.
src/qt/transactionview.h
Outdated
src/qt/transactionview.h
Outdated
src/qt/transactionview.h
Outdated
There was a problem hiding this comment.
Agree, all is done in this PR context.
src/qt/transactionview.h
Outdated
There was a problem hiding this comment.
Nit, I would sort the slots.
src/qt/transactionview.cpp
Outdated
There was a problem hiding this comment.
Nit, change to QTimer* amount_typing_delay = new QTimer(this);
src/qt/transactionview.cpp
Outdated
There was a problem hiding this comment.
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.
nit: comment (before before)
|
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.