Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/config.py

    r503 r689  
    211211class Config(object):
    212212    """Our configuration."""
    213     DEFAULT_UPDATE_URL = "http://mlx.varadiistvan.hu/update"
     213    DEFAULT_UPDATE_URL = "http://mlx.varadiistvan.hu/update/cef"
    214214
    215215    _messageTypesSection = "messageTypes"
     
    233233        self._vsSmoothingLength = -2
    234234
     235        self._useSimBrief = False
     236        self._simBriefUserName = ""
     237        self._simBriefPassword = ""
     238        self._rememberSimBriefPassword = False
     239
    235240        self._pirepDirectory = None
    236241        self._pirepAutoSave = False
     
    442447        if vsSmoothingLength!=self._vsSmoothingLength:
    443448            self._vsSmoothingLength = vsSmoothingLength
     449            self._modified = True
     450
     451    @property
     452    def useSimBrief(self):
     453        """Check if SimBrief should be used."""
     454        return self._useSimBrief
     455
     456    @useSimBrief.setter
     457    def useSimBrief(self, useSimBrief):
     458        """Check if SimBrief should be used."""
     459        if self._useSimBrief != useSimBrief:
     460            self._useSimBrief = useSimBrief
     461            self._modified = True
     462
     463    @property
     464    def simBriefUserName(self):
     465        """Get the SimBrief user name last used"""
     466        return self._simBriefUserName
     467
     468    @simBriefUserName.setter
     469    def simBriefUserName(self, simBriefUserName):
     470        """Set the SimBrief user name to be used next."""
     471        if self._simBriefUserName != simBriefUserName:
     472            self._simBriefUserName = simBriefUserName
     473            self._modified = True
     474
     475    @property
     476    def simBriefPassword(self):
     477        """Get the SimBrief password last used"""
     478        return self._simBriefPassword
     479
     480    @simBriefPassword.setter
     481    def simBriefPassword(self, simBriefPassword):
     482        """Set the SimBrief password to be used next."""
     483        if self._simBriefPassword != simBriefPassword:
     484            self._simBriefPassword = simBriefPassword
     485            self._modified = True
     486
     487    @property
     488    def rememberSimBriefPassword(self):
     489        """Get if we should remember the SimBrief password."""
     490        return self._rememberSimBriefPassword
     491
     492    @rememberSimBriefPassword.setter
     493    def rememberSimBriefPassword(self, rememberSimBriefPassword):
     494        """Set if we should remember the SimBrief password."""
     495        if rememberSimBriefPassword!=self._rememberSimBriefPassword:
     496            self._rememberSimBriefPassword = rememberSimBriefPassword
    444497            self._modified = True
    445498
     
    678731                                                "vsSmoothingLength",
    679732                                                -2))
     733
     734        self._useSimBrief = self._getBoolean(config, "simbrief",
     735                                             "use", False)
     736        self._simBriefUserName = self._get(config, "simbrief",
     737                                           "username", "")
     738        self._simBriefPassword = self._get(config, "simbrief",
     739                                           "password", "")
     740        self._rememberSimBriefPassword = self._getBoolean(config, "simbrief",
     741                                                          "rememberPassword",
     742                                                          False)
     743
    680744        self._pirepDirectory = self._get(config, "general",
    681745                                         "pirepDirectory", None)
     
    758822                   str(self._vsSmoothingLength))
    759823
     824        config.add_section("simbrief")
     825        config.set("simbrief", "use",
     826                   "yes" if self._useSimBrief else "no")
     827        config.set("simbrief", "username", self._simBriefUserName)
     828        config.set("simbrief", "password", self._simBriefPassword)
     829        config.set("simbrief", "rememberPassword",
     830                   "yes" if self._rememberSimBriefPassword else "no")
     831
    760832        if self._pirepDirectory is not None:
    761833            config.set("general", "pirepDirectory", self._pirepDirectory)
     
    907979        print "  vsSmoothingLength:", self._vsSmoothingLength
    908980
     981        print "  useSimBrief:", self._useSimBrief
     982        print "  simBriefUserName:", self._simBriefUserName
     983        print "  rememberSimBriefPassword:", self._rememberSimBriefPassword
     984
    909985        print "  pirepDirectory:", self._pirepDirectory
    910986        print "  pirepAutoSave:", self._pirepAutoSave
Note: See TracChangeset for help on using the changeset viewer.