Changeset 1167:73ea9ed7e1da for src
- Timestamp:
- 07/13/24 12:37:01 (4 months ago)
- Branch:
- python3
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/flight.py
r1160 r1167 67 67 comboModel.append(("N/A",)) 68 68 comboModel.append(("VECTORS",)) 69 70 approachModel = Gtk.ListStore(GObject.TYPE_STRING) 71 approachModel.append(("ILS",)) 72 approachModel.append(("RNAV",)) 73 approachModel.append(("RNAV X",)) 74 approachModel.append(("RNAV Y",)) 75 approachModel.append(("RNAV Z",)) 76 approachModel.append(("RNP",)) 77 approachModel.append(("RNP X",)) 78 approachModel.append(("RNP Y",)) 79 approachModel.append(("RNP Z",)) 80 approachModel.append(("LOC",)) 81 approachModel.append(("LOC DME",)) 82 approachModel.append(("LOC DME X",)) 83 approachModel.append(("LOC DME Y",)) 84 approachModel.append(("LOC DME Z",)) 85 approachModel.append(("LCTR",)) 86 approachModel.append(("VOR",)) 87 approachModel.append(("VOR DME",)) 88 approachModel.append(("VOR DME X",)) 89 approachModel.append(("VOR DME Y",)) 90 approachModel.append(("VOR DME Z",)) 91 approachModel.append(("NDB",)) 92 approachModel.append(("VISUAL",)) 93 approachModel.append(("OTHER",)) 69 94 70 95 #----------------------------------------------------------------------------- … … 5433 5458 table.attach(label, 1, 2, row, row + 1) 5434 5459 5435 self._approachType = Gtk.Entry() 5436 self._approachType.set_width_chars(10) 5460 self._approachType = Gtk.ComboBox(model = approachModel) 5461 renderer = Gtk.CellRendererText() 5462 self._approachType.pack_start(renderer, True) 5463 self._approachType.add_attribute(renderer, "text", 0) 5437 5464 self._approachType.set_tooltip_text(xstr("landing_approach_tooltip")) 5438 self._approachType. connect("changed", self._upperChanged)5465 self._approachType.set_sensitive(False) 5439 5466 table.attach(self._approachType, 2, 4, row, row + 1) 5440 5467 label.set_mnemonic_widget(self._approachType) … … 5490 5517 def approachType(self): 5491 5518 """Get the approach type.""" 5492 return self._approachType.get_text() 5519 index = self._approachType.get_active() 5520 return self._approachType.get_model()[index][0] 5493 5521 5494 5522 @property … … 5541 5569 self._runway.set_sensitive(True) 5542 5570 5543 self._approachType.set_ text("")5571 self._approachType.set_active(0) 5544 5572 self._approachType.set_sensitive(True) 5545 5573 … … 5582 5610 self.transition is not None) and \ 5583 5611 self._runway.get_text()!="" and \ 5584 self. _approachType.get_text()!=""and \5612 self.approachType is not None and \ 5585 5613 self.vref is not None 5586 5614 self._button.set_sensitive(sensitive) … … 6030 6058 self._gate.set_sensitive(False) 6031 6059 6060 6061 def prepareShow(self): 6062 """Prepare the page for showing by updating the times and 6063 the buttons as well.""" 6032 6064 self._updateTimes() 6033 6065 … … 6038 6070 timesCorrect = not self._tooBigTimeDifference or \ 6039 6071 gui.hasComments or gui.hasDelayCode 6072 otherApproach = self._wizard.approachType=="OTHER" and \ 6073 not gui.hasComments 6040 6074 sensitive = gui.flight is not None and \ 6041 6075 gui.flight.stage==const.STAGE_END and \ 6042 6076 (self._gatesModel.get_iter_first() is None or 6043 6077 self._gate.get_active()>=0) and \ 6044 faultsExplained and timesCorrect 6045 6046 self._updateHelp(faultsExplained, timesCorrect) 6078 faultsExplained and timesCorrect and \ 6079 not otherApproach 6080 6081 self._updateHelp(faultsExplained, timesCorrect, otherApproach) 6047 6082 6048 6083 wasSensitive = self._saveButton.get_sensitive() … … 6181 6216 self.updateButtons() 6182 6217 6183 def _updateHelp(self, faultsExplained, timesCorrect ):6218 def _updateHelp(self, faultsExplained, timesCorrect, otherApproach): 6184 6219 """Update the help text according to the actual situation.""" 6185 6220 if not faultsExplained: … … 6187 6222 elif not timesCorrect: 6188 6223 self.setHelp(xstr("finish_help") + xstr("finish_help_wrongtime")) 6224 elif otherApproach: 6225 self.setHelp(xstr("finish_help") + xstr("finish_help_otherappr")) 6189 6226 else: 6190 6227 self.setHelp(xstr("finish_help") + xstr("finish_help_goodtime"))
Note:
See TracChangeset
for help on using the changeset viewer.