* src/DataViews/_PlaceView.py: add attempt to map to google maps

svn: r6984
This commit is contained in:
Don Allingham 2006-07-04 03:53:51 +00:00
parent 872a650565
commit 1ab9acf99f
2 changed files with 19 additions and 0 deletions

View File

@ -1,4 +1,5 @@
2006-07-03 Don Allingham <don@gramps-project.org>
* src/DataViews/_PlaceView.py: add attempt to map to google maps
* src/glade/gramps.glade: fix date status button.
2006-07-02 Don Allingham <don@gramps-project.org>

View File

@ -98,6 +98,23 @@ class PlaceView(PageView.ListView):
_('_Column Editor'), callback=self.column_editor)
self.add_action('FastMerge', None, _('_Merge'),
callback=self.fast_merge)
self.add_action('GoogleMaps', gtk.STOCK_JUMP_TO, _('_Google Maps'),
callback=self.google)
def google(self, obj):
import GrampsDisplay
place_handle = self.selected_handles()[0]
place = self.dbstate.db.get_place_from_handle(place_handle)
descr = place.get_title()
longitude = place.get_longitude()
latitude = place.get_latitude()
if longitude and latitude:
path = "http://maps.google.com/?sll=%s,%s" % (longitude, latitude)
else:
path = "http://maps.google.com/maps?q=%s" % '+'.join(descr.split())
GrampsDisplay.url(path)
def column_editor(self,obj):
import ColumnOrder
@ -151,6 +168,7 @@ class PlaceView(PageView.ListView):
<menuitem action="Add"/>
<menuitem action="Edit"/>
<menuitem action="Remove"/>
<menuitem action="GoogleMaps"/>
</popup>
</ui>'''