Exemple #1
0
    def save(self):
        global lang, translations
        log("Saving GRP settings")
        Config = ConfigParser.ConfigParser()
        Config.read(config_file)
        for lang2, language in available_translations.iteritems():
            if language == self.Language.get():
                if lang != lang2:
                    Config.set("General", "Language", lang2)
                break
        Config.set("Review", "FuzzyStonePlacement",
                   self.FuzzyStonePlacement.get())
        Config.set("Review", "RealGameSequenceDeepness",
                   self.RealGameSequenceDeepness.get())
        Config.set("Review", "GobanScreenRatio", self.GobanScreenRatio.get())
        Config.set("Analysis", "MaxVariations",
                   self.MaxVariationsToRecord.get())
        Config.set("Analysis", "SaveCommandLine", self.SaveCommandLine.get())
        Config.set("Analysis", "StopAtFirstResign",
                   self.StopAtFirstResign.get())
        Config.set("Review", "MaxVariations",
                   self.MaxVariationsToDisplay.get())
        coloring = {
            _("Winning variations (>50%) only in blue"): "blue_for_winning",
            _("The best variation in blue"): "blue_for_best",
            _("Variations better than actual game move in blue"):
            "blue_for_better"
        }
        Config.set("Review", "VariationsColoring",
                   coloring[self.VariationsColoring.get().encode("utf")])
        Config.set("Review", "InvertedMouseWheel",
                   self.InvertedMouseWheel.get())
        Config.set("Analysis", "NoVariationIfSameMove",
                   self.NoVariationIfSameMove.get())
        labeling = {_("Letters"): "letter", _("Rates"): "rate"}
        Config.set("Review", "VariationsLabel",
                   labeling[self.VariationsLabel.get().encode("utf")])

        Config.write(open(config_file, "w"))

        if self.refresh != None:
            self.refresh()
Exemple #2
0
	def save(self):
		global lang, translations
		log("Saving GRP settings")
		Config = ConfigParser.ConfigParser()
		Config.read(config_file)
		for lang2, language in available_translations.iteritems():
			if language==self.Language.get():
				if lang!=lang2:
					Config.set("General","Language",lang2)
				break
		Config.set("Review","FuzzyStonePlacement",self.FuzzyStonePlacement.get())
		Config.set("Review","RealGameSequenceDeepness",self.RealGameSequenceDeepness.get())
		Config.set("Review","GobanScreenRatio",self.GobanScreenRatio.get())
		Config.set("Analysis","MaxVariations",self.MaxVariationsToRecord.get())
		Config.set("Analysis","SaveCommandLine",self.SaveCommandLine.get())
		Config.set("Analysis","StopAtFirstResign",self.StopAtFirstResign.get())
		Config.set("Review","MaxVariations",self.MaxVariationsToDisplay.get())
		
		Config.write(open(config_file,"w"))
		
		if self.parent!=None:
			self.parent.refresh()