From 63152be01a5b6a4c8fe0900f6de322ae3a07181a Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Mon, 25 Apr 2011 23:05:32 +0000 Subject: [PATCH] Add default GrampsBar gramplets for new geography views svn: r17262 --- src/plugins/view/geoevents.py | 6 ++++++ src/plugins/view/geofamily.py | 6 ++++++ src/plugins/view/geoperson.py | 18 ++++++++++++------ src/plugins/view/geoplaces.py | 7 ++++++- 4 files changed, 30 insertions(+), 7 deletions(-) diff --git a/src/plugins/view/geoevents.py b/src/plugins/view/geoevents.py index 32622e229..5a5b71fd6 100644 --- a/src/plugins/view/geoevents.py +++ b/src/plugins/view/geoevents.py @@ -380,3 +380,9 @@ class GeoEvents(GeoGraphyView): add_item.show() menu.append(add_item) + def get_default_gramplets(self): + """ + Define the default gramplets for the sidebar and bottombar. + """ + return (("Event Filter Gramplet",), + ()) diff --git a/src/plugins/view/geofamily.py b/src/plugins/view/geofamily.py index 10f303c2c..25f193b73 100644 --- a/src/plugins/view/geofamily.py +++ b/src/plugins/view/geofamily.py @@ -428,3 +428,9 @@ class GeoFamily(GeoGraphyView): """ return + def get_default_gramplets(self): + """ + Define the default gramplets for the sidebar and bottombar. + """ + return (("Family Filter Gramplet",), + ()) diff --git a/src/plugins/view/geoperson.py b/src/plugins/view/geoperson.py index 0ed2164e0..fa01a831a 100644 --- a/src/plugins/view/geoperson.py +++ b/src/plugins/view/geoperson.py @@ -205,8 +205,8 @@ class GeoPerson(GeoGraphyView): return False startlat = float(marks[i][3]) startlon = float(marks[i][4]) - heading = 1 - if index == 0 and stepyear == 0: + heading = 1 + if index == 0 and stepyear == 0: self.remove_all_gps() self.osm.gps_add(startlat, startlon, heading) endlat = float(marks[ni][3]) @@ -221,12 +221,12 @@ class GeoPerson(GeoGraphyView): latstep = ( endlat - startlat ) / years lonstep = ( endlon - startlon ) / years stepyear = 1 if stepyear < 1 else stepyear - startlat += ( latstep * stepyear ) - startlon += ( lonstep * stepyear ) + startlat += ( latstep * stepyear ) + startlon += ( lonstep * stepyear ) if ( int(startyear) + stepyear ) > int(endmov) : self.already_started = False return False - self.osm.gps_add(startlat, startlon, heading) + self.osm.gps_add(startlat, startlon, heading) stepyear += 1 difflat = ( startlat - endlat ) if startlat > endlat else \ ( endlat - startlat ) @@ -241,7 +241,7 @@ class GeoPerson(GeoGraphyView): # 100ms => 1s per 10 years. # For a 100 years person, it takes 10 secondes. glib.timeout_add(100, self.animate, menu, marks, i, stepyear) - return False + return False def _createmap(self,obj): """ @@ -429,3 +429,9 @@ class GeoPerson(GeoGraphyView): menu.append(add_item) return + def get_default_gramplets(self): + """ + Define the default gramplets for the sidebar and bottombar. + """ + return (("Person Filter Gramplet",), + ()) diff --git a/src/plugins/view/geoplaces.py b/src/plugins/view/geoplaces.py index b8ab76a04..f2c7342ed 100644 --- a/src/plugins/view/geoplaces.py +++ b/src/plugins/view/geoplaces.py @@ -324,4 +324,9 @@ class GeoPlaces(GeoGraphyView): add_item.show() menu.append(add_item) - + def get_default_gramplets(self): + """ + Define the default gramplets for the sidebar and bottombar. + """ + return (("Place Filter Gramplet",), + ())