diff options
author | Jaime van Kessel <nallath@gmail.com> | 2016-06-20 14:46:05 +0300 |
---|---|---|
committer | Jaime van Kessel <nallath@gmail.com> | 2016-06-20 14:46:05 +0300 |
commit | 8237047907807aeccd4257e759f429b4692ef054 (patch) | |
tree | 869b3bfe625ad87b10bcaa8bb526b83765a15ecc /cura/MachineAction.py | |
parent | 83c1ee80823e1459d1f9b005898ed64cc6624e55 (diff) |
Actions are now added as buttons to machinePages
CURA-1385
Diffstat (limited to 'cura/MachineAction.py')
-rw-r--r-- | cura/MachineAction.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/cura/MachineAction.py b/cura/MachineAction.py index ba40135916..67c4566f53 100644 --- a/cura/MachineAction.py +++ b/cura/MachineAction.py @@ -1,7 +1,7 @@ # Copyright (c) 2016 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. -from PyQt5.QtCore import QObject, pyqtSlot +from PyQt5.QtCore import QObject, pyqtSlot, pyqtProperty, pyqtSignal from UM.PluginObject import PluginObject @@ -11,12 +11,20 @@ class MachineAction(QObject, PluginObject): self._key = key self._label = label + labelChanged = pyqtSignal() + def getKey(self): return self._key - def getLabel(self): + @pyqtProperty(str, notify = labelChanged) + def label(self): return self._label + def setLabel(self, label): + if self._label != label: + self._label = label + self.labelChanged.emit() + @pyqtSlot() def execute(self): self._execute() |