From 2ee42dda3359599260799b5d0db0d1727e759bfb Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Tue, 27 Mar 2018 11:56:08 +0200 Subject: [PATCH] CURA-5158 The printer menu now reacts to the global container changes so it is updates even if there is no connection. --- resources/qml/MachineSelection.qml | 12 ++++++++++++ resources/qml/Menus/ConfigurationMenu/SyncButton.qml | 5 ----- resources/qml/Sidebar.qml | 12 ++++++++++++ 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/resources/qml/MachineSelection.qml b/resources/qml/MachineSelection.qml index d075486eb2..201321df91 100644 --- a/resources/qml/MachineSelection.qml +++ b/resources/qml/MachineSelection.qml @@ -83,4 +83,16 @@ ToolButton } menu: PrinterMenu { } + + // Make the toolbutton react when the global container changes, otherwise if Cura is not connected to the printer, + // switching printers make no reaction + Connections + { + target: Cura.MachineManager + onGlobalContainerChanged: + { + base.isNetworkPrinter = Cura.MachineManager.activeMachineNetworkKey != "" + base.printerConnected = Cura.MachineManager.printerOutputDevices.length != 0 + } + } } diff --git a/resources/qml/Menus/ConfigurationMenu/SyncButton.qml b/resources/qml/Menus/ConfigurationMenu/SyncButton.qml index 6654708482..078acb65b2 100644 --- a/resources/qml/Menus/ConfigurationMenu/SyncButton.qml +++ b/resources/qml/Menus/ConfigurationMenu/SyncButton.qml @@ -97,11 +97,6 @@ Button { target: Cura.MachineManager onCurrentConfigurationChanged: updateOnSync() - } - - Connections - { - target: Cura.MachineManager onOutputDevicesChanged: updateOnSync() } } \ No newline at end of file diff --git a/resources/qml/Sidebar.qml b/resources/qml/Sidebar.qml index 1c1bfca7c3..cb9422d622 100644 --- a/resources/qml/Sidebar.qml +++ b/resources/qml/Sidebar.qml @@ -661,4 +661,16 @@ Rectangle watchedProperties: [ "value" ] storeIndex: 0 } + + // Make the ConfigurationSelector react when the global container changes, otherwise if Cura is not connected to the printer, + // switching printers make no reaction + Connections + { + target: Cura.MachineManager + onGlobalContainerChanged: + { + base.isNetworkPrinter = Cura.MachineManager.activeMachineNetworkKey != "" + base.printerConnected = Cura.MachineManager.printerOutputDevices.length != 0 + } + } }