Skip to content
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

865: Auto update from spinbox change #879

Merged
merged 15 commits into from
Mar 4, 2021

Conversation

DolicaAkelloEgwel
Copy link
Collaborator

@DolicaAkelloEgwel DolicaAkelloEgwel commented Mar 3, 2021

Issue

Closes #865

Description

Makes the spin box update methods trigger during valueChanged rather than editingFinished. Also moved the disabling/enabling of the preview index spin box to the view as I feel like it belongs there rather than in the presenter.

Testing

None. There currently aren't any tests for the files I added code to.

Acceptance Criteria

Change the spinbox values for the operations and check that the preview updates, and the value only increases once.

Documentation

Changed the release notes.

@DolicaAkelloEgwel DolicaAkelloEgwel changed the title 865 auto update from spinbox change 865: Auto update from spinbox change Mar 3, 2021
@DolicaAkelloEgwel DolicaAkelloEgwel marked this pull request as ready for review March 3, 2021 16:32
Copy link
Collaborator

@samtygier-stfc samtygier-stfc left a comment

Choose a reason for hiding this comment

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

Solves the original problem, but makes it much hard to change the value by typing in a new one.

For example if you open the rebin filter, select the factor box and try to type 0.6. As soon as I press 0, the value changes to 0.00, if I put the cursor after the decimal places and type 6 nothing happens, I guess because there is a limit on the number of positions allowed.

Is it possible to trigger the on_change without resetting it to #,##?

Or if not could a timer be used. So valueChanged starts a 1 second timer, any additional change resets the timer to 1 second, and when the timer finishes it calls _on_change_and_disable.

Copy link
Collaborator

@samtygier-stfc samtygier-stfc left a comment

Choose a reason for hiding this comment

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

Thanks. Works nicely now.

@DolicaAkelloEgwel DolicaAkelloEgwel merged commit 68bdfcb into master Mar 4, 2021
@DolicaAkelloEgwel DolicaAkelloEgwel deleted the 865_auto_update_from_spinbox_change branch March 4, 2021 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Operations auto update not triggered on spinbox changes
2 participants