Changeset 152:f0701a18628a for src/mlx/gui
- Timestamp:
- 05/05/12 11:40:28 (13 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/gui.py
r151 r152 399 399 self._logView.get_buffer().set_text("") 400 400 401 def _disconnect(self ):401 def _disconnect(self, closingMessage = None, duration = 3): 402 402 """Disconnect from the simulator if connected.""" 403 403 self.stopMonitoring() 404 404 405 405 if self._connected: 406 self._flight.simulator.disconnect() 406 if closingMessage is None: 407 self._flight.simulator.disconnect() 408 else: 409 fs.sendMessage(const.MESSAGETYPE_ENVIRONMENT, 410 closingMessage, duration, 411 disconnect = True) 407 412 self._connected = False 408 413 … … 455 460 self._wizard.setStage(stage) 456 461 if stage==const.STAGE_END: 457 # FIXME: perhaps a more elegant method, e.g.458 # the simulator should provide a function disconnect459 # with a final message460 gobject.timeout_add(1000, self._disconnect)462 self._disconnect(closingMessage = 463 "Flight plan closed. Welcome to %s" % \ 464 (self.bookedFlight.arrivalICAO,), 465 duration = 5) 461 466 462 467 def setRating(self, rating):
Note:
See TracChangeset
for help on using the changeset viewer.