From c6b39859ac29a94059880ec8044b54477c76e598 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 27 Jun 2020 14:45:28 +0100 Subject: [PATCH] Don't load old canvas json for 2.2 projects; Prevent load on close Signed-off-by: falkTX --- source/frontend/carla_host.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/source/frontend/carla_host.py b/source/frontend/carla_host.py index 2c9bd700d..74f0ecdf7 100644 --- a/source/frontend/carla_host.py +++ b/source/frontend/carla_host.py @@ -786,7 +786,7 @@ class HostWindow(QMainWindow): self.ui.rack.setEnabled(True) self.ui.graphicsView.setEnabled(True) - if not self.fWithCanvas: + if self.fCustomStopAction == self.CUSTOM_ACTION_APP_CLOSE or not self.fWithCanvas: return QTimer.singleShot(1000, self.slot_canvasRefresh) @@ -795,11 +795,15 @@ class HostWindow(QMainWindow): if not os.path.exists(extrafile): return - try: - with open(extrafile, "r") as fh: + with open(self.fProjectFilename, "r") as fh: + if "".join(fh.readlines(90)).find("") < 0: + return + + with open(extrafile, "r") as fh: + try: canvasdata = json.load(fh)['canvas'] - except: - return + except: + return patchcanvas.restoreGroupPositions(canvasdata)