Ignore:
Timestamp:
12/10/12 19:28:32 (11 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

The basic strobe-less RTO handling logic works (#143)

File:
1 edited

Legend:

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

    r300 r349  
    3333                 (const.DELAYCODE_WEATHER, xstr("info_delay_weather")),
    3434                 (const.DELAYCODE_PERSONAL, xstr("info_delay_personal")) ]
    35    
     35
    3636    @staticmethod
    3737    def _createCommentArea(label):
     
    5050        alignment.set_padding(padding_top = 4, padding_bottom = 4,
    5151                              padding_left = 8, padding_right = 8)
    52        
     52
    5353        scroller = gtk.ScrolledWindow()
    5454        # FIXME: these should be constants
     
    8080        (frame, self._comments) = FlightInfo._createCommentArea(xstr("info_comments"))
    8181        commentsBox.pack_start(frame, True, True, 8)
     82        self._comments.get_buffer().connect("changed", self._commentsChanged)
    8283
    8384        (frame, self._flightDefects) = \
     
    130131        return text2unicode(buffer.get_text(buffer.get_start_iter(),
    131132                                            buffer.get_end_iter(), True))
    132    
     133
     134    @property
     135    def hasComments(self):
     136        """Get whether there is any text in comments field."""
     137        return self._comments.get_buffer().get_char_count()>0
     138
    133139    @property
    134140    def flightDefects(self):
     
    147153                codes.append(delayCodes[index][0])
    148154        return codes
    149            
     155
    150156    def enable(self):
    151157        """Enable the flight info tab."""
     
    153159        self._flightDefects.set_sensitive(True)
    154160        self._delayTable.set_sensitive(True)
    155        
     161
    156162    def disable(self):
    157163        """Enable the flight info tab."""
     
    167173        for widget in self._delayCodeWidgets:
    168174            widget.set_active(False)
     175
     176    def _commentsChanged(self, textbuffer):
     177        """Called when the comments have changed."""
     178        self._gui.updateRTO(inLoop = True)
Note: See TracChangeset for help on using the changeset viewer.