Changeset 810:2414e2751578


Ignore:
Timestamp:
09/08/16 07:33:24 (8 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Information about the number of rejected and pending flights is dispayed on the flight selection page (re #307)

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • locale/en/mlx.po

    r790 r810  
    369369msgid "flightsel_title"
    370370msgstr "Flight selection"
     371
     372msgid "flightsel_prehelp_nopending"
     373msgstr ""
     374
     375msgid "flightsel_prehelp_0rep_rej"
     376msgstr ""
     377"<span color=\"red\">You have %d rejected flight(s).</span>\n\n "
     378
     379msgid "flightsel_prehelp_rep_0rej"
     380msgstr ""
     381"You have %d reported flight(s).\n\n "
     382
     383msgid "flightsel_prehelp_rep_rej"
     384msgstr ""
     385"<span color=\"red\">You have %d rejected and %d reported flight(s).</span>\n\n "
    371386
    372387msgid "flightsel_help"
  • locale/hu/mlx.po

    r790 r810  
    369369msgid "flightsel_title"
    370370msgstr "Járatválasztás"
     371
     372msgid "flightsel_prehelp_nopending"
     373msgstr ""
     374
     375msgid "flightsel_prehelp_0rep_rej"
     376msgstr ""
     377"<span color=\"red\">%d visszautasított járatod van.</span>\n\n "
     378
     379msgid "flightsel_prehelp_rep_0rej"
     380msgstr ""
     381"%d jelentett járatod van.\n\n "
     382
     383msgid "flightsel_prehelp_rep_rej"
     384msgstr ""
     385"<span color=\"red\">%d visszautasított és %d jelentett járatod van.</span>\n\n "
    371386
    372387msgid "flightsel_help"
  • src/mlx/gui/flight.py

    r805 r810  
    511511    def activate(self):
    512512        """Fill the flight list."""
     513        self._setupHelp()
    513514        self._flightList.set_sensitive(True)
    514515        self._loadButton.set_sensitive(True)
     
    521522        self._loadButton.set_sensitive(False)
    522523        self._refreshButton.set_sensitive(False)
     524
     525    def _setupHelp(self):
     526        """Setup the help string"""
     527        help = ""
     528
     529        if self._wizard.loggedIn:
     530            numReported = len(self._wizard.loginResult.reportedFlights)
     531            numRejected = len(self._wizard.loginResult.rejectedFlights)
     532            if numReported==0 and numRejected==0:
     533                help = xstr("flightsel_prehelp_nopending")
     534            elif numReported>0 and numRejected==0:
     535                help = xstr("flightsel_prehelp_rep_0rej") % (numReported,)
     536            elif numReported==0 and numRejected>0:
     537                help = xstr("flightsel_prehelp_0rep_rej") % (numRejected,)
     538            else:
     539                help = xstr("flightsel_prehelp_rep_rej") % \
     540                       (numReported, numRejected)
     541
     542        help += xstr("flightsel_help")
     543
     544        self.setHelp(help)
    523545
    524546    def _buildFlights(self):
     
    581603    def _refreshCallback(self, returned, result):
    582604        """Callback for the refresh."""
    583         if returned and result.loggedIn:
    584             self._buildFlights()
     605        if returned:
     606            self._setupHelp()
     607            if result.loggedIn:
     608                self._buildFlights()
    585609
    586610    def _selectionChanged(self, selection):
Note: See TracChangeset for help on using the changeset viewer.