mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Load meta of the project on loading time (Fixes #2225)
This commit is contained in:
1 parent
4fc29504f2
commit
b0783eeccc
2 files changed
+65
-2
No files matched your search
@@ -739,7 +739,28 @@ class Project:
|
||||
except OSError:
|
||||
pass
|
||||
try:
|
||||
topology = load_topology(path)["topology"]
|
||||
project_data = load_topology(path)
|
||||
|
||||
#load meta of project
|
||||
keys_to_load = [
|
||||
"auto_start",
|
||||
"auto_close",
|
||||
"auto_open",
|
||||
"scene_height",
|
||||
"scene_width",
|
||||
"zoom",
|
||||
"show_layers",
|
||||
"snap_to_grid",
|
||||
"show_grid",
|
||||
"show_interface_labels"
|
||||
]
|
||||
|
||||
for key in keys_to_load:
|
||||
val = project_data.get(key, None)
|
||||
if val is not None:
|
||||
setattr(self, key, val)
|
||||
|
||||
topology = project_data["topology"]
|
||||
for compute in topology.get("computes", []):
|
||||
yield from self.controller.add_compute(**compute)
|
||||
for node in topology.get("nodes", []):
|
||||
|
||||
Reference in new issue
Block a user