mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Fix order of machine actions on manage printers page
MachineActionManager now uses lists instead of dicts because dicts don't maintain the order.
This commit is contained in:
parent
0a75aa7496
commit
228f5be35a
2 changed files with 7 additions and 5 deletions
|
@ -57,9 +57,10 @@ class MachineActionManager(QObject):
|
||||||
def addRequiredAction(self, definition_id, action_key):
|
def addRequiredAction(self, definition_id, action_key):
|
||||||
if action_key in self._machine_actions:
|
if action_key in self._machine_actions:
|
||||||
if definition_id in self._required_actions:
|
if definition_id in self._required_actions:
|
||||||
self._required_actions[definition_id] |= {self._machine_actions[action_key]}
|
if self._machine_actions[action_key] not in self._required_actions[definition_id]:
|
||||||
|
self._required_actions[definition_id].append(self._machine_actions[action_key])
|
||||||
else:
|
else:
|
||||||
self._required_actions[definition_id] = {self._machine_actions[action_key]}
|
self._required_actions[definition_id] = [self._machine_actions[action_key]]
|
||||||
else:
|
else:
|
||||||
raise UnknownMachineActionError("Action %s, which is required for %s is not known." % (action_key, definition_id))
|
raise UnknownMachineActionError("Action %s, which is required for %s is not known." % (action_key, definition_id))
|
||||||
|
|
||||||
|
@ -67,9 +68,10 @@ class MachineActionManager(QObject):
|
||||||
def addSupportedAction(self, definition_id, action_key):
|
def addSupportedAction(self, definition_id, action_key):
|
||||||
if action_key in self._machine_actions:
|
if action_key in self._machine_actions:
|
||||||
if definition_id in self._supported_actions:
|
if definition_id in self._supported_actions:
|
||||||
self._supported_actions[definition_id] |= {self._machine_actions[action_key]}
|
if self._machine_actions[action_key] not in self._supported_actions[definition_id]:
|
||||||
|
self._supported_actions[definition_id].append(self._machine_actions[action_key])
|
||||||
else:
|
else:
|
||||||
self._supported_actions[definition_id] = {self._machine_actions[action_key]}
|
self._supported_actions[definition_id] = [self._machine_actions[action_key]]
|
||||||
else:
|
else:
|
||||||
Logger.log("w", "Unable to add %s to %s, as the action is not recognised", action_key, definition_id)
|
Logger.log("w", "Unable to add %s to %s, as the action is not recognised", action_key, definition_id)
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
"preferred_material": "*pla*",
|
"preferred_material": "*pla*",
|
||||||
"preferred_quality": "*normal*",
|
"preferred_quality": "*normal*",
|
||||||
"first_start_actions": ["UMOUpgradeSelection", "UMOCheckup", "BedLevel"],
|
"first_start_actions": ["UMOUpgradeSelection", "UMOCheckup", "BedLevel"],
|
||||||
"supported_actions": ["UMOCheckup", "UpgradeFirmware", "BedLevel", "UMOUpgradeSelection"]
|
"supported_actions": ["UMOUpgradeSelection", "UMOCheckup", "BedLevel", "UpgradeFirmware"]
|
||||||
},
|
},
|
||||||
|
|
||||||
"overrides": {
|
"overrides": {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue