Index: src/mlx/gui/flight.py
===================================================================
--- src/mlx/gui/flight.py	(revision 126)
+++ src/mlx/gui/flight.py	(revision 130)
@@ -416,7 +416,7 @@
             self._wizard.getFleet(self._fleetRetrieved)
         else:
-            self._nextDistance = 2
-            self._wizard.jumpPage(2)
-
+            self._wizard.updatePlane(self._planeUpdated,
+                                     flight.tailNumber,
+                                     const.PLANE_AWAY)
     def _fleetRetrieved(self, fleet):
         """Called when the fleet has been retrieved."""
@@ -437,4 +437,9 @@
                 self._nextDistance = 1
                 self._wizard.nextPage()
+
+    def _planeUpdated(self, success):
+        """Callback for the plane updating."""
+        self._nextDistance = 2
+        self._wizard.jumpPage(2)
         
 #-----------------------------------------------------------------------------
@@ -509,10 +514,9 @@
             self._wizard._departureGate = gateNumber
 
-            #self._wizard._updatePlane(self._planeUpdated,
-            #                          self._wizard._bookedFlight.tailNumber,
-            #                          const.PLANE_HOME,
-            #                          gateNumber)
-        
-        self._wizard.nextPage()
+            self._wizard.updatePlane(self._planeUpdated,
+                                     self._wizard._bookedFlight.tailNumber,
+                                     const.PLANE_HOME, gateNumber)
+        else:
+            self._wizard.nextPage()
 
     def _planeUpdated(self, success):
@@ -1665,4 +1669,13 @@
     def _forwardClicked(self, button):
         """Called when the forward button is clicked."""
+        if not self._completed and \
+           self._wizard.bookedFlight.arrivalICAO=="LHBP":
+            self._wizard.getFleet(callback = self._fleetRetrieved,
+                                  force = True)
+        else:
+            self._wizard.nextPage()
+
+    def _fleetRetrieved(self, fleet):
+        """Callback for the fleet retrieval."""
         self._wizard.nextPage()
 
@@ -1684,5 +1697,5 @@
                                   xscale = 0.0, yscale = 0.0)
 
-        table = gtk.Table(7, 2)
+        table = gtk.Table(8, 2)
         table.set_row_spacings(4)
         table.set_col_spacings(16)
@@ -1786,4 +1799,24 @@
         table.attach(onlineFlightAlignment, 1, 2, 6, 7)
 
+        labelAlignment = gtk.Alignment(xalign = 1.0, xscale = 0.0,
+                                       yalign = 0.5, yscale = 0.0)
+        self._gateLabel = gtk.Label(xstr("finish_gate"))
+        self._gateLabel.set_use_underline(True)
+        labelAlignment.add(self._gateLabel)
+        table.attach(labelAlignment, 0, 1, 7, 8)
+
+        self._gatesModel = gtk.ListStore(str)
+
+        self._gate = gtk.ComboBox(model = self._gatesModel)
+        renderer = gtk.CellRendererText()
+        self._gate.pack_start(renderer, True)
+        self._gate.add_attribute(renderer, "text", 0)
+        self._gate.set_tooltip_text(xstr("finish_gate_tooltip"))
+        self._gate.connect("changed", self._gateChanged)               
+        gateAlignment = gtk.Alignment(xalign=0.0, xscale=1.0)
+        gateAlignment.add(self._gate)
+        table.attach(gateAlignment, 1, 2, 7, 8)
+        self._gateLabel.set_mnemonic_widget(self._gate)
+
         self.addPreviousButton(clicked = self._backClicked)
 
@@ -1834,14 +1867,37 @@
         self._onlineFlight.set_active(True)
 
+        self._gatesModel.clear()
+        if self._wizard.bookedFlight.arrivalICAO=="LHBP":
+            occupiedGates = self._wizard._fleet.getOccupiedGateNumbers()
+            for gateNumber in const.lhbpGateNumbers:
+                if gateNumber not in occupiedGates:
+                    self._gatesModel.append([gateNumber])
+            self._gateLabel.set_sensitive(True)
+            self._gate.set_sensitive(True)
+            self._gate.set_active(-1)
+        else:
+            self._gateLabel.set_sensitive(False)
+            self._gate.set_sensitive(False)
+
     def _backClicked(self, button):
         """Called when the Back button is pressed."""
         self.goBack()
 
+    def _updateButtons(self):
+        """Update the sensitivity state of the buttons."""
+        sensitive = self._flightType.get_active()>=0 and \
+                    (self._gatesModel.get_iter_first() is None or
+                     self._gate.get_active()>=0)
+        
+        #self._saveButton.set_sensitive(sensitive)
+        self._sendButton.set_sensitive(sensitive)        
+
     def _flightTypeChanged(self, comboBox):
         """Called when the flight type has changed."""
-        index = self._flightType.get_active()
-        flightTypeIsValid = index>=0
-        #self._saveButton.set_sensitive(flightTypeIsValid)
-        self._sendButton.set_sensitive(flightTypeIsValid)
+        self._updateButtons()
+
+    def _gateChanged(self, comboBox):
+        """Called when the arrival gate has changed."""
+        self._updateButtons()
 
     def _sendClicked(self, button):
@@ -1888,4 +1944,25 @@
         dialog.run()
         dialog.hide()
+
+        if returned and result.success:
+            bookedFlight = self._wizard.bookedFlight
+            if bookedFlight.arrivalICAO=="LHBP":
+                iter = self._gate.get_active_iter()                
+                gateNumber = None if iter is None \
+                             else self._gatesModel.get_value(iter, 0)
+                
+                status = const.PLANE_PARKING if gateNumber is None \
+                         else const.PLANE_HOME
+            else:
+                gateNumber = None
+                status = const.PLANE_AWAY
+
+            self._wizard.updatePlane(self._planeUpdated,
+                                     bookedFlight.tailNumber,
+                                     status, gateNumber = gateNumber)
+
+    def _planeUpdated(self, success):
+        """Callback for the plane updating."""
+        pass
         
 #-----------------------------------------------------------------------------
@@ -2096,5 +2173,4 @@
                                               [self._bookedFlight.arrivalICAO])
             
-            self._takeoffPage.allowForward()
         elif stage==const.STAGE_END:
             self._landingPage.flightEnded()
@@ -2104,5 +2180,4 @@
         self._fleet = None
         self._fleetCallback = None
-        self._updatePlaneCallback = None
         
         self._loginResult = None
@@ -2119,8 +2194,8 @@
         self.setCurrentPage(0)
 
-    def getFleet(self, callback):
+    def getFleet(self, callback, force = False):
         """Get the fleet via the GUI and call the given callback."""
         self._fleetCallback = callback
-        self.gui.getFleet(self._fleetRetrieved)
+        self.gui.getFleet(callback = self._fleetRetrieved, force = force)
 
     def _fleetRetrieved(self, fleet):
@@ -2131,33 +2206,8 @@
         self._fleetCallback = None
         
-    def _updatePlane(self, callback, tailNumber, status, gateNumber = None):
+    def updatePlane(self, callback, tailNumber, status, gateNumber = None):
         """Update the given plane's gate information."""
-        self.gui.beginBusy(xstr("fleet_update_busy"))
-        self._updatePlaneCallback = callback
-        self.gui.webHandler.updatePlane(self._updatePlaneResultCallback,
-                                        tailNumber, status, gateNumber)
-
-    def _updatePlaneResultCallback(self, returned, result):
-        """Callback for the plane updating operation."""
-        gobject.idle_add(self._handleUpdatePlaneResult, returned, result)
-
-    def _handleUpdatePlaneResult(self, returned, result):
-        """Handle the result of a plane update operation."""
-        self.gui.endBusy()
-        if returned:
-            success = result.success
-        else:
-            success = None
-
-            dialog = gtk.MessageDialog(parent = self.gui.mainWindow,
-                                       type = MESSAGETYPE_ERROR,
-                                       message_format =
-                                       xstr("fleet_update_failed"))
-            dialog.add_button(xstr("button_ok"), RESPONSETYPE_OK)
-            dialog.set_title(WINDOW_TITLE_BASE)
-            dialog.run()
-            dialog.hide()
-
-        self._updatePlaneCallback(success)
+        self.gui.updatePlane(tailNumber, status, gateNumber = gateNumber,
+                             callback = callback)
 
     def _connectSimulator(self):
