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

EMSUSD-1519 refactor collection UI #4053

Merged
merged 3 commits into from
Dec 20, 2024

Conversation

pierrebai-adsk
Copy link
Collaborator

Separate data from UI:

  • Add data and usdData modules.
  • Add collectionData and stringData to the data module as abstract interface to read and modify collection data.
  • Add usdCollectionData and usdCollectionStringListData to usdData, for USD implementation.
  • This also avoids business logic referring to UI labels and such.
  • This also automatically updates the data source for the UI since the model is the data source.
  • Allow setting the collection on the usdCollectionData.
  • Fix the default value for the include-all flag.
  • Still need to derive a Maya implementation to host picking and undo/redo.
  • Make all UI use the collectionData and stringListData classes to hold and modify data instead of having business logic in UI.

Refactor UI code:

  • Rename list.py to stringListPanel.py to avoid clashing with Python's list type.
  • Removed all update and updateUI functions and flags and listen to dataChanged signals instead.
  • Moved drag-and-drop event filter to string list view.
  • Don't stop adding dropped item just because one is invalid.
  • Move dropped item conversion and validation to the data class.

Small UI fixes:

  • Fix selection mode of list views.
  • Fixed issues with the check box callback getting the wrong state.
  • Add include-all checkbox tooltip.
  • Made the color and font size for the filtered list view come from the Theme.
  • Removed place holder label and use paint event instead to both paint "no object found" and "drop stuff here".

Separate data from UI:
- Add data and usdData modules.
- Add collectionData and stringData to the data module as abstract interface to read and modify collection data.
- Add usdCollectionData and usdCollectionStringListData to usdData, for USD implementation.
- This also avoids business logic referring to UI labels and such.
- This also automatically updates the data source for teh Ui since the model is the data source.
- Allow setting the collection on the usdCollectionData.
- Fix the default value for the include-all flag.
- Still need to derive a Maya implementation to host picking and undo/redo.
- Make all UI use the collectionData and stringListData classes to hold and modify data instead of having business logic in UI.

Refactor UI code:
- Rename list.py to stringListPanel.py to avoid clashing with Python's list type.
- Removed all update and updateUI functions and flags and listen to dataChanged signals instead.
- Moved drag-and-drop event filter to string list view.
- Don't stop adding dropped item just because one is invalid.
- Move dropped item conversion and validation to the data class.

Small UI fixes:
- Fix selection mode of list views.
- Fixed issues with the check box callback getting the wrong state.
- Add include-all checkbox tooltip.
- Made the color and font size for the filtered list view come from the Theme.
- Removed place holder label and use paint event instead to both paint "no object found" and "drop stuff here".
@pierrebai-adsk pierrebai-adsk marked this pull request as ready for review December 17, 2024 22:32
@pierrebai-adsk pierrebai-adsk self-assigned this Dec 17, 2024
Copy link
Collaborator

@haberlu haberlu left a comment

Choose a reason for hiding this comment

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

Adding some comments.

- Add check for colelction and prim in data class to help integration in USdView.
- Remove picking from data, leaving it in the Host class.
- Change constants to be all-uppercase.
- Don't increase the place-holder text size.
- Add comments in __init__.py files.
- Make USD stage accessible in teh data classes, to allow picking by Host.
@pierrebai-adsk pierrebai-adsk removed their assignment Dec 19, 2024
@pierrebai-adsk pierrebai-adsk added the shared_components Shared Components (Max / Maya) label Dec 19, 2024
@pierrebai-adsk pierrebai-adsk self-assigned this Dec 19, 2024
barbalt
barbalt previously approved these changes Dec 19, 2024
- Make more labels into constants. (Needed to find the QAction.)
Comment on lines +117 to +121
def _paintPlaceHolder(self, placeHolderText):
painter = QPainter(self.viewport())
theme = Theme.instance()
painter.setPen(theme.palette.colorPlaceHolderText)
painter.drawText(self.rect(), Qt.AlignCenter, placeHolderText)
Copy link
Collaborator

Choose a reason for hiding this comment

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

could be moved inside the paintEvent() override - to avoid being accidentally called outside the paintEvent - what must not be done in Qt.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

True even if unlikely. I will move it in a subsequent PR that is based on this one. (Not another refactor one :) )

@pierrebai-adsk pierrebai-adsk added ready-for-merge Development process is finished, PR is ready for merge and removed ready-for-merge Development process is finished, PR is ready for merge labels Dec 20, 2024
@seando-adsk seando-adsk merged commit 31b0893 into dev Dec 20, 2024
11 checks passed
@seando-adsk seando-adsk deleted the bailp/EMSUSD-1519/split-UI-and-data branch December 20, 2024 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge Development process is finished, PR is ready for merge shared_components Shared Components (Max / Maya)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants