mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 15:07:28 -06:00
Fix printer type update in the main printer selection menu
CURA-6057
This commit is contained in:
parent
e1804e0a47
commit
0962481bc1
2 changed files with 7 additions and 1 deletions
|
@ -25,13 +25,17 @@ Button
|
||||||
property var outputDevice: null
|
property var outputDevice: null
|
||||||
property var printerTypesList: []
|
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
|
property var updatePrinterTypesFunction: updatePrinterTypesList
|
||||||
// This function converts the printer type string to another string.
|
// This function converts the printer type string to another string.
|
||||||
property var printerTypeLabelConversionFunction: Cura.MachineManager.getAbbreviatedMachineName
|
property var printerTypeLabelConversionFunction: Cura.MachineManager.getAbbreviatedMachineName
|
||||||
|
|
||||||
function updatePrinterTypesList()
|
function updatePrinterTypesList()
|
||||||
{
|
{
|
||||||
printerTypesList = (outputDevice != null) ? outputDevice.uniquePrinterTypes : []
|
var to_update = (updatePrinterTypesOnlyWhenChecked && checked) || !updatePrinterTypesOnlyWhenChecked
|
||||||
|
printerTypesList = (to_update && outputDevice != null) ? outputDevice.uniquePrinterTypes : []
|
||||||
}
|
}
|
||||||
|
|
||||||
contentItem: Item
|
contentItem: Item
|
||||||
|
|
|
@ -97,6 +97,8 @@ Item
|
||||||
|
|
||||||
printerTypeLabelAutoFit: true
|
printerTypeLabelAutoFit: true
|
||||||
|
|
||||||
|
// update printer types for all items in the list
|
||||||
|
updatePrinterTypesOnlyWhenChecked: false
|
||||||
updatePrinterTypesFunction: updateMachineTypes
|
updatePrinterTypesFunction: updateMachineTypes
|
||||||
// show printer type as it is
|
// show printer type as it is
|
||||||
printerTypeLabelConversionFunction: function(value) { return value }
|
printerTypeLabelConversionFunction: function(value) { return value }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue