Changeset 607:d0dccf044560


Ignore:
Timestamp:
03/01/15 18:40:59 (9 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

The help text on the Finish page is updated dynamically based on the situation (re #248)

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • locale/en/mlx.po

    r604 r607  
    966966"satisfied, you can save or send your PIREP."
    967967
     968msgid "finish_help_faults"
     969msgstr ""
     970"<span foreground=\"red\">\n\nYou had one or more faults during your flight. Please, provide some\n"
     971"explanation on the Flight info tab before sending the PIREP.</span>"
     972
    968973msgid "finish_help_wrongtime"
    969974msgstr ""
  • locale/hu/mlx.po

    r604 r607  
    967967"megfelelnek, elmentheted vagy elküldheted a PIREP-et."
    968968
     969msgid "finish_help_faults"
     970msgstr ""
     971"<span foreground=\"red\">\n\nA repülés során vétettél egy vagy több hibát. Kérlek, a Járat info oldalon\n"
     972"írj ezekre magyarázatot a Járat info oldalon a PIREP elküldése előtt.</span>"
     973
    969974msgid "finish_help_wrongtime"
    970975msgstr ""
  • src/mlx/gui/flight.py

    r605 r607  
    32693269        """Update the sensitivity state of the buttons."""
    32703270        gui = self._wizard.gui
     3271        faultsExplained = gui.faultsFullyExplained
     3272        timesCorrect = self.flightType is None or \
     3273                       not self._tooBigTimeDifference or \
     3274                       gui.hasComments or gui.hasDelayCode
    32713275        sensitive = self._flightType.get_active()>=0 and \
    32723276                    (self._gatesModel.get_iter_first() is None or
    32733277                     self._gate.get_active()>=0) and \
    3274                     (not self._tooBigTimeDifference or
    3275                      gui.hasComments or gui.hasDelayCode) and \
    3276                     gui.faultsFullyExplained
     3278                     faultsExplained and timesCorrect
     3279
     3280        self._updateHelp(faultsExplained, timesCorrect)
    32773281
    32783282        wasSensitive = self._saveButton.get_sensitive()
     
    35113515        self._tooBigTimeDifference = departureError or arrivalError
    35123516
    3513         if self._tooBigTimeDifference and self.flightType is not None:
    3514             self.setHelp(xstr("finish_help") + xstr("finish_help_wrongtime"))
    3515         else:
    3516             self.setHelp(xstr("finish_help") + xstr("finish_help_goodtime"))
    3517 
    35183517        self._depTime.set_markup(self._formatTime(bookedFlight.departureTime,
    35193518                                                  flight.blockTimeStart,
     
    35273526
    35283527        self.updateButtons()
     3528
     3529    def _updateHelp(self, faultsExplained, timesCorrect):
     3530        """Update the help text according to the actual situation."""
     3531        if not faultsExplained:
     3532            self.setHelp(xstr("finish_help") + xstr("finish_help_faults"))
     3533        elif not timesCorrect:
     3534            self.setHelp(xstr("finish_help") + xstr("finish_help_wrongtime"))
     3535        else:
     3536            self.setHelp(xstr("finish_help") + xstr("finish_help_goodtime"))
     3537
    35293538
    35303539#-----------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.