Ignore:
Timestamp:
09/25/16 08:13:34 (8 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
hg-Phase:
(<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
Message:

The pending flights window gets closed automatically if no pending flights remain (re #307).

File:
1 edited

Legend:

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

    r827 r828  
    342342            for flight in flights:
    343343                self._wizard.reflyFlight(flight)
     344            self._window.checkFlights()
     345        else:
     346            communicationErrorDialog()
    344347
    345348    def _deleteClicked(self, button):
     
    378381            for flight in flights:
    379382                self._wizard.deleteFlight(flight)
     383            self._window.checkFlights()
     384        else:
     385            communicationErrorDialog()
    380386
    381387#-----------------------------------------------------------------------------
     
    439445        self._rejectedFrame.addFlight(flight)
    440446
     447    def checkFlights(self):
     448        """Check if there are any flights in any of the lists, and close the
     449        window if not."""
     450        if not self.hasFlights:
     451            self.emit("delete-event", None)
     452
    441453    def _closeClicked(self, button):
    442454        """Called when the Close button is clicked.
Note: See TracChangeset for help on using the changeset viewer.