Exemple #1
0
 def geotag_selection(self,job,item,continue_cb,lat,lon):
     if item.selected:
         if item.thumb:
             from picty import imagemanip
             pb=imagemanip.scale_pixbuf(item.thumb,40)
             imagemanip.set_coords(item,lat,lon)
             gobject.idle_add(self.osm.add_image,lat,lon,pb)
Exemple #2
0
 def drag_receive_signal(self, osm, drag_context, x, y, selection_data,
                         info, timestamp):
     if selection_data.type == 'image-filename':
         path = selection_data.data
         item = baseobjects.Item(path)
         ind = self.worker.active_collection.find(item)
         if ind < 0:
             return False
         item = self.worker.active_collection(ind)
         if not item.selected:
             if item.thumb:
                 coords = osm.get_co_ordinates(x, y)
                 lat = coords[0] / math.pi * 180
                 lon = coords[1] / math.pi * 180
                 from picty import imagemanip
                 pb = imagemanip.scale_pixbuf(item.thumb, 40)
                 self.osm.add_image(lat, lon, pb)
                 imagemanip.set_coords(item, lat, lon)
                 self.update_map_items()
         else:
             coords = osm.get_co_ordinates(x, y)
             lat = coords[0] / math.pi * 180
             lon = coords[1] / math.pi * 180
             self.plugin.run_as_job(self.geotag_selection,
                                    self.update_map_items, 900, lat, lon)
Exemple #3
0
 def drag_receive_signal(self, osm, drag_context, x, y, selection_data, info, timestamp):
     if selection_data.type=='image-filename':
         path=selection_data.data
         item=baseobjects.Item(path)
         ind=self.worker.active_collection.find(item)
         if ind<0:
             return False
         item=self.worker.active_collection(ind)
         if not item.selected:
             if item.thumb:
                 coords=osm.get_co_ordinates(x, y)
                 lat=coords[0]/math.pi*180
                 lon=coords[1]/math.pi*180
                 from picty import imagemanip
                 pb=imagemanip.scale_pixbuf(item.thumb,40)
                 self.osm.add_image(lat,lon,pb)
                 imagemanip.set_coords(item,lat,lon)
                 self.update_map_items()
         else:
             coords=osm.get_co_ordinates(x, y)
             lat=coords[0]/math.pi*180
             lon=coords[1]/math.pi*180
             self.plugin.run_as_job(self.geotag_selection,self.update_map_items,900,lat,lon)