Ignore:
Timestamp:
03/14/22 09:58:58 (2 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
python3
hg-Phase:
(<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
Message:

Updated the flight type handling (re #357)

File:
1 edited

Legend:

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

    r1033 r1034  
    23292329        self._bagWeight.set_sensitive(True)
    23302330
    2331         if bookedFlight.flightType==BookedFlight.FLIGHT_TYPE_CHARTER:
     2331        if bookedFlight.flightType==const.FLIGHTTYPE_CHARTER:
    23322332            self._cargoWeight.set_int(0)
    23332333            self._cargoWeight.set_sensitive(False)
     
    23652365        zfw += self._numPassengers.get_int() * \
    23662366            (const.WEIGHT_PASSENGER_CHARTER
    2367              if bookedFlight.flightType==BookedFlight.FLIGHT_TYPE_CHARTER
     2367             if bookedFlight.flightType==const.FLIGHTTYPE_CHARTER
    23682368             else const.WEIGHT_PASSENGER)
    23692369        zfw += self._numChildren.get_int() * const.WEIGHT_CHILD
     
    51075107        table.attach(labelAlignment, 0, 1, row, row+1)
    51085108
    5109         self._flightType = createFlightTypeComboBox()
    5110         self._flightType.set_tooltip_text(xstr("finish_type_tooltip"))
    5111         self._flightType.set_active(0)
    5112         self._flightType.connect("changed", self._flightTypeChanged)
    5113         flightTypeAlignment = Gtk.Alignment(xalign=0.0, xscale=0.0)
    5114         flightTypeAlignment.add(self._flightType)
    5115         table.attach(flightTypeAlignment, 1, 2, row, row+1)
    5116         label.set_mnemonic_widget(self._flightType)
    5117 
    5118         row += 1
    5119 
    51205109        self._onlineFlight = Gtk.CheckButton(xstr("finish_online"))
    51215110        self._onlineFlight.set_use_underline(True)
     
    51785167
    51795168    @property
    5180     def flightType(self):
    5181         """Get the flight type."""
    5182         index = self._flightType.get_active()
    5183         return None if index<0 else self._flightType.get_model()[index][1]
    5184 
    5185     @property
    51865169    def online(self):
    51875170        """Get whether the flight was an online flight or not."""
     
    52155198                                  (flight.startFuel - flight.endFuel,))
    52165199
    5217         self._flightType.set_active(-1)
    52185200        self._onlineFlight.set_active(self._wizard.loggedIn)
    52195201
     
    52405222        gui = self._wizard.gui
    52415223        faultsExplained = gui.faultsFullyExplained
    5242         timesCorrect = self.flightType is None or \
    5243                        not self._tooBigTimeDifference or \
     5224        timesCorrect = not self._tooBigTimeDifference or \
    52445225                       gui.hasComments or gui.hasDelayCode
    52455226        sensitive = gui.flight is not None and \
    52465227                    gui.flight.stage==const.STAGE_END and \
    5247                     self._flightType.get_active()>=0 and \
    52485228                    (self._gatesModel.get_iter_first() is None or
    52495229                     self._gate.get_active()>=0) and \
     
    52815261        """Called when the Back button is pressed."""
    52825262        self.goBack()
    5283 
    5284     def _flightTypeChanged(self, comboBox):
    5285         """Called when the flight type has changed."""
    5286         self._updateTimes()
    52875263
    52885264    def _gateChanged(self, comboBox):
     
    53745350        (arrivalWarning, arrivalError) = flight.blockTimeEndWrong
    53755351
    5376         if self.flightType==const.FLIGHTTYPE_VIP:
     5352        if bookedFlight.flightType==const.FLIGHTTYPE_VIP:
    53775353            departureError = arrivalError = False
    53785354
    5379         self._tooBigTimeDifference = departureError or arrivalError
     5355        self._tooBigTimeDifference = departureError and arrivalError
    53805356
    53815357        self._depTime.set_markup(self._formatTime(bookedFlight.departureTime,
Note: See TracChangeset for help on using the changeset viewer.