Changeset 220:96ad81e11b85 for src/mlx


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

The Data tab of the PIREP viewer works

Location:
src/mlx
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/const.py

    r197 r220  
    203203#-------------------------------------------------------------------------------
    204204
     205flightTypes = [ FLIGHTTYPE_SCHEDULED,
     206                FLIGHTTYPE_OLDTIMER,
     207                FLIGHTTYPE_VIP,
     208                FLIGHTTYPE_CHARTER ]
     209
     210#-------------------------------------------------------------------------------
     211
     212_flightTypeStrings = { FLIGHTTYPE_SCHEDULED : "scheduled",
     213                       FLIGHTTYPE_OLDTIMER : "ot",
     214                       FLIGHTTYPE_VIP : "vip",
     215                       FLIGHTTYPE_CHARTER : "charter" }
     216
     217def flightType2string(flightType):
     218    """Get the string equivalent of the given flight type."""
     219    print _flightTypeStrings
     220    return _flightTypeStrings[flightType] \
     221           if flightType in _flightTypeStrings else None   
     222
     223#-------------------------------------------------------------------------------
     224
    205225# Delay code: loading problems
    206226DELAYCODE_LOADING = 0
  • src/mlx/gui/common.py

    r191 r220  
    5353
    5454    SELECTION_MULTIPLE = gtk.SELECTION_MULTIPLE
     55
     56    SHADOW_IN = gtk.SHADOW_IN
     57
     58    POLICY_AUTOMATIC = gtk.POLICY_AUTOMATIC
    5559
    5660    def text2unicode(text):
     
    97101    SELECTION_MULTIPLE = gtk.SelectionMode.MULTIPLE
    98102
     103    SHADOW_IN = gtk.ShadowType.IN
     104
     105    POLICY_AUTOMATIC = gtk.PolicyType.AUTOMATIC
     106
    99107    import codecs
    100108    _utf8Decoder = codecs.getdecoder("utf-8")
  • src/mlx/gui/gui.py

    r215 r220  
    1212from mlx.gui.prefs import Preferences
    1313from mlx.gui.checklist import ChecklistEditor
     14from mlx.gui.pirep import PIREPViewer
    1415
    1516import mlx.const as const
     
    144145        self._monitorWindowY = None
    145146        self._selfToggling = False
     147
     148        self._pirepViewer = PIREPViewer(self)
    146149
    147150        window.show_all()
     
    10061009                if result==RESPONSETYPE_OK:
    10071010                    self.sendPIREP(pirep)
     1011                elif result==1:
     1012                    self._pirepViewer.setPIREP(pirep)
     1013                    self._pirepViewer.show_all()
     1014                    self._pirepViewer.run()
     1015                    self._pirepViewer.hide()
    10081016
    10091017    def _getLoadPirepDialog(self):
     
    11381146
    11391147        dialog.add_button(xstr("button_cancel"), RESPONSETYPE_REJECT)
     1148        dialog.add_button(xstr("viewPIREP"), 1)
    11401149        dialog.add_button(xstr("sendPIREP"), RESPONSETYPE_OK)
    11411150       
  • src/mlx/i18n.py

    r217 r220  
    873873                 "you may try again later. Or it can be a bug;\n" \
    874874                 "see the debug log for more information.")
     875
     876        self.add("viewPIREP", "_View PIREP...")
     877
     878        self.add("pirepView_title", "PIREP viewer")
     879
     880        self.add("pirepView_frame_flight", "Flight")
     881        self.add("pirepView_callsign", "Callsign:")
     882        self.add("pirepView_tailNumber", "Tail no.:")
     883        self.add("pirepView_aircraftType", "Aircraft:")
     884        self.add("pirepView_departure", "Departure airport:")
     885        self.add("pirepView_departure_time", "time:")
     886        self.add("pirepView_arrival", "Arrival airport:")
     887        self.add("pirepView_arrival_time", "time:")
     888        self.add("pirepView_numPassengers", "PAX:")
     889        self.add("pirepView_numCrew", "Crew:")
     890        self.add("pirepView_bagWeight", "Baggage:")
     891        self.add("pirepView_cargoWeight", "Cargo:")
     892        self.add("pirepView_mailWeight", "Mail:")
     893        self.add("pirepView_route", "MAVA route:")
     894
     895        self.add("pirepView_frame_route", "Route filed")
     896        self.add("pirepView_filedCruiseLevel", "Cruise level:")
     897        self.add("pirepView_modifiedCruiseLevel", "modified to:")
     898
     899        self.add("pirepView_frame_departure", "Departure")
     900        self.add("pirepView_runway", "Runway:")
     901        self.add("pirepView_sid", "SID:")
     902
     903        self.add("pirepView_frame_arrival", "Arrival")
     904        self.add("pirepView_star", "STAR:")
     905        self.add("pirepView_transition", "Transition:")
     906        self.add("pirepView_approachType", "Approach:")
     907
     908        self.add("pirepView_frame_statistics", "Statistics")
     909        self.add("pirepView_blockTimeStart", "Block time start:")
     910        self.add("pirepView_blockTimeEnd", "end:")
     911        self.add("pirepView_flightTimeStart", "Flight time start:")
     912        self.add("pirepView_flightTimeEnd", "end:")
     913        self.add("pirepView_flownDistance", "Flown distance:")
     914        self.add("pirepView_fuelUsed", "Fuel used:")
     915        self.add("pirepView_rating", "Rating:")
     916
     917        self.add("pirepView_frame_miscellaneous", "Miscellaneous")
     918        self.add("pirepView_flightType", "Type:")
     919        self.add("pirepView_online", "Online:")
     920        self.add("pirepView_yes", "yes")
     921        self.add("pirepView_no", "no")
     922        self.add("pirepView_delayCodes", "Delay codes:")
    875923
    876924#------------------------------------------------------------------------------
  • src/mlx/pirep.py

    r151 r220  
    1010class PIREP(object):
    1111    """A pilot's report of a flight."""
    12     _delayCodeNames = { const.DELAYCODE_LOADING : "Loading Problems",
    13                         const.DELAYCODE_NETWORK : "Net Problems",
    14                         const.DELAYCODE_SYSTEM : "System Crash/Freezing",
    15                         const.DELAYCODE_TRAFFIC : "Traffic Problems",
    16                         const.DELAYCODE_WEATHER : "Weather Problems",
    17                         const.DELAYCODE_VATSIM : "VATSIM Problem",
    18                         const.DELAYCODE_CONTROLLER : "Controller's Fault",
    19                         const.DELAYCODE_NAVIGATION : "Navigation Problem",
    20                         const.DELAYCODE_APRON : "Apron Navigation Problems",
    21                         const.DELAYCODE_PERSONAL : "Personal Reasons" }
     12    delayCodeNames = { const.DELAYCODE_LOADING : "Loading Problems",
     13                       const.DELAYCODE_NETWORK : "Net Problems",
     14                       const.DELAYCODE_SYSTEM : "System Crash/Freezing",
     15                       const.DELAYCODE_TRAFFIC : "Traffic Problems",
     16                       const.DELAYCODE_WEATHER : "Weather Problems",
     17                       const.DELAYCODE_VATSIM : "VATSIM Problem",
     18                       const.DELAYCODE_CONTROLLER : "Controller's Fault",
     19                       const.DELAYCODE_NAVIGATION : "Navigation Problem",
     20                       const.DELAYCODE_APRON : "Apron Navigation Problems",
     21                       const.DELAYCODE_PERSONAL : "Personal Reasons" }
    2222
    2323    @staticmethod
     
    117117            for code in self.delayCodes:
    118118                if s: s += ", "
    119                 s += PIREP._delayCodeNames[code]
     119                s += PIREP.delayCodeNames[code]
    120120            return s
    121121
Note: See TracChangeset for help on using the changeset viewer.