diff --git a/gns3server/controller/project.py b/gns3server/controller/project.py index 8a459c84..aa6aed06 100644 --- a/gns3server/controller/project.py +++ b/gns3server/controller/project.py @@ -68,7 +68,7 @@ class Project: def __init__(self, name=None, project_id=None, path=None, controller=None, status="opened", filename=None, auto_start=False, auto_open=False, auto_close=True, scene_height=1000, scene_width=2000, zoom=100, show_layers=False, snap_to_grid=False, show_grid=False, - show_interface_labels=False): + grid_size=0, show_interface_labels=False): self._controller = controller assert name is not None @@ -83,6 +83,7 @@ class Project: self._show_layers = show_layers self._snap_to_grid = snap_to_grid self._show_grid = show_grid + self._grid_size = grid_size self._show_interface_labels = show_interface_labels self._loading = False @@ -235,6 +236,21 @@ class Project: """ self._show_grid = show_grid + @property + def grid_size(self): + """ + Grid size + :return: integer + """ + return self._grid_size + + @grid_size.setter + def grid_size(self, grid_size): + """ + Setter for grid size + """ + self._grid_size = grid_size + @property def show_interface_labels(self): """ @@ -760,6 +776,7 @@ class Project: "show_layers", "snap_to_grid", "show_grid", + "grid_size", "show_interface_labels" ] @@ -999,6 +1016,7 @@ class Project: "show_layers": self._show_layers, "snap_to_grid": self._snap_to_grid, "show_grid": self._show_grid, + "grid_size": self._grid_size, "show_interface_labels": self._show_interface_labels } diff --git a/gns3server/controller/topology.py b/gns3server/controller/topology.py index d88db985..efee8377 100644 --- a/gns3server/controller/topology.py +++ b/gns3server/controller/topology.py @@ -83,6 +83,7 @@ def project_to_topology(project): "show_layers": project.show_layers, "snap_to_grid": project.snap_to_grid, "show_grid": project.show_grid, + "grid_size": project.grid_size, "show_interface_labels": project.show_interface_labels, "topology": { "nodes": [], diff --git a/gns3server/schemas/project.py b/gns3server/schemas/project.py index eb008389..242f5e5b 100644 --- a/gns3server/schemas/project.py +++ b/gns3server/schemas/project.py @@ -66,6 +66,10 @@ PROJECT_CREATE_SCHEMA = { "type": "boolean", "description": "Show the grid on the drawing area" }, + "grid_size": { + "type": "integer", + "description": "Grid size for the drawing area" + }, "show_interface_labels": { "type": "boolean", "description": "Show interface labels on the drawing area" @@ -125,6 +129,10 @@ PROJECT_UPDATE_SCHEMA = { "type": "boolean", "description": "Show the grid on the drawing area" }, + "grid_size": { + "type": "integer", + "description": "Grid size for the drawing area" + }, "show_interface_labels": { "type": "boolean", "description": "Show interface labels on the drawing area" @@ -200,6 +208,10 @@ PROJECT_OBJECT_SCHEMA = { "type": "boolean", "description": "Show the grid on the drawing area" }, + "grid_size": { + "type": "integer", + "description": "Grid size for the drawing area" + }, "show_interface_labels": { "type": "boolean", "description": "Show interface labels on the drawing area" diff --git a/gns3server/schemas/topology.py b/gns3server/schemas/topology.py index bf9fc1cf..faadf81b 100644 --- a/gns3server/schemas/topology.py +++ b/gns3server/schemas/topology.py @@ -89,6 +89,10 @@ TOPOLOGY_SCHEMA = { "type": "boolean", "description": "Show the grid on the drawing area" }, + "grid_size": { + "type": "integer", + "description": "Grid size for the drawing area" + }, "show_interface_labels": { "type": "boolean", "description": "Show interface labels on the drawing area"