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.
This commit is contained in:
Ghostkeeper 2016-06-08 14:16:13 +02:00
parent 0a34577fdb
commit 59c8a4e66d
No known key found for this signature in database
GPG key ID: 701948C5954A7385

View file

@ -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)