From a3892c814798ded4f26f219eb75efca209d10826 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Fri, 18 Mar 2022 16:44:56 +0100 Subject: [PATCH] Remove reference to Cura in UM component Add isActiveModelFunction that can be overwritten in inheriting components Override isActiveModelFunction in Profiles page, this is done because quality models do not have a unique id that can be assigned to activeId CURA-9044 --- resources/qml/Preferences/ProfilesPage.qml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/resources/qml/Preferences/ProfilesPage.qml b/resources/qml/Preferences/ProfilesPage.qml index 1b18cbce4c..7358e515bb 100644 --- a/resources/qml/Preferences/ProfilesPage.qml +++ b/resources/qml/Preferences/ProfilesPage.qml @@ -48,6 +48,17 @@ UM.ManagementPage onHamburgeButtonClicked: menu.popup(content_item, content_item.width - menu.width, hamburger_button.height) + isActiveModelFunction: function(model, id) { + if (model.is_read_only) + { + return (model.name == Cura.MachineManager.activeQualityOrQualityChangesName) && (model.intent_category == Cura.MachineManager.activeIntentCategory); + } + else + { + return model.name == Cura.MachineManager.activeQualityOrQualityChangesName; + } + } + onCreateProfile: { createQualityDialog.object = Cura.ContainerManager.makeUniqueName(Cura.MachineManager.activeQualityOrQualityChangesName);