Changeset 78:31c23c6721d1


Ignore:
Timestamp:
04/14/12 08:46:32 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Added some further data to the connect page

Location:
src/mlx/gui
Files:
2 edited

Legend:

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

    r76 r78  
    99import datetime
    1010import time
     11
     12#------------------------------------------------------------------------------
     13
     14acftTypeNames = { const.AIRCRAFT_B736: "Boeing 737-600",
     15                  const.AIRCRAFT_B737: "Boeing 737-700",
     16                  const.AIRCRAFT_B738: "Boeing 737-800",
     17                  const.AIRCRAFT_DH8D: "Bombardier Dash 8-Q400",
     18                  const.AIRCRAFT_B733: "Boeing 737-300",
     19                  const.AIRCRAFT_B734: "Boeing 737-400",
     20                  const.AIRCRAFT_B735: "Boeing 737-500",
     21                  const.AIRCRAFT_B762: "Boeing 767-200",
     22                  const.AIRCRAFT_B763: "Boeing 767-300",
     23                  const.AIRCRAFT_CRJ2: "Bombardier CRJ200",
     24                  const.AIRCRAFT_F70:  "Fokker 70",
     25                  const.AIRCRAFT_DC3:  "Lisunov Li-2",
     26                  const.AIRCRAFT_T134: "Tupolev Tu-134",
     27                  const.AIRCRAFT_T154: "Tupolev Tu-154",
     28                  const.AIRCRAFT_YK40: "Yakovlev Yak-40" }
    1129
    1230#-----------------------------------------------------------------------------
     
    484502    def __init__(self, wizard):
    485503        """Construct the connect page."""
    486         help = "The flight begins at the airport given below.\n" \
    487                "Park your aircraft there, at the gate below, if given.\n\n" \
     504        help = "Load the aircraft below into the simulator and park it\n" \
     505               "at the given airport, at the gate below, if present.\n\n" \
    488506               "Then press the Connect button to connect to the simulator."
    489507        super(ConnectPage, self).__init__(wizard,
     
    494512                                  xscale = 0.0, yscale = 0.0)
    495513
    496         table = gtk.Table(2, 2)
     514        table = gtk.Table(5, 2)
    497515        table.set_row_spacings(4)
    498516        table.set_col_spacings(16)
     
    502520
    503521        labelAlignment = gtk.Alignment(xalign=1.0, xscale=0.0)
    504         label = gtk.Label("ICAO code:")
     522        label = gtk.Label("Flight number:")
    505523        labelAlignment.add(label)
    506524        table.attach(labelAlignment, 0, 1, 0, 1)
     525
     526        labelAlignment = gtk.Alignment(xalign=0.0, xscale=0.0)
     527        self._flightNumber = gtk.Label()
     528        self._flightNumber.set_width_chars(6)
     529        self._flightNumber.set_alignment(0.0, 0.5)
     530        labelAlignment.add(self._flightNumber)
     531        table.attach(labelAlignment, 1, 2, 0, 1)
     532
     533        labelAlignment = gtk.Alignment(xalign=1.0, xscale=0.0)
     534        label = gtk.Label("Aircraft:")
     535        labelAlignment.add(label)
     536        table.attach(labelAlignment, 0, 1, 1, 2)
     537
     538        labelAlignment = gtk.Alignment(xalign=0.0, xscale=0.0)
     539        self._aircraft = gtk.Label()
     540        self._aircraft.set_width_chars(25)
     541        self._aircraft.set_alignment(0.0, 0.5)
     542        labelAlignment.add(self._aircraft)
     543        table.attach(labelAlignment, 1, 2, 1, 2)
     544
     545        labelAlignment = gtk.Alignment(xalign=1.0, xscale=0.0)
     546        label = gtk.Label("Tail number:")
     547        labelAlignment.add(label)
     548        table.attach(labelAlignment, 0, 1, 2, 3)
     549
     550        labelAlignment = gtk.Alignment(xalign=0.0, xscale=0.0)
     551        self._tailNumber = gtk.Label()
     552        self._tailNumber.set_width_chars(6)
     553        self._tailNumber.set_alignment(0.0, 0.5)
     554        labelAlignment.add(self._tailNumber)
     555        table.attach(labelAlignment, 1, 2, 2, 3)
     556
     557        labelAlignment = gtk.Alignment(xalign=1.0, xscale=0.0)
     558        label = gtk.Label("Airport:")
     559        labelAlignment.add(label)
     560        table.attach(labelAlignment, 0, 1, 3, 4)
    507561
    508562        labelAlignment = gtk.Alignment(xalign=0.0, xscale=0.0)
     
    511565        self._departureICAO.set_alignment(0.0, 0.5)
    512566        labelAlignment.add(self._departureICAO)
    513         table.attach(labelAlignment, 1, 2, 0, 1)
     567        table.attach(labelAlignment, 1, 2, 3, 4)
    514568
    515569        labelAlignment = gtk.Alignment(xalign=1.0, xscale=0.0)
    516570        label = gtk.Label("Gate:")
    517571        labelAlignment.add(label)
    518         table.attach(labelAlignment, 0, 1, 1, 2)
     572        table.attach(labelAlignment, 0, 1, 4, 5)
    519573
    520574        labelAlignment = gtk.Alignment(xalign=0.0, xscale=0.0)
     
    523577        self._departureGate.set_alignment(0.0, 0.5)
    524578        labelAlignment.add(self._departureGate)
    525         table.attach(labelAlignment, 1, 2, 1, 2)
     579        table.attach(labelAlignment, 1, 2, 4, 5)
    526580
    527581        button = self.addButton(gtk.STOCK_GO_BACK)
     
    539593        self._button.disconnect(self._clickedID)
    540594        self._clickedID = self._button.connect("clicked", self._connectClicked)
    541        
    542         icao = self._wizard._bookedFlight.departureICAO
     595
     596        bookedFlight = self._wizard._bookedFlight
     597
     598        self._flightNumber.set_markup("<b>" + bookedFlight.callsign + "</b>")
     599
     600        aircraftType = acftTypeNames[bookedFlight.aircraftType]
     601        self._aircraft.set_markup("<b>" + aircraftType + "</b>")
     602       
     603        self._tailNumber.set_markup("<b>" + bookedFlight.tailNumber + "</b>")
     604
     605        icao = bookedFlight.departureICAO
    543606        self._departureICAO.set_markup("<b>" + icao + "</b>")
    544607        gate = self._wizard._departureGate
  • src/mlx/gui/gui.py

    r77 r78  
    1818import threading
    1919import sys
    20 
    21 #------------------------------------------------------------------------------
    22 
    23 acftTypes = [ ("Boeing 737-600", const.AIRCRAFT_B736),
    24               ("Boeing 737-700", const.AIRCRAFT_B737),
    25               ("Boeing 737-800", const.AIRCRAFT_B738),
    26               ("Bombardier Dash 8-Q400", const.AIRCRAFT_DH8D),
    27               ("Boeing 737-300", const.AIRCRAFT_B733),
    28               ("Boeing 737-400", const.AIRCRAFT_B734),
    29               ("Boeing 737-500", const.AIRCRAFT_B735),
    30               ("Boeing 767-200", const.AIRCRAFT_B762),
    31               ("Boeing 767-300", const.AIRCRAFT_B763),
    32               ("Bombardier CRJ200", const.AIRCRAFT_CRJ2),
    33               ("Fokker 70", const.AIRCRAFT_F70),
    34               ("Lisunov Li-2", const.AIRCRAFT_DC3),
    35               ("Tupolev Tu-134", const.AIRCRAFT_T134),
    36               ("Tupolev Tu-154", const.AIRCRAFT_T154),
    37               ("Yakovlev Yak-40", const.AIRCRAFT_YK40) ]
    3820
    3921#------------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.