Changeset 136:6d206b573dee


Ignore:
Timestamp:
04/30/12 15:21:44 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
hg-Phase:
(<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
Message:

Added option to enable/disable the online gate system

Location:
src/mlx
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/acft.py

    r134 r136  
    155155            elif newStage==const.STAGE_TAXIAFTERLAND:
    156156                bookedFlight = self._flight.bookedFlight
    157                 if bookedFlight.arrivalICAO=="LHBP" and \
    158                    self._flight.config.isMessageTypeFS(const.MESSAGETYPE_GATE_SYSTEM):
     157                config = self._flight.config
     158                if config.onlineGateSystem and \
     159                   bookedFlight.arrivalICAO=="LHBP" and \
     160                   config.isMessageTypeFS(const.MESSAGETYPE_GATE_SYSTEM):
    159161                    self._flight.getFleet(callback = self._fleetRetrieved,
    160162                                          force = True)
  • src/mlx/config.py

    r134 r136  
    3737
    3838        self._language = ""
     39        self._onlineGateSystem = True
    3940        self._flareTimeFromFS = False
    4041       
     
    9293        if language!=self._language:
    9394            self._language = language
     95            self._modified = True
     96
     97    @property
     98    def onlineGateSystem(self):
     99        """Get whether the online gate system should be used."""
     100        return self._onlineGateSystem
     101
     102    @onlineGateSystem.setter
     103    def onlineGateSystem(self, onlineGateSystem):
     104        """Set whether the online gate system should be used."""
     105        if onlineGateSystem!=self._onlineGateSystem:
     106            self._onlineGateSystem = onlineGateSystem
    94107            self._modified = True
    95108
     
    163176
    164177        self._language = self._get(config, "general", "language", "")
     178        self._onlineGateSystem = self._getBoolean(config, "general",
     179                                                  "onlineGateSystem",
     180                                                  True)
    165181        self._flareTimeFromFS = self._getBoolean(config, "general",
    166182                                                 "flareTimeFromFS",
     
    194210        if self._language:
    195211            config.set("general", "language", self._language)
     212        config.set("general", "onlineGateSystem",
     213                   "yes" if self._onlineGateSystem else "no")
    196214        config.set("general", "flareTimeFromFS",
    197215                   "yes" if self._flareTimeFromFS else "no")
  • src/mlx/gui/flight.py

    r130 r136  
    413413        """Update the departure gate for the booked flight."""
    414414        flight = self._wizard._bookedFlight
    415         if flight.departureICAO=="LHBP":
    416             self._wizard.getFleet(self._fleetRetrieved)
     415        if self._wizard.gui.config.onlineGateSystem:
     416            if flight.departureICAO=="LHBP":
     417                self._wizard.getFleet(self._fleetRetrieved)
     418            else:
     419                self._wizard.updatePlane(self._planeUpdated,
     420                                         flight.tailNumber,
     421                                         const.PLANE_AWAY)
    417422        else:
    418             self._wizard.updatePlane(self._planeUpdated,
    419                                      flight.tailNumber,
    420                                      const.PLANE_AWAY)
     423            self._nextDistance = 2
     424            self._wizard.jumpPage(2)
     425           
    421426    def _fleetRetrieved(self, fleet):
    422427        """Called when the fleet has been retrieved."""
     
    16691674    def _forwardClicked(self, button):
    16701675        """Called when the forward button is clicked."""
    1671         if not self._completed and \
     1676        if self._wizard.gui.config.onlineGateSystem and \
     1677           not self._completed and \
    16721678           self._wizard.bookedFlight.arrivalICAO=="LHBP":
    16731679            self._wizard.getFleet(callback = self._fleetRetrieved,
     
    18681874
    18691875        self._gatesModel.clear()
    1870         if self._wizard.bookedFlight.arrivalICAO=="LHBP":
     1876        if self._wizard.gui.config.onlineGateSystem and \
     1877           self._wizard.bookedFlight.arrivalICAO=="LHBP":
    18711878            occupiedGates = self._wizard._fleet.getOccupiedGateNumbers()
    18721879            for gateNumber in const.lhbpGateNumbers:
     
    19451952        dialog.hide()
    19461953
    1947         if returned and result.success:
     1954        if self._wizard.gui.config.onlineGateSystem and returned and result.success:
    19481955            bookedFlight = self._wizard.bookedFlight
    19491956            if bookedFlight.arrivalICAO=="LHBP":
  • src/mlx/gui/prefs.py

    r132 r136  
    6767        """Setup the dialog from the given configuration."""
    6868        self._setLanguage(config.language)
     69        self._onlineGateSystem.set_active(config.onlineGateSystem)
    6970        self._flareTimeFromFS.set_active(config.flareTimeFromFS)
    7071
     
    8990        """Setup the given config from the settings in the dialog."""
    9091        config.language = self._getLanguage()
     92        config.onlineGateSystem = self._onlineGateSystem.get_active()
    9193        config.flareTimeFromFS = self._flareTimeFromFS.get_active()
    9294
     
    142144        self._warnedRestartNeeded = False
    143145
     146        self._onlineGateSystem = gtk.CheckButton(xstr("prefs_onlineGateSystem"))
     147        self._onlineGateSystem.set_use_underline(True)
     148        self._onlineGateSystem.set_tooltip_text(xstr("prefs_onlineGateSystem_tooltip"))
     149        mainBox.pack_start(self._onlineGateSystem, False, False, 4)
     150
    144151        self._flareTimeFromFS = gtk.CheckButton(xstr("prefs_flaretimeFromFS"))
    145152        self._flareTimeFromFS.set_use_underline(True)
    146153        self._flareTimeFromFS.set_tooltip_text(xstr("prefs_flaretimeFromFS_tooltip"))
    147 
    148154        mainBox.pack_start(self._flareTimeFromFS, False, False, 4)
    149155                                       
  • src/mlx/i18n.py

    r132 r136  
    560560        self.add("prefs_lang_en_GB", "English")
    561561        self.add("prefs_lang_hu_HU", "Hungarian")
     562        self.add("prefs_onlineGateSystem",
     563                 "_Use the Online Gate System")
     564        self.add("prefs_onlineGateSystem_tooltip",
     565                 "If this is checked, the logger will query and update the "
     566                 "LHBP Online Gate System.")
    562567        self.add("prefs_flaretimeFromFS",
    563568                 "Take flare _time from the simulator")
     
    10551060        self.add("prefs_lang_en_GB", "angol")
    10561061        self.add("prefs_lang_hu_HU", "magyar")
     1062        self.add("prefs_onlineGateSystem",
     1063                 "Az Online _Gate System használata")
     1064        self.add("prefs_onlineGateSystem_tooltip",
     1065                 "Ha ezt bejelölöd, a logger lekérdezi és frissíti az "
     1066                 "LHBP Online Gate System adatait.")
    10571067        self.add("prefs_flaretimeFromFS",
    10581068                 "A ki_lebegtetés idejét vedd a szimulátorból")
Note: See TracChangeset for help on using the changeset viewer.