mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-20 05:07:50 -06:00
Update intent categories upon adding containers or changing configuration
Also upon start-up. Contributes to issue CURA-6597.
This commit is contained in:
parent
d2daa15a13
commit
bd2237dc45
1 changed files with 7 additions and 0 deletions
|
@ -6,6 +6,7 @@ import collections
|
|||
|
||||
from cura.Settings.IntentManager import IntentManager
|
||||
from UM.Qt.ListModel import ListModel
|
||||
from UM.Settings.ContainerRegistry import ContainerRegistry #To update the list if anything changes.
|
||||
|
||||
from UM.i18n import i18nCatalog
|
||||
catalog = i18nCatalog("cura")
|
||||
|
@ -34,6 +35,12 @@ class IntentCategoryModel(ListModel):
|
|||
self.addRoleName(self.IntentCategoryRole, "intent_category")
|
||||
self.addRoleName(self.WeightRole, "weight")
|
||||
|
||||
ContainerRegistry.getInstance().containerAdded.connect(self._onChanged)
|
||||
ContainerRegistry.getInstance().containerRemoved.connect(self._onChanged)
|
||||
IntentManager.getInstance().configurationChanged.connect(self._onChanged)
|
||||
|
||||
self.update()
|
||||
|
||||
## Updates the list of intents.
|
||||
def update(self) -> None:
|
||||
available_categories = IntentManager.getInstance().currentAvailableIntentCategories()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue