-
Notifications
You must be signed in to change notification settings - Fork 41
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
2389: Validate text/int/float inputs within the preferences panel #2476
Conversation
…is valid. If so, stage the change, otherwise, unstage any previous changes (to eliminate unwanted intermediate values)
This needs to wait for the pyside merge which will require some more changes. |
@krzywon to look at it again |
This should be ready for review now |
@rozyczko to look at it |
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 code looks good, minor questions raised to address outside the scope of this review.
Functionality:
- leaving a textbox in yellow state stil allows Apply and OK. Clicking either button updates the staging stack with the incorrect value
Additionally, I am getting failures on clicking "Accept" on the Preferences panel. This seems to be a leftover from merging the PySide6 branch into main. We might as well create a separate ticket for this.
09:02:11 - sas.qtgui.Perspectives.Fitting.FittingWidget - ERROR - Traceback (most recent call last):
File "D:\projects\sasview\src\sas\qtgui\Utilities\Preferences\PreferencesPanel.py", line 100, in _okClicked
self._saveStagedChanges()
File "D:\projects\sasview\src\sas\qtgui\Utilities\Preferences\PreferencesPanel.py", line 106, in _saveStagedChanges
self.stackedWidget.widget(i).applyNonConfigValues()
File "D:\projects\sasview\src\sas\qtgui\Perspectives\Fitting\FittingOptions.py", line 177, in applyNonConfigValues
color = line_edit.palette().color(QtGui.QPalette.Background).name()
AttributeError: type object 'PySide6.QtGui.QPalette' has no attribute 'Background'
Also, the Default Fit Algorithm combobox is squashed.
…ns when any inputs are invalid or when no changes are staged
… value was changed back to the original value before accepting it
I went ahead and covered all of your suggestions here. They are all related to validation and made the system better |
Thanks! The code and widgets look good now. The functionality is almost there.
|
…e state, regardless of the number of changes made by the user
@rozyczko to check |
There are still some minor glitches but we need this functionality. |
Description
A validator method was added to the preferences widget to check that text input boxes are valid before staging any changes. If the value becomes invalid, any previously staged value for that input is removed.
Fixes #2389
Fixes #2521
How Has This Been Tested?
New (but minimal) unit tests and locally running the GUI to ensure invalid entries are not stored in the config.
Review Checklist (please remove items if they don't apply):