Changeset 1034:4836f52b49cd for src/mlx/gui/flight.py
- Timestamp:
- 03/14/22 09:58:58 (2 years ago)
- Branch:
- python3
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/flight.py
r1033 r1034 2329 2329 self._bagWeight.set_sensitive(True) 2330 2330 2331 if bookedFlight.flightType== BookedFlight.FLIGHT_TYPE_CHARTER:2331 if bookedFlight.flightType==const.FLIGHTTYPE_CHARTER: 2332 2332 self._cargoWeight.set_int(0) 2333 2333 self._cargoWeight.set_sensitive(False) … … 2365 2365 zfw += self._numPassengers.get_int() * \ 2366 2366 (const.WEIGHT_PASSENGER_CHARTER 2367 if bookedFlight.flightType== BookedFlight.FLIGHT_TYPE_CHARTER2367 if bookedFlight.flightType==const.FLIGHTTYPE_CHARTER 2368 2368 else const.WEIGHT_PASSENGER) 2369 2369 zfw += self._numChildren.get_int() * const.WEIGHT_CHILD … … 5107 5107 table.attach(labelAlignment, 0, 1, row, row+1) 5108 5108 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 += 15119 5120 5109 self._onlineFlight = Gtk.CheckButton(xstr("finish_online")) 5121 5110 self._onlineFlight.set_use_underline(True) … … 5178 5167 5179 5168 @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 @property5186 5169 def online(self): 5187 5170 """Get whether the flight was an online flight or not.""" … … 5215 5198 (flight.startFuel - flight.endFuel,)) 5216 5199 5217 self._flightType.set_active(-1)5218 5200 self._onlineFlight.set_active(self._wizard.loggedIn) 5219 5201 … … 5240 5222 gui = self._wizard.gui 5241 5223 faultsExplained = gui.faultsFullyExplained 5242 timesCorrect = self.flightType is None or \ 5243 not self._tooBigTimeDifference or \ 5224 timesCorrect = not self._tooBigTimeDifference or \ 5244 5225 gui.hasComments or gui.hasDelayCode 5245 5226 sensitive = gui.flight is not None and \ 5246 5227 gui.flight.stage==const.STAGE_END and \ 5247 self._flightType.get_active()>=0 and \5248 5228 (self._gatesModel.get_iter_first() is None or 5249 5229 self._gate.get_active()>=0) and \ … … 5281 5261 """Called when the Back button is pressed.""" 5282 5262 self.goBack() 5283 5284 def _flightTypeChanged(self, comboBox):5285 """Called when the flight type has changed."""5286 self._updateTimes()5287 5263 5288 5264 def _gateChanged(self, comboBox): … … 5374 5350 (arrivalWarning, arrivalError) = flight.blockTimeEndWrong 5375 5351 5376 if self.flightType==const.FLIGHTTYPE_VIP:5352 if bookedFlight.flightType==const.FLIGHTTYPE_VIP: 5377 5353 departureError = arrivalError = False 5378 5354 5379 self._tooBigTimeDifference = departureError orarrivalError5355 self._tooBigTimeDifference = departureError and arrivalError 5380 5356 5381 5357 self._depTime.set_markup(self._formatTime(bookedFlight.departureTime,
Note:
See TracChangeset
for help on using the changeset viewer.