Geography: clear views when no-database signal emitted
This commit is contained in:
parent
4b5e1e9702
commit
a563e47c1a
@ -136,6 +136,7 @@ class GeoGraphyView(OsmGps, NavigationView):
|
|||||||
OsmGps.__init__(self, uistate)
|
OsmGps.__init__(self, uistate)
|
||||||
self.dbstate = dbstate
|
self.dbstate = dbstate
|
||||||
self.dbstate.connect('database-changed', self.change_db)
|
self.dbstate.connect('database-changed', self.change_db)
|
||||||
|
self.dbstate.connect('no-database', self.clear_view)
|
||||||
self.default_text = "Enter location here!"
|
self.default_text = "Enter location here!"
|
||||||
self.centerlon = config.get("geography.center-lon")
|
self.centerlon = config.get("geography.center-lon")
|
||||||
self.centerlat = config.get("geography.center-lat")
|
self.centerlat = config.get("geography.center-lat")
|
||||||
@ -261,6 +262,13 @@ class GeoGraphyView(OsmGps, NavigationView):
|
|||||||
NavigationView.on_delete(self)
|
NavigationView.on_delete(self)
|
||||||
self._config.save()
|
self._config.save()
|
||||||
|
|
||||||
|
def clear_view(self):
|
||||||
|
self.place_list = []
|
||||||
|
self.remove_all_markers()
|
||||||
|
self.remove_all_gps()
|
||||||
|
self.remove_all_tracks()
|
||||||
|
self.message_layer.clear_messages()
|
||||||
|
|
||||||
def change_db(self, dbse):
|
def change_db(self, dbse):
|
||||||
"""
|
"""
|
||||||
Callback associated with DbState. Whenever the database
|
Callback associated with DbState. Whenever the database
|
||||||
|
Loading…
Reference in New Issue
Block a user