From 5024581e2e79a5c3e590363ce6c689ffe5250479 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Thu, 15 Sep 2016 17:42:36 +0200 Subject: [PATCH] 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 --- DiscoverUM3Action.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/DiscoverUM3Action.py b/DiscoverUM3Action.py index 82d9240819..0b0e61d585 100644 --- a/DiscoverUM3Action.py +++ b/DiscoverUM3Action.py @@ -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"))