Ignore:
Timestamp:
07/03/12 14:52:59 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Changed the way the altitude clashes are handled

File:
1 edited

Legend:

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

    r268 r272  
    255255        editedIter = model.get_iter_from_string(path)
    256256        editedPath = model.get_path(editedIter)
    257         if self._hasAltitude(newAltitude, ignorePath = editedPath):
     257        otherPath = self._hasAltitude(newAltitude, ignorePath = editedPath)
     258        if otherPath is not None:
    258259            dialog = gtk.MessageDialog(parent = self,
    259260                                       type = MESSAGETYPE_QUESTION,
     
    273274        if newAltitude is not None:
    274275            model[editedPath][0] = newAltitude
     276            if otherPath is not None:
     277                model.remove(model.get_iter(otherPath))
    275278
    276279    def _saveApproachCallouts(self):
     
    409412        or not.
    410413       
    411         ignorePath is a path in the model to ignore."""       
     414        ignorePath is a path in the model to ignore.
     415
     416        Returns the path of the element found, if any, or None, if the
     417        altitude is not found."""       
    412418        model = self._fileListModel
    413419        iter = model.get_iter_first()
     
    415421            path = model.get_path(iter)
    416422            if path!=ignorePath and altitude==model[path][0]:
    417                 return True
     423                return path
    418424            iter = model.iter_next(iter)
    419425
    420         return False
     426        return None
    421427
    422428    def _getNextValidUsualAltitude(self, startValue, descending):
Note: See TracChangeset for help on using the changeset viewer.