diff --git a/cura/Settings/ExtruderManager.py b/cura/Settings/ExtruderManager.py index e83b053d89..e465b6bb68 100755 --- a/cura/Settings/ExtruderManager.py +++ b/cura/Settings/ExtruderManager.py @@ -56,6 +56,7 @@ class ExtruderManager(QObject): """Notify when the user switches the currently active extruder.""" def emitGlobalStackExtrudersChanged(self): + # HACK # The emit function can't be directly connected to another signal. This wrapper function is required. # The extrudersChanged signal is emitted early when changing machines. This triggers it a second time # after the extruder have changed properly. This is important for any QML using ExtruderManager.extruderIds diff --git a/resources/qml/MachineSettings/ComboBoxWithOptions.qml b/resources/qml/MachineSettings/ComboBoxWithOptions.qml index 33ec84aaa2..7ba7c0f701 100644 --- a/resources/qml/MachineSettings/ComboBoxWithOptions.qml +++ b/resources/qml/MachineSettings/ComboBoxWithOptions.qml @@ -74,7 +74,7 @@ UM.TooltipArea return } - if (typeof propertyProvider.properties["options"] == "string") + if (typeof propertyProvider.properties["options"] === "string") { return } @@ -84,9 +84,9 @@ UM.TooltipArea { var key = propertyProvider.properties["options"].keys()[i] var value = propertyProvider.properties["options"][key] - append({ text: value, code: key}) + append({ text: value, code: key }) - if (propertyProvider.properties.value == key) + if (propertyProvider.properties.value === key) { comboBox.currentIndex = i } @@ -132,7 +132,7 @@ UM.TooltipArea onActivated: { var newValue = model.get(index).value - if (propertyProvider.properties.value != newValue && newValue != undefined) + if (propertyProvider.properties.value !== newValue && newValue !== undefined) { if (setValueFunction !== null) { diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedAdhesionSelector.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedAdhesionSelector.qml index 3d0c4ac82c..2183ef7d5e 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedAdhesionSelector.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedAdhesionSelector.qml @@ -14,8 +14,8 @@ RecommendedSettingSection title: catalog.i18nc("@label", "Adhesion") icon: UM.Theme.getIcon("Adhesion") - enableSectionSwitchVisible: platformAdhesionType.properties.enabled == "True" - enableSectionSwitchChecked: platformAdhesionType.properties.value != "skirt" && platformAdhesionType.properties.value != "none" + enableSectionSwitchVisible: platformAdhesionType.properties.enabled === "True" + enableSectionSwitchChecked: platformAdhesionType.properties.value !== "skirt" && platformAdhesionType.properties.value !== "none" enableSectionSwitchEnabled: recommendedPrintSetup.settingsEnabled tooltipText: catalog.i18nc("@label", "Enable printing a brim or raft. This will add a flat area around or under your object which is easy to cut off afterwards.") @@ -30,7 +30,8 @@ RecommendedSettingSection storeIndex: 0 } - function onEnableSectionChanged(state) { + function onEnableSectionChanged(state) + { curaRecommendedMode.setAdhesion(state) } } diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml index 179f2606f8..f78ae38dce 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml @@ -77,7 +77,8 @@ Item Item { height: UM.Theme.getSize("narrow_margin").height } //Spacer - Column { + Column + { id: settingColumn width: parent.width spacing: UM.Theme.getSize("thin_margin").height @@ -117,7 +118,8 @@ Item width: parent.width } - RecommendedAdhesionSelector { + RecommendedAdhesionSelector + { width: parent.width } } diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedSettingItem.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedSettingItem.qml index ca9869db68..e07bc3b643 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedSettingItem.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedSettingItem.qml @@ -41,7 +41,6 @@ Item onExited: base.hideTooltip() } - Loader { id: settingContainer @@ -86,7 +85,6 @@ Item NumberAnimation { property: "Layout.minimumHeight"; duration: 100; } // Animate section dissapearring as it closes NumberAnimation { property: "opacity"; duration: 100; } - } } } \ No newline at end of file diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedStrengthSelector.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedStrengthSelector.qml index 57383e6018..0e15397fd7 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedStrengthSelector.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedStrengthSelector.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Ultimaker +// Copyright (c) 2022 UltiMaker // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 @@ -40,7 +40,7 @@ RecommendedSettingSection settingName: "infill_sparse_density" updateAllExtruders: true // disable slider when gradual support is enabled - enabled: parseInt(infillSteps.properties.value) == 0 + enabled: parseInt(infillSteps.properties.value) === 0 function updateSetting(value) { diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml index 2ae6dfcb41..44b3d28e24 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml @@ -59,7 +59,6 @@ RecommendedSettingSection settingControl: Cura.SingleSettingExtruderSelectorBar { - extruderSettingName: "support_extruder_nr" } }, diff --git a/resources/qml/Toolbar.qml b/resources/qml/Toolbar.qml index 894f280240..fd48ef7448 100644 --- a/resources/qml/Toolbar.qml +++ b/resources/qml/Toolbar.qml @@ -137,10 +137,10 @@ Item delegate: Cura.ExtruderButton { extruder: model - isTopElement: extrudersModel.getItem(0).id == model.id - isBottomElement: extrudersModel.getItem(extrudersModel.rowCount() - 1).id == model.id + isTopElement: extrudersModel.getItem(0).id === model.id + isBottomElement: extrudersModel.getItem(extrudersModel.rowCount() - 1).id === model.id text: catalog.i18ncp("@label %1 is filled in with the name of an extruder", "Print Selected Model with %1", "Print Selected Models with %1", UM.Selection.selectionCount).arg(extruder.name) - checked: Cura.ExtruderManager.selectedObjectExtruders.indexOf(extruder.id) != -1 + checked: Cura.ExtruderManager.selectedObjectExtruders.indexOf(extruder.id) !== -1 enabled: UM.Selection.hasSelection && extruder.stack.isEnabled font: UM.Theme.getFont("small_emphasis") diff --git a/resources/qml/Widgets/SingleSettingComboBox.qml b/resources/qml/Widgets/SingleSettingComboBox.qml index 4807359484..338e14b144 100644 --- a/resources/qml/Widgets/SingleSettingComboBox.qml +++ b/resources/qml/Widgets/SingleSettingComboBox.qml @@ -43,7 +43,7 @@ Cura.ComboBox { var value = propertyProvider.properties["options"][key] comboboxModel.append({ text: value, code: key}) - if (propertyProvider.properties.value == key) + if (propertyProvider.properties.value === key) { // The combobox is cleared after each value change so the currentIndex must be set each time. currentIndex = i @@ -81,7 +81,7 @@ Cura.ComboBox { function parseValueAndUpdateSetting() { - if (comboboxModel.get(currentIndex) && comboboxModel.get(currentIndex).code != propertyProvider.properties.value) + if (comboboxModel.get(currentIndex) && comboboxModel.get(currentIndex).code !== propertyProvider.properties.value) { updateSetting(comboboxModel.get(currentIndex).code) } diff --git a/resources/qml/Widgets/SingleSettingExtruderSelectorBar.qml b/resources/qml/Widgets/SingleSettingExtruderSelectorBar.qml index 80f77304c3..d753bb9167 100644 --- a/resources/qml/Widgets/SingleSettingExtruderSelectorBar.qml +++ b/resources/qml/Widgets/SingleSettingExtruderSelectorBar.qml @@ -56,10 +56,10 @@ Row Cura.ExtruderButton { - anchors.margins : 0 + anchors.margins: 0 padding: 0 extruder: model - checked: extruder.index == selectedIndex + checked: extruder.index === selectedIndex iconScale: 0.8 font: UM.Theme.getFont("tiny_emphasis") buttonSize: UM.Theme.getSize("small_button").width diff --git a/resources/qml/Widgets/SingleSettingTextField.qml b/resources/qml/Widgets/SingleSettingTextField.qml index d1dc3aab90..5bff7fdb5a 100644 --- a/resources/qml/Widgets/SingleSettingTextField.qml +++ b/resources/qml/Widgets/SingleSettingTextField.qml @@ -87,13 +87,13 @@ UM.TextField function parseValueUpdateSetting() { - if (propertyProvider.properties.value == text || (parseFloat(propertyProvider.properties.value) == parseFloat(text) && !isNan(parseFloat(text)))) + if (propertyProvider.properties.value === text || (parseFloat(propertyProvider.properties.value) === parseFloat(text))) { // Don't set the property value from the control. It already has the same value return } - if (propertyProvider && text != propertyProvider.properties.value) + if (propertyProvider && text !== propertyProvider.properties.value) { updateSetting(text); } @@ -119,7 +119,7 @@ UM.TextField State { name: "validationError" - when: propertyProvider.properties.validationState == "ValidatorState.Exception" || propertyProvider.properties.validationState == "ValidatorState.MinimumError" || propertyProvider.properties.validationState == "ValidatorState.MaximumError" + when: propertyProvider.properties.validationState === "ValidatorState.Exception" || propertyProvider.properties.validationState === "ValidatorState.MinimumError" || propertyProvider.properties.validationState === "ValidatorState.MaximumError" PropertyChanges { target: background @@ -130,7 +130,7 @@ UM.TextField State { name: "validationWarning" - when: propertyProvider.properties.validationState == "ValidatorState.MinimumWarning" || propertyProvider.properties.validationState == "ValidatorState.MaximumWarning" + when: propertyProvider.properties.validationState === "ValidatorState.MinimumWarning" || propertyProvider.properties.validationState === "ValidatorState.MaximumWarning" PropertyChanges { target: background