From 3248a05819fccd54f71f6765ff5846b15c22b181 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 29 Oct 2018 11:28:08 +0100 Subject: [PATCH] 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 --- cura/CuraApplication.py | 1 + plugins/MonitorStage/__init__.py | 4 +++- plugins/PreviewStage/PreviewStage.py | 13 +++++++++++++ plugins/PreviewStage/__init__.py | 22 ++++++++++++++++++++++ plugins/PreviewStage/plugin.json | 8 ++++++++ 5 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 plugins/PreviewStage/PreviewStage.py create mode 100644 plugins/PreviewStage/__init__.py create mode 100644 plugins/PreviewStage/plugin.json diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 5824d21b1c..8f9816e968 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -433,6 +433,7 @@ class CuraApplication(QtApplication): "XmlMaterialProfile", "Toolbox", "PrepareStage", + "PreviewStage", "MonitorStage", "LocalFileOutputDevice", "LocalContainerProvider", diff --git a/plugins/MonitorStage/__init__.py b/plugins/MonitorStage/__init__.py index bdaf53a36c..0468e6319b 100644 --- a/plugins/MonitorStage/__init__.py +++ b/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() diff --git a/plugins/PreviewStage/PreviewStage.py b/plugins/PreviewStage/PreviewStage.py new file mode 100644 index 0000000000..a51bf766b6 --- /dev/null +++ b/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 \ No newline at end of file diff --git a/plugins/PreviewStage/__init__.py b/plugins/PreviewStage/__init__.py new file mode 100644 index 0000000000..e03992fc00 --- /dev/null +++ b/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() + } diff --git a/plugins/PreviewStage/plugin.json b/plugins/PreviewStage/plugin.json new file mode 100644 index 0000000000..9349da2b0e --- /dev/null +++ b/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" +} \ No newline at end of file