Skip to content

Conversation

@lclc
Copy link

@lclc lclc commented Aug 9, 2017

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.

@fanquake fanquake added the GUI label Aug 9, 2017
Copy link
Contributor

@promag promag left a 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?

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be removed.

@promag
Copy link
Contributor

promag commented Aug 9, 2017

Nit, reword commit and PR title to qt: Add delay before filtering transactions?

@jonasschnelli
Copy link
Contributor

Concept ACK

@lclc lclc changed the title [Qt] Search TX: Add delay before filtering [Qt] Add delay before filtering transactions Aug 9, 2017
@lclc
Copy link
Author

lclc commented Aug 9, 2017

Thanks a lot for the fast review and suggestions for improvement @promag. I've updated the commit accordingly.

Should the interval be configurable?

I don't think many people want to change that. If we see 200ms is not optimal we can still change it later.
Adding this as a config flag option would probably mostly add code that nobody uses in the end - but if more people think it's a good idea I can implement it.

@sipa
Copy link
Member

sipa commented Aug 9, 2017

Don't make things configurable if there is no advice for what to set it to.

Copy link
Contributor

@promag promag left a 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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move to .cpp?

Copy link
Contributor

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.

Copy link
Author

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.

Copy link
Contributor

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.

Copy link
Author

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.

@lclc
Copy link
Author

lclc commented Aug 9, 2017

Improved as suggested by @promag.

Copy link

@benma benma left a 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.

Copy link

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.

Copy link
Contributor

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.

Copy link
Member

@sipa sipa Aug 10, 2017

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.

Copy link
Contributor

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.

Copy link

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?

Copy link
Author

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.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Contributor

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.

@laanwj
Copy link
Member

laanwj commented Aug 10, 2017

Concept ACK, thanks!

Don't make things configurable if there is no advice for what to set it to.

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.

@lclc
Copy link
Author

lclc commented Aug 10, 2017

Thanks a lot for clarifying, review and testing @benma. I changed the commit according to the developer notes.

@benma
Copy link

benma commented Aug 10, 2017

ACK 6d073a2d1c85ecc523d13c5f47514daa5de4757c

Copy link
Contributor

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..

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove.

@promag
Copy link
Contributor

promag commented Aug 18, 2017

utACK 6d073a2.

@jonasschnelli
Copy link
Contributor

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)?.
Maybe @promag can do a test?

@promag
Copy link
Contributor

promag commented Aug 18, 2017

@jonasschnelli yes start() resets.

Copy link
Contributor

@promag promag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

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);

Copy link
Contributor

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 // ....

@jonasschnelli
Copy link
Contributor

@lclc, could you address @promag's points? I'd like to get this in soon.

@lclc
Copy link
Author

lclc commented Sep 11, 2017 via email

@lclc lclc force-pushed the searchDelay branch 3 times, most recently from 47145f6 to a82976d Compare September 12, 2017 17:22
@lclc
Copy link
Author

lclc commented Sep 12, 2017

Updated.

Thanks for the reviews @promag - this version is now quite a bit simpler and cleaner by now than the first one :)

@promag
Copy link
Contributor

promag commented Sep 12, 2017

utACK a82976d. Will test in a couple of hours.

@promag
Copy link
Contributor

promag commented Sep 12, 2017

Tested ACK a82976d.

@flack
Copy link
Contributor

flack commented Sep 15, 2017

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?

@promag
Copy link
Contributor

promag commented Sep 15, 2017

@jonasschnelli
Copy link
Contributor

Tested ACK a82976d96009680ab61bcea763f15c7594b9afb0

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: comment (before before)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, fixed.

@promag
Copy link
Contributor

promag commented Sep 26, 2017

Tested ACK 7b137ac.

@jonasschnelli jonasschnelli merged commit 7b137ac into bitcoin:master Sep 26, 2017
jonasschnelli added a commit that referenced this pull request Sep 26, 2017
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
maflcko pushed a commit to maflcko/bitcoin-core that referenced this pull request Oct 3, 2017
jasonbcox pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Aug 16, 2019
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
codablock pushed a commit to codablock/dash that referenced this pull request Sep 25, 2019
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
jonspock pushed a commit to jonspock/devault that referenced this pull request Dec 8, 2019
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
jonspock pushed a commit to jonspock/devault that referenced this pull request Dec 8, 2019
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
proteanx pushed a commit to devaultcrypto/devault that referenced this pull request Dec 12, 2019
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
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants