Changeset 272:b80168ef552a for src


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

Location:
src/mlx
Files:
2 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):
  • src/mlx/i18n.py

    r270 r272  
    995995        self.add("callouts_altitude_clash_sec",
    996996                 "Shall I set the altitude nevertheless? If so, "
    997                  "both callouts will be played when reaching the altitude "
    998                  "simultaneously.")
     997                 "the other callout with the same altitude will be "
     998                 "removed.")
    999999
    10001000#------------------------------------------------------------------------------
     
    18751875        self.add("callouts_altitude_clash_sec",
    18761876                 "Ennek ellenére beállítsam a megadott magasságoz? Ha "
    1877                  "így teszek, mindkét bemondást egyidejűleg le fogja "
    1878                  "játszani a program a magasság elérésekor.")
     1877                 "így teszek, a másik bemondást egyúttal törlöm.")
    18791878
    18801879#------------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.