From b40ba0cfc7bdf1a3e185200865084c9276a03760 Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Tue, 28 Nov 2017 14:58:53 +0100 Subject: [PATCH] Update network cluster output device print view component creation - CURA-4568 --- .../NetworkClusterPrinterOutputDevice.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/plugins/UM3NetworkPrinting/NetworkClusterPrinterOutputDevice.py b/plugins/UM3NetworkPrinting/NetworkClusterPrinterOutputDevice.py index a737212e64..738177e99d 100644 --- a/plugins/UM3NetworkPrinting/NetworkClusterPrinterOutputDevice.py +++ b/plugins/UM3NetworkPrinting/NetworkClusterPrinterOutputDevice.py @@ -235,17 +235,8 @@ class NetworkClusterPrinterOutputDevice(NetworkPrinterOutputDevice.NetworkPrinte def spawnPrintView(self): if self._print_view is None: - path = QUrl.fromLocalFile(os.path.join(self._plugin_path, "PrintWindow.qml")) - component = QQmlComponent(Application.getInstance()._engine, path) - - self._print_context = QQmlContext(Application.getInstance()._engine.rootContext()) - self._print_context.setContextProperty("OutputDevice", self) - self._print_view = component.create(self._print_context) - - if component.isError(): - Logger.log("e", " Errors creating component: \n%s", "\n".join( - [e.toString() for e in component.errors()])) - + path = os.path.join(self._plugin_path, "PrintWindow.qml") + self._print_view = Application.getInstance().createQmlComponent(path, {"OutputDevice", self}) if self._print_view is not None: self._print_view.show()