Get plugin path like most other plugins do

Contributes to CL-1274
This commit is contained in:
Ian Paschal 2019-03-04 12:42:48 +01:00
parent 87d4a68c0e
commit a74717ca3c
4 changed files with 12 additions and 12 deletions

View file

@ -85,8 +85,8 @@ class CloudOutputDevice(NetworkedPrinterOutputDevice):
# 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( self._monitor_view_qml_path = os.path.join(
PluginRegistry.getPluginDirectory(), PluginRegistry.getInstance().getPluginPath("UM3NetworkPrinting"),
"UM3NetworkPrinting", "resources", "qml", "MonitorStage.qml" "resources", "qml", "MonitorStage.qml"
) )
# Trigger the printersChanged signal when the private signal is triggered. # Trigger the printersChanged signal when the private signal is triggered.

View file

@ -66,8 +66,8 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice):
self._received_print_jobs = False # type: bool self._received_print_jobs = False # type: bool
self._monitor_view_qml_path = os.path.join( self._monitor_view_qml_path = os.path.join(
PluginRegistry.getPluginDirectory(), PluginRegistry.getInstance().getPluginPath("UM3NetworkPrinting"),
"UM3NetworkPrinting", "resources", "qml", "MonitorStage.qml" "resources", "qml", "MonitorStage.qml"
) )
# Trigger the printersChanged signal when the private signal is triggered # Trigger the printersChanged signal when the private signal is triggered
@ -130,8 +130,8 @@ 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( path = os.path.join(
PluginRegistry.getPluginDirectory(), PluginRegistry.getInstance().getPluginPath("UM3NetworkPrinting"),
"UM3NetworkPrinting", "resources", "qml", "PrintWindow.qml" "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:

View file

@ -78,8 +78,8 @@ class LegacyUM3OutputDevice(NetworkedPrinterOutputDevice):
self.setIconName("print") self.setIconName("print")
self._monitor_view_qml_path = os.path.join( self._monitor_view_qml_path = os.path.join(
PluginRegistry.getPluginDirectory(), PluginRegistry.getInstance().getPluginPath("UM3NetworkPrinting"),
"UM3NetworkPrinting", "resources", "qml", "MonitorStage.qml" "resources", "qml", "MonitorStage.qml"
) )
self._output_controller = LegacyUM3PrinterOutputController(self) self._output_controller = LegacyUM3PrinterOutputController(self)

View file

@ -458,8 +458,8 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
text = i18n_catalog.i18nc("@info:status", "Send and monitor print jobs from anywhere using your Ultimaker account."), text = i18n_catalog.i18nc("@info:status", "Send and monitor print jobs from anywhere using your Ultimaker account."),
lifetime = 0, lifetime = 0,
image_source = QUrl.fromLocalFile(os.path.join( image_source = QUrl.fromLocalFile(os.path.join(
PluginRegistry.getPluginDirectory(), PluginRegistry.getInstance().getPluginPath("UM3NetworkPrinting"),
"UM3NetworkPrinting", "resources", "svg", "cloud-flow-start.svg" "resources", "svg", "cloud-flow-start.svg"
)), )),
image_caption = i18n_catalog.i18nc("@info:status", "Connect to Ultimaker Cloud"), image_caption = i18n_catalog.i18nc("@info:status", "Connect to Ultimaker Cloud"),
option_text = i18n_catalog.i18nc("@action", "Don't ask me again for this printer."), option_text = i18n_catalog.i18nc("@action", "Don't ask me again for this printer."),
@ -482,8 +482,8 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
text = i18n_catalog.i18nc("@info:status", "You can now send and monitor print jobs from anywhere using your Ultimaker account."), text = i18n_catalog.i18nc("@info:status", "You can now send and monitor print jobs from anywhere using your Ultimaker account."),
lifetime = 30, lifetime = 30,
image_source = QUrl.fromLocalFile(os.path.join( image_source = QUrl.fromLocalFile(os.path.join(
PluginRegistry.getPluginDirectory(), PluginRegistry.getInstance().getPluginPath("UM3NetworkPrinting"),
"UM3NetworkPrinting", "resources", "svg", "cloud-flow-completed.svg" "resources", "svg", "cloud-flow-completed.svg"
)), )),
image_caption = i18n_catalog.i18nc("@info:status", "Connected!") image_caption = i18n_catalog.i18nc("@info:status", "Connected!")
) )