Index: src/mlx/const.py
===================================================================
--- src/mlx/const.py	(revision 432)
+++ src/mlx/const.py	(revision 437)
@@ -237,36 +237,4 @@
 #-------------------------------------------------------------------------------
 
-## Delay code: loading problems
-DELAYCODE_LOADING = 0
-
-## Delay code: VATSIM problem
-DELAYCODE_VATSIM = 1
-
-## Delay code: network problems
-DELAYCODE_NETWORK = 2
-
-## Delay code: controller's fault
-DELAYCODE_CONTROLLER = 3
-
-## Delay code: system crash or freeze
-DELAYCODE_SYSTEM = 4
-
-## Delay code: navigation problem
-DELAYCODE_NAVIGATION = 5
-
-## Delay code: traffic problems
-DELAYCODE_TRAFFIC = 6
-
-## Delay code: apron navigation
-DELAYCODE_APRON = 7
-
-## Delay code: weather problems
-DELAYCODE_WEATHER = 8
-
-## Delay code: personal reasons
-DELAYCODE_PERSONAL = 9
-
-#-------------------------------------------------------------------------------
-
 ## Message type: logger error
 # FIXME: cannot set the hotkey
Index: src/mlx/gui/delaycodes.py
===================================================================
--- src/mlx/gui/delaycodes.py	(revision 436)
+++ src/mlx/gui/delaycodes.py	(revision 437)
@@ -185,9 +185,20 @@
 #------------------------------------------------------------------------------
 
+class CheckButton(gtk.CheckButton):
+    """A check button that contains a reference to a row in the delay code
+    data table."""
+    def __init__(self, delayCodeRow):
+        """Construct the check button."""
+        super(CheckButton, self).__init__()
+        self.delayCodeRow = delayCodeRow
+
+#------------------------------------------------------------------------------
+
 CAPTION = 1
 
 DELAYCODE = 2
 
-_data1 = ( ["Num", "Code", "Title", "Description"],
+_data1 = ( lambda row: row[0].strip(),
+           ["Num", "Code", "Title", "Description"],
            [ (CAPTION, "Others"),
              (DELAYCODE, ("      6", "OA  ", "NO GATES/STAND AVAILABLE",
@@ -203,7 +214,8 @@
                           "Error with passenger or baggage details")) ] )
 
-_data2 = ( ["MA", "IATA", "Description"],
+_data2 = ( lambda row: row[0].strip(),
+           ["MA", "IATA", "Description"],
            [ (CAPTION, "Passenger and baggage"),
-             (DELAYCODE, ("    012", "01",
+             (DELAYCODE, ("    012", "01   ",
                           "Late shipping of parts and/or materials")),
              (DELAYCODE, ("    111", "11",
@@ -223,8 +235,9 @@
         super(DelayCodeTable, self).__init__()
 
+        self._delayCodeData = None
+
         self._treeView = None
 
-        self._listStore = gtk.ListStore(str, str)
-        self._treeView = gtk.TreeView(self._listStore)
+        self._treeView = gtk.TreeView(gtk.ListStore(str, str))
         self._treeView.set_rules_hint(True)
 
@@ -232,4 +245,5 @@
 
         self._alignments = []
+        self._checkButtons = []
 
         self._eventBox = gtk.EventBox()
@@ -244,4 +258,17 @@
 
         self._previousWidth = 0
+
+    @property
+    def delayCodes(self):
+        """Get a list of the delay codes checked by the user."""
+        codes = []
+
+        if self._delayCodeData is not None:
+            codeExtractor = self._delayCodeData[0]
+            for checkButton in self._checkButtons:
+                if checkButton.get_active():
+                    codes.append(codeExtractor(checkButton.delayCodeRow))
+
+        return codes
 
     def allocate_column_sizes(self, allocation):
@@ -263,9 +290,11 @@
             data = _data2
 
+        self._delayCodeData = data
+
         columns = self._treeView.get_columns()
         for column in columns:
             self._treeView.remove_column(column)
 
-        (headers, rows) = data
+        (_extractor, headers, rows) = data
         numColumns = len(headers) + 1
         numRows = len(rows)
@@ -287,4 +316,5 @@
 
         self._alignments = []
+        self._checkButtons = []
 
         firstDelayCodeRow = True
@@ -301,6 +331,8 @@
                 self._table.set_row_spacing(i, 8)
             elif type==DELAYCODE:
+                checkButton = CheckButton(elements)
+                self._checkButtons.append(checkButton)
                 alignment = Alignment(xalign = 0.5, yalign = 0.5, xscale = 1.0)
-                alignment.add(gtk.CheckButton())
+                alignment.add(checkButton)
                 self._table.attach(alignment, 0, 1, i, i+1)
                 if firstDelayCodeRow:
Index: src/mlx/gui/info.py
===================================================================
--- src/mlx/gui/info.py	(revision 436)
+++ src/mlx/gui/info.py	(revision 437)
@@ -23,18 +23,4 @@
     """The flight info tab."""
     @staticmethod
-    def _delayCodes():
-        """Get an array of delay codes."""
-        return [ (const.DELAYCODE_LOADING, xstr("info_delay_loading")),
-                 (const.DELAYCODE_VATSIM, xstr("info_delay_vatsim")),
-                 (const.DELAYCODE_NETWORK, xstr("info_delay_net")),
-                 (const.DELAYCODE_CONTROLLER, xstr("info_delay_atc")),
-                 (const.DELAYCODE_SYSTEM, xstr("info_delay_system")),
-                 (const.DELAYCODE_NAVIGATION, xstr("info_delay_nav")),
-                 (const.DELAYCODE_TRAFFIC, xstr("info_delay_traffic")),
-                 (const.DELAYCODE_APRON, xstr("info_delay_apron")),
-                 (const.DELAYCODE_WEATHER, xstr("info_delay_weather")),
-                 (const.DELAYCODE_PERSONAL, xstr("info_delay_personal")) ]
-
-    @staticmethod
     def _createCommentArea(label):
         """Create a comment area.
@@ -54,11 +40,7 @@
 
         scroller = gtk.ScrolledWindow()
-        # FIXME: these should be constants
-        scroller.set_policy(gtk.PolicyType.AUTOMATIC if pygobject
-                            else gtk.POLICY_AUTOMATIC,
-                            gtk.PolicyType.AUTOMATIC if pygobject
-                            else gtk.POLICY_AUTOMATIC)
-        scroller.set_shadow_type(gtk.ShadowType.IN if pygobject
-                                 else gtk.SHADOW_IN)
+        scroller.set_policy(POLICY_AUTOMATIC, POLICY_AUTOMATIC)
+        scroller.set_shadow_type(SHADOW_IN)
+
         comments = gtk.TextView()
         comments.set_wrap_mode(WRAP_WORD)
@@ -100,23 +82,5 @@
                               padding_left = 8, padding_right = 8)
 
-
-        # self._delayTable = table = gtk.Table(5, 2)
-        # table.set_col_spacings(16)
-
-        # row = 0
-        # column = 0
-
-        # self._delayCodeWidgets = []
-        # for (_code, label) in FlightInfo._delayCodes():
-        #     button = gtk.CheckButton(label)
-        #     button.set_use_underline(True)
-        #     table.attach(button, column, column + 1, row, row + 1)
-        #     self._delayCodeWidgets.append(button)
-        #     if column==0:
-        #         column += 1
-        #     else:
-        #         row += 1
-        #         column = 0
-        self._delayTable = table = DelayCodeTable()
+        self._delayCodeTable = table = DelayCodeTable()
         self._delayWindow = scrolledWindow = gtk.ScrolledWindow()
         scrolledWindow.add(table)
@@ -156,10 +120,5 @@
     def delayCodes(self):
         """Get the list of delay codes checked by the user."""
-        codes =  []
-        delayCodes = FlightInfo._delayCodes()
-        for index in range(0, len(delayCodes)):
-            if self._delayCodeWidgets[index].get_active():
-                codes.append(delayCodes[index][0])
-        return codes
+        return self._delayCodeTable.delayCodes
 
     def enable(self, aircraftType):
@@ -167,7 +126,7 @@
         self._comments.set_sensitive(True)
         self._flightDefects.set_sensitive(True)
-        self._delayTable.setType(aircraftType)
+        self._delayCodeTable.setType(aircraftType)
         self._delayWindow.set_sensitive(True)
-        self._delayTable.setStyle()
+        self._delayCodeTable.setStyle()
 
     def disable(self):
@@ -176,5 +135,5 @@
         self._flightDefects.set_sensitive(False)
         self._delayWindow.set_sensitive(False)
-        self._delayTable.setStyle()
+        self._delayCodeTable.setStyle()
 
     def reset(self):
@@ -182,7 +141,5 @@
         self._comments.get_buffer().set_text("")
         self._flightDefects.get_buffer().set_text("")
-        self._delayTable.reset()
-        # for widget in self._delayCodeWidgets:
-        #     widget.set_active(False)
+        self._delayCodeTable.reset()
 
     def _commentsChanged(self, textbuffer):
Index: src/mlx/gui/pirep.py
===================================================================
--- src/mlx/gui/pirep.py	(revision 303)
+++ src/mlx/gui/pirep.py	(revision 437)
@@ -241,5 +241,5 @@
         for code in pirep.delayCodes:
             if delayCodes: delayCodes += ", "
-            delayCodes += PIREP.delayCodeNames[code]
+            delayCodes += code
         
         self._delayCodes.get_buffer().set_text(delayCodes)        
Index: src/mlx/pirep.py
===================================================================
--- src/mlx/pirep.py	(revision 401)
+++ src/mlx/pirep.py	(revision 437)
@@ -19,15 +19,4 @@
 class PIREP(object):
     """A pilot's report of a flight."""
-    delayCodeNames = { const.DELAYCODE_LOADING : "Loading Problems",
-                       const.DELAYCODE_NETWORK : "Net Problems",
-                       const.DELAYCODE_SYSTEM : "System Crash/Freezing",
-                       const.DELAYCODE_TRAFFIC : "Traffic Problems",
-                       const.DELAYCODE_WEATHER : "Weather Problems",
-                       const.DELAYCODE_VATSIM : "VATSIM Problem",
-                       const.DELAYCODE_CONTROLLER : "Controller's Fault",
-                       const.DELAYCODE_NAVIGATION : "Navigation Problem",
-                       const.DELAYCODE_APRON : "Apron Navigation Problems",
-                       const.DELAYCODE_PERSONAL : "Personal Reasons" }
-
     @staticmethod
     def _formatLine(timeStr, line):
@@ -140,5 +129,5 @@
             for code in self.delayCodes:
                 if s: s += ", "
-                s += PIREP.delayCodeNames[code]
+                s += code
             return s
 
