forked from M-Labs/artiq
browser: be arrogant re changing state dump formats
This commit is contained in:
parent
3d393e4654
commit
856706188f
|
@ -179,18 +179,14 @@ class FilesDock(QtWidgets.QDockWidget):
|
||||||
}
|
}
|
||||||
|
|
||||||
def restore_state(self, state):
|
def restore_state(self, state):
|
||||||
dir = state.get("dir")
|
|
||||||
if dir:
|
|
||||||
self.select_dir(dir)
|
|
||||||
if self.override_restore_file:
|
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:
|
else:
|
||||||
file = state.get("file")
|
self.select_dir(state["dir"])
|
||||||
if file:
|
self.select_file(state["file"])
|
||||||
self.select_file(file)
|
self.rt.header().restoreState(QtCore.QByteArray(state["header"]))
|
||||||
header = state.get("header")
|
self.splitter.restoreState(QtCore.QByteArray(state["splitter"]))
|
||||||
if header:
|
|
||||||
self.rt.header().restoreState(QtCore.QByteArray(header))
|
|
||||||
splitter = state.get("splitter")
|
|
||||||
if splitter:
|
|
||||||
self.splitter.restoreState(QtCore.QByteArray(splitter))
|
|
||||||
|
|
Loading…
Reference in New Issue