Ignore:
Timestamp:
05/03/12 18:27:13 (13 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Implemented FS time synchronization

Location:
src/mlx/gui
Files:
2 edited

Legend:

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

    r147 r148  
    699699            self._simulator = fs.createSimulator(const.SIM_MSFS9, self)
    700700            fs.setupMessageSending(self.config, self._simulator)
    701 
     701            self._setupTimeSync()
     702       
    702703        self._flight.simulator = self._simulator
    703704
     
    853854        """Callback for editing the preferences."""
    854855        self._preferences.run(self.config)
     856        self._setupTimeSync()
     857
     858    def _setupTimeSync(self):
     859        """Enable or disable the simulator time synchronization based on the
     860        configuration."""
     861        simulator = self._simulator
     862        if simulator is not None:
     863            if self.config.syncFSTime:
     864                simulator.enableTimeSync()
     865            else:
     866                simulator.disableTimeSync()
  • src/mlx/gui/prefs.py

    r147 r148  
    7171        self._onlineACARS.set_active(config.onlineACARS)
    7272        self._flareTimeFromFS.set_active(config.flareTimeFromFS)
     73        self._syncFSTime.set_active(config.syncFSTime)
    7374
    7475        for messageType in const.messageTypes:
     
    9697        config.onlineACARS = self._onlineACARS.get_active()
    9798        config.flareTimeFromFS = self._flareTimeFromFS.get_active()
     99        config.syncFSTime = self._syncFSTime.get_active()
    98100
    99101        for messageType in const.messageTypes:
     
    167169        self._flareTimeFromFS.set_tooltip_text(xstr("prefs_flaretimeFromFS_tooltip"))
    168170        mainBox.pack_start(self._flareTimeFromFS, False, False, 4)
     171                                       
     172        self._syncFSTime = gtk.CheckButton(xstr("prefs_syncFSTime"))
     173        self._syncFSTime.set_use_underline(True)
     174        self._syncFSTime.set_tooltip_text(xstr("prefs_syncFSTime_tooltip"))
     175        mainBox.pack_start(self._syncFSTime, False, False, 4)
    169176                                       
    170177        return mainAlignment
Note: See TracChangeset for help on using the changeset viewer.