Skip to content

Commit

Permalink
browser: be arrogant re changing state dump formats
Browse files Browse the repository at this point in the history
jordens committed Apr 20, 2016
1 parent 3d393e4 commit 8567061
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions artiq/browser/files.py
Original file line number Diff line number Diff line change
@@ -179,18 +179,14 @@ def save_state(self):
}

def restore_state(self, state):
dir = state.get("dir")
if dir:
self.select_dir(dir)
if self.override_restore_file:
self.select_file(os.path.normpath(self.override_restore_file))
f = os.path.normpath(self.override_restore_file)
if os.path.isdir(f):
self.select_dir(f)
else:
self.select_file(f)
else:
file = state.get("file")
if file:
self.select_file(file)
header = state.get("header")
if header:
self.rt.header().restoreState(QtCore.QByteArray(header))
splitter = state.get("splitter")
if splitter:
self.splitter.restoreState(QtCore.QByteArray(splitter))
self.select_dir(state["dir"])
self.select_file(state["file"])
self.rt.header().restoreState(QtCore.QByteArray(state["header"]))
self.splitter.restoreState(QtCore.QByteArray(state["splitter"]))

0 comments on commit 8567061

Please sign in to comment.