mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-03 01:04:35 +08:00
Don't try to get the plugin path when there's no plugin registry
i.e. in tests Contributes to CL-1274
This commit is contained in:
parent
a74717ca3c
commit
88fc7d0fba
@ -84,10 +84,11 @@ class CloudOutputDevice(NetworkedPrinterOutputDevice):
|
|||||||
self._account = api_client.account
|
self._account = api_client.account
|
||||||
|
|
||||||
# We use the Cura Connect monitor tab to get most functionality right away.
|
# We use the Cura Connect monitor tab to get most functionality right away.
|
||||||
self._monitor_view_qml_path = os.path.join(
|
if PluginRegistry.getInstance() is not None:
|
||||||
PluginRegistry.getInstance().getPluginPath("UM3NetworkPrinting"),
|
self._monitor_view_qml_path = os.path.join(
|
||||||
"resources", "qml", "MonitorStage.qml"
|
PluginRegistry.getInstance().getPluginPath("UM3NetworkPrinting"),
|
||||||
)
|
"resources", "qml", "MonitorStage.qml"
|
||||||
|
)
|
||||||
|
|
||||||
# Trigger the printersChanged signal when the private signal is triggered.
|
# Trigger the printersChanged signal when the private signal is triggered.
|
||||||
self.printersChanged.connect(self._clusterPrintersChanged)
|
self.printersChanged.connect(self._clusterPrintersChanged)
|
||||||
|
@ -65,10 +65,11 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice):
|
|||||||
self._print_jobs = [] # type: List[UM3PrintJobOutputModel]
|
self._print_jobs = [] # type: List[UM3PrintJobOutputModel]
|
||||||
self._received_print_jobs = False # type: bool
|
self._received_print_jobs = False # type: bool
|
||||||
|
|
||||||
self._monitor_view_qml_path = os.path.join(
|
if PluginRegistry.getInstance() is not None:
|
||||||
PluginRegistry.getInstance().getPluginPath("UM3NetworkPrinting"),
|
self._monitor_view_qml_path = os.path.join(
|
||||||
"resources", "qml", "MonitorStage.qml"
|
PluginRegistry.getInstance().getPluginPath("UM3NetworkPrinting"),
|
||||||
)
|
"resources", "qml", "MonitorStage.qml"
|
||||||
|
)
|
||||||
|
|
||||||
# Trigger the printersChanged signal when the private signal is triggered
|
# Trigger the printersChanged signal when the private signal is triggered
|
||||||
self.printersChanged.connect(self._clusterPrintersChanged)
|
self.printersChanged.connect(self._clusterPrintersChanged)
|
||||||
@ -129,11 +130,12 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice):
|
|||||||
|
|
||||||
def _spawnPrinterSelectionDialog(self):
|
def _spawnPrinterSelectionDialog(self):
|
||||||
if self._printer_selection_dialog is None:
|
if self._printer_selection_dialog is None:
|
||||||
path = os.path.join(
|
if PluginRegistry.getInstance() is not None:
|
||||||
PluginRegistry.getInstance().getPluginPath("UM3NetworkPrinting"),
|
path = os.path.join(
|
||||||
"resources", "qml", "PrintWindow.qml"
|
PluginRegistry.getInstance().getPluginPath("UM3NetworkPrinting"),
|
||||||
)
|
"resources", "qml", "PrintWindow.qml"
|
||||||
self._printer_selection_dialog = self._application.createQmlComponent(path, {"OutputDevice": self})
|
)
|
||||||
|
self._printer_selection_dialog = self._application.createQmlComponent(path, {"OutputDevice": self})
|
||||||
if self._printer_selection_dialog is not None:
|
if self._printer_selection_dialog is not None:
|
||||||
self._printer_selection_dialog.show()
|
self._printer_selection_dialog.show()
|
||||||
|
|
||||||
|
@ -77,10 +77,11 @@ class LegacyUM3OutputDevice(NetworkedPrinterOutputDevice):
|
|||||||
|
|
||||||
self.setIconName("print")
|
self.setIconName("print")
|
||||||
|
|
||||||
self._monitor_view_qml_path = os.path.join(
|
if PluginRegistry.getInstance() is not None:
|
||||||
PluginRegistry.getInstance().getPluginPath("UM3NetworkPrinting"),
|
self._monitor_view_qml_path = os.path.join(
|
||||||
"resources", "qml", "MonitorStage.qml"
|
PluginRegistry.getInstance().getPluginPath("UM3NetworkPrinting"),
|
||||||
)
|
"resources", "qml", "MonitorStage.qml"
|
||||||
|
)
|
||||||
|
|
||||||
self._output_controller = LegacyUM3PrinterOutputController(self)
|
self._output_controller = LegacyUM3PrinterOutputController(self)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user