'Restore layout state.'

def set_layout_settings(self, settings, dont_goto=None):

    splitsettings = settings.get('splitsettings')
    if (splitsettings is None):
        return
    splitter = self
    editor = None
    for (index, (is_vertical, cfname, clines)) in enumerate(splitsettings):
        if (index > 0):
            splitter.split((Qt.Vertical if is_vertical else Qt.Horizontal))
            splitter = splitter.widget(1)
        editorstack = splitter.widget(0)
        for (index, finfo) in enumerate(editorstack.data):
            editor = finfo.editor
            if (dont_goto is not None):
                pass
            else:
                try:
                    editor.go_to_line(clines[index])
                except IndexError:
                    pass
    hexstate = settings.get('hexstate')
    if (hexstate is not None):
        self.restoreState(QByteArray().fromHex(str(hexstate).encode('utf-8')))
    sizes = settings.get('sizes')
    if (sizes is not None):
        self.setSizes(sizes)
    if (editor is not None):
        editor.clearFocus()
        editor.setFocus()
