diff options
author | Jaime van Kessel <nallath@gmail.com> | 2016-04-29 14:15:26 +0300 |
---|---|---|
committer | Jaime van Kessel <nallath@gmail.com> | 2016-04-29 14:15:26 +0300 |
commit | 32143ced4401d87a7326ef7a0ce24fe1229d9fdc (patch) | |
tree | 8f6c9d8a70033bc01cf7bc7d284c1c5b66b9f953 /cura/MachineActionManager.py | |
parent | 9896cc181796331852e87babffb6a76d452287c3 (diff) |
Fixed firstStart actions
CURA-1385
Diffstat (limited to 'cura/MachineActionManager.py')
-rw-r--r-- | cura/MachineActionManager.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/cura/MachineActionManager.py b/cura/MachineActionManager.py index d7a0478f37..be94d1696c 100644 --- a/cura/MachineActionManager.py +++ b/cura/MachineActionManager.py @@ -51,8 +51,11 @@ class MachineActionManager: ## Add an action to the first start list of a machine. def addFirstStartAction(self, machine, action_key, index = None): if action_key in self._machine_actions: - if machine in self._supported_actions and index is not None: - self._first_start_actions[machine].insert(index, self._machine_actions[action_key]) + if machine in self._first_start_actions: + if index is not None: + self._first_start_actions[machine].insert(index, self._machine_actions[action_key]) + else: + self._first_start_actions[machine].append(self._machine_actions[action_key]) else: self._first_start_actions[machine] = [self._machine_actions[action_key]] else: @@ -84,6 +87,17 @@ class MachineActionManager: else: return set() + ## Get all actions that need to be perfomed upon first start of a given machine. + # Note that contrary to required / supported actions a list is returned (as it could be required to run the same + # action multiple times). + # \param machine The machine you want the first start actions of + # \returns List of actions. + def getFirstStartActions(self, machine): + if machine in self._first_start_actions: + return self._first_start_actions[machine] + else: + return [] + ## Remove Machine action from manager # \param action to remove def removeMachineAction(self, action): |