Changeset 88:3fdb6ad947ad for src/mlx/gui
- Timestamp:
- 04/16/12 17:53:47 (13 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- src/mlx/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/flight.py
r86 r88 1373 1373 super(LandingPage, self).__init__(wizard, "Landing", help) 1374 1374 1375 self._flightEnded = False 1376 1375 1377 alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5, 1376 1378 xscale = 0.0, yscale = 0.0) … … 1475 1477 def activate(self): 1476 1478 """Called when the page is activated.""" 1479 self._flightEnded = False 1480 1477 1481 self._starButton.set_sensitive(True) 1478 1482 self._starButton.set_active(False) … … 1492 1496 self._vref.set_sensitive(True) 1493 1497 1498 self._updateForwardButton() 1499 1500 def flightEnded(self): 1501 """Called when the flight has ended.""" 1502 self._flightEnded = True 1494 1503 self._updateForwardButton() 1495 1504 … … 1526 1535 def _updateForwardButton(self, widget = None): 1527 1536 """Update the sensitivity of the forward button.""" 1528 sensitive = (self._starButton.get_active() or \ 1537 sensitive = self._flightEnded and \ 1538 (self._starButton.get_active() or \ 1529 1539 self._transitionButton.get_active()) and \ 1530 1540 (self._star.get_text()!="" or … … 1680 1690 if stage==const.STAGE_TAKEOFF: 1681 1691 self._takeoffPage.freezeValues() 1692 elif stage==const.STAGE_END: 1693 self._landingPage.flightEnded() 1682 1694 1683 1695 def _initialize(self): -
src/mlx/gui/gui.py
r86 r88 150 150 gtk.main() 151 151 152 if self._flight is not None: 153 simulator = self._flight.simulator 154 if self._monitoring: 155 simulator.stopMonitoring() 156 self._monitoring = False 157 simulator.disconnect() 152 if self._flight is not None and self._connected: 153 self.stopMonitoring() 154 self._flight.simulator.disconnect() 158 155 159 156 def connected(self, fsType, descriptor): … … 265 262 self._statusIcon.setStage(stage) 266 263 self._wizard.setStage(stage) 264 if stage==const.STAGE_END: 265 self.stopMonitoring() 266 self.simulator.disconnect() 267 self._connecting = False 268 self._connected = False 269 self._statusbar.updateConnection(self._connecting, self._connected) 267 270 268 271 def setRating(self, rating): … … 412 415 def startMonitoring(self): 413 416 """Start monitoring.""" 414 self._simulator.startMonitoring() 415 self._monitoring = True 417 if not self._monitoring: 418 self.simulator.startMonitoring() 419 self._monitoring = True 416 420 417 421 def stopMonitoring(self): 418 422 """Stop monitoring.""" 419 self._simulator.stoptMonitoring() 420 self._monitoring = False 423 if self._monitoring: 424 self.simulator.stopMonitoring() 425 self._monitoring = False 421 426 422 427 def _buildLogFrame(self):
Note:
See TracChangeset
for help on using the changeset viewer.