Changeset 278:f4860ca38620 for src/mlx


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

Double click is handled on the gate selection page

File:
1 edited

Legend:

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

    r277 r278  
    732732        self._gateList.append_column(column)
    733733        self._gateList.set_headers_visible(False)
     734        self._gateList.connect("row-activated", self._rowActivated)
    734735
    735736        gateSelection = self._gateList.get_selection()
     
    782783        """Called when the forward button is clicked."""
    783784        if not self._completed:
    784             selection = self._gateList.get_selection()
    785             (listStore, iter) = selection.get_selected()
    786             (gateNumber,) = listStore.get(iter, 0)
    787 
    788             self._wizard._departureGate = gateNumber
    789 
    790             self._wizard.updatePlane(self._planeUpdated,
    791                                      self._wizard._bookedFlight.tailNumber,
    792                                      const.PLANE_HOME, gateNumber)
     785            self._gateSelected()
    793786        else:
    794787            self._wizard.nextPage()
     788
     789    def _rowActivated(self, flightList, path, column):
     790        """Called when a row is activated."""
     791        if not self._completed:
     792            self._gateSelected()
     793
     794    def _gateSelected(self):
     795        """Called when a gate has been selected."""
     796        selection = self._gateList.get_selection()
     797        (listStore, iter) = selection.get_selected()
     798        (gateNumber,) = listStore.get(iter, 0)
     799
     800        self._wizard._departureGate = gateNumber
     801
     802        self._wizard.updatePlane(self._planeUpdated,
     803                                 self._wizard._bookedFlight.tailNumber,
     804                                 const.PLANE_HOME, gateNumber)       
    795805
    796806    def _planeUpdated(self, success):
Note: See TracChangeset for help on using the changeset viewer.