From 8260f30b9452cca93da20ad3f6d3fb5409839682 Mon Sep 17 00:00:00 2001 From: Serge Noiraud Date: Wed, 25 Apr 2012 07:17:04 +0000 Subject: [PATCH] Geography : force to redraw the layers when we change the map provider. svn: r19386 --- src/plugins/lib/maps/osmGps.py | 1 + src/plugins/view/geoevents.py | 7 ++----- src/plugins/view/geofamily.py | 5 +---- src/plugins/view/geoperson.py | 4 ++++ src/plugins/view/geoplaces.py | 5 +---- 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/plugins/lib/maps/osmGps.py b/src/plugins/lib/maps/osmGps.py index c2b5d24b4..3e57cfc27 100644 --- a/src/plugins/lib/maps/osmGps.py +++ b/src/plugins/lib/maps/osmGps.py @@ -148,6 +148,7 @@ class OsmGps(): self.osm.connect('changed', self.zoom_changed) self.osm.show() self.vbox.pack_start(self.osm) + self.goto_handle(handle=None) def add_selection_layer(self): """ diff --git a/src/plugins/view/geoevents.py b/src/plugins/view/geoevents.py index 9784d44c5..a767dd955 100644 --- a/src/plugins/view/geoevents.py +++ b/src/plugins/view/geoevents.py @@ -174,10 +174,7 @@ class GeoEvents(GeoGraphyView): """ Rebuild the tree with the given events handle as the root. """ - if handle: - self.change_active(handle) - self._createmap(handle) - self.uistate.modify_statusbar(self.dbstate) + self.build_tree() def show_all_events(self, menu, event, lat, lon): """ @@ -289,7 +286,7 @@ class GeoEvents(GeoGraphyView): self._createmap_for_one_event(event) else: if obj is None: - events_handle = dbstate.db.iter_event_handles() + events_handle = dbstate.db.get_event_handles() for event_hdl in events_handle: event = dbstate.db.get_event_from_handle(event_hdl) self._createmap_for_one_event(event) diff --git a/src/plugins/view/geofamily.py b/src/plugins/view/geofamily.py index 4b36eba8f..154b74cca 100644 --- a/src/plugins/view/geofamily.py +++ b/src/plugins/view/geofamily.py @@ -173,10 +173,7 @@ class GeoFamily(GeoGraphyView): """ Rebuild the tree with the given person handle as the root. """ - if handle: - self.change_active(handle) - self._createmap(handle) - self.uistate.modify_statusbar(self.dbstate) + self.build_tree() def build_tree(self): """ diff --git a/src/plugins/view/geoperson.py b/src/plugins/view/geoperson.py index 28593d4a8..f724bdedb 100644 --- a/src/plugins/view/geoperson.py +++ b/src/plugins/view/geoperson.py @@ -204,6 +204,10 @@ class GeoPerson(GeoGraphyView): if handle: self.change_active(handle) self._createmap(handle) + active = self.get_active() + if active: + p1 = self.dbstate.db.get_person_from_handle(active) + self._createmap(p1) self.uistate.modify_statusbar(self.dbstate) def build_tree(self): diff --git a/src/plugins/view/geoplaces.py b/src/plugins/view/geoplaces.py index 8d5839fb7..55ed480e9 100644 --- a/src/plugins/view/geoplaces.py +++ b/src/plugins/view/geoplaces.py @@ -174,10 +174,7 @@ class GeoPlaces(GeoGraphyView): """ Rebuild the tree with the given places handle as the root. """ - if handle: - self.change_active(handle) - self._createmap(handle) - self.uistate.modify_statusbar(self.dbstate) + self.build_tree() def show_all_places(self, menu, event, lat, lon): """