Added machine action dialog optional

Based on this change, users will be able to run their machine action plugins code just by clicking the action button, so without having to open a modal.
This commit is contained in:
Julian 2022-09-07 16:32:58 +02:00
parent ed14e3bd44
commit 75840426d7
2 changed files with 29 additions and 4 deletions

View file

@ -74,10 +74,14 @@ UM.ManagementPage
onClicked:
{
var currentItem = machineActionRepeater.model[index]
actionDialog.loader.manager = currentItem
actionDialog.loader.source = currentItem.qmlPath
actionDialog.title = currentItem.label
actionDialog.show()
if (currentItem.openAsDialog()) {
actionDialog.loader.manager = currentItem
actionDialog.loader.source = currentItem.qmlPath
actionDialog.title = currentItem.label
actionDialog.show()
} else {
currentItem.execute()
}
}
}
}