mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-15 02:37:49 -06:00
Add psuedocode/boilerplate for intent manager
This won't run. Don't try to import this class yet. It's outlining what we need to implement to get intents per stack. It does no form of caching at this point. Build first, optimise later, right. Contributes to issue CURA-6091.
This commit is contained in:
parent
aea5e50401
commit
fa65875824
2 changed files with 109 additions and 0 deletions
14
cura/Machines/Models/IntentCategoryModel.py
Normal file
14
cura/Machines/Models/IntentCategoryModel.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
#Copyright (c) 2019 Ultimaker B.V.
|
||||
#Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
from UM.Qt.ListModel import ListModel
|
||||
from cura.Settings.IntentManager import IntentManager
|
||||
|
||||
class IntentCategoryModel(ListModel):
|
||||
def __init__(self, intent_category: str):
|
||||
self._intent_category = intent_category
|
||||
|
||||
def update(self):
|
||||
available_intents = IntentManager.getInstance().currentAvailableIntents()
|
||||
result = filter(lambda intent: intent.getMetaDataEntry("intent_category") == self._intent_category, available_intents)
|
||||
super().update(result)
|
Loading…
Add table
Add a link
Reference in a new issue