Changeset 1094:a2a4b6462f53


Ignore:
Timestamp:
07/16/23 10:55:47 (10 months ago)
Author:
István Váradi <ivaradi@…>
Branch:
python3
hg-Phase:
(<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
Message:

The taxi sounds can be started on pushback (re #367)

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • locale/en/mlx.po

    r1087 r1094  
    18481848msgid "prefs_sounds_pilotHotkeyShift_tooltip"
    18491849msgstr "If checked, the Shift key should be pressed together with the main key."
     1850
     1851msgid "prefs_sounds_taxiSoundOnPushback"
     1852msgstr "Play safety _demo on pushback"
     1853
     1854msgid "prefs_sounds_taxiSoundOnPushback_tooltip"
     1855msgstr ""
     1856"If checked, the Malév song and the safety demo are played "
     1857"immediately as pushback begins. Otherwise they are played when "
     1858"the plane is taxiing at 5 knots at least"
    18501859
    18511860msgid "prefs_sounds_approachCallouts"
  • locale/hu/mlx.po

    r1087 r1094  
    18571857msgstr ""
    18581858"Ha kijelölöd, a Shift billentyűt is le kell nyomni a főbillentyűvel együtt."
     1859
     1860msgid "prefs_sounds_taxiSoundOnPushback"
     1861msgstr "Biztonsági _ismertető indítása hátratoláskor"
     1862
     1863msgid "prefs_sounds_taxiSoundOnPushback_tooltip"
     1864msgstr ""
     1865"Ha bejelölöd, a Malév dalt és a biztonsági ismertetőt "
     1866"már a hátratolás megkezdésekor elkezdi játszani a program. "
     1867"Egyébként ezeket csak gurulás közben, 5 csomós sebesség "
     1868"elérésekor kezdi el."
    18591869
    18601870msgid "prefs_sounds_approachCallouts"
  • src/mlx/config.py

    r1084 r1094  
    249249        self._pilotHotkey = Hotkey(ctrl = True, shift = False, key = "0")
    250250
     251        self._taxiSoundOnPushback = False
     252
    251253        self._enableApproachCallouts = False
    252254        self._speedbrakeAtTD = True
     
    608610        if pilotHotkey!=self._pilotHotkey:
    609611            self._pilotHotkey = pilotHotkey
     612            self._modified = True
     613
     614    @property
     615    def taxiSoundOnPushback(self):
     616        """Get whether the taxi sound should be played as soon as pushback starts."""
     617        return self._taxiSoundOnPushback
     618
     619    @taxiSoundOnPushback.setter
     620    def taxiSoundOnPushback(self, taxiSoundOnPushback):
     621        """Set whether the taxi sound should be played as soon as pushback starts."""
     622        if taxiSoundOnPushback!=self._taxiSoundOnPushback:
     623            self._taxiSoundOnPushback = taxiSoundOnPushback
    610624            self._modified = True
    611625
     
    802816        self._pilotHotkey.set(self._get(config, "sounds",
    803817                                        "pilotHotkey", "C0"))
     818
     819        self._taxiSoundOnPushback = \
     820            self._getBoolean(config, "sounds", "taxiSoundOnPushback", False)
    804821        self._enableApproachCallouts = \
    805822            self._getBoolean(config, "sounds", "enableApproachCallouts", False)
     
    903920                   "yes" if self._pilotControlsSounds else "no")
    904921        config.set("sounds", "pilotHotkey", str(self._pilotHotkey))
     922        config.set("sounds", "taxiSoundOnPushback",
     923                   "yes" if self._taxiSoundOnPushback else "no")
    905924        config.set("sounds", "enableApproachCallouts",
    906925                   "yes" if self._enableApproachCallouts else "no")
     
    10471066        print("  pilotHotkey:", str(self._pilotHotkey))
    10481067
     1068        print("  taxiSoundOnPushback:", self._taxiSoundOnPushback)
     1069
    10491070        print("  enableApproachCallouts:", self._enableApproachCallouts)
    10501071        print("  speedbrakeAtTD:", self._speedbrakeAtTD)
  • src/mlx/gui/prefs.py

    r1067 r1094  
    270270        self._enableChecklists.set_active(config.enableChecklists)
    271271        self._checklistHotkey.set(config.checklistHotkey)
     272
     273        self._taxiSoundOnPushback.set_active(config.taxiSoundOnPushback)
    272274
    273275        self._autoUpdate.set_active(config.autoUpdate)
     
    321323        config.checklistHotkey = self._checklistHotkey.get()
    322324
     325        config.taxiSoundOnPushback = self._taxiSoundOnPushback.get_active()
     326
    323327        config.autoUpdate = self._autoUpdate.get_active()
    324328        config.updateURL = self._updateURL.get_text()
     
    700704        backgroundBox.pack_start(self._pilotHotkey, False, False, 4)
    701705
     706        self._taxiSoundOnPushback = Gtk.CheckButton(xstr("prefs_sounds_taxiSoundOnPushback"))
     707        self._taxiSoundOnPushback.set_use_underline(True)
     708        self._taxiSoundOnPushback.set_tooltip_text(xstr("prefs_sounds_taxiSoundOnPushback_tooltip"))
     709        backgroundBox.pack_start(self._taxiSoundOnPushback, False, False, 4)
     710
    702711        self._enableApproachCallouts = Gtk.CheckButton(xstr("prefs_sounds_approachCallouts"))
    703712        self._enableApproachCallouts.set_use_underline(True)
     
    750759        self._pilotControlsSounds.set_sensitive(active)
    751760        self._pilotControlsSoundsToggled(self._pilotControlsSounds)
     761        self._taxiSoundOnPushback.set_sensitive(active)
    752762        self._enableApproachCallouts.set_sensitive(active)
    753763        self._speedbrakeAtTD.set_sensitive(active)
  • src/mlx/soundsched.py

    r919 r1094  
    149149    def __init__(self, flight, boardingSound = None):
    150150        """Construct the taxi sound."""
     151        config = flight.config
     152
    151153        super(TaxiSound, self).__init__(const.SOUND_MALEV,
    152154                                        const.STAGE_PUSHANDTAXI,
    153155                                        previousSound = boardingSound,
    154156                                        extraCondition = lambda _flight, state:
    155                                         state.groundSpeed>5)
     157                                        config.taxiSoundOnPushback or state.groundSpeed>5)
    156158
    157159        self._flight = flight
Note: See TracChangeset for help on using the changeset viewer.