-
Notifications
You must be signed in to change notification settings - Fork 124
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
Extracted Logic in Pairing Table View to Presenter #38213
base: main
Are you sure you want to change the base?
Conversation
- Updated Failing Tests - Created Getters for Properties in PairingTableView so the properties are accesed through the getters in the PairingTablePresenter
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 for the effort on moving the logic out of the view class. I know this view is not easy to refactor ! Generally the view seems more neat and decluttered, although I have found some moved functions that maybe belong in the view, and we could subscribe the presenter to the view to avoid connecting signals/slots on the presenter and use notifiers instead to call the relevant functions on the presenter.
Also, when testing I have found this error when i click on Load current run
:
...es/mantidqtinterfaces/Muon/GUI/Common/pairing_table_widget/pairing_table_widget_presenter.py
Outdated
Show resolved
Hide resolved
...es/mantidqtinterfaces/Muon/GUI/Common/pairing_table_widget/pairing_table_widget_presenter.py
Show resolved
Hide resolved
...nterfaces/mantidqtinterfaces/Muon/GUI/Common/pairing_table_widget/pairing_table_constants.py
Outdated
Show resolved
Hide resolved
dfab969
to
9974af2
Compare
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.
Except for a typo that is creating a runtime error, I have followed the manual testing instructions without any functional issue on the pair table widget. Thanks for the good work on this refactoring.
I have added some additional comments on small things that I've noticed during review.
...nterfaces/mantidqtinterfaces/Muon/GUI/Common/pairing_table_widget/pairing_table_constants.py
Outdated
Show resolved
Hide resolved
...es/mantidqtinterfaces/Muon/GUI/Common/pairing_table_widget/pairing_table_widget_presenter.py
Outdated
Show resolved
Hide resolved
...es/mantidqtinterfaces/Muon/GUI/Common/pairing_table_widget/pairing_table_widget_presenter.py
Show resolved
Hide resolved
...es/mantidqtinterfaces/Muon/GUI/Common/pairing_table_widget/pairing_table_widget_presenter.py
Outdated
Show resolved
Hide resolved
...erfaces/mantidqtinterfaces/Muon/GUI/Common/pairing_table_widget/pairing_table_widget_view.py
Outdated
Show resolved
Hide resolved
qt/python/mantidqtinterfaces/test/Muon/grouping_tab/pairing_table_group_selector_test.py
Outdated
Show resolved
Hide resolved
qt/python/mantidqtinterfaces/test/Muon/grouping_tab/pairing_table_group_selector_test.py
Outdated
Show resolved
Hide resolved
…nd Presenter - created a getter for model._context so the property can be accessed using the getter - remove pairing table constants
Code has been updated to fix an issue on the pairing table pointed out by @adriazalvarez, Thanks. |
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 for the latest changes Yusuf.
I have been testing the pairing table again, everything works as expected.
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 forgot to approve 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.
Just noticed a couple more improvements that could be made while we're editing these files.
...es/mantidqtinterfaces/Muon/GUI/Common/pairing_table_widget/pairing_table_widget_presenter.py
Outdated
Show resolved
Hide resolved
|
||
def enable_updates(self): | ||
"""Allow update signals to be sent.""" | ||
self._view.set_is_updating(False) |
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.
Is there a reason this call seems to be backwards?
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.
@adriazalvarez what do you think about this, do you think the function should be renamed?
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.
Yes, probably the naming is confusing in this case, although I see how it is name as it is, as the function really means enable signals, and is_updating
is a flag to not process view signals. Perhaps a clearer name could be unblock_update_signals
and block_update_signals
for disable_updates
.
What do you think, @cailafinn ?
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 think the best way would be to rename the functions in the view to be disable_updates
and enable_updates
. is_updating
and the term signals
are implementation details of the view and Qt, so ideally should not be used as terms in the view's public-facing API.
Description of work
Fixes #38105
To test:
This does not require release notes because it involves code restructuring, no new functionality has been added