Changeset 841:e9399d1ef250 for src


Ignore:
Timestamp:
04/17/17 07:09:50 (8 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

A fault explanation text can be set programmatically.

Location:
src/mlx/gui
Files:
2 edited

Legend:

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

    r834 r841  
    9393        return buffer.get_text(buffer.get_start_iter(),
    9494                               buffer.get_end_iter(), True)
     95
     96    @explanation.setter
     97    def explanation(self, explanation):
     98        """Set the explanation."""
     99        self._explanation.get_buffer().set_text(explanation)
    95100
    96101    @property
     
    235240                          numExplanations = self._numExplanations -
    236241                          (1 if hasExplanation else 0))
     242
     243    def setExplanation(self, id, explanation):
     244        """Set the explanation for the fault with the given ID"""
     245        self._faultWidgets[id][1].explanation = explanation
    237246
    238247    def reset(self):
  • src/mlx/gui/info.py

    r840 r841  
    147147        self._faultExplainWidget.clearFault(id)
    148148
     149    def setExplanation(self, id, explanation):
     150        """Set the explanation of the given fault."""
     151        self._faultExplainWidget.setExplanation(id, explanation)
     152
    149153    def enable(self, aircraftType):
    150154        """Enable the flight info tab."""
Note: See TracChangeset for help on using the changeset viewer.