From 311b5ac7915b38b02e69c68ede4048d6d86d3c0f Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Mon, 19 Mar 2018 18:00:48 +0100 Subject: [PATCH] CURA-4870 Force update the list model also when the output device changes. --- .../ConfigurationListView.qml | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml index 999fecd7fd..88173195be 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml @@ -17,6 +17,13 @@ Column padding: UM.Theme.getSize("default_margin").width spacing: Math.round(UM.Theme.getSize("default_margin").height / 2) + function forceModelUpdate() + { + // FIXME For now the model should be removed and then created again, otherwise changes in the printer don't automatically update the UI + configurationList.model = [] + configurationList.model = outputDevice.uniqueConfigurations + } + Label { id: configurationListHeading @@ -78,9 +85,16 @@ Column target: outputDevice onUniqueConfigurationsChanged: { - // FIXME For now the model should be removed and then created again, otherwise changes in the printer don't automatically update the UI - configurationList.model = [] - configurationList.model = outputDevice.uniqueConfigurations + forceModelUpdate() + } + } + + Connections + { + target: Cura.MachineManager + onOutputDevicesChanged: + { + forceModelUpdate() } } } \ No newline at end of file