Fix events for added components

Not sharing the _context variable with the machine action fixes signals and events being sent to the additional components.

CURA-2277 and CURA-2276
This commit is contained in:
fieldOfView 2016-09-15 17:42:36 +02:00
parent 2725abd4f4
commit 5024581e2e

View File

@ -21,7 +21,7 @@ class DiscoverUM3Action(MachineAction):
self._network_plugin = None
self._context = None
self._additional_components_context = None
self._additional_component = None
self._additional_components_view = None
@ -110,9 +110,9 @@ class DiscoverUM3Action(MachineAction):
self._additional_component = QQmlComponent(Application.getInstance()._engine, path)
# We need access to engine (although technically we can't)
self._context = QQmlContext(Application.getInstance()._engine.rootContext())
self._context.setContextProperty("manager", self)
self._additional_components_view = self._additional_component.create(self._context)
self._additional_components_context = QQmlContext(Application.getInstance()._engine.rootContext())
self._additional_components_context.setContextProperty("manager", self)
self._additional_components_view = self._additional_component.create(self._additional_components_context)
Application.getInstance().addAdditionalComponent("monitorButtons", self._additional_components_view.findChild(QObject, "networkPrinterConnectButton"))
Application.getInstance().addAdditionalComponent("machinesDetailPane", self._additional_components_view.findChild(QObject, "networkPrinterConnectionInfo"))