Skip to content

Commit

Permalink
saving includes plot properties
Browse files Browse the repository at this point in the history
  • Loading branch information
tobias47n9e committed Jun 12, 2015
1 parent 3ab1109 commit 7afdf60
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions innstereo/main_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ def on_toolbutton_save_clicked(self, widget):
"""
copy = {}
copy["filetype"] = "InnStereo data file 1.0"
copy["settings"] = self.settings.get_properties()
copy["layers"] = []
for row in self.layer_store:
lyr_obj = row[3]
Expand Down Expand Up @@ -382,6 +383,7 @@ def open_project(self, project_file):
if parse["filetype"] != "InnStereo data file 1.0":
print("Not a valid InnStereo data file")

self.settings.set_properties(parse["settings"])
for layer in parse["layers"]:
props = layer[0]
data = layer[1]
Expand Down
19 changes: 19 additions & 0 deletions innstereo/plot_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,3 +367,22 @@ def set_show_cross(self, new_state):
means it will not be drawn.
"""
self.props["show_cross"] = new_state

def get_properties(self):
"""
Returns the current plot properties in a dictionary.
The plot properties are stored in a dictionary. For loading and saving
the dict is requested by the main window.
"""
return self.props

def set_properties(self, new_props):
"""
Sets the properties to those passed in a dictionary.
Loading a file will also set the plot properties to the saved state.
The properties are appllied to this plot.
"""
self.props = new_props

0 comments on commit 7afdf60

Please sign in to comment.