From 0962481bc154ce3cd40e8fce873582b56e7e01da Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 8 Apr 2019 09:43:35 +0200 Subject: [PATCH] Fix printer type update in the main printer selection menu CURA-6057 --- resources/qml/PrinterSelector/MachineSelectorButton.qml | 6 +++++- resources/qml/WelcomePages/AddNetworkPrinterScrollView.qml | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/resources/qml/PrinterSelector/MachineSelectorButton.qml b/resources/qml/PrinterSelector/MachineSelectorButton.qml index 33d7958340..98e2042448 100644 --- a/resources/qml/PrinterSelector/MachineSelectorButton.qml +++ b/resources/qml/PrinterSelector/MachineSelectorButton.qml @@ -25,13 +25,17 @@ Button property var outputDevice: null property var printerTypesList: [] + // Indicates if only to update the printer types list when this button is checked + property bool updatePrinterTypesOnlyWhenChecked: true + property var updatePrinterTypesFunction: updatePrinterTypesList // This function converts the printer type string to another string. property var printerTypeLabelConversionFunction: Cura.MachineManager.getAbbreviatedMachineName function updatePrinterTypesList() { - printerTypesList = (outputDevice != null) ? outputDevice.uniquePrinterTypes : [] + var to_update = (updatePrinterTypesOnlyWhenChecked && checked) || !updatePrinterTypesOnlyWhenChecked + printerTypesList = (to_update && outputDevice != null) ? outputDevice.uniquePrinterTypes : [] } contentItem: Item diff --git a/resources/qml/WelcomePages/AddNetworkPrinterScrollView.qml b/resources/qml/WelcomePages/AddNetworkPrinterScrollView.qml index 53a3241527..924eeb930d 100644 --- a/resources/qml/WelcomePages/AddNetworkPrinterScrollView.qml +++ b/resources/qml/WelcomePages/AddNetworkPrinterScrollView.qml @@ -97,6 +97,8 @@ Item printerTypeLabelAutoFit: true + // update printer types for all items in the list + updatePrinterTypesOnlyWhenChecked: false updatePrinterTypesFunction: updateMachineTypes // show printer type as it is printerTypeLabelConversionFunction: function(value) { return value }