Browse Source

add 10 new tracks button

master
Nils 3 years ago
parent
commit
358e5396c2
  1. 1
      engine/api.py
  2. 9
      qtgui/trackEditor.py

1
engine/api.py

@ -631,7 +631,6 @@ def newEmptyTrack():
insertTrack(newIndex, newTrack) #handles callbacks and undo insertTrack(newIndex, newTrack) #handles callbacks and undo
return (id(newTrack)) return (id(newTrack))
def deleteTrack(trId): def deleteTrack(trId):
"""Can not delete hidden tracks because these don't implement undo. """Can not delete hidden tracks because these don't implement undo.
A hidden track is already considered "deleted" by the program. A hidden track is already considered "deleted" by the program.

9
qtgui/trackEditor.py

@ -323,6 +323,10 @@ class TrackEditor(QtWidgets.QWidget):
self.addTrackButton.clicked.connect(api.newEmptyTrack) self.addTrackButton.clicked.connect(api.newEmptyTrack)
self.layout.addWidget(self.addTrackButton) self.layout.addWidget(self.addTrackButton)
self.addTenTracksButton = QtWidgets.QPushButton("add ten tracks placeholder text")
self.addTenTracksButton.clicked.connect(self.addTenTracks)
self.layout.addWidget(self.addTenTracksButton)
#Upbeat Tick Widget and Action-Button #Upbeat Tick Widget and Action-Button
allUpbeats = QtWidgets.QWidget() allUpbeats = QtWidgets.QWidget()
allUpbeatsLayout = QtWidgets.QHBoxLayout() allUpbeatsLayout = QtWidgets.QHBoxLayout()
@ -347,6 +351,10 @@ class TrackEditor(QtWidgets.QWidget):
unfoldAllAdvanvced.clicked.connect(self.unfoldAllAdvanced) unfoldAllAdvanvced.clicked.connect(self.unfoldAllAdvanced)
allUpbeatsLayout.addWidget(unfoldAllAdvanvced) allUpbeatsLayout.addWidget(unfoldAllAdvanvced)
def addTenTracks(self):
for i in range(10):
api.newEmptyTrack()
def updateTrackWidgets(self, listOfStaticTrackRepresentations): def updateTrackWidgets(self, listOfStaticTrackRepresentations):
"""React to the backend adding, deleting, hiding or moving tracks. """React to the backend adding, deleting, hiding or moving tracks.
A track widget persists until the track gets deleted. No re-creation on every change. """ A track widget persists until the track gets deleted. No re-creation on every change. """
@ -378,6 +386,7 @@ class TrackEditor(QtWidgets.QWidget):
numberOfTracks = trackExportObject["index"]+1 numberOfTracks = trackExportObject["index"]+1
self.addTrackButton.setText(translate("trackEditorPythonFile", "Add new Track (currently: ") + str(numberOfTracks) + ")") self.addTrackButton.setText(translate("trackEditorPythonFile", "Add new Track (currently: ") + str(numberOfTracks) + ")")
self.addTenTracksButton.setText(translate("trackEditorPythonFile", "Add 10 new Tracks (currently: ") + str(numberOfTracks) + ")")
for trId in leftOver: #track still exist here but not in the backend. Delete. for trId in leftOver: #track still exist here but not in the backend. Delete.
w = self.tracks[trId] w = self.tracks[trId]

Loading…
Cancel
Save