From 59c8a4e66d5c0b8f5a2cc1b5fbb2a3e9af9c4629 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 8 Jun 2016 14:16:13 +0200 Subject: [PATCH] Fix validation of extruder-type settings Based on how ints are validated, since the data is the same. Contributes to issues CURA-1278 and CURA-340. --- cura/CuraApplication.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 37ba6cf7ad..8acd3eda2a 100644 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -47,6 +47,7 @@ from PyQt5.QtCore import pyqtSlot, QUrl, pyqtSignal, pyqtProperty, QEvent, Q_ENU from PyQt5.QtGui import QColor, QIcon from PyQt5.QtQml import qmlRegisterUncreatableType, qmlRegisterSingletonType, qmlRegisterType +import ast #For literal eval of extruder setting types. import platform import sys import os.path @@ -92,7 +93,7 @@ class CuraApplication(QtApplication): # Need to do this before ContainerRegistry tries to load the machines SettingDefinition.addSupportedProperty("global_only", DefinitionPropertyType.Function, default = False) - SettingDefinition.addSettingType("extruder", int, str, UM.Settings.Validator) + SettingDefinition.addSettingType("extruder", str, ast.literal_eval, UM.Settings.Validator) super().__init__(name = "cura", version = CuraVersion, buildtype = CuraBuildType)