Browse Source

Fix double saving of the score and quadruple saving of each track!

master
Nils 2 years ago
parent
commit
a238b22dcc
  1. 2
      engine/main.py
  2. 6
      qtgui/menu.py

2
engine/main.py

@ -1076,7 +1076,7 @@ class Data(template.engine.sequencer.Score):
def serialize(self)->dict:
dictionary = super().serialize()
dictionary["class"] = self.__class__.__name__
dictionary["tracks"] = [track.serialize() for track in self.tracks]
#already in super().serialize: dictionary["tracks"] = [track.serialize() for track in self.tracks]
#we can't save hiddenTracks as dict because the serialized track is a dict itself, which is not hashable and therefore not a dict-key.
dictionary["hiddenTracks"] = [[track.serialize(), originalIndex] for track, originalIndex in self.hiddenTracks.items()]
dictionary["tempoTrack"] = self.tempoTrack.serialize()

6
qtgui/menu.py

@ -203,8 +203,8 @@ class MenuActionDatabase(object):
self.mainWindow.ui.actionZoom_Out_Score_View : self.mainWindow.zoomOut,
self.mainWindow.ui.actionWiden_Score_View : self.mainWindow.widen,
self.mainWindow.ui.actionShrink_Score_View : self.mainWindow.shrinken,
self.mainWindow.ui.actionSave : api.save,
self.mainWindow.ui.actionQuit : self.mainWindow.nsmClient.serverSendExitToSelf,
#self.mainWindow.ui.actionSave : api.save, #Already defined in template. This will trigger twice if used here.
self.mainWindow.ui.actionQuit : self.mainWindow.nsmClient.serverSendExitToSelf, #Strangely this is also defined in template but needs to be here. Wow, what a mess.
self.mainWindow.ui.actionShow_PDF : api.showPDF,
self.mainWindow.ui.actionExport_to_Ly : self.exportLy,
@ -371,7 +371,7 @@ class MenuActionDatabase(object):
self.mainWindow.ui.actionZoom_Out_Score_View,
self.mainWindow.ui.actionWiden_Score_View,
self.mainWindow.ui.actionShrink_Score_View,
self.mainWindow.ui.actionSave,
#self.mainWindow.ui.actionSave,
self.mainWindow.ui.actionQuit,
self.mainWindow.ui.actionShow_PDF,
self.mainWindow.ui.actionExport_to_Ly,

Loading…
Cancel
Save