Skip to content

Commit

Permalink
creating pyqtslot for desired functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
saumyaj3 committed Feb 7, 2024
1 parent a8e3d51 commit d2e8999
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions cura/CuraApplication.py
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,10 @@ def getObjectsModel(self, *args):
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:
Expand Down
3 changes: 1 addition & 2 deletions resources/qml/Preferences/MachinesPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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
{
Expand Down

0 comments on commit d2e8999

Please sign in to comment.