diff options
Diffstat (limited to 'src/ui.py')
-rw-r--r-- | src/ui.py | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -35,8 +35,20 @@ class KPLayerList(QtGui.QWidget): self.actRemove = tb.addAction(KP.icon('LayerRemove'), 'Remove', self.removeLayer) self.actMoveUp = tb.addAction(QtGui.QIcon(), 'Move Up', self.moveUp) self.actMoveDown = tb.addAction(QtGui.QIcon(), 'Move Down', self.moveDown) + self.actPlayPause = tb.addAction(KP.icon('APlay'), 'Play', self.toggleAnimatingScene) + playPaused = QtCore.pyqtSignal() + + def toggleAnimatingScene(self): + self.playPaused.emit() + if self.actPlayPause.text() == 'Play': + self.actPlayPause.setIcon(KP.icon('AStop')) + self.actPlayPause.setText('Stop') + else: + self.actPlayPause.setIcon(KP.icon('APlay')) + self.actPlayPause.setText('Play') + def setButtonStates(self): index = self.selectedLayerIndex() @@ -416,6 +428,7 @@ class KPMainWindow(QtGui.QMainWindow): self.layerListDock.setWidget(self.layerList) self.layerList.selectedLayerChanged.connect(self.handleSelectedLayerChanged) + self.layerList.playPaused.connect(self.scene.playPause) self.objectSelector = KPObjectSelector() self.objectSelector.objChanged.connect(self.handleSelectedObjectChanged) |