mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-15 20:15:54 +08:00
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:
parent
2725abd4f4
commit
5024581e2e
@ -21,7 +21,7 @@ class DiscoverUM3Action(MachineAction):
|
|||||||
|
|
||||||
self._network_plugin = None
|
self._network_plugin = None
|
||||||
|
|
||||||
self._context = None
|
self._additional_components_context = None
|
||||||
self._additional_component = None
|
self._additional_component = None
|
||||||
self._additional_components_view = None
|
self._additional_components_view = None
|
||||||
|
|
||||||
@ -110,9 +110,9 @@ class DiscoverUM3Action(MachineAction):
|
|||||||
self._additional_component = QQmlComponent(Application.getInstance()._engine, path)
|
self._additional_component = QQmlComponent(Application.getInstance()._engine, path)
|
||||||
|
|
||||||
# We need access to engine (although technically we can't)
|
# We need access to engine (although technically we can't)
|
||||||
self._context = QQmlContext(Application.getInstance()._engine.rootContext())
|
self._additional_components_context = QQmlContext(Application.getInstance()._engine.rootContext())
|
||||||
self._context.setContextProperty("manager", self)
|
self._additional_components_context.setContextProperty("manager", self)
|
||||||
self._additional_components_view = self._additional_component.create(self._context)
|
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("monitorButtons", self._additional_components_view.findChild(QObject, "networkPrinterConnectButton"))
|
||||||
Application.getInstance().addAdditionalComponent("machinesDetailPane", self._additional_components_view.findChild(QObject, "networkPrinterConnectionInfo"))
|
Application.getInstance().addAdditionalComponent("machinesDetailPane", self._additional_components_view.findChild(QObject, "networkPrinterConnectionInfo"))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user