Index: src/mlx/gui/flight.py
===================================================================
--- src/mlx/gui/flight.py	(revision 58)
+++ src/mlx/gui/flight.py	(revision 59)
@@ -494,4 +494,27 @@
 #-----------------------------------------------------------------------------
 
+class PayloadPage(Page):
+    """Page to allow setting up the payload."""
+    def __init__(self, wizard):
+        """Construct the page."""
+        help = "The briefing contains the weights below.\n" \
+               "Setup the cargo weight and check if the simulator\n" \
+               "reports the expected Zero Fuel Weight."
+        super(PayloadPage, self).__init__(wizard, "Payload", help)
+
+        button = gtk.Button("_Query ZFW")
+        button.connect("clicked", self._zfwRequested)
+        self.setMainWidget(button)
+
+    def _zfwRequested(self, button):
+        """Called when the ZFW is requested from the simulator."""
+        self._wizard.gui.simulator.requestZFW(self._handleZFW)
+
+    def _handleZFW(self, zfw):
+        """Called when the ZFW value is retrieved."""
+        print "ZFW", zfw
+
+#-----------------------------------------------------------------------------
+
 class Wizard(gtk.VBox):
     """The flight wizard."""
@@ -509,4 +532,5 @@
         self._pages.append(GateSelectionPage(self))
         self._pages.append(ConnectPage(self))
+        self._pages.append(PayloadPage(self))
 
         maxWidth = 0
@@ -523,17 +547,5 @@
         self.set_size_request(maxWidth, maxHeight)
 
-        self._fleet = None
-        self._fleetCallback = None
-        self._updatePlaneCallback = None
-        
-        self._loginResult = None
-        self._bookedFlight = None
-        self._departureGate = "-"
-
-        self._logger = Logger(output = gui)
-        self._flight = None
-        self._simulator = None
-        
-        self.setCurrentPage(0)
+        self._initialize()
         
     @property
@@ -567,4 +579,28 @@
         self._pages[self._currentPage].grabDefault()
 
+    def connected(self, fsType, descriptor):
+        """Called when the connection could be made to the simulator."""
+        self.nextPage()
+
+    def connectionFailed(self):
+        """Called when the connection could not be made to the simulator."""
+        self._initialize()
+
+    def disconnected(self):
+        """Called when we have disconnected from the simulator."""
+        self._initialize()
+
+    def _initialize(self):
+        """Initialize the wizard."""
+        self._fleet = None
+        self._fleetCallback = None
+        self._updatePlaneCallback = None
+        
+        self._loginResult = None
+        self._bookedFlight = None
+        self._departureGate = "-"
+
+        self.setCurrentPage(0)
+        
     def _getFleet(self, callback, force = False):
         """Get the fleet, if needed.
@@ -634,20 +670,5 @@
     def _connectSimulator(self):
         """Connect to the simulator."""
-        self._logger.reset()
-        self._flight = Flight(self.gui._logger, self.gui)
-
-        self._flight.aircraftType = self._bookedFlight.aircraftType
-        aircraft = self._flight.aircraft = Aircraft.create(self._flight)
-        self._flight.aircraft._checkers.append(self.gui)
-        
-        self._flight.cruiseAltitude = -1        
-        self._flight.zfw = -1
-
-        if self._simulator is None:
-            self._simulator = fs.createSimulator(const.SIM_MSFS9, self.gui)
-
-        self._flight.simulator = self._simulator 
-        self._simulator.connect(aircraft)
-        #self._simulator.startMonitoring()
+        self.gui.connectSimulator(self._bookedFlight.aircraftType)
     
 #-----------------------------------------------------------------------------
Index: src/mlx/gui/gui.py
===================================================================
--- src/mlx/gui/gui.py	(revision 51)
+++ src/mlx/gui/gui.py	(revision 59)
@@ -43,8 +43,10 @@
         self.config = config
         self._connecting = False
+        self._reconnecting = False
         self._connected = False
         self._logger = logger.Logger(output = self)
         self._flight = None
         self._simulator = None
+        self._monitoring = False
 
         self._stdioLock = threading.Lock()
@@ -127,4 +129,9 @@
                                       else gdk.WATCH)
 
+    @property
+    def simulator(self):
+        """Get the simulator used by us."""
+        return self._simulator
+        
     def run(self):
         """Run the GUI."""
@@ -140,6 +147,8 @@
         if self._flight is not None:
             simulator = self._flight.simulator
-            simulator.stopMonitoring()
-            simulator.disconnect()            
+            if self._monitoring:
+                simulator.stopMonitoring()
+                self._monitoring = False
+            simulator.disconnect()                        
 
     def connected(self, fsType, descriptor):
@@ -147,6 +156,46 @@
         self._connected = True
         self._logger.untimedMessage("Connected to the simulator %s" % (descriptor,))
-        gobject.idle_add(self._statusbar.updateConnection,
-                         self._connecting, self._connected)
+        gobject.idle_add(self._handleConnected, fsType, descriptor)
+
+    def _handleConnected(self, fsType, descriptor):
+        """Called when the connection to the simulator has succeeded."""
+        self._statusbar.updateConnection(self._connecting, self._connected)
+        self.endBusy()
+        if not self._reconnecting:
+            self._wizard.connected(fsType, descriptor)
+        self._reconnecting = False
+
+    def connectionFailed(self):
+        """Called when the connection failed."""
+        self._logger.untimedMessage("Connection to the simulator failed")
+        gobject.idle_add(self._connectionFailed)
+
+    def _connectionFailed(self):
+        """Called when the connection failed."""
+        self.endBusy()
+        self._statusbar.updateConnection(self._connecting, self._connected)
+
+        dialog = gtk.MessageDialog(type = MESSAGETYPE_ERROR,
+                                   message_format =
+                                   "Cannot connect to the simulator.",
+                                   parent = self._mainWindow)
+        dialog.format_secondary_markup("Rectify the situation, and press <b>Try again</b> "
+                                       "to try the connection again, " 
+                                       "or <b>Cancel</b> to cancel the flight.")
+        
+        dialog.add_button("_Cancel", 0)
+        dialog.add_button("_Try again", 1)
+        dialog.set_default_response(1)
+        
+        result = dialog.run()
+        dialog.hide()
+        if result == 1:
+            self.beginBusy("Connecting to the simulator.")
+            self._simulator.reconnect()
+        else:
+            self._connecting = False
+            self._reconnecting = False
+            self._statusbar.updateConnection(self._connecting, self._connected)
+            self._wizard.connectionFailed()
         
     def disconnected(self):
@@ -154,6 +203,36 @@
         self._connected = False
         self._logger.untimedMessage("Disconnected from the simulator")
-        gobject.idle_add(self._statusbar.updateConnection,
-                         self._connecting, self._connected)
+
+        gobject.idle_add(self._disconnected)
+
+    def _disconnected(self):
+        """Called when we have disconnected from the simulator unexpectedly."""        
+        self._statusbar.updateConnection(self._connecting, self._connected)
+
+        dialog = gtk.MessageDialog(type = MESSAGETYPE_ERROR,
+                                   message_format =
+                                   "The connection to the simulator failed unexpectedly.",
+                                   parent = self._mainWindow)
+        dialog.format_secondary_markup("If the simulator has crashed, restart it "
+                                       "and restore your flight as much as possible "
+                                       "to the state it was in before the crash.\n"
+                                       "Then press <b>Reconnect</b> to reconnect.\n\n"
+                                       "If you want to cancel the flight, press <b>Cancel</b>.")
+
+        dialog.add_button("_Cancel", 0)
+        dialog.add_button("_Reconnect", 1)
+        dialog.set_default_response(1)
+
+        result = dialog.run()
+        dialog.hide()
+        if result == 1:
+            self.beginBusy("Connecting to the simulator.")
+            self._reconnecting = True
+            self._simulator.reconnect()
+        else:
+            self._connecting = False
+            self._reconnecting = False
+            self._statusbar.updateConnection(self._connecting, self._connected)
+            self._wizard.disconnected()
 
     def write(self, msg):
@@ -285,32 +364,44 @@
             self._stdioAfterNewLine = False
 
+    def connectSimulator(self, aircraftType):
+        """Connect to the simulator for the first time."""
+        self._logger.reset()
+
+        self._flight = flight.Flight(self._logger, self)
+        self._flight.aircraftType = aircraftType
+        self._flight.aircraft = acft.Aircraft.create(self._flight)
+        self._flight.aircraft._checkers.append(self)
+        
+        if self._simulator is None:
+            self._simulator = fs.createSimulator(const.SIM_MSFS9, self)
+
+        self._flight.simulator = self._simulator
+
+        self.beginBusy("Connecting to the simulator...")
+        self._statusbar.updateConnection(self._connecting, self._connected)
+
+        self._connecting = True
+        self._simulator.connect(self._flight.aircraft)        
+
     def _connectToggled(self, button):
         """Callback for the connection button."""
         if self._connectButton.get_active():
-            self._logger.reset()
-            self._flight = flight.Flight(self._logger, self)
-
             acftListModel = self._acftList.get_model()
-            self._flight.aircraftType = \
-                acftListModel[self._acftList.get_active()][1]
-            self._flight.aircraft = acft.Aircraft.create(self._flight)
-            self._flight.aircraft._checkers.append(self)
-
+            self.connectSimulator(acftListModel[self._acftList.get_active()][1])
+            
             self._flight.cruiseAltitude = self._flSpinButton.get_value_as_int() * 100
 
             self._flight.zfw = self._zfwSpinButton.get_value_as_int()
-
-            if self._simulator is None:
-                self._simulator = fs.createSimulator(const.SIM_MSFS9, self)
-
-            self._flight.simulator = self._simulator
-
-            self._connecting = True
-            self._simulator.connect(self._flight.aircraft)
+            
             self._simulator.startMonitoring()
+            self._monitoring = True
         else:
             self.resetFlightStatus()
             self._connecting = False
+            self._connected = False
+
             self._simulator.stopMonitoring()
+            self._monitoring = False
+
             self._simulator.disconnect()
             self._flight = None
Index: src/mlx/gui/statusbar.py
===================================================================
--- src/mlx/gui/statusbar.py	(revision 49)
+++ src/mlx/gui/statusbar.py	(revision 59)
@@ -87,5 +87,5 @@
     
     def _drawConnState(self, connStateArea, eventOrContext):
-        """Draw the connection state."""
+        """Draw the connection state."""        
         context = eventOrContext if pygobject else connStateArea.window.cairo_create()
 
