From 23a2b6e0f7ef86454904e67590b10725c6bf5d4b Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Wed, 14 Mar 2018 11:54:10 +0100 Subject: [PATCH] CURA-4870 Don't show the configuration selector if the printer is not a network printer (for example don't show if is USB) --- resources/qml/MachineSelection.qml | 2 +- resources/qml/Menus/ConfigurationMenu/SyncButton.qml | 12 ++++++++---- resources/qml/Sidebar.qml | 3 ++- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/resources/qml/MachineSelection.qml b/resources/qml/MachineSelection.qml index 4bddd20b2b..b3f9629703 100644 --- a/resources/qml/MachineSelection.qml +++ b/resources/qml/MachineSelection.qml @@ -12,7 +12,7 @@ import "Menus" ToolButton { id: base - property var isNetworkPrinter: Cura.MachineManager.activeMachineNetworkKey != "" + property bool isNetworkPrinter: Cura.MachineManager.activeMachineNetworkKey != "" property var printerStatus: Cura.MachineManager.printerOutputDevices.length != 0 ? "connected" : "disconnected" text: isNetworkPrinter ? Cura.MachineManager.activeMachineNetworkGroupName : Cura.MachineManager.activeMachineName diff --git a/resources/qml/Menus/ConfigurationMenu/SyncButton.qml b/resources/qml/Menus/ConfigurationMenu/SyncButton.qml index a2d1d53b78..f0394cc107 100644 --- a/resources/qml/Menus/ConfigurationMenu/SyncButton.qml +++ b/resources/qml/Menus/ConfigurationMenu/SyncButton.qml @@ -17,11 +17,15 @@ Button width: parent.width height: parent.height - function updateOnSync() { - if (outputDevice != undefined) { - for (var index in outputDevice.uniqueConfigurations) { + function updateOnSync() + { + if (outputDevice != undefined) + { + for (var index in outputDevice.uniqueConfigurations) + { var configuration = outputDevice.uniqueConfigurations[index] - if (Cura.MachineManager.matchesConfiguration(configuration)) { + if (Cura.MachineManager.matchesConfiguration(configuration)) + { base.matched = true; return; } diff --git a/resources/qml/Sidebar.qml b/resources/qml/Sidebar.qml index 47882c9ecc..5211ee5a1d 100644 --- a/resources/qml/Sidebar.qml +++ b/resources/qml/Sidebar.qml @@ -19,6 +19,7 @@ Rectangle property bool hideView: Cura.MachineManager.activeMachineName == "" // Is there an output device for this printer? + property bool isNetworkPrinter: Cura.MachineManager.activeMachineNetworkKey != "" property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0 property bool printerAcceptsCommands: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands property var connectedPrinter: Cura.MachineManager.printerOutputDevices.length >= 1 ? Cura.MachineManager.printerOutputDevices[0] : null @@ -106,7 +107,7 @@ Rectangle ConfigurationSelection { id: configSelection - visible: printerConnected && !sidebar.monitoringPrint && !sidebar.hideSettings + visible: isNetworkPrinter && !sidebar.monitoringPrint && !sidebar.hideSettings width: visible ? Math.round(base.width * 0.15) : 0 height: UM.Theme.getSize("sidebar_header").height anchors.top: base.top