Changeset 1087:73fbd444b7fe for src/mlx/gui
- Timestamp:
- 03/19/23 13:28:59 (20 months ago)
- Branch:
- python3
- Phase:
- public
- amend_source:
- 0d69ca1836814137b601f24493e4d718c56b12b7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/flight.py
r1086 r1087 3380 3380 self._cruiseProfile.add_attribute(renderer, "text", 0) 3381 3381 self._cruiseProfile.set_tooltip_text(xstr("simbrief_cruise_profile_tooltip")) 3382 self._cruiseProfile.connect("changed", self._cruiseProfileChanged) 3382 3383 table.attach(self._cruiseProfile, 1, 2, row, row+1) 3383 3384 label.set_mnemonic_widget(self._cruiseProfile) 3385 3386 self._cruiseParameter = Gtk.Entry() 3387 self._cruiseParameter.set_width_chars(5) 3388 self._cruiseParameter.set_tooltip_text(xstr("simbrief_cruise_parameter_tooltip")) 3389 self._cruiseParameter.set_sensitive(False) 3390 self._cruiseParameter.connect("changed", self._cruiseParameterChanged) 3391 table.attach(self._cruiseParameter, 2, 3, row, row+1) 3392 3384 3393 row += 1 3385 3394 … … 3454 3463 """Update the sensitivity of the forward button.""" 3455 3464 self._button.set_sensitive(True) 3456 self._button.set_sensitive(len(self._userName.get_text())>0 and 3457 len(self._password.get_text())>0) 3465 3466 sensitive = not self._useInternalBrowser.get_active() or \ 3467 (len(self._userName.get_text())>0 and 3468 len(self._password.get_text())>0) 3469 if sensitive: 3470 simBriefData = self._wizard.gui.flight.aircraft.simBriefData 3471 cruiseProfileIndex = self._cruiseProfile.get_active() 3472 sensitive = \ 3473 cruiseProfileIndex not in simBriefData.cruiseParameters or \ 3474 not simBriefData.cruiseParameters[cruiseProfileIndex][0] or \ 3475 len(self._cruiseParameter.get_text())>0 3476 3477 self._button.set_sensitive(sensitive) 3458 3478 3459 3479 def _backClicked(self, button): … … 3517 3537 self._climbProfile.set_sensitive(False) 3518 3538 self._cruiseProfile.set_sensitive(False) 3539 self._cruiseParameter.set_sensitive(False) 3519 3540 self._descentProfile.set_sensitive(False) 3520 3541 … … 3694 3715 plan[key] = value 3695 3716 3717 cruiseParameters = self._wizard.gui.flight.aircraft.simBriefData.cruiseParameters 3718 cruiseProfileIndex = self._cruiseProfile.get_active() 3719 if cruiseProfileIndex in cruiseParameters: 3720 value = self._cruiseParameter.get_text() 3721 if value: 3722 plan[cruiseParameters[cruiseProfileIndex][1]] = value 3723 3696 3724 return plan 3697 3725 … … 3730 3758 should be converted to uppercase.""" 3731 3759 entry.set_text(entry.get_text().upper()) 3760 3761 def _cruiseProfileChanged(self, comboBox): 3762 """Called when the cruise profile has changed. 3763 3764 It updates the sensitivity of the cruise parameter entry field""" 3765 simBriefData = self._wizard.gui.flight.aircraft.simBriefData 3766 3767 activeIndex = self._cruiseProfile.get_active() 3768 self._cruiseParameter.set_sensitive(activeIndex in 3769 simBriefData.cruiseParameters) 3770 3771 self._updateForwardButton() 3772 3773 def _cruiseParameterChanged(self, entry): 3774 """Called when the cruise parameter has changed. 3775 3776 The sensitivty of the Forward button will be updated""" 3777 self._updateForwardButton() 3732 3778 3733 3779 def _getResults(self, link):
Note:
See TracChangeset
for help on using the changeset viewer.