From 7e4e66d0e34e43d82fd6eb1920afcedd6c2bf993 Mon Sep 17 00:00:00 2001 From: prculley Date: Sat, 14 Oct 2017 11:36:31 -0500 Subject: [PATCH] Fix Geography view 'Find' when db is closed. Fixes #10229 --- gramps/plugins/view/geoclose.py | 4 +++- gramps/plugins/view/geoevents.py | 2 ++ gramps/plugins/view/geofamclose.py | 3 +++ gramps/plugins/view/geofamily.py | 2 ++ gramps/plugins/view/geoperson.py | 2 ++ gramps/plugins/view/geoplaces.py | 4 +++- 6 files changed, 15 insertions(+), 2 deletions(-) diff --git a/gramps/plugins/view/geoclose.py b/gramps/plugins/view/geoclose.py index 527f02d2f..f831a9c01 100644 --- a/gramps/plugins/view/geoclose.py +++ b/gramps/plugins/view/geoclose.py @@ -323,10 +323,12 @@ class GeoClose(GeoGraphyView): all handling of visibility is now in rebuild_trees, see that for more information. """ + self.lifeway_layer.clear_ways() + if not self.dbstate.is_open(): + return active = self.get_active() if active: person = self.dbstate.db.get_person_from_handle(active) - self.lifeway_layer.clear_ways() if person is None: self.goto_handle(None) else: diff --git a/gramps/plugins/view/geoevents.py b/gramps/plugins/view/geoevents.py index 8359136ad..fcf54eb94 100644 --- a/gramps/plugins/view/geoevents.py +++ b/gramps/plugins/view/geoevents.py @@ -187,6 +187,8 @@ class GeoEvents(GeoGraphyView): all handling of visibility is now in rebuild_trees, see that for more information. """ + if not self.dbstate.is_open(): + return active = self.uistate.get_active('Event') if active: self._createmap(active) diff --git a/gramps/plugins/view/geofamclose.py b/gramps/plugins/view/geofamclose.py index d0c81ea4e..266ff6d81 100644 --- a/gramps/plugins/view/geofamclose.py +++ b/gramps/plugins/view/geofamclose.py @@ -317,6 +317,9 @@ class GeoFamClose(GeoGraphyView): all handling of visibility is now in rebuild_trees, see that for more information. """ + self.lifeway_layer.clear_ways() + if not self.dbstate.is_open(): + return active = self.get_active() if active: family = self.dbstate.db.get_family_from_handle(active) diff --git a/gramps/plugins/view/geofamily.py b/gramps/plugins/view/geofamily.py index 78825118b..977fc9af6 100644 --- a/gramps/plugins/view/geofamily.py +++ b/gramps/plugins/view/geofamily.py @@ -175,6 +175,8 @@ class GeoFamily(GeoGraphyView): all handling of visibility is now in rebuild_trees, see that for more information. """ + if not self.dbstate.is_open(): + return if self.uistate.get_active('Family'): self._createmap(self.uistate.get_active('Family')) else: diff --git a/gramps/plugins/view/geoperson.py b/gramps/plugins/view/geoperson.py index 67f5fbae9..b0648fc2f 100644 --- a/gramps/plugins/view/geoperson.py +++ b/gramps/plugins/view/geoperson.py @@ -210,6 +210,8 @@ class GeoPerson(GeoGraphyView): all handling of visibility is now in rebuild_trees, see that for more information. """ + if not self.dbstate.is_open(): + return active = self.get_active() self._createmap(None) self.uistate.modify_statusbar(self.dbstate) diff --git a/gramps/plugins/view/geoplaces.py b/gramps/plugins/view/geoplaces.py index ee1e787ea..d205d3c46 100644 --- a/gramps/plugins/view/geoplaces.py +++ b/gramps/plugins/view/geoplaces.py @@ -1,4 +1,4 @@ - # -*- python -*- +# -*- python -*- # -*- coding: utf-8 -*- # # Gramps - a GTK+/GNOME based genealogy program @@ -232,6 +232,8 @@ class GeoPlaces(GeoGraphyView): all handling of visibility is now in rebuild_trees, see that for more information. """ + if not self.dbstate.is_open(): + return active = self.uistate.get_active('Place') if active: self._createmap(active)