diff options
author | Jaime van Kessel <nallath@gmail.com> | 2022-03-31 15:16:57 +0300 |
---|---|---|
committer | Jaime van Kessel <nallath@gmail.com> | 2022-03-31 15:16:57 +0300 |
commit | af712785c8a0e88eb5b86c7f9dacbf7b5b69d12a (patch) | |
tree | 1f43123cbe74a5b7b2f5a8754d29f2a8afd0a4d4 /resources/qml/Menus | |
parent | 1df9ca55c88d3fa26b0c11f48a35e4565f20543c (diff) |
No longer inject parameters into function handling in qml
Diffstat (limited to 'resources/qml/Menus')
-rw-r--r-- | resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml | 2 | ||||
-rw-r--r-- | resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml | 4 | ||||
-rw-r--r-- | resources/qml/Menus/ContextMenu.qml | 4 | ||||
-rw-r--r-- | resources/qml/Menus/ExtensionMenu.qml | 8 | ||||
-rw-r--r-- | resources/qml/Menus/MaterialMenu.qml | 20 | ||||
-rw-r--r-- | resources/qml/Menus/NozzleMenu.qml | 4 | ||||
-rw-r--r-- | resources/qml/Menus/OpenFilesMenu.qml | 4 | ||||
-rw-r--r-- | resources/qml/Menus/PrinterMenu.qml | 8 | ||||
-rw-r--r-- | resources/qml/Menus/SaveProjectMenu.qml | 4 | ||||
-rw-r--r-- | resources/qml/Menus/SettingVisibilityPresetsMenu.qml | 9 | ||||
-rw-r--r-- | resources/qml/Menus/SettingsMenu.qml | 4 |
11 files changed, 34 insertions, 37 deletions
diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index 58d96f8028..d9ffc5b09f 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -57,7 +57,7 @@ Cura.ExpandablePopup property var extruderStack: activeMachine ? activeMachine.extruderList[model.index]: null property bool valueWarning: !Cura.ExtruderManager.getExtruderHasQualityForMaterial(extruderStack) - property bool valueError: activeMachine ? Cura.ContainerManager.getContainerMetaDataEntry(extruderStack.material.id, "compatible", "") != "True" : false + property bool valueError: activeMachine ? Cura.ContainerManager.getContainerMetaDataEntry(extruderStack.material.id, "compatible") != "True" : false // Extruder icon. Shows extruder index and has the same color as the active material. Cura.ExtruderIcon diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index 4b2b84d39e..55ee56be8e 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -202,7 +202,7 @@ Item return paddedWidth - textWidth - UM.Theme.getSize("print_setup_big_item").height * 0.5 - UM.Theme.getSize("default_margin").width } } - property string instructionLink: Cura.MachineManager.activeStack != null ? Cura.ContainerManager.getContainerMetaDataEntry(Cura.MachineManager.activeStack.material.id, "instruction_link", ""): "" + property string instructionLink: Cura.MachineManager.activeStack != null ? Cura.ContainerManager.getContainerMetaDataEntry(Cura.MachineManager.activeStack.material.id, "instruction_link"): "" Row { @@ -269,7 +269,7 @@ Item { id: materialSelection - property bool valueError: Cura.MachineManager.activeStack !== null ? Cura.ContainerManager.getContainerMetaDataEntry(Cura.MachineManager.activeStack.material.id, "compatible", "") !== "True" : true + property bool valueError: Cura.MachineManager.activeStack !== null ? Cura.ContainerManager.getContainerMetaDataEntry(Cura.MachineManager.activeStack.material.id, "compatible") !== "True" : true property bool valueWarning: !Cura.MachineManager.isActiveQualitySupported text: Cura.MachineManager.activeStack !== null ? Cura.MachineManager.activeStack.material.name : "" diff --git a/resources/qml/Menus/ContextMenu.qml b/resources/qml/Menus/ContextMenu.qml index 1bba79e2c1..cbae92efba 100644 --- a/resources/qml/Menus/ContextMenu.qml +++ b/resources/qml/Menus/ContextMenu.qml @@ -45,8 +45,8 @@ Cura.Menu shortcut: "Ctrl+" + (model.index + 1) } // Add it to the fifth position (and above) as we want it to be added after the extruder header. - onObjectAdded: base.insertItem(index + 5, object) - onObjectRemoved: base.removeItem(object) + onObjectAdded: function(index, object) { base.insertItem(index + 5, object) } + onObjectRemoved: function(object) { base.removeItem(object) } } // Global actions diff --git a/resources/qml/Menus/ExtensionMenu.qml b/resources/qml/Menus/ExtensionMenu.qml index 3c2d1a79c7..4ba36bbb40 100644 --- a/resources/qml/Menus/ExtensionMenu.qml +++ b/resources/qml/Menus/ExtensionMenu.qml @@ -53,12 +53,12 @@ Cura.Menu sourceComponent: modelText.trim() == "" ? extensionsMenuSeparator : extensionsMenuItem } - onObjectAdded: sub_menu.insertItem(index, object.item) - onObjectRemoved: sub_menu.removeItem(object.item) + onObjectAdded: function(index, object) { sub_menu.insertItem(index, object.item)} + onObjectRemoved: function(object) { sub_menu.removeItem(object.item)} } } - onObjectAdded: extensionMenu.insertMenu(index, object) - onObjectRemoved: extensionMenu.removeMenu(object) + onObjectAdded: function(index, object) { extensionMenu.insertMenu(index, object) } + onObjectRemoved: function(object) { extensionMenu.removeMenu(object)} } }
\ No newline at end of file diff --git a/resources/qml/Menus/MaterialMenu.qml b/resources/qml/Menus/MaterialMenu.qml index e6d7fbc3e9..5ffe4efbb6 100644 --- a/resources/qml/Menus/MaterialMenu.qml +++ b/resources/qml/Menus/MaterialMenu.qml @@ -66,8 +66,8 @@ Cura.Menu checked: model.root_material_id === materialMenu.currentRootMaterialId onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node) } - onObjectAdded: materialMenu.insertItem(index + 1, object) - onObjectRemoved: materialMenu.removeItem(index) + onObjectAdded: function(index, object) { materialMenu.insertItem(index + 1, object) } + onObjectRemoved: function(object) { materialMenu.removeItem(index) } } Cura.MenuSeparator { visible: favoriteMaterialsModel.items.length > 0} @@ -88,8 +88,8 @@ Cura.Menu checked: model.root_material_id === materialMenu.currentRootMaterialId onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node) } - onObjectAdded: genericMenu.insertItem(index, object) - onObjectRemoved: genericMenu.removeItem(index) + onObjectAdded: function(index, object) { genericMenu.insertItem(index, object)} + onObjectRemoved: function(object) {genericMenu.removeItem(index) } } } @@ -127,16 +127,16 @@ Cura.Menu onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node) } - onObjectAdded: brandMaterialsMenu.insertItem(index, object) - onObjectRemoved: brandMaterialsMenu.removeItem(object) + onObjectAdded: function(index, object) { brandMaterialsMenu.insertItem(index, object)} + onObjectRemoved: function(object) {brandMaterialsMenu.removeItem(object)} } } - onObjectAdded: brandMenu.insertMenu(index, object) - onObjectRemoved: brandMenu.removeMenu(object) + onObjectAdded: function(index, object) { brandMenu.insertMenu(index, object)} + onObjectRemoved: function(object) {brandMenu.removeMenu(object)} } } - onObjectAdded: materialMenu.insertMenu(index + 4, object) - onObjectRemoved: materialMenu.removeMenu(object) + onObjectAdded: function(index, object) {materialMenu.insertMenu(index + 4, object)} + onObjectRemoved: function(object) { materialMenu.removeMenu(object)} } Cura.MenuSeparator {} diff --git a/resources/qml/Menus/NozzleMenu.qml b/resources/qml/Menus/NozzleMenu.qml index b320a02a5e..896866e82f 100644 --- a/resources/qml/Menus/NozzleMenu.qml +++ b/resources/qml/Menus/NozzleMenu.qml @@ -49,8 +49,8 @@ Cura.Menu onTriggered: Cura.MachineManager.setVariant(nozzleMenu.extruderIndex, model.container_node) } - onObjectAdded: nozzleMenu.insertItem(index, object) - onObjectRemoved: nozzleMenu.removeItem(object) + onObjectAdded: function(index, object) { nozzleMenu.insertItem(index, object) } + onObjectRemoved: function(object) {nozzleMenu.removeItem(object)} } } diff --git a/resources/qml/Menus/OpenFilesMenu.qml b/resources/qml/Menus/OpenFilesMenu.qml index de5ab00c76..1cc98d2285 100644 --- a/resources/qml/Menus/OpenFilesMenu.qml +++ b/resources/qml/Menus/OpenFilesMenu.qml @@ -34,8 +34,8 @@ Cura.Menu } shortcut: model.shortcut } - onObjectAdded: openFilesMenu.insertItem(index, object) + onObjectAdded: function(index, object) { openFilesMenu.insertItem(index, object)} - onObjectRemoved: openFilesMenu.removeItem(object) + onObjectRemoved: function(object) { openFilesMenu.removeItem(object) } } } diff --git a/resources/qml/Menus/PrinterMenu.qml b/resources/qml/Menus/PrinterMenu.qml index 9f0e0575b0..6a9a36b17d 100644 --- a/resources/qml/Menus/PrinterMenu.qml +++ b/resources/qml/Menus/PrinterMenu.qml @@ -38,8 +38,8 @@ Cura.Menu checked: Cura.MachineManager.activeMachineNetworkGroupName == connectGroupName onTriggered: Cura.MachineManager.setActiveMachine(model.id) } - onObjectAdded: menu.insertItem(2, object) - onObjectRemoved: menu.removeItem(object) + onObjectAdded: function(index, object) { menu.insertItem(2, object)} + onObjectRemoved: function(object) { menu.removeItem(object)} } Cura.MenuSeparator { visible: networKPrinterInstantiator.count > 0 } @@ -66,8 +66,8 @@ Cura.Menu onTriggered: Cura.MachineManager.setActiveMachine(model.id) } // A bit hackish, but we have 2 items at the end, put them before that - onObjectAdded: menu.insertItem(menu.count - 2, object) - onObjectRemoved: menu.removeItem(object) + onObjectAdded: function(index, object) { menu.insertItem(menu.count - 2, object) } + onObjectRemoved: function(object) { menu.removeItem(object) } } Cura.MenuSeparator { visible: localPrinterInstantiator.count > 0 } diff --git a/resources/qml/Menus/SaveProjectMenu.qml b/resources/qml/Menus/SaveProjectMenu.qml index 16d54382d1..ac40f4b598 100644 --- a/resources/qml/Menus/SaveProjectMenu.qml +++ b/resources/qml/Menus/SaveProjectMenu.qml @@ -43,8 +43,8 @@ Cura.Menu shortcut: model.shortcut enabled: saveProjectMenu.shouldBeVisible } - onObjectAdded: saveProjectMenu.insertItem(index, object) - onObjectRemoved: saveProjectMenu.removeItem(object) + onObjectAdded: function(index, object) { saveProjectMenu.insertItem(index, object)} + onObjectRemoved: function(object) { saveProjectMenu.removeItem(object)} } WorkspaceSummaryDialog diff --git a/resources/qml/Menus/SettingVisibilityPresetsMenu.qml b/resources/qml/Menus/SettingVisibilityPresetsMenu.qml index 08d74a74ce..8518f4e93c 100644 --- a/resources/qml/Menus/SettingVisibilityPresetsMenu.qml +++ b/resources/qml/Menus/SettingVisibilityPresetsMenu.qml @@ -29,14 +29,11 @@ Cura.Menu checkable: true checked: modelData.presetId == settingVisibilityPresetsModel.activePreset ActionGroup.group: group - onTriggered: - { - settingVisibilityPresetsModel.setActivePreset(modelData.presetId); - } + onTriggered: settingVisibilityPresetsModel.setActivePreset(modelData.presetId) } - onObjectAdded: menu.insertItem(index, object) - onObjectRemoved: menu.removeItem(object) + onObjectAdded: function(index, object) { menu.insertItem(index, object) } + onObjectRemoved: function(object) { menu.removeItem(object)} } Cura.MenuSeparator {} diff --git a/resources/qml/Menus/SettingsMenu.qml b/resources/qml/Menus/SettingsMenu.qml index 25bee871f5..c93ee0bb09 100644 --- a/resources/qml/Menus/SettingsMenu.qml +++ b/resources/qml/Menus/SettingsMenu.qml @@ -67,8 +67,8 @@ Cura.Menu height: visible ? implicitHeight: 0 } } - onObjectAdded: base.insertMenu(index, object) - onObjectRemoved: base.removeMenu(object) + onObjectAdded: function(index, object) { base.insertMenu(index, object) } + onObjectRemoved:function(object) { base.removeMenu(object)} } Cura.MenuSeparator { } |