Changeset 708:2e411a2d77a0 for src/mlx


Ignore:
Timestamp:
10/25/15 09:17:01 (8 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
cef
Phase:
public
Message:

The takeoff and landing runways can be entered (re #279).

File:
1 edited

Legend:

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

    r707 r708  
    18231823        table.attach(gtk.Label("kg"), 2, 3, 3, 4)
    18241824
     1825        label = gtk.Label(xstr("simbrief_takeoff_runway"))
     1826        label.set_use_underline(True)
     1827        label.set_alignment(0.0, 0.5)
     1828        table.attach(label, 0, 1, 4, 5)
     1829
     1830        self._takeoffRunway = gtk.Entry()
     1831        self._takeoffRunway.set_width_chars(10)
     1832        self._takeoffRunway.set_tooltip_text(xstr("simbrief_takeoff_runway_tooltip"))
     1833        self._takeoffRunway.connect("changed", self._upperChanged)
     1834        table.attach(self._takeoffRunway, 1, 2, 4, 5)
     1835        label.set_mnemonic_widget(self._takeoffRunway)
     1836
     1837        label = gtk.Label(xstr("simbrief_landing_runway"))
     1838        label.set_use_underline(True)
     1839        label.set_alignment(0.0, 0.5)
     1840        table.attach(label, 0, 1, 5, 6)
     1841
     1842        self._landingRunway = gtk.Entry()
     1843        self._landingRunway.set_width_chars(10)
     1844        self._landingRunway.set_tooltip_text(xstr("simbrief_takeoff_runway_tooltip"))
     1845        self._landingRunway.connect("changed", self._upperChanged)
     1846        table.attach(self._landingRunway, 1, 2, 5, 6)
     1847        label.set_mnemonic_widget(self._landingRunway)
     1848
    18251849        self.addCancelFlightButton()
    18261850
     
    18431867        self._extraFuel.set_int(0)
    18441868        self._extraFuel.set_sensitive(True)
     1869
     1870        self._takeoffRunway.set_text("")
     1871        self._takeoffRunway.set_sensitive(True)
     1872
     1873        self._landingRunway.set_text("")
     1874        self._landingRunway.set_sensitive(True)
    18451875
    18461876        self._updateForwardButton()
     
    18771907            self._rememberButton.set_sensitive(False)
    18781908            self._extraFuel.set_sensitive(False)
     1909            self._takeoffRunway.set_sensitive(False)
     1910            self._landingRunway.set_sensitive(False)
    18791911
    18801912            self._wizard.gui.beginBusy("Calling SimBrief...")
     
    20232055
    20242056        plan["addedfuel"] = str(self._extraFuel.get_int() / 1000.0)
    2025         plan["origrwy"] = "" # FIXME: query
    2026         plan["destrwy"] = "" # FIXME: query
     2057        plan["origrwy"] = self._takeoffRunway.get_text()
     2058        plan["destrwy"] = self._landingRunway.get_text()
    20272059        plan["climb"] = "250/300/78" # FIXME: query
    20282060        plan["cruise"] = "LRC" # FIXME: query
     
    20302062
    20312063        return plan
     2064
     2065    def _upperChanged(self, entry, arg = None):
     2066        """Called when the value of some entry widget has changed and the value
     2067        should be converted to uppercase."""
     2068        entry.set_text(entry.get_text().upper())
    20322069
    20332070#-----------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.