Changeset 675:122e92f35a2c for src/mlx


Ignore:
Timestamp:
08/23/15 07:35:33 (9 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

The status of the Next button on the Route page is continuously updated while entering the FL on the keyboard (re #278)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/gui/flight.py

    r638 r675  
    17481748        self._cruiseLevel.set_tooltip_text(xstr("route_level_tooltip"))
    17491749        self._cruiseLevel.set_numeric(True)
     1750        self._cruiseLevel.connect("changed", self._cruiseLevelChanged)
    17501751        self._cruiseLevel.connect("value-changed", self._cruiseLevelChanged)
    17511752        label.set_mnemonic_widget(self._cruiseLevel)
     
    18221823    def _updateForwardButton(self):
    18231824        """Update the sensitivity of the forward button."""
    1824         self._button.set_sensitive(self._cruiseLevel.get_value_as_int()>=50 and \
    1825                                    self._getRoute()!="")
    1826 
    1827     def _cruiseLevelChanged(self, spinButton):
     1825        cruiseLevelText = self._cruiseLevel.get_text()
     1826        cruiseLevel = int(cruiseLevelText) if cruiseLevelText else 0
     1827        self._button.set_sensitive(cruiseLevel>=50 and self._getRoute()!="")
     1828
     1829    def _cruiseLevelChanged(self, *arg):
    18281830        """Called when the cruise level has changed."""
    18291831        self._updateForwardButton()
Note: See TracChangeset for help on using the changeset viewer.