diff --git a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py index 395741391a..d052d925d2 100644 --- a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py +++ b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py @@ -84,10 +84,11 @@ class CloudOutputDevice(NetworkedPrinterOutputDevice): self._account = api_client.account # We use the Cura Connect monitor tab to get most functionality right away. - self._monitor_view_qml_path = os.path.join( - PluginRegistry.getInstance().getPluginPath("UM3NetworkPrinting"), - "resources", "qml", "MonitorStage.qml" - ) + if PluginRegistry.getInstance() is not None: + self._monitor_view_qml_path = os.path.join( + PluginRegistry.getInstance().getPluginPath("UM3NetworkPrinting"), + "resources", "qml", "MonitorStage.qml" + ) # Trigger the printersChanged signal when the private signal is triggered. self.printersChanged.connect(self._clusterPrintersChanged) diff --git a/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py b/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py index df668c2b20..6ca6b0cd10 100644 --- a/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py +++ b/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py @@ -65,10 +65,11 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice): self._print_jobs = [] # type: List[UM3PrintJobOutputModel] self._received_print_jobs = False # type: bool - self._monitor_view_qml_path = os.path.join( - PluginRegistry.getInstance().getPluginPath("UM3NetworkPrinting"), - "resources", "qml", "MonitorStage.qml" - ) + if PluginRegistry.getInstance() is not None: + self._monitor_view_qml_path = os.path.join( + PluginRegistry.getInstance().getPluginPath("UM3NetworkPrinting"), + "resources", "qml", "MonitorStage.qml" + ) # Trigger the printersChanged signal when the private signal is triggered self.printersChanged.connect(self._clusterPrintersChanged) @@ -129,11 +130,12 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice): def _spawnPrinterSelectionDialog(self): if self._printer_selection_dialog is None: - path = os.path.join( - PluginRegistry.getInstance().getPluginPath("UM3NetworkPrinting"), - "resources", "qml", "PrintWindow.qml" - ) - self._printer_selection_dialog = self._application.createQmlComponent(path, {"OutputDevice": self}) + if PluginRegistry.getInstance() is not None: + path = os.path.join( + PluginRegistry.getInstance().getPluginPath("UM3NetworkPrinting"), + "resources", "qml", "PrintWindow.qml" + ) + self._printer_selection_dialog = self._application.createQmlComponent(path, {"OutputDevice": self}) if self._printer_selection_dialog is not None: self._printer_selection_dialog.show() diff --git a/plugins/UM3NetworkPrinting/src/LegacyUM3OutputDevice.py b/plugins/UM3NetworkPrinting/src/LegacyUM3OutputDevice.py index dd100d7433..2c7c33d382 100644 --- a/plugins/UM3NetworkPrinting/src/LegacyUM3OutputDevice.py +++ b/plugins/UM3NetworkPrinting/src/LegacyUM3OutputDevice.py @@ -77,10 +77,11 @@ class LegacyUM3OutputDevice(NetworkedPrinterOutputDevice): self.setIconName("print") - self._monitor_view_qml_path = os.path.join( - PluginRegistry.getInstance().getPluginPath("UM3NetworkPrinting"), - "resources", "qml", "MonitorStage.qml" - ) + if PluginRegistry.getInstance() is not None: + self._monitor_view_qml_path = os.path.join( + PluginRegistry.getInstance().getPluginPath("UM3NetworkPrinting"), + "resources", "qml", "MonitorStage.qml" + ) self._output_controller = LegacyUM3PrinterOutputController(self)