Ignore:
Timestamp:
04/30/12 15:21:44 (13 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Added option to enable/disable the online gate system

Location:
src/mlx/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 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                                       
Note: See TracChangeset for help on using the changeset viewer.