From d2e8999e453eacc6bfcc633592c2249d1d730b2a Mon Sep 17 00:00:00 2001 From: "saumya.jain" Date: Wed, 7 Feb 2024 15:20:52 +0100 Subject: [PATCH] creating pyqtslot for desired functionality CURA-11596 --- cura/CuraApplication.py | 4 ++++ resources/qml/Preferences/MachinesPage.qml | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index edf4353ae8..f8b3894ed9 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -1101,6 +1101,10 @@ class CuraApplication(QtApplication): self._object_manager = ObjectsModel(self) return self._object_manager + @pyqtSlot(str, result = "QVariantList") + def getSupportedActionMachineList(self, definition_id: str) -> List["MachineAction"]: + return self._machine_action_manager.getSupportedActions(self._machine_manager.getDefinitionByMachineId(definition_id)) + @pyqtSlot(result = QObject) def getExtrudersModel(self, *args) -> "ExtrudersModel": if self._extruders_model is None: diff --git a/resources/qml/Preferences/MachinesPage.qml b/resources/qml/Preferences/MachinesPage.qml index 845c6cf492..1e287e74a0 100644 --- a/resources/qml/Preferences/MachinesPage.qml +++ b/resources/qml/Preferences/MachinesPage.qml @@ -12,7 +12,6 @@ import Cura 1.0 as Cura UM.ManagementPage { id: base - property var machineActionManager: CuraApplication.getMachineActionManager() Item { enabled: false; UM.I18nCatalog { id: catalog; name: "cura"} } title: catalog.i18nc("@title:tab", "Printers") @@ -63,7 +62,7 @@ UM.ManagementPage Repeater { id: machineActionRepeater - model: base.currentItem.id ? machineActionManager.getSupportedActions(Cura.MachineManager.getDefinitionByMachineId(base.currentItem.id)) : null + model: base.currentItem ? CuraApplication.getSupportedActionMachineList(base.currentItem.id) : null Item {