Просмотр исходного кода

Implement stage model in top bar

ChrisTerBeke 7 лет назад
Родитель
Сommit
0e1c9146cf

+ 5 - 2
cura/CuraApplication.py

@@ -229,7 +229,9 @@ class CuraApplication(QtApplication):
             "TranslateTool",
             "FileLogger",
             "XmlMaterialProfile",
-            "PluginBrowser"
+            "PluginBrowser",
+            "PrepareStage",
+            "MonitorStage"
         ])
         self._physics = None
         self._volume = None
@@ -668,13 +670,14 @@ class CuraApplication(QtApplication):
 
         controller = self.getController()
 
+        controller.setActiveStage("PrepareStage")
         controller.setActiveView("SolidView")
         controller.setCameraTool("CameraTool")
         controller.setSelectionTool("SelectionTool")
 
         t = controller.getTool("TranslateTool")
         if t:
-            t.setEnabledAxis([ToolHandle.XAxis, ToolHandle.YAxis,ToolHandle.ZAxis])
+            t.setEnabledAxis([ToolHandle.XAxis, ToolHandle.YAxis, ToolHandle.ZAxis])
 
         Selection.selectionChanged.connect(self.onSelectionChanged)
 

+ 1 - 1
plugins/MonitorStage/__init__.py

@@ -10,7 +10,7 @@ def getMetaData():
     return {
         "stage": {
             "name": i18n_catalog.i18nc("@item:inmenu", "Monitor"),
-            "weight": 0,
+            "weight": 1,
             "icon": ""
         }
     }

+ 8 - 0
plugins/MonitorStage/plugin.json

@@ -0,0 +1,8 @@
+{
+    "name": "Monitor Stage",
+    "author": "Ultimaker B.V.",
+    "version": "1.0.0",
+    "description": "Provides a monitor stage in Cura.",
+    "api": 4,
+    "i18n-catalog": "cura"
+}

+ 8 - 0
plugins/PrepareStage/plugin.json

@@ -0,0 +1,8 @@
+{
+    "name": "Prepare Stage",
+    "author": "Ultimaker B.V.",
+    "version": "1.0.0",
+    "description": "Provides a prepare stage in Cura.",
+    "api": 4,
+    "i18n-catalog": "cura"
+}

+ 1 - 0
resources/qml/Topbar.qml

@@ -82,6 +82,7 @@ Rectangle
                 exclusiveGroup: sidebarHeaderBarGroup
                 style: UM.Theme.styles.topbar_header_tab
                 height: UM.Theme.getSize("sidebar_header").height
+                onClicked: UM.Controller.setActiveStage(model.id)
             }
         }