Fix comments code review IntentManager.

part of CURA-6091
This commit is contained in:
Remco Burema 2019-07-02 14:43:56 +02:00
parent 50cbf71f68
commit 270cf28ea1
2 changed files with 8 additions and 8 deletions

View file

@ -92,7 +92,7 @@ class CuraContainerStack(ContainerStack):
## Set the intent container.
#
# \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)
## Get the quality container.

View file

@ -114,11 +114,11 @@ class IntentManager(QObject):
## 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
# selects, or just when creating a new printer.
def defaultIntent(self) -> InstanceContainer:
def getDefaultIntent(self) -> InstanceContainer:
return CuraApplication.getInstance().empty_intent_container
## 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()
global_stack = application.getGlobalContainerStack()
if global_stack is None:
@ -131,11 +131,11 @@ class IntentManager(QObject):
if intent:
extruder_stack.intent = intent[0]
else:
extruder_stack.intent = self.defaultIntent()
extruder_stack.intent = self.getDefaultIntent()
application.getMachineManager().setQualityGroupByQualityType(quality_type)
## Selects the default intents on every extruder.
def selectDefaultIntent(self) -> None:
for extruder_stack in ExtruderManager.getInstance().getUsedExtruderStacks():
extruder_stack.intent = self.defaultIntent()
extruder_stack.intent = self.getDefaultIntent()