mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-14 10:17:52 -06:00
Fix comments code review IntentManager.
part of CURA-6091
This commit is contained in:
parent
50cbf71f68
commit
270cf28ea1
2 changed files with 8 additions and 8 deletions
|
@ -92,7 +92,7 @@ class CuraContainerStack(ContainerStack):
|
||||||
## Set the intent container.
|
## Set the intent container.
|
||||||
#
|
#
|
||||||
# \param new_intent The new intent container. It is expected to have a "type" metadata entry with the value "intent".
|
# \param new_intent The new intent container. It is expected to have a "type" metadata entry with the value "intent".
|
||||||
def setIntent(self, new_intent: InstanceContainer, postpone_emit: bool = False) -> None:
|
def setIntent(self, new_intent: InstanceContainer, *, postpone_emit: bool = False) -> None:
|
||||||
self.replaceContainer(_ContainerIndexes.Intent, new_intent, postpone_emit=postpone_emit)
|
self.replaceContainer(_ContainerIndexes.Intent, new_intent, postpone_emit=postpone_emit)
|
||||||
|
|
||||||
## Get the quality container.
|
## Get the quality container.
|
||||||
|
|
|
@ -114,11 +114,11 @@ class IntentManager(QObject):
|
||||||
## The intent that gets selected by default when no intent is available for
|
## The intent that gets selected by default when no intent is available for
|
||||||
# the configuration, an extruder can't match the intent that the user
|
# the configuration, an extruder can't match the intent that the user
|
||||||
# selects, or just when creating a new printer.
|
# selects, or just when creating a new printer.
|
||||||
def defaultIntent(self) -> InstanceContainer:
|
def getDefaultIntent(self) -> InstanceContainer:
|
||||||
return CuraApplication.getInstance().empty_intent_container
|
return CuraApplication.getInstance().empty_intent_container
|
||||||
|
|
||||||
## Apply intent on the stacks.
|
## Apply intent on the stacks.
|
||||||
def selectIntent(self, intent_category, quality_type) -> None:
|
def selectIntent(self, intent_category: str, quality_type: str) -> None:
|
||||||
application = CuraApplication.getInstance()
|
application = CuraApplication.getInstance()
|
||||||
global_stack = application.getGlobalContainerStack()
|
global_stack = application.getGlobalContainerStack()
|
||||||
if global_stack is None:
|
if global_stack is None:
|
||||||
|
@ -131,11 +131,11 @@ class IntentManager(QObject):
|
||||||
if intent:
|
if intent:
|
||||||
extruder_stack.intent = intent[0]
|
extruder_stack.intent = intent[0]
|
||||||
else:
|
else:
|
||||||
extruder_stack.intent = self.defaultIntent()
|
extruder_stack.intent = self.getDefaultIntent()
|
||||||
|
|
||||||
application.getMachineManager().setQualityGroupByQualityType(quality_type)
|
application.getMachineManager().setQualityGroupByQualityType(quality_type)
|
||||||
|
|
||||||
## Selects the default intents on every extruder.
|
## Selects the default intents on every extruder.
|
||||||
def selectDefaultIntent(self) -> None:
|
def selectDefaultIntent(self) -> None:
|
||||||
for extruder_stack in ExtruderManager.getInstance().getUsedExtruderStacks():
|
for extruder_stack in ExtruderManager.getInstance().getUsedExtruderStacks():
|
||||||
extruder_stack.intent = self.defaultIntent()
|
extruder_stack.intent = self.getDefaultIntent()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue