Browse Source

add info label with order of blocks to track editor

master
Nils 4 months ago
parent
commit
07cd62279e
  1. 6
      qtgui/designer/trackWidget.py
  2. 13
      qtgui/designer/trackWidget.ui
  3. 8
      qtgui/trackEditor.py

6
qtgui/designer/trackWidget.py

@ -25,6 +25,12 @@ class Ui_trackGroupWidget(object):
self.verticalLayout.setContentsMargins(3, 3, 3, 3)
self.verticalLayout.setSpacing(3)
self.verticalLayout.setObjectName("verticalLayout")
self.blocksLabel = QtWidgets.QLabel(trackGroupWidget)
self.blocksLabel.setText("TextLabel")
self.blocksLabel.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
self.blocksLabel.setWordWrap(True)
self.blocksLabel.setObjectName("blocksLabel")
self.verticalLayout.addWidget(self.blocksLabel)
self.track = QtWidgets.QWidget(trackGroupWidget)
self.track.setMaximumSize(QtCore.QSize(16777215, 45))
self.track.setObjectName("track")

13
qtgui/designer/trackWidget.ui

@ -44,6 +44,19 @@
<property name="bottomMargin">
<number>3</number>
</property>
<item>
<widget class="QLabel" name="blocksLabel">
<property name="text">
<string notr="true">TextLabel</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="track" native="true">
<property name="maximumSize">

8
qtgui/trackEditor.py

@ -316,6 +316,7 @@ class TrackEditor(QtWidgets.QWidget):
self.setLayout(self.layout)
api.callbacks.tracksChangedIncludingHidden.append(self.updateTrackWidgets)
api.callbacks.updateBlockTrack.append(self.updateBlockList)
self.tracks = {} #id:trackWidget. As any dict, not in order
#Add Track Button
@ -410,6 +411,13 @@ class TrackEditor(QtWidgets.QWidget):
w = self.tracks[visibleTracks[0]["id"]]
w.ui.deleteButton.setEnabled(False) #it is not possible to delete the only visible track. The backend will prevent it but we don't even offer the choice here.
def updateBlockList(self, trackId, listOfBlockExportDicts):
"""This comes in for every small item change. But only per track"""
trackWidget = self.tracks[trackId]
prefix = translate("trackEditorPythonFile", "Block Order:") + " "
trackWidget.ui.blocksLabel.setText(prefix + " ".join(block["name"] for block in listOfBlockExportDicts))
def setAllUpbeats(self):
for trackWidget in self.tracks.values():
trackWidget.ui.upbeatSpinBox.setValue(self.allUpbeatsCombinedTickWidget.value())

Loading…
Cancel
Save