Commit d16fc11c authored by sumpfralle's avatar sumpfralle

switched to binary "pickle" protocol (otherwise "__slot__" classes refuse to get pickled)


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@1242 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 32855e03
...@@ -51,6 +51,7 @@ import pycam.Utils.xml_handling ...@@ -51,6 +51,7 @@ import pycam.Utils.xml_handling
GTKBUILD_FILE = "pycam-project.ui" GTKBUILD_FILE = "pycam-project.ui"
GTKMENU_FILE = "menubar.xml" GTKMENU_FILE = "menubar.xml"
GTKRC_FILE_WINDOWS = "gtkrc_windows" GTKRC_FILE_WINDOWS = "gtkrc_windows"
PICKLE_PROTOCOL = 2
WINDOW_ICON_FILENAMES = ["logo_%dpx.png" % pixels for pixels in (16, 32, 48, 64, 128)] WINDOW_ICON_FILENAMES = ["logo_%dpx.png" % pixels for pixels in (16, 32, 48, 64, 128)]
...@@ -714,7 +715,8 @@ class ProjectGui(object): ...@@ -714,7 +715,8 @@ class ProjectGui(object):
if not self.settings.get("models"): if not self.settings.get("models"):
return return
# TODO: store all models # TODO: store all models
self._undo_states.append(pickle.dumps(self.settings.get("models")[0])) self._undo_states.append(pickle.dumps(
self.settings.get("models")[0].model, PICKLE_PROTOCOL))
log.debug("Stored the current state of the model for undo") log.debug("Stored the current state of the model for undo")
while len(self._undo_states) > MAX_UNDO_STATES: while len(self._undo_states) > MAX_UNDO_STATES:
self._undo_states.pop(0) self._undo_states.pop(0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment