mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 23:17:32 -06:00
Machine actions can now be used as a plugin type for Cura
CURA-1385
This commit is contained in:
parent
4beec2982e
commit
af3e4e3a15
2 changed files with 7 additions and 0 deletions
|
@ -2,6 +2,8 @@
|
|||
# Cura is released under the terms of the AGPLv3 or higher.
|
||||
from UM.Logger import Logger
|
||||
|
||||
from UM.PluginRegistry import PluginRegistry # So MachineAction can be added as plugin type
|
||||
|
||||
|
||||
## Raised when trying to add an unknown machine action as a required action
|
||||
class UnknownMachineAction(Exception):
|
||||
|
@ -27,6 +29,8 @@ class MachineActionManager:
|
|||
## Dict of all actions that need to be done when first added by machine reference.
|
||||
self._first_start_actions = {}
|
||||
|
||||
PluginRegistry.addType("machine_action", self.addMachineAction)
|
||||
|
||||
## Add a required action to a machine
|
||||
# Raises an exception when the action is not recognised.
|
||||
def addRequiredAction(self, machine, action_key):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue