Пример #1
0
 def on_add(self, widget, data=None):
     clipboard = gtk.Clipboard()
     text = clipboard.wait_for_text()
     wp = None
     if text != None:
         try:
             coord = Coordinates.parse_string(text)
             wp =  Waypoint(coord.lat, coord.lon, coord.alt)
         except(ValueError):
             pass
     
     if wp == None:
         pos = self._session.sleek_position
         wp = Waypoint()
         wp.lat=pos.lat
         wp.lon=pos.lon
         wp.alt=pos.alt
     
     new_row = self._session.wpList.append(self._session.get_manual_list_iter(),(wp,))
Пример #2
0
 def on_latlon_edited( self, cell, path, new_text, model ):
     c = Coordinates.parse_string(new_text)
     wp = model[path][0]
     wp.lat = c.lat
     wp.lon = c.lon
     print wp.strlatlon()