Changeset 1034:4836f52b49cd for src/mlx/gui
- Timestamp:
- 03/14/22 09:58:58 (3 years ago)
- Branch:
- python3
- Phase:
- public
- Location:
- src/mlx/gui
- Files:
-
- 3 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, -
src/mlx/gui/pirep.py
r1033 r1034 387 387 self._flownMailWeight.set_text("%.0f" % (pirep.mailWeight,)) 388 388 self._flightType.set_text(xstr("flighttype_" + 389 flightType2string(pirep. flightType)))389 flightType2string(pirep.bookedFlight.flightType))) 390 390 self._online.set_text(xstr("pirepView_" + 391 391 ("yes" if pirep.online else "no"))) … … 956 956 self._flownCargoWeight.set_value(pirep.cargoWeight) 957 957 self._flownMailWeight.set_value(pirep.mailWeight) 958 self._flightType.set_active(flightType2index(pirep.flightType)) 958 self._flightType.set_text(xstr("flighttype_" + 959 flightType2string(pirep.bookedFlight.flightType))) 959 960 self._online.set_active(pirep.online) 960 961 … … 1444 1445 self._flownMailWeight.set_tooltip_text(xstr("payload_mail_tooltip")) 1445 1446 1446 self._flightType = createFlightTypeComboBox()1447 self._flightType = PIREPViewer.getDataLabel(width = 3) 1447 1448 PIREPEditor.tableAttachWidget(table, 0, 2, 1448 1449 xstr("pirepView_flightType"), 1449 1450 self._flightType) 1450 self._flightType.connect("changed", self._updateButtons)1451 self._flightType.set_tooltip_text(xstr("pirepEdit_flight_type_tooltip"))1452 1451 1453 1452 self._online = Gtk.CheckButton(xstr("pirepEdit_online")) … … 1608 1607 pirep.mailWeight = self._flownMailWeight.get_value() 1609 1608 1610 pirep.flightType = flightTypes[self._flightType.get_active()]1611 1609 pirep.online = self._online.get_active() 1612 1610 -
src/mlx/gui/weighthelp.py
r1033 r1034 4 4 from mlx.i18n import xstr 5 5 from mlx.checks import PayloadChecker 6 from mlx.rpc import BookedFlight7 6 8 7 import mlx.const as const … … 441 440 return self._pax * \ 442 441 (const.WEIGHT_PASSENGER_CHARTER 443 if self._flightType== BookedFlight.FLIGHT_TYPE_CHARTER442 if self._flightType==const.FLIGHTTYPE_CHARTER 444 443 else const.WEIGHT_PASSENGER) + \ 445 444 self._children * const.WEIGHT_CHILD + \
Note:
See TracChangeset
for help on using the changeset viewer.