Browse Source

Add menu function to access block properties

master
Nils 7 months ago
parent
commit
fb32b793aa
  1. 1
      CHANGELOG
  2. 6
      engine/api.py
  3. 1
      engine/block.py
  4. 4
      qtgui/designer/mainwindow.py
  5. 6
      qtgui/designer/mainwindow.ui
  6. 5
      qtgui/mainwindow.py
  7. 2
      qtgui/menu.py

1
CHANGELOG

@ -22,6 +22,7 @@ Cleaner .ly export with more line breaks, comments and using more default ly ins
Settings menu to autoconnect metronome audio ports to system on startup. Default off.
Metronome audio outputs now use real metronome name, not only pretty name
Use lilypond title as jack pretty client name, if provided (needs libcalfbox-lss 1.1.0)
Add preview image to Lilypond properties and metadata
## 2022-04-15 2.0.3

6
engine/api.py

@ -745,6 +745,12 @@ def resetDuationSettingsSignature(trId):
callbacks._updateTrack(trId)
#Blocks
def currentBlockExport():
"""Return the static export item of the current block.
Compatible with getDataAsDict and putDataFromDict
such as names and minimum tick duration"""
return session.data.currentTrack().currentBlock().getDataAsDict()
def appendBlock(trackid = None):
"""
Has dynamic behaviour:

1
engine/block.py

@ -202,6 +202,7 @@ class Block(object):
def getDataAsDict(self):
return { "name" : self.name,
"minimumInTicks" : self.minimumInTicks,
"id" : id(self), #read only. Not applied in putDataFromDict
}
def putDataFromDict(self, dataDict):

4
qtgui/designer/mainwindow.py

@ -677,6 +677,8 @@ class Ui_MainWindow(object):
self.actionAutoconnect_Metronome = QtWidgets.QAction(MainWindow)
self.actionAutoconnect_Metronome.setCheckable(True)
self.actionAutoconnect_Metronome.setObjectName("actionAutoconnect_Metronome")
self.actionBlock_Properties = QtWidgets.QAction(MainWindow)
self.actionBlock_Properties.setObjectName("actionBlock_Properties")
self.menuObjects.addAction(self.actionMetrical_Instruction)
self.menuObjects.addAction(self.actionClef)
self.menuObjects.addAction(self.actionKey_Signature)
@ -760,6 +762,7 @@ class Ui_MainWindow(object):
self.menuTracks.addAction(self.actionDelete_Current_Track)
self.menuTracks.addAction(self.actionUse_Current_Track_as_Metronome)
self.menuTracks.addSeparator()
self.menuTracks.addAction(self.actionBlock_Properties)
self.menuTracks.addAction(self.actionSplit_Current_Block)
self.menuTracks.addAction(self.actionAppend_Block)
self.menuTracks.addAction(self.actionDuplicate)
@ -1023,3 +1026,4 @@ class Ui_MainWindow(object):
self.actionAutoconnect_Metronome.setText(_translate("MainWindow", "Autoconnect Metronome"))
self.actionAutoconnect_Metronome.setIconText(_translate("MainWindow", "Wether to autoconnect the mixer ports on program start. Not for NSM."))
self.actionAutoconnect_Metronome.setToolTip(_translate("MainWindow", "Wether to autoconnect the mixer ports on program start. Not for NSM."))
self.actionBlock_Properties.setText(_translate("MainWindow", "Block Properties"))

6
qtgui/designer/mainwindow.ui

@ -157,6 +157,7 @@
<addaction name="actionDelete_Current_Track"/>
<addaction name="actionUse_Current_Track_as_Metronome"/>
<addaction name="separator"/>
<addaction name="actionBlock_Properties"/>
<addaction name="actionSplit_Current_Block"/>
<addaction name="actionAppend_Block"/>
<addaction name="actionDuplicate"/>
@ -1802,6 +1803,11 @@
<string>Wether to autoconnect the mixer ports on program start. Not for NSM.</string>
</property>
</action>
<action name="actionBlock_Properties">
<property name="text">
<string>Block Properties</string>
</property>
</action>
</widget>
<resources/>
<connections/>

5
qtgui/mainwindow.py

@ -39,6 +39,7 @@ import engine.api as api
from engine.midiinput.stepmidiinput import stepMidiInput #singleton instance
from .constantsAndConfigs import constantsAndConfigs
from .menu import MenuActionDatabase
from .submenus import BlockPropertiesEdit
from .scoreview import ScoreView
from .trackEditor import TrackEditor
from .resources import *
@ -202,6 +203,10 @@ class MainWindow(TemplateMainWindow):
if state:
api.connectMetronomeToSystemPorts()
def currentBlockProperties(self):
"""For menu action self.mainWindow.ui.actionBlock_Properties"""
BlockPropertiesEdit(self, staticExportItem = api.currentBlockExport())
class LeftToolBarPrevailingDuration(QtWidgets.QLabel):
def __init__(self, mainWindow):
super().__init__(self.makeText(api.D4))

2
qtgui/menu.py

@ -261,6 +261,8 @@ class MenuActionDatabase(object):
self.mainWindow.ui.actionMIDI_Channel_Minus : api.midiRelativeChannelMinus,
self.mainWindow.ui.actionMIDI_Channel_Reset : api.midiRelativeChannelReset,
self.mainWindow.ui.actionBlock_Properties : self.mainWindow.currentBlockProperties,
self.mainWindow.ui.actionAppend_Block : api.appendBlock,
self.mainWindow.ui.actionSplit_Current_Block : api.splitBlock,
self.mainWindow.ui.actionJoin_with_next_Block : api.joinBlock,

Loading…
Cancel
Save