Browse Source

Don't load old canvas json for 2.2 projects; Prevent load on close

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.2.0-RC1
falkTX 4 years ago
parent
commit
c6b39859ac
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
1 changed files with 9 additions and 5 deletions
  1. +9
    -5
      source/frontend/carla_host.py

+ 9
- 5
source/frontend/carla_host.py View File

@@ -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("<CARLA-PROJECT VERSION='2.0'>") < 0:
return

with open(extrafile, "r") as fh:
try:
canvasdata = json.load(fh)['canvas']
except:
return
except:
return

patchcanvas.restoreGroupPositions(canvasdata)



Loading…
Cancel
Save