Changeset 1139:9754005a7e70 for src/mlx
- Timestamp:
- 04/21/24 08:49:36 (7 months ago)
- Branch:
- python3
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/flight.py
r1120 r1139 2705 2705 changed.""" 2706 2706 bookedFlight = self._wizard._bookedFlight 2707 numPassengers = \ 2708 self._numPassengers.get_int() + \ 2709 self._numChildren.get_int() + \ 2710 self._numInfants.get_int() 2711 minCabinCrew = 0 if numPassengers==0 else \ 2707 numPassengers = self._numPassengers.get_int() 2708 numSeatsOccupied = numPassengers + self._numChildren.get_int() 2709 minCabinCrew = 0 if numSeatsOccupied==0 else \ 2712 2710 (bookedFlight.maxPassengers // 50) + 1 2713 2711 … … 2724 2722 self._crewLabel.set_use_underline(True) 2725 2723 2726 tooManyPassengers = numPassengers>bookedFlight.maxPassengers 2727 if tooManyPassengers: 2724 tooManyPassengers = numSeatsOccupied>bookedFlight.maxPassengers 2725 tooManyInfants = self._numInfants.get_int() > numPassengers 2726 if tooManyPassengers or tooManyInfants: 2728 2727 self._paxLabel.set_markup("<b><span foreground=\"red\">" + 2729 2728 xstr("payload_pax") + 2730 2729 "</span></b>") 2731 extraHelp.append(xstr("payload_help_many_pax") % (bookedFlight.maxPassengers,))2732 2730 else: 2733 2731 self._paxLabel.set_text(xstr("payload_pax")) 2732 2733 if tooManyPassengers: 2734 extraHelp.append(xstr("payload_help_many_pax") % 2735 (bookedFlight.maxPassengers,)) 2736 elif tooManyInfants: 2737 extraHelp.append(xstr("payload_help_many_infants") % 2738 (numPassengers,)) 2739 2734 2740 self._paxLabel.set_use_underline(True) 2735 2741 … … 2740 2746 self.setHelp(hlp) 2741 2747 2742 self._button.set_sensitive(enoughCrew and not tooManyPassengers )2743 2748 self._button.set_sensitive(enoughCrew and not tooManyPassengers and 2749 not tooManyInfants) 2744 2750 2745 2751 self._updateCalculatedZFW()
Note:
See TracChangeset
for help on using the changeset viewer.