CURA-4870 Wait until the configuration has all the mandatory data before

add it to the list of unique configurations.
Remove some connections to signals and reuse already defined listeners.
This commit is contained in:
Diego Prado Gesto 2018-03-13 13:14:29 +01:00
parent d807ce57a5
commit dfb903fb81
6 changed files with 36 additions and 21 deletions

View file

@ -40,6 +40,16 @@ class ConfigurationModel(QObject):
def buildplateConfiguration(self):
return self._buildplate_configuration
## This method is intended to indicate whether the configuration is valid or not.
# The method checks if the mandatory fields are or not set
def isValid(self):
if not self._extruder_configurations:
return False
for configuration in self._extruder_configurations:
if configuration is None:
return False
return self._printer_type is not None
def __str__(self):
message_chunks = []
message_chunks.append("Printer type: " + self._printer_type)