Ignore:
Timestamp:
04/16/12 17:53:47 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

The logger disconnects from the simulator if the flight has ended and the Forward button on the landing page can be activated only then.

File:
1 edited

Legend:

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

    r86 r88  
    150150        gtk.main()
    151151
    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()                       
    158155
    159156    def connected(self, fsType, descriptor):
     
    265262        self._statusIcon.setStage(stage)
    266263        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)
    267270
    268271    def setRating(self, rating):
     
    412415    def startMonitoring(self):
    413416        """Start monitoring."""
    414         self._simulator.startMonitoring()
    415         self._monitoring = True
     417        if not self._monitoring:
     418            self.simulator.startMonitoring()
     419            self._monitoring = True
    416420
    417421    def stopMonitoring(self):
    418422        """Stop monitoring."""
    419         self._simulator.stoptMonitoring()
    420         self._monitoring = False
     423        if self._monitoring:
     424            self.simulator.stopMonitoring()
     425            self._monitoring = False
    421426
    422427    def _buildLogFrame(self):
Note: See TracChangeset for help on using the changeset viewer.