Changeset 604:0ec6a6f58f08 for src/mlx/gui/info.py
- Timestamp:
- 03/01/15 16:53:08 (9 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/info.py
r555 r604 3 3 4 4 from mlx.gui.delaycodes import DelayCodeTable 5 from mlx.gui.faultexplain import FaultExplainWidget 5 6 6 7 from mlx.i18n import xstr … … 14 15 # 15 16 # This module implements to \ref FlightInfo class, which is the widget for the 16 # extra information related to the flight. It contains text areasfor the17 # comments and the flight defects at the top next to each other, and the frame18 # for the delay codes at thebottom in the centre.17 # extra information related to the flight. It contains a text area for the 18 # comments, the fault list widget, and the frame for the delay codes at the 19 # bottom in the centre. 19 20 20 21 #------------------------------------------------------------------------------ … … 61 62 xscale = 1.0, yscale = 1.0) 62 63 commentsBox = gtk.HBox() 64 commentsBox.set_homogeneous(True) 63 65 64 66 (frame, self._comments) = FlightInfo._createCommentArea(xstr("info_comments")) … … 66 68 self._comments.get_buffer().connect("changed", self._commentsChanged) 67 69 68 (frame, self._flightDefects) = \ 69 FlightInfo._createCommentArea(xstr("info_defects")) 70 commentsBox.pack_start(frame, True, True, 8) 70 self._faultExplainWidget = FaultExplainWidget() 71 commentsBox.pack_start(self._faultExplainWidget, True, True, 8) 71 72 72 73 self._commentsAlignment.add(commentsBox) … … 113 114 114 115 @property 115 def flightDefects(self): 116 """Get the flight defects.""" 117 buffer = self._flightDefects.get_buffer() 118 return text2unicode(buffer.get_text(buffer.get_start_iter(), 119 buffer.get_end_iter(), True)) 116 def faultsAndExplanations(self): 117 """Get the faults and explanations as HTML.""" 118 return self._faultExplainWidget.html 120 119 121 120 @property … … 129 128 return self._delayCodeTable.hasDelayCode 130 129 130 def addFault(self, id, faultText): 131 """Add a fault to the list of faults.""" 132 self._faultExplainWidget.addFault(id, faultText) 133 134 def updateFault(self, id, faultText): 135 """Update a fault to the list of faults.""" 136 self._faultExplainWidget.updateFault(id, faultText) 137 138 def clearFault(self, id): 139 """Clear a fault to the list of faults.""" 140 self._faultExplainWidget.clearFault(id) 141 131 142 def enable(self, aircraftType): 132 143 """Enable the flight info tab.""" 133 144 self._comments.set_sensitive(True) 134 self._f lightDefects.set_sensitive(True)145 self._faultExplainWidget.set_sensitive(True) 135 146 self._delayCodeTable.setType(aircraftType) 136 147 self._delayWindow.set_sensitive(True) … … 140 151 """Enable the flight info tab.""" 141 152 self._comments.set_sensitive(False) 142 self._f lightDefects.set_sensitive(False)153 self._faultExplainWidget.set_sensitive(False) 143 154 self._delayWindow.set_sensitive(False) 144 155 self._delayCodeTable.setStyle() … … 147 158 """Reset the flight info tab.""" 148 159 self._comments.get_buffer().set_text("") 149 self._f lightDefects.get_buffer().set_text("")160 self._faultExplainWidget.reset() 150 161 self._delayCodeTable.reset() 151 162
Note:
See TracChangeset
for help on using the changeset viewer.