From 1c6f0963708de41f362d53ffabef1419424a3dbf Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Tue, 4 Jul 2006 03:53:51 +0000 Subject: [PATCH] * src/DataViews/_PlaceView.py: add attempt to map to google maps svn: r6984 --- gramps2/ChangeLog | 1 + gramps2/src/DataViews/_PlaceView.py | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 0c41395ba..5c8a557ea 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,4 +1,5 @@ 2006-07-03 Don Allingham + * src/DataViews/_PlaceView.py: add attempt to map to google maps * src/glade/gramps.glade: fix date status button. 2006-07-02 Don Allingham diff --git a/gramps2/src/DataViews/_PlaceView.py b/gramps2/src/DataViews/_PlaceView.py index 1c649272e..350f7e7f8 100644 --- a/gramps2/src/DataViews/_PlaceView.py +++ b/gramps2/src/DataViews/_PlaceView.py @@ -98,7 +98,24 @@ 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): + '''