From 361b99cee6fff1cc269bd3c9f87d0f830cb3a078 Mon Sep 17 00:00:00 2001 From: Serge Noiraud Date: Wed, 23 Dec 2009 10:08:16 +0000 Subject: [PATCH] GeoView : Add Nick to the contributors. Force the zoom to be locked when adding places. svn: r13890 --- src/plugins/view/geoview.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/plugins/view/geoview.py b/src/plugins/view/geoview.py index 8ab3afd0f..157946f70 100644 --- a/src/plugins/view/geoview.py +++ b/src/plugins/view/geoview.py @@ -9,6 +9,7 @@ # Copyright (C) 2009 Helge GRAMPS # Copyright (C) 2009 Josip # Copyright (C) 2009 Gary Burton +# Copyright (C) 2009 Nick Hall # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -326,6 +327,7 @@ class GeoView(HtmlView): def _place_added(self, handle_list): self.displaytype = "places" + self._set_lock_unlock(True) self._geo_places() def top_widget(self): @@ -971,6 +973,17 @@ class GeoView(HtmlView): self._change_map("google") self._ask_year_selection(self.last_year) + def _set_lock_unlock(self, state): + """ + Change the lock/unlock state. + """ + actionstyles = self.lock_action.get_action('SaveZoom') + widgets = actionstyles.get_proxies() + for widget in widgets : + if isinstance(widget, gtk.ToggleToolButton): + widget.set_active(state) + self._set_lock_unlock_icon() + def _set_lock_unlock_icon(self): """ Change the lock/unlock icon depending on the button state.