Delay using getPluginPath() until after start up time

CL-1266
This commit is contained in:
Simon Edwards 2019-04-01 14:30:20 +02:00
parent 58f1c05564
commit 19c6fceb0c

View file

@ -77,13 +77,15 @@ class LegacyUM3OutputDevice(NetworkedPrinterOutputDevice):
self.setIconName("print") self.setIconName("print")
if PluginRegistry.getInstance() is not None: self._output_controller = LegacyUM3PrinterOutputController(self)
def _createMonitorViewFromQML(self) -> None:
if self._monitor_view_qml_path is None and PluginRegistry.getInstance() is not None:
self._monitor_view_qml_path = os.path.join( self._monitor_view_qml_path = os.path.join(
PluginRegistry.getInstance().getPluginPath("UM3NetworkPrinting"), PluginRegistry.getInstance().getPluginPath("UM3NetworkPrinting"),
"resources", "qml", "MonitorStage.qml" "resources", "qml", "MonitorStage.qml"
) )
super()._createMonitorViewFromQML()
self._output_controller = LegacyUM3PrinterOutputController(self)
def _onAuthenticationStateChanged(self): def _onAuthenticationStateChanged(self):
# We only accept commands if we are authenticated. # We only accept commands if we are authenticated.