Changeset 80:d3ca14051108 for src


Ignore:
Timestamp:
04/14/12 09:03:10 (13 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

The simulator time is displayed in the status bar

Location:
src/mlx/gui
Files:
3 edited

Legend:

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

    r79 r80  
    549549        labelAlignment = gtk.Alignment(xalign=0.0, xscale=0.0)
    550550        self._tailNumber = gtk.Label()
    551         self._tailNumber.set_width_chars(6)
     551        self._tailNumber.set_width_chars(10)
    552552        self._tailNumber.set_alignment(0.0, 0.5)
    553553        labelAlignment.add(self._tailNumber)
     
    561561        labelAlignment = gtk.Alignment(xalign=0.0, xscale=0.0)
    562562        self._departureICAO = gtk.Label()
    563         self._departureICAO.set_width_chars(5)
     563        self._departureICAO.set_width_chars(6)
    564564        self._departureICAO.set_alignment(0.0, 0.5)
    565565        labelAlignment.add(self._departureICAO)
  • src/mlx/gui/gui.py

    r78 r80  
    218218        """Update the data."""
    219219        gobject.idle_add(self._monitorWindow.setData, state)
     220        gobject.idle_add(self._statusbar.updateTime, state.timestamp)
    220221
    221222    def resetFlightStatus(self):
    222223        """Reset the status of the flight."""
    223224        self._statusbar.resetFlightStatus()
     225        self._statusbar.updateTime()
    224226        self._statusIcon.resetFlightStatus()
    225227
  • src/mlx/gui/statusbar.py

    r70 r80  
    88
    99import math
     10import time
    1011
    1112#-------------------------------------------------------------------------------
     
    6162        statusBox.pack_start(gtk.VSeparator(), False, False, 8)
    6263
     64        self._timeLabel = gtk.Label("--:--:--")
     65        self._timeLabel.set_width_chars(8)
     66        self._timeLabel.set_tooltip_text("The simulator time in UTC")
     67        self._timeLabel.set_alignment(1.0, 0.5)
     68       
     69        statusBox.pack_start(self._timeLabel, False, False, 8)
     70
     71        statusBox.pack_start(gtk.VSeparator(), False, False, 8)
     72
    6373        self._ratingLabel = gtk.Label()
    6474        self._ratingLabel.set_width_chars(12)
     
    7585       
    7686        self._updateFlightStatus()
     87        self.updateTime()
    7788
    7889    def updateConnection(self, connecting, connected):
     
    8596        """Update the busy state."""
    8697        self._busyLabel.set_text("" if message is None else message)
     98
     99    def updateTime(self, t = None):
     100        """Update the time"""
     101        timeStr = "--:--:--" if t is None \
     102                  else time.strftime("%H:%M:%S", time.gmtime(t))
     103       
     104        self._timeLabel.set_text(timeStr)
    87105
    88106    def _drawConnState(self, connStateArea, eventOrContext):
Note: See TracChangeset for help on using the changeset viewer.