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

Improve part list #518

Closed
Bouni opened this issue Aug 6, 2024 · 6 comments · Fixed by #519
Closed

Improve part list #518

Bouni opened this issue Aug 6, 2024 · 6 comments · Fixed by #519
Labels
enhancement New feature or request feature request A new feature is requested

Comments

@Bouni
Copy link
Owner

Bouni commented Aug 6, 2024

I wanted for a long time to replace the part list with something that lets me add, change or delete entries without having to re-populate the entire list every time a change is made.

I think the way to go is using a DataViewCtrl in combination with a PyDataViewModel.

That also allows to sort the columns using anatural sort algorithm without having the database to do the sorting.

@Bouni Bouni added enhancement New feature or request feature request A new feature is requested labels Aug 6, 2024
@Bouni
Copy link
Owner Author

Bouni commented Aug 6, 2024

I'm currently working on a POC but that takes some time as it is a massive change

@Bouni
Copy link
Owner Author

Bouni commented Aug 6, 2024

For those who are interested, I created a small test wx frame that uses DataViewCtrl and a data model PyDataViewModel.

DataViewCtrl: https://gist.github.com/Bouni/28651a1a6cc2dd4d2749612097801f97
datamodel: https://gist.github.com/Bouni/659b6f8a10132b6536a010f83f785c02

DataView

Natural Sort works without database, adding elements, modifiying elements and deleting elements works as well.

Still to do: Select alike, center icons

@chmorgan
Copy link
Collaborator

chmorgan commented Aug 6, 2024

@Bouni what would the purpose be to add/update/remove entries or is that just showing the low level functionality of not having to rebuild the list each time?

@Bouni
Copy link
Owner Author

Bouni commented Aug 7, 2024

Yes, Just test if everything we need works. With buttons for this test but later automatically

@Bouni
Copy link
Owner Author

Bouni commented Aug 7, 2024

Ok, so I added the datamodel and the DataViewCtrl into the Plugin as a basic test and it seems to work fine!

DataView2

All Sorting is done without the database, I only poulate the List initialy from the database

@Bouni Bouni linked a pull request Aug 7, 2024 that will close this issue
@Bouni
Copy link
Owner Author

Bouni commented Aug 7, 2024

I work on a PR that integrate this into the plugin, the changes will quite extensive as a lot of logic is no longer necessary

@Bouni Bouni closed this as completed in #519 Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature request A new feature is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants