# Path: Qt.py



import os
import sys
import ts2
import ts2.utils
from os import path
from Qt import QtCore, QtWidgets
        return ts2.utils.from_json(s)

    def addEditorRecent(self, filePath):
        """Add a recent file"""
        lst = self.getEditorRecent()
        if filePath in lst:
            # already in so remove, so move to front
            lst.remove(filePath)
        # insert at front
        lst.insert(0, filePath)
        if len(lst) > 10:
            lst = lst[:10]
        self.setValue("editorRecent", ts2.utils.to_json(lst))
        return lst

    def saveWindow(self, window):
        """Save window geometry and state"""
        self.setValue("window/%s/geometry" % window.objectName(),
                      window.saveGeometry())
        if isinstance(window, QtWidgets.QDialog):
            return
        self.setValue("window/%s/state" % window.objectName(),
                      window.saveState())

    def restoreWindow(self, window):
        """Restore window geometry and state"""
        v = self.value("window/%s/geometry" % window.objectName())
        if v:
            window.restoreGeometry(v)


# Path: Qt.py



# Path: ts2/xobjects/xsettings.py
import os
import sys
import ts2
import ts2.utils
from os import path
from Qt import QtCore, QtWidgets

        return ts2.utils.from_json(s)

    def addEditorRecent(self, filePath):
        """Add a recent file"""
        lst = self.getEditorRecent()
        if filePath in lst:
            # already in so remove, so move to front
            lst.remove(filePath)
        # insert at front
        lst.insert(0, filePath)
        if len(lst) > 10:
            lst = lst[:10]
        self.setValue("editorRecent", ts2.utils.to_json(lst))
        return lst

    def saveWindow(self, window):
        """Save window geometry and state"""
        self.setValue("window/%s/geometry" % window.objectName(),
                      window.saveGeometry())
        if isinstance(window, QtWidgets.QDialog):
            return
        self.setValue("window/%s/state" % window.objectName(),
                      window.saveState())

    def restoreWindow(self, window):
        """Restore window geometry and state"""
        v = self.value("window/%s/geometry" % window.objectName())
        if v:
            window.restoreGeometry(v)


        if isinstance(window, QtWidgets.QDialog):