示例#1
0
 def registerPreferedSettings(self):
     """
     Register current settings as preferd settings
     """
     settings = QtCore.QSettings("OpenAlea", "OpenAleaLab")
     settings.setValue("preferedGeometry", self.saveGeometry())
     settings.setValue("preferedWindowState", self.saveState())
示例#2
0
 def defaultSettings(self):
     """
     Restore default settings (geometry and window state)
     """
     settings = QtCore.QSettings("OpenAlea", "OpenAleaLab")
     self.restoreGeometry(settings.value("defaultGeometry"))
     self.restoreState(settings.value("defaultWindowState"))
示例#3
0
 def writeSettings(self):
     """
     Register current settings (geometry and window state)
     in a setting file
     """
     settings = QtCore.QSettings("OpenAlea", "OpenAleaLab")
     settings.setValue("geometry", self.saveGeometry())
     settings.setValue("windowState", self.saveState())
     settings.setValue("session", self.session.project)
示例#4
0
 def preferedSettings(self):
     """
     Get prefered settings and restore them
     """
     try:
         settings = QtCore.QSettings("OpenAlea", "OpenAleaLab")
         self.restoreGeometry(settings.value("preferedGeometry"))
         self.restoreState(settings.value("preferedWindowState"))
     except:
         logger.warning("Can t restore prefered session")
示例#5
0
    def readSettings(self):
        """
        Read a setting file and restore
        registered settings (geometry and window state)
        """
        settings = QtCore.QSettings("OpenAlea", "OpenAleaLab")

        try:
            self.restoreGeometry(settings.value("geometry"))
            # self.restoreState(settings.value("windowState"))
        except:
            # if you launch application for the first time,
            # it will save the default state
            settings.setValue("defaultGeometry", self.saveGeometry())
            # settings.setValue("defaultWindowState", self.saveState())
            logger.warning("Can t restore session")