Ignore:
Timestamp:
04/28/12 15:25:51 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

The fleet is now retrieved centrally and is updated on the Gates page all the time

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/gui/flight.py

    r118 r119  
    416416        flight = self._wizard._bookedFlight
    417417        if flight.departureICAO=="LHBP":
    418             self._wizard._getFleet(self._fleetRetrieved)
     418            self._wizard.gui.getFleet(self._fleetRetrieved)
    419419        else:
    420420            self._nextDistance = 2
     
    532532            dialog.hide()
    533533
    534             self._wizard._getFleet(self._fleetRetrieved)
     534            self._wizard.gui.getFleet(self._fleetRetrieved)
    535535
    536536    def _fleetRetrieved(self, fleet):
     
    21212121        self.setCurrentPage(0)
    21222122       
    2123     def _getFleet(self, callback, force = False):
    2124         """Get the fleet, if needed.
    2125 
    2126         callback is function that will be called, when the feet is retrieved,
    2127         or the retrieval fails. It should have a single argument that will
    2128         receive the fleet object on success, None otherwise.
    2129         """
    2130         if self._fleet is not None and not force:
    2131             callback(self._fleet)
    2132 
    2133         self.gui.beginBusy(xstr("fleet_busy"))
    2134         self._fleetCallback = callback
    2135         self.gui.webHandler.getFleet(self._fleetResultCallback)
    2136 
    2137     def _fleetResultCallback(self, returned, result):
    2138         """Called when the fleet has been queried."""
    2139         gobject.idle_add(self._handleFleetResult, returned, result)
    2140 
    2141     def _handleFleetResult(self, returned, result):
    2142         """Handle the fleet result."""
    2143         self.gui.endBusy()
    2144         if returned:
    2145             self._fleet = result.fleet
    2146         else:
    2147             self._fleet = None
    2148 
    2149             dialog = gtk.MessageDialog(parent = self.gui.mainWindow,
    2150                                        type = MESSAGETYPE_ERROR,
    2151                                        buttons = BUTTONSTYPE_OK,
    2152                                        message_format = xstr("fleet_failed"))
    2153             dialog.set_title(WINDOW_TITLE_BASE)
    2154             dialog.run()
    2155             dialog.hide()
    2156 
    2157         self._fleetCallback(self._fleet)
    2158 
    21592123    def _updatePlane(self, callback, tailNumber, status, gateNumber = None):
    21602124        """Update the given plane's gate information."""
Note: See TracChangeset for help on using the changeset viewer.