Do not reload a project if project is already opened

Ref https://github.com/GNS3/gns3-gui/issues/1251
This commit is contained in:
Julien Duponchelle committed 2016-06-17 17:50:06 +02:00
1 parent 4783691c87
commit 3132d51694
4 files changed
+34 -1

No files matched your search

+4 -1
View File
@@ -217,7 +217,10 @@ class Controller:
topo_data.pop("revision")
topo_data.pop("type")
project = yield from self.add_project(path=os.path.dirname(path), status="closed", filename=os.path.basename(path), **topo_data)
if topo_data["project_id"] in self._projects:
project = self._projects[topo_data["project_id"]]
else:
project = yield from self.add_project(path=os.path.dirname(path), status="closed", filename=os.path.basename(path), **topo_data)
if load:
yield from project.open()
return project
+3
View File
@@ -337,6 +337,9 @@ class Project:
"""
Load topology elements
"""
if self._status == "opened":
return
self.reset()
path = self._topology_file()
if os.path.exists(path):