Index: src/mlx/gui/flight.py
===================================================================
--- src/mlx/gui/flight.py	(revision 908)
+++ src/mlx/gui/flight.py	(revision 919)
@@ -32,5 +32,5 @@
 #
 # This module implements the main tab of the application, the flight
-# wizard. The wizard consists of \ref Page "pages", that come one yafter the
+# wizard. The wizard consists of \ref Page "pages", that come one after the
 # other. As some pages might be skipped, the pages dynamically store the index
 # of the previous page so that going back to it is simpler. The \ref
@@ -405,10 +405,10 @@
     def _offlineClicked(self, button):
         """Called when the offline button was clicked."""
-        print "mlx.flight.LoginPage: offline flight selected"
+        print("mlx.flight.LoginPage: offline flight selected")
         self._wizard.nextPage()
 
     def _loginClicked(self, button):
         """Called when the login button was clicked."""
-        print "mlx.flight.LoginPage: logging in"
+        print("mlx.flight.LoginPage: logging in")
         self._wizard.login(self._handleLoginResult,
                            self._pilotID.get_text(),
@@ -649,10 +649,10 @@
         if response==RESPONSETYPE_OK:
             fileName = text2unicode(dialog.get_filename())
-            print "Saving", fileName
+            print("Saving", fileName)
             try:
                 with open(fileName, "wt") as f:
                     flight.writeIntoFile(f)
-            except Exception, e:
-                print "Failed to save flight:", util.utf2unicode(str(e))
+            except Exception as e:
+                print("Failed to save flight:", util.utf2unicode(str(e)))
                 dialog = gtk.MessageDialog(parent = self._wizard.gui.mainWindow,
                                            type = MESSAGETYPE_ERROR,
@@ -706,5 +706,5 @@
         flight=self._getSelectedFlight()
 
-        print "DPI", context.get_dpi_x(), context.get_dpi_y()
+        print("DPI", context.get_dpi_x(), context.get_dpi_y())
 
         scale = context.get_dpi_x() / 72.0
@@ -719,5 +719,5 @@
 
         layout = cr.create_layout()
-        layout.set_text(u"Malév VA official briefing")
+        layout.set_text("Malév VA official briefing")
         font = pango.FontDescription("sans")
         font.set_size(int(32 * scale * pango.SCALE))
@@ -740,5 +740,5 @@
 
         layout = cr.create_layout()
-        layout.set_text(u"%s (%s) részére" %
+        layout.set_text("%s (%s) részére" %
                         (loginResult.pilotName, loginResult.pilotID))
         font = pango.FontDescription("sans")
@@ -940,5 +940,5 @@
         if response==RESPONSETYPE_OK:
             fileName = text2unicode(dialog.get_filename())
-            print "Loading", fileName
+            print("Loading", fileName)
             bookedFlight = web.BookedFlight()
             try:
@@ -946,6 +946,6 @@
                     bookedFlight.readFromFile(f)
                 self.addFlight(bookedFlight)
-            except Exception, e:
-                print "Failed to load flight:", util.utf2unicode(str(e))
+            except Exception as e:
+                print("Failed to load flight:", util.utf2unicode(str(e)))
                 dialog = gtk.MessageDialog(parent = self._wizard.gui.mainWindow,
                                            type = MESSAGETYPE_ERROR,
@@ -1629,13 +1629,13 @@
                                             self.phoneNumber, self.nationality,
                                             self.password)
-        print "Registering with data:"
-        print "  name:", self.name1, self.name2, registrationData.firstName, registrationData.surName, requestedNameOrder
-        print "  yearOfBirth:", self.yearOfBirth, registrationData.yearOfBirth
-        print "  emailAddress:", self.emailAddress, registrationData.emailAddress
-        print "  emailAddressPublic:", self.emailAddressPublic, registrationData.emailAddressPublic
-        print "  vatsimID:", self.vatsimID, registrationData.vatsimID
-        print "  ivaoID:", self.ivaoID, registrationData.ivaoID
-        print "  phoneNumber:", self.phoneNumber, registrationData.phoneNumber
-        print "  nationality:", self.nationality, registrationData.nationality
+        print("Registering with data:")
+        print("  name:", self.name1, self.name2, registrationData.firstName, registrationData.surName, requestedNameOrder)
+        print("  yearOfBirth:", self.yearOfBirth, registrationData.yearOfBirth)
+        print("  emailAddress:", self.emailAddress, registrationData.emailAddress)
+        print("  emailAddressPublic:", self.emailAddressPublic, registrationData.emailAddressPublic)
+        print("  vatsimID:", self.vatsimID, registrationData.vatsimID)
+        print("  ivaoID:", self.ivaoID, registrationData.ivaoID)
+        print("  phoneNumber:", self.phoneNumber, registrationData.phoneNumber)
+        print("  nationality:", self.nationality, registrationData.nationality)
 
         gui = self._wizard.gui
@@ -1653,13 +1653,13 @@
         gui.endBusy()
 
-        print "Registration result:"
-        print "  returned:", returned
+        print("Registration result:")
+        print("  returned:", returned)
         if returned:
-            print "  registered:", result.registered
+            print("  registered:", result.registered)
             if result.registered:
-                print "  pilotID", result.pilotID
-                print "  loggedIn", result.loggedIn
-            print "  emailAlreadyRegistered:", result.emailAlreadyRegistered
-            print "  invalidData:", result.invalidData
+                print("  pilotID", result.pilotID)
+                print("  loggedIn", result.loggedIn)
+            print("  emailAlreadyRegistered:", result.emailAlreadyRegistered)
+            print("  invalidData:", result.invalidData)
 
         registrationOK = returned and result.registered
@@ -1830,5 +1830,5 @@
     def activate(self):
         """Activate the student page."""
-        print "StudentPage.activate"
+        print("StudentPage.activate")
         self._getEntryExamStatusCancelled = False
 
@@ -1844,5 +1844,5 @@
     def finalize(self):
         """Finalize the page."""
-        print "StudentPage.finalize"
+        print("StudentPage.finalize")
         self._getEntryExamStatusCancelled = True
 
@@ -1864,5 +1864,5 @@
     def _handleEntryExamStatus(self, returned, result):
         """Called when the entry exam status is availabe."""
-        print "_handleEntryExamStatus", returned, result
+        print("_handleEntryExamStatus", returned, result)
         if returned and not self._getEntryExamStatusCancelled:
             self._entryExamLink = result.entryExamLink
@@ -2125,5 +2125,5 @@
                                   xscale = 0.0, yscale = 0.0)
 
-        table = gtk.Table(8, 3)
+        table = gtk.Table(7, 3)
         table.set_row_spacings(4)
         table.set_col_spacings(16)
@@ -2132,32 +2132,20 @@
         self.setMainWidget(alignment)
 
-        label = gtk.Label(xstr("payload_cockpit_crew"))
+        label = gtk.Label(xstr("payload_crew"))
         label.set_use_underline(True)
         label.set_alignment(0.0, 0.5)
         table.attach(label, 0, 1, 0, 1)
 
-        self._numCockpitCrew = IntegerEntry(defaultValue = 0)
-        self._numCockpitCrew.set_width_chars(6)
-        self._numCockpitCrew.connect("integer-changed", self._weightChanged)
-        self._numCockpitCrew.set_tooltip_text(xstr("payload_cockpit_crew_tooltip"))
-        table.attach(self._numCockpitCrew, 1, 2, 0, 1)
-        label.set_mnemonic_widget(self._numCockpitCrew)
-
-        label = gtk.Label(xstr("payload_cabin_crew"))
+        self._numCrew = IntegerEntry(defaultValue = 0)
+        self._numCrew.set_width_chars(6)
+        self._numCrew.connect("integer-changed", self._weightChanged)
+        self._numCrew.set_tooltip_text(xstr("payload_crew_tooltip"))
+        table.attach(self._numCrew, 1, 2, 0, 1)
+        label.set_mnemonic_widget(self._numCrew)
+
+        label = gtk.Label(xstr("payload_pax"))
         label.set_use_underline(True)
         label.set_alignment(0.0, 0.5)
         table.attach(label, 0, 1, 1, 2)
-
-        self._numCabinCrew = IntegerEntry(defaultValue = 0)
-        self._numCabinCrew.set_width_chars(6)
-        self._numCabinCrew.connect("integer-changed", self._weightChanged)
-        self._numCabinCrew.set_tooltip_text(xstr("payload_cabin_crew_tooltip"))
-        table.attach(self._numCabinCrew, 1, 2, 1, 2)
-        label.set_mnemonic_widget(self._numCabinCrew)
-
-        label = gtk.Label(xstr("payload_pax"))
-        label.set_use_underline(True)
-        label.set_alignment(0.0, 0.5)
-        table.attach(label, 0, 1, 2, 3)
 
         self._numPassengers = IntegerEntry(defaultValue = 0)
@@ -2165,5 +2153,5 @@
         self._numPassengers.connect("integer-changed", self._weightChanged)
         self._numPassengers.set_tooltip_text(xstr("payload_pax_tooltip"))
-        table.attach(self._numPassengers, 1, 2, 2, 3)
+        table.attach(self._numPassengers, 1, 2, 1, 2)
         label.set_mnemonic_widget(self._numPassengers)
 
@@ -2171,5 +2159,5 @@
         label.set_use_underline(True)
         label.set_alignment(0.0, 0.5)
-        table.attach(label, 0, 1, 3, 4)
+        table.attach(label, 0, 1, 2, 3)
 
         self._bagWeight = IntegerEntry(defaultValue = 0)
@@ -2177,13 +2165,13 @@
         self._bagWeight.connect("integer-changed", self._weightChanged)
         self._bagWeight.set_tooltip_text(xstr("payload_bag_tooltip"))
-        table.attach(self._bagWeight, 1, 2, 3, 4)
+        table.attach(self._bagWeight, 1, 2, 2, 3)
         label.set_mnemonic_widget(self._bagWeight)
 
-        table.attach(gtk.Label("kg"), 2, 3, 3, 4)
+        table.attach(gtk.Label("kg"), 2, 3, 2, 3)
 
         label = gtk.Label(xstr("payload_cargo"))
         label.set_use_underline(True)
         label.set_alignment(0.0, 0.5)
-        table.attach(label, 0, 1, 4, 5)
+        table.attach(label, 0, 1, 3, 4)
 
         self._cargoWeight = IntegerEntry(defaultValue = 0)
@@ -2191,13 +2179,13 @@
         self._cargoWeight.connect("integer-changed", self._weightChanged)
         self._cargoWeight.set_tooltip_text(xstr("payload_cargo_tooltip"))
-        table.attach(self._cargoWeight, 1, 2, 4, 5)
+        table.attach(self._cargoWeight, 1, 2, 3, 4)
         label.set_mnemonic_widget(self._cargoWeight)
 
-        table.attach(gtk.Label("kg"), 2, 3, 4, 5)
+        table.attach(gtk.Label("kg"), 2, 3, 3, 4)
 
         label = gtk.Label(xstr("payload_mail"))
         label.set_use_underline(True)
         label.set_alignment(0.0, 0.5)
-        table.attach(label, 0, 1, 5, 6)
+        table.attach(label, 0, 1, 4, 5)
 
         self._mailWeight = IntegerEntry(defaultValue = 0)
@@ -2205,20 +2193,20 @@
         self._mailWeight.connect("integer-changed", self._weightChanged)
         self._mailWeight.set_tooltip_text(xstr("payload_mail_tooltip"))
-        table.attach(self._mailWeight, 1, 2, 5, 6)
+        table.attach(self._mailWeight, 1, 2, 4, 5)
         label.set_mnemonic_widget(self._mailWeight)
 
-        table.attach(gtk.Label("kg"), 2, 3, 5, 6)
+        table.attach(gtk.Label("kg"), 2, 3, 4, 5)
 
         label = gtk.Label("<b>" + xstr("payload_zfw") + "</b>")
         label.set_alignment(0.0, 0.5)
         label.set_use_markup(True)
-        table.attach(label, 0, 1, 6, 7)
+        table.attach(label, 0, 1, 5, 6)
 
         self._calculatedZFW = gtk.Label()
         self._calculatedZFW.set_width_chars(6)
         self._calculatedZFW.set_alignment(1.0, 0.5)
-        table.attach(self._calculatedZFW, 1, 2, 6, 7)
-
-        table.attach(gtk.Label("kg"), 2, 3, 6, 7)
+        table.attach(self._calculatedZFW, 1, 2, 5, 6)
+
+        table.attach(gtk.Label("kg"), 2, 3, 5, 6)
 
         self._zfwButton = gtk.Button(xstr("payload_fszfw"))
@@ -2226,13 +2214,13 @@
         self._zfwButton.connect("clicked", self._zfwRequested)
         self._zfwButton.set_tooltip_text(xstr("payload_fszfw_tooltip"))
-        table.attach(self._zfwButton, 0, 1, 7, 8)
+        table.attach(self._zfwButton, 0, 1, 6, 7)
 
         self._simulatorZFW = gtk.Label("-")
         self._simulatorZFW.set_width_chars(6)
         self._simulatorZFW.set_alignment(1.0, 0.5)
-        table.attach(self._simulatorZFW, 1, 2, 7, 8)
+        table.attach(self._simulatorZFW, 1, 2, 6, 7)
         self._simulatorZFWValue = None
 
-        table.attach(gtk.Label("kg"), 2, 3, 7, 8)
+        table.attach(gtk.Label("kg"), 2, 3, 6, 7)
 
         self.addCancelFlightButton()
@@ -2241,12 +2229,7 @@
 
     @property
-    def numCockpitCrew(self):
-        """The number of the cockpit crew members on the flight."""
-        return self._numCockpitCrew.get_int()
-
-    @property
-    def numCabinCrew(self):
-        """The number of the cabin crew members on the flight."""
-        return self._numCabinCrew.get_int()
+    def numCrew(self):
+        """The number of the crew members on the flight."""
+        return self._numCrew.get_int()
 
     @property
@@ -2273,14 +2256,7 @@
         """Setup the information."""
         bookedFlight = self._wizard._bookedFlight
-        aircraft = self._wizard.gui._flight.aircraft
-
-        numCockpitCrew = bookedFlight.numCockpitCrew
-        numCabinCrew = bookedFlight.numCabinCrew
-        numCrew = numCockpitCrew + numCabinCrew
-
-        self._numCockpitCrew.set_int(numCockpitCrew)
-        self._numCockpitCrew.set_sensitive(True)
-        self._numCabinCrew.set_int(numCabinCrew)
-        self._numCabinCrew.set_sensitive(True)
+
+        self._numCrew.set_int(bookedFlight.numCrew)
+        self._numCrew.set_sensitive(True)
         self._numPassengers.set_int(bookedFlight.numPassengers)
         self._numPassengers.set_sensitive(True)
@@ -2300,6 +2276,5 @@
     def finalize(self):
         """Finalize the payload page."""
-        self._numCockpitCrew.set_sensitive(False)
-        self._numCabinCrew.set_sensitive(False)
+        self._numCrew.set_sensitive(False)
         self._numPassengers.set_sensitive(False)
         self._bagWeight.set_sensitive(False)
@@ -2310,13 +2285,9 @@
     def calculateZFW(self):
         """Calculate the ZFW value."""
-        aircraft = self._wizard.gui._flight.aircraft
         zfw = self._wizard.gui._flight.aircraft.dow
-        zfw += (self.numCockpitCrew - aircraft.dowCockpit) * aircraft.cockpitCrewWeight
-        zfw += (self.numCabinCrew - aircraft.dowCabin) * aircraft.cabinCrewWeight
-        zfw += (self._numPassengers.get_int()) * aircraft.humanWeight
+        zfw += (self._numCrew.get_int() + self._numPassengers.get_int()) * 82
         zfw += self._bagWeight.get_int()
         zfw += self._cargoWeight.get_int()
         zfw += self._mailWeight.get_int()
-        zfw = int(zfw)
         return zfw
 
@@ -3020,5 +2991,5 @@
 
             plan = self._getPlan()
-            print "plan:", plan
+            print("plan:", plan)
 
             takeoffRunway = self._takeoffRunway.get_text()
@@ -3056,5 +3027,5 @@
         are returned. Otherwise a dialog box is displayed informing the user of
         invalid credentials and requesting another set of them."""
-        print "_getCredentials", count
+        print("_getCredentials", count)
         if count==0:
             return (self._userName.get_text(), self._password.get_text())
@@ -3090,5 +3061,5 @@
     def _simBriefProgress(self, progress, result, flightInfo):
         """The real SimBrief progress handler."""
-        print "_simBriefProgress", progress, result, flightInfo
+        print("_simBriefProgress", progress, result, flightInfo)
         if result==cef.SIMBRIEF_RESULT_NONE:
             message = SimBriefSetupPage.progress2Message.get(progress,
@@ -3787,5 +3758,5 @@
     def _metarChanged(self, buffer):
         """Called when the METAR has changed."""
-        print "BriefingPage.metarChanged", self._updatingMETAR
+        print("BriefingPage.metarChanged", self._updatingMETAR)
         if not self._updatingMETAR:
             self.metarEdited = True
@@ -3799,5 +3770,5 @@
 
         It uppercases all characters."""
-        print "BriefingPage.metarInserted", self._updatingMETAR
+        print("BriefingPage.metarInserted", self._updatingMETAR)
         if not self._updatingMETAR:
             self._updatingMETAR = True
@@ -4054,5 +4025,5 @@
     def activate(self):
         """Activate the page."""
-        print "TakeoffPage.activate"
+        print("TakeoffPage.activate")
 
         self._updatingMETAR = True
@@ -4098,5 +4069,5 @@
     def allowForward(self):
         """Allow going to the next page."""
-        print "TakeoffPage.allowForward"
+        print("TakeoffPage.allowForward")
         self._forwardAllowed = True
         self._updateForwardButton()
@@ -4104,5 +4075,5 @@
     def reset(self):
         """Reset the page if the wizard is reset."""
-        print "TakeoffPage.reset"
+        print("TakeoffPage.reset")
 
         super(TakeoffPage, self).reset()
@@ -4124,5 +4095,5 @@
         pages."""
         if self._active:
-            print "TakeoffPage.changeMETAR"
+            print("TakeoffPage.changeMETAR")
             self._updatingMETAR = True
             self._metar.get_buffer().set_text(metar, -1)
@@ -4145,14 +4116,14 @@
                      self.derate is not None)
 
-        print "TakeoffPage._updateForwardButton: forwardAllowed:", self._forwardAllowed, ", sensitive:", sensitive
+        print("TakeoffPage._updateForwardButton: forwardAllowed:", self._forwardAllowed, ", sensitive:", sensitive)
         if self._forwardAllowed:
-            print "  METAR: ", self._metar.get_text()
-            print "  runway: ", self._runway.get_text()
-            print "  SID:", self.sid
-            print "  V1:", self.v1
-            print "  VR:", self.vr
-            print "  V2:", self.v2
-            print "  derateType:", self._derateType
-            print "  derate:", self.derate
+            print("  METAR: ", self._metar.get_text())
+            print("  runway: ", self._runway.get_text())
+            print("  SID:", self.sid)
+            print("  V1:", self.v1)
+            print("  VR:", self.vr)
+            print("  V2:", self.v2)
+            print("  derateType:", self._derateType)
+            print("  derate:", self.derate)
 
         self._button.set_sensitive(sensitive)
@@ -4160,5 +4131,5 @@
     def _valueChanged(self, widget, arg = None):
         """Called when the value of some widget has changed."""
-        print "TakeoffPage._valueChanged"
+        print("TakeoffPage._valueChanged")
 
         self._updateForwardButton()
@@ -4167,5 +4138,5 @@
         """Called when the value of some entry widget has changed and the value
         should be converted to uppercase."""
-        print "TakeoffPage._upperChanged"
+        print("TakeoffPage._upperChanged")
         entry.set_text(entry.get_text().upper())
         self._valueChanged(entry, arg)
@@ -4180,5 +4151,5 @@
     def _derateChanged(self, entry):
         """Called when the value of the derate is changed."""
-        print "TakeoffPage._derateChanged"
+        print("TakeoffPage._derateChanged")
         self._updateForwardButton()
 
@@ -4291,5 +4262,5 @@
     def _metarChanged(self, entry):
         """Called when the METAR has changed."""
-        print "TakeoffPage.metarChanged", self._updatingMETAR
+        print("TakeoffPage.metarChanged", self._updatingMETAR)
         if not self._updatingMETAR:
             self._updateForwardButton()
@@ -4300,5 +4271,5 @@
 
         It uppercases all characters."""
-        print "TakeoffPage.metarInserted", self._updatingMETAR
+        print("TakeoffPage.metarInserted", self._updatingMETAR)
         if not self._updatingMETAR:
             self._updatingMETAR = True
@@ -4657,5 +4628,5 @@
         pages."""
         if self._active:
-            print "LandingPage.changeMETAR"
+            print("LandingPage.changeMETAR")
             self._updatingMETAR = True
             self._metar.get_buffer().set_text(metar, -1)
@@ -4718,5 +4689,5 @@
     def _metarChanged(self, entry):
         """Called when the METAR has changed."""
-        print "LandingPage.metarChanged", self._updatingMETAR
+        print("LandingPage.metarChanged", self._updatingMETAR)
         if not self._updatingMETAR:
             self._updateForwardButton()
@@ -4727,5 +4698,5 @@
 
         It uppercases all characters."""
-        print "LandingPage.metarInserted", self._updatingMETAR
+        print("LandingPage.metarInserted", self._updatingMETAR)
         if not self._updatingMETAR:
             self._updatingMETAR = True
@@ -5246,7 +5217,8 @@
         pass
 
-    def _formatTime(self, scheduledTime, realTimestamp, (warning, error)):
+    def _formatTime(self, scheduledTime, realTimestamp, xxx_todo_changeme):
         """Format the departure or arrival time based on the given data as a
         markup for a label."""
+        (warning, error) = xxx_todo_changeme
         realTime = time.gmtime(realTimestamp)
 
@@ -5570,12 +5542,7 @@
 
     @property
-    def numCockpitCrew(self):
-        """Get the number of cockpit crew members."""
-        return self._payloadPage.numCockpitCrew
-
-    @property
-    def numCabinCrew(self):
-        """Get the number of cabin crew members."""
-        return self._payloadPage.numCabinCrew
+    def numCrew(self):
+        """Get the number of crew members."""
+        return self._payloadPage.numCrew
 
     @property
@@ -5786,5 +5753,5 @@
         elif stage==const.STAGE_LANDING:
             if not self._arrivalBriefingPage.metarEdited:
-                print "Downloading arrival METAR again"
+                print("Downloading arrival METAR again")
                 self.gui.webHandler.getMETARs(self._arrivalMETARCallback,
                                               [self._bookedFlight.arrivalICAO])
@@ -5925,5 +5892,4 @@
                 self._loginResult = result
                 self.gui.loginSuccessful()
-                acft.setupTypes(result.aircraftTypes)
             else:
                 if isReload:
