mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-02 00:34:26 +08:00

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.
14 lines
582 B
Python
14 lines
582 B
Python
#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) |