@ -219,30 +228,49 @@ class InstrumentTreeController(object):
parentLibraryWidget.setExpanded(api.session.guiSharedDataToSave["libraryIsExpanded"][libraryId])#only possible after gi.init() was done and item inserted.
#parentLibraryWidget.setHidden(True) #only possible after insert
ifshowOnlyLoadedInstrumentsandinstrumentDict["idKey"]inself._cachedLastInstrumentStatusandnotself._cachedLastInstrumentStatus[instrumentDict["idKey"]]["state"]:#don't create if we only want to see enabled instrument
self.start(additionalData)#This shows the GUI, or not, depends on the NSM gui save setting. We need to call that after the menu, otherwise the about dialog will block and then we get new menu entries, which looks strange.
api.callbacks.rescanSampleDir.append(self.react_rescanSampleDir)#This only happens on actual, manually instructed rescanning through the api. We instruct this through our Rescan-Dialog.
ifsettings.contains("instrumentTreeIsNested"):#Only call after the instruments got parsed
@ -174,6 +175,7 @@ class MainWindow(TemplateMainWindow):
self.menu.addMenuEntry("menuView","actionExpandAll",QtCore.QCoreApplication.translate("Menu","Expand all Libraries"),lambda:self.instrumentTreeController.setAllExpanded(True))
self.menu.addMenuEntry("menuView","actionCollapseAll",QtCore.QCoreApplication.translate("Menu","Collapse all Libraries"),lambda:self.instrumentTreeController.setAllExpanded(False))
self.menu.addMenuEntry("menuView","actionShowOnlyLoadedInstruments",QtCore.QCoreApplication.translate("Menu","Show only loaded instruments"),self.toggleShowOnlyLoadedInstrumentsAndRemember,checkable=True,startChecked=False)#function receives check state as automatic parameter
self.menu.addMenuEntry("menuView","actionFlatNested",QtCore.QCoreApplication.translate("Menu","Nested Instrument List"),self.toggleNestedFlatAndRemember,checkable=True,startChecked=True)#function receives check state as automatic parameter
self.menu.addMenuEntry("menuView","actionPianoRollVisible",QtCore.QCoreApplication.translate("Menu","Piano Roll"),self.pianoRollToggleVisibleAndRemember,shortcut="Ctrl+R",checkable=True,startChecked=True)#function receives check state as automatic parameter
self.menu.addMenuEntry("menuView","actionPianoVisible",QtCore.QCoreApplication.translate("Menu","Piano"),self.pianoToggleVisibleAndRemember,shortcut="Ctrl+P",checkable=True,startChecked=True)#function receives check state as automatic parameter
@ -189,28 +191,41 @@ class MainWindow(TemplateMainWindow):
self.ui.actionShowOnlyLoadedInstruments.setChecked(state)#if called from outside the menu, e.g. load
self.instrumentTreeController.buildTree(data=None)#with data=None it will used the cache data we received once, at startup. All other values use the menu check marks
self.instrumentTreeController.buildTree(data=None,nested=state)#with data=None it will used the cache data we received once, at startup
self.ui.actionFlatNested.setChecked(state)#if called from outside the menu, e.g. load
self.instrumentTreeController.buildTree(data=None)#with data=None it will used the cache data we received once, at startup. All other values use the menu check marks