Changeset 91:c3fc045d7aeb for src/mlx/gui
- Timestamp:
- 04/19/12 14:46:07 (13 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- src/mlx/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/flight.py
r89 r91 1798 1798 self.nextPage() 1799 1799 1800 def connectionFailed(self): 1801 """Called when the connection could not be made to the simulator.""" 1802 self._initialize() 1803 1804 def disconnected(self): 1805 """Called when we have disconnected from the simulator.""" 1800 def reset(self): 1801 """Resets the wizard to go back to the login page.""" 1806 1802 self._initialize() 1807 1803 -
src/mlx/gui/gui.py
r90 r91 157 157 gtk.main() 158 158 159 if self._flight is not None and self._connected: 160 self.stopMonitoring() 161 self._flight.simulator.disconnect() 159 self._disconnect() 162 160 163 161 def connected(self, fsType, descriptor): … … 203 201 self._simulator.reconnect() 204 202 else: 205 self._connecting = False 206 self._reconnecting = False 207 self._statusbar.updateConnection(self._connecting, self._connected) 208 self._wizard.connectionFailed() 209 self._flightInfo.reset() 203 self.reset() 210 204 211 205 def disconnected(self): … … 241 235 self._simulator.reconnect() 242 236 else: 243 self._connecting = False 244 self._reconnecting = False 245 self._statusbar.updateConnection(self._connecting, self._connected) 246 self._wizard.disconnected() 247 self._flightInfo.reset() 248 237 self.reset() 238 239 def reset(self): 240 """Reset the GUI.""" 241 self._disconnect() 242 self._wizard.reset() 243 self._flightInfo.reset() 244 self.resetFlightStatus() 245 246 def _disconnect(self): 247 """Disconnect from the simulator if connected.""" 248 if self._connected: 249 self.stopMonitoring() 250 self._flight.simulator.disconnect() 251 self._connected = False 252 253 self._connecting = False 254 self._reconnecting = False 255 self._statusbar.updateConnection(False, False) 256 249 257 def write(self, msg): 250 258 """Write the given message to the log.""" … … 272 280 self._wizard.setStage(stage) 273 281 if stage==const.STAGE_END: 274 self.stopMonitoring() 275 self.simulator.disconnect() 276 self._connecting = False 277 self._connected = False 278 self._statusbar.updateConnection(self._connecting, self._connected) 282 self._disconnect() 279 283 280 284 def setRating(self, rating):
Note:
See TracChangeset
for help on using the changeset viewer.