-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Cura 11003 add searchbar for offlineprinter #18804
Cura 11003 add searchbar for offlineprinter #18804
Conversation
Added a search field in the 'Add Local Printer' section which allows users to search for their desired printer. A timer has been set to trigger the search function as the user types into the search field. A clear button is visible for easy removal of the search text. Adjusted the ListModel.py to correctly emit dataChanged signal when there are changes in the list. CURA-11003
The commit simplifies the function for updating current items in the AddLocalPrinterScrollView.qml file. It also removes unnecessary properties and functions, streamlining the process for setting printer info. The changes improve code readability and efficiency CURA-11003
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 some minor remarks and questions.
I also wanted to point out that Qt has a QSortFilterProxyModel
class that is designed to handle this use case. You don't have to change the data in the model, but just apply the filter on the view. This is a bit faster and also makes it much easier to keep the selection and hide empty sections. I have a real-life example here if you are interested (in C++ though)
This indeed looks like a good way to filter out the messages. I just used the functionality already present in the MachineModel for filtering out the machines. I also need another filter, visible:true else whole bunch of other random things shows up in the list. |
helps to increase code readability and maintainability. CURA-11003
This commit addresses an issue wherein undefined current items were not properly handled in the AddLocalPrinterScrollView module. We've changed the code so that it now checks if currentItem and currentItem.name exist before attempting to assign. If they don't exist, we now set default values to avoid null or undefined references. This prevents potential errors or inconsistent behaviors in the UI. CURA-11003
Co-authored-by: Jaime van Kessel <nallath@gmail.com>
Co-authored-by: Jaime van Kessel <nallath@gmail.com>
has anyone tried this method? and how it is performing? |
solves #16716. This feature will be available in the next version of cura. |
Description
Add Searchbar to the "Add An Offline Printer" list