From 00c328bfe9f344aa1b6f5695d172c002734fbc59 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Thu, 15 Sep 2016 13:44:12 +0200 Subject: [PATCH 1/5] Fix qml warnings when no printer is connected --- UM3InfoComponents.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UM3InfoComponents.qml b/UM3InfoComponents.qml index 686a13e2cb..f0da9e627c 100644 --- a/UM3InfoComponents.qml +++ b/UM3InfoComponents.qml @@ -97,7 +97,7 @@ Item Repeater { id: nozzleColumn - model: Cura.MachineManager.printerOutputDevices[0].hotendIds + model: printerConnected ? Cura.MachineManager.printerOutputDevices[0].hotendIds : null Label { text: nozzleColumn.model[index] } } } @@ -106,7 +106,7 @@ Item Repeater { id: materialColumn - model: Cura.MachineManager.printerOutputDevices[0].materialNames + model: printerConnected ? Cura.MachineManager.printerOutputDevices[0].materialNames : null Label { text: materialColumn.model[index] } } } From cf2c3e79cfb3c8a06d4a2c3081a2bf00c63ca98b Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Thu, 15 Sep 2016 14:17:04 +0200 Subject: [PATCH 2/5] Do not show the "Request Access" button when no printer is connected CURA-2277 --- UM3InfoComponents.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UM3InfoComponents.qml b/UM3InfoComponents.qml index f0da9e627c..598e26a7fd 100644 --- a/UM3InfoComponents.qml +++ b/UM3InfoComponents.qml @@ -28,7 +28,7 @@ Item text: catalog.i18nc("@action:button", "Request Access") style: UM.Theme.styles.sidebar_action_button onClicked: Cura.MachineManager.printerOutputDevices[0].requestAuthentication() - visible: !base.printerAcceptsCommands && !base.authenticationRequested + visible: printerConnected && !base.printerAcceptsCommands && !base.authenticationRequested } Button From 2725abd4f43a44492969e1476ef98fd2448e8138 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Thu, 15 Sep 2016 14:49:15 +0200 Subject: [PATCH 3/5] Don't show Request Access button when no printer is connected CURA-2276 --- UM3InfoComponents.qml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/UM3InfoComponents.qml b/UM3InfoComponents.qml index 598e26a7fd..b5a707b280 100644 --- a/UM3InfoComponents.qml +++ b/UM3InfoComponents.qml @@ -38,7 +38,6 @@ Item text: catalog.i18nc("@action:button", "Connect") style: UM.Theme.styles.sidebar_action_button onClicked: connectActionDialog.show() - enabled: true visible: !base.printerConnected } } @@ -72,7 +71,7 @@ Item tooltip: catalog.i18nc("@info:tooltip", "Send access request to the printer") text: catalog.i18nc("@action:button", "Request Access") onClicked: Cura.MachineManager.printerOutputDevices[0].requestAuthentication() - visible: !base.printerAcceptsCommands && !base.authenticationRequested + visible: base.printerConnected && !base.printerAcceptsCommands && !base.authenticationRequested } Row From 5024581e2e79a5c3e590363ce6c689ffe5250479 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Thu, 15 Sep 2016 17:42:36 +0200 Subject: [PATCH 4/5] 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")) From c50cae6d28268fab23fe1e615165f449c1dba1aa Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Thu, 15 Sep 2016 17:43:25 +0200 Subject: [PATCH 5/5] Fix showing additional components for UM3Ex CURA-2276 and CURA-2277 --- UM3InfoComponents.qml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/UM3InfoComponents.qml b/UM3InfoComponents.qml index b5a707b280..a5ed944773 100644 --- a/UM3InfoComponents.qml +++ b/UM3InfoComponents.qml @@ -10,7 +10,7 @@ Item { id: base - property bool isUM3: Cura.MachineManager.activeDefinitionId == "ultimaker3" + property bool isUM3: Cura.MachineManager.activeQualityDefinitionId == "ultimaker3" property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0 property bool printerAcceptsCommands: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands property bool authenticationRequested: printerConnected && Cura.MachineManager.printerOutputDevices[0].authenticationState == 2 // AuthState.AuthenticationRequested @@ -28,7 +28,7 @@ Item text: catalog.i18nc("@action:button", "Request Access") style: UM.Theme.styles.sidebar_action_button onClicked: Cura.MachineManager.printerOutputDevices[0].requestAuthentication() - visible: printerConnected && !base.printerAcceptsCommands && !base.authenticationRequested + visible: printerConnected && !printerAcceptsCommands && !authenticationRequested } Button @@ -38,7 +38,7 @@ Item text: catalog.i18nc("@action:button", "Connect") style: UM.Theme.styles.sidebar_action_button onClicked: connectActionDialog.show() - visible: !base.printerConnected + visible: !printerConnected } } @@ -71,12 +71,12 @@ Item tooltip: catalog.i18nc("@info:tooltip", "Send access request to the printer") text: catalog.i18nc("@action:button", "Request Access") onClicked: Cura.MachineManager.printerOutputDevices[0].requestAuthentication() - visible: base.printerConnected && !base.printerAcceptsCommands && !base.authenticationRequested + visible: printerConnected && !printerAcceptsCommands && !authenticationRequested } Row { - visible: base.printerConnected + visible: printerConnected spacing: UM.Theme.getSize("default_margin").width anchors.left: parent.left @@ -115,7 +115,7 @@ Item { tooltip: catalog.i18nc("@info:tooltip", "Load the configuration of the printer into Cura") text: catalog.i18nc("@action:button", "Activate Configuration") - visible: base.printerConnected + visible: printerConnected onClicked: manager.loadConfigurationFromPrinter() } }