Browse Source

Expose intent model to QML

CURA-6534
Jaime van Kessel 5 years ago
parent
commit
2d8c19203e

+ 2 - 0
cura/CuraApplication.py

@@ -61,6 +61,7 @@ from cura.Arranging.Arrange import Arrange
 from cura.Arranging.ArrangeObjectsJob import ArrangeObjectsJob
 from cura.Arranging.ArrangeObjectsAllBuildPlatesJob import ArrangeObjectsAllBuildPlatesJob
 from cura.Arranging.ShapeArray import ShapeArray
+from cura.Machines.Models.IntentModel import IntentModel
 
 from cura.Operations.SetParentOperation import SetParentOperation
 
@@ -1069,6 +1070,7 @@ class CuraApplication(QtApplication):
         qmlRegisterSingletonType(CustomQualityProfilesDropDownMenuModel, "Cura", 1, 0,
                                  "CustomQualityProfilesDropDownMenuModel", self.getCustomQualityProfilesDropDownMenuModel)
         qmlRegisterType(NozzleModel, "Cura", 1, 0, "NozzleModel")
+        qmlRegisterType(IntentModel, "Cura", 1, 6, "IntentModel")
 
         qmlRegisterType(MaterialSettingsVisibilityHandler, "Cura", 1, 0, "MaterialSettingsVisibilityHandler")
         qmlRegisterType(SettingVisibilityPresetsModel, "Cura", 1, 0, "SettingVisibilityPresetsModel")

+ 1 - 1
cura/Machines/Models/IntentModel.py

@@ -2,7 +2,7 @@
 # Cura is released under the terms of the LGPLv3 or higher.
 
 from typing import Optional
-from PyQt5.QtCore.QObject import QObject
+from PyQt5.QtCore import QObject
 from UM.Qt.ListModel import ListModel
 from PyQt5.QtCore import Qt
 

+ 1 - 0
resources/intent/smooth.inst.cfg

@@ -1,6 +1,7 @@
 [general]
 version = 4
 name = Smooth (TEST INTENT)
+definition = fdmprinter
 
 [metadata]
 setting_version = 7

+ 1 - 0
resources/intent/strong.inst.cfg

@@ -1,6 +1,7 @@
 [general]
 version = 4
 name = Strong (TEST INTENT)
+definition = fdmprinter
 
 [metadata]
 setting_version = 7