Use plugin Id instead of __file__ for USBPrinting

CURA-6255
This commit is contained in:
Nino van Hooff 2019-12-24 14:51:50 +01:00
parent dcaa10e409
commit 49b93db6df

View file

@ -88,7 +88,10 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
self._firmware_name_requested = False
self._firmware_updater = AvrFirmwareUpdater(self)
self._monitor_view_qml_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "MonitorItem.qml")
from .USBPrinterOutputDeviceManager import USBPrinterOutputDeviceManager
plugin_id = USBPrinterOutputDeviceManager.getInstance().getPluginId()
plugin_path = PluginRegistry.getInstance().getPluginPath(plugin_id)
self._monitor_view_qml_path = os.path.join(plugin_path, "MonitorItem.qml")
CuraApplication.getInstance().getOnExitCallbackManager().addCallback(self._checkActivePrintingUponAppExit)