def __saveSettings(self):
     if not os.path.exists(settingsPath()):
         os.makedirs(settingsPath())
     path = os.path.join(settingsPath(), "browser-" + self.__viewHandler.getName())
     with open(path, "w") as f:
         settings = {}
         settings["resx"] = self.size().width()
         settings["resy"] = self.size().height()
         self.__viewHandler.getView()._saveSettings(settings)
         pickle.dump(settings, f)
Beispiel #2
0
 def __saveSettings(self):
     if not os.path.exists(settingsPath()):
         os.makedirs(settingsPath())
     path = os.path.join(settingsPath(),
                         "browser-" + self.__viewHandler.getName())
     with open(path, 'w') as f:
         settings = {}
         settings["resx"] = self.size().width()
         settings["resy"] = self.size().height()
         self.__viewHandler.getView()._saveSettings(settings)
         pickle.dump(settings, f)
    def __loadSettings(self):
        settings = {}
        path = os.path.join(settingsPath(), "browser-" + self.__viewHandler.getName())
        try:
            if os.path.isfile(path):
                with open(path, "r") as f:
                    settings = pickle.load(f)
        except Exception as e:
            print "Failed to load settings!:", e

        self.__viewHandler.getView()._loadSettings(settings)
        if "resx" in settings and "resy" in settings:
            self.resize(settings["resx"], settings["resy"])
Beispiel #4
0
    def __loadSettings(self):
        settings = {}
        path = os.path.join(settingsPath(),
                            "browser-" + self.__viewHandler.getName())
        try:
            if os.path.isfile(path):
                with open(path, 'r') as f:
                    settings = pickle.load(f)
        except Exception as e:
            print "Failed to load settings!:", e

        self.__viewHandler.getView()._loadSettings(settings)
        if "resx" in settings and "resy" in settings:
            self.resize(settings["resx"], settings["resy"])