Ignore:
Timestamp:
05/31/12 14:59:58 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

It is now possible to cancel a flight and to start a new one at the end and also to refresh the list of flights.

File:
1 edited

Legend:

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

    r204 r208  
    402402        self._flightInfo.enable()
    403403
     404    def cancelFlight(self):
     405        """Cancel the current file, if the user confirms it."""
     406        dialog = gtk.MessageDialog(parent = self._mainWindow,
     407                                   type = MESSAGETYPE_QUESTION,
     408                                   message_format = xstr("cancelFlight_question"))
     409
     410        dialog.add_button(xstr("button_no"), RESPONSETYPE_NO)
     411        dialog.add_button(xstr("button_yes"), RESPONSETYPE_YES)
     412
     413        dialog.set_title(WINDOW_TITLE_BASE)
     414        result = dialog.run()
     415        dialog.hide()
     416       
     417        if result==RESPONSETYPE_YES:
     418            self.reset()
     419
    404420    def reset(self):
    405421        """Reset the GUI."""
     
    412428        self._weightHelp.reset()
    413429        self._weightHelp.disable()
    414         self._wizard.reset()
    415430        self._notebook.set_current_page(0)
    416431
    417432        self._logView.get_buffer().set_text("")
     433
     434        self._wizard.reloadFlights(self._handleReloadResult)
     435
     436    def _handleReloadResult(self, returned, result):
     437        """Handle the result of the reloading of the flights."""
     438        self._wizard.reset(result if returned and result.loggedIn else None)
    418439
    419440    def _disconnect(self, closingMessage = None, duration = 3):
Note: See TracChangeset for help on using the changeset viewer.