From a8e5f3acf9e6ece4be0328381dc9ff846fb85811 Mon Sep 17 00:00:00 2001 From: Serge Noiraud Date: Wed, 23 Dec 2009 07:06:44 +0000 Subject: [PATCH] GeoView : add signal when places are added. thanks nick. svn: r13889 --- src/plugins/view/geoview.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/plugins/view/geoview.py b/src/plugins/view/geoview.py index 9ac4b38ce..8ab3afd0f 100644 --- a/src/plugins/view/geoview.py +++ b/src/plugins/view/geoview.py @@ -322,7 +322,12 @@ class GeoView(HtmlView): self.without_coord_file = os.path.join(GEOVIEW_SUBPATH, "without_coord.html") self.endinit = False - + self.signal_map = {'place-add': self._place_added} + + def _place_added(self, handle_list): + self.displaytype = "places" + self._geo_places() + def top_widget(self): """ The top widget to use, for GeoView : @@ -920,7 +925,7 @@ class GeoView(HtmlView): self.displaytype = "event" self._geo_places() - def _new_database(self, *args): # pylint: disable-msg=W0613 + def _new_database(self, db): """ We just change the database. Restore the initial config. Is it good ? @@ -932,6 +937,9 @@ class GeoView(HtmlView): config.get('geoview.latitude'), config.get('geoview.longitude'), "D.D8") + self._change_db(db) + for sig in self.signal_map: + self.callman.add_db_signal(sig, self.signal_map[sig]) def _geo_places(self): """ @@ -1834,7 +1842,7 @@ class GeoView(HtmlView): _("Cannot center the map. No location with coordinates." "The following reasons are :