Browse Source

Add PreviewStagePlugin stubs

Since we are going to move all the views into a seperate stage, we need to add another stage to do that.

CURA-5829
Jaime van Kessel 6 years ago
parent
commit
3248a05819

+ 1 - 0
cura/CuraApplication.py

@@ -433,6 +433,7 @@ class CuraApplication(QtApplication):
             "XmlMaterialProfile",
             "Toolbox",
             "PrepareStage",
+            "PreviewStage",
             "MonitorStage",
             "LocalFileOutputDevice",
             "LocalContainerProvider",

+ 3 - 1
plugins/MonitorStage/__init__.py

@@ -7,14 +7,16 @@ from . import MonitorStage
 from UM.i18n import i18nCatalog
 i18n_catalog = i18nCatalog("cura")
 
+
 def getMetaData():
     return {
         "stage": {
             "name": i18n_catalog.i18nc("@item:inmenu", "Monitor"),
-            "weight": 1
+            "weight": 2
         }
     }
 
+
 def register(app):
     return {
         "stage": MonitorStage.MonitorStage()

+ 13 - 0
plugins/PreviewStage/PreviewStage.py

@@ -0,0 +1,13 @@
+# Copyright (c) 2018 Ultimaker B.V.
+# Cura is released under the terms of the LGPLv3 or higher.
+from UM.Application import Application
+from cura.Stages.CuraStage import CuraStage
+
+
+class PreviewStage(CuraStage):
+    def __init__(self, parent = None) -> None:
+        super().__init__(parent)
+        Application.getInstance().engineCreatedSignal.connect(self._engineCreated)
+
+    def _engineCreated(self):
+        return

+ 22 - 0
plugins/PreviewStage/__init__.py

@@ -0,0 +1,22 @@
+# Copyright (c) 2017 Ultimaker B.V.
+# Cura is released under the terms of the LGPLv3 or higher.
+
+from . import PreviewStage
+
+from UM.i18n import i18nCatalog
+i18n_catalog = i18nCatalog("cura")
+
+
+def getMetaData():
+    return {
+        "stage": {
+            "name": i18n_catalog.i18nc("@item:inmenu", "Preview"),
+            "weight": 1
+        }
+    }
+
+
+def register(app):
+    return {
+        "stage": PreviewStage.PreviewStage()
+    }

+ 8 - 0
plugins/PreviewStage/plugin.json

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