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)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.