7902: Update place details gramplet
Add name, type and alternative names. Locations are now displayed in a separate gramplet.
This commit is contained in:
parent
8316e06853
commit
4bbc0f74d4
@ -113,7 +113,10 @@ class PlaceDetails(Gramplet):
|
|||||||
self.title.set_text(place.get_title())
|
self.title.set_text(place.get_title())
|
||||||
|
|
||||||
self.clear_table()
|
self.clear_table()
|
||||||
self.display_location(place)
|
self.add_row(_('Name'), place.get_name())
|
||||||
|
self.add_row(_('Type'), place.get_type())
|
||||||
|
self.display_separator()
|
||||||
|
self.display_alt_names(place)
|
||||||
self.display_separator()
|
self.display_separator()
|
||||||
lat, lon = conv_lat_lon(place.get_latitude(),
|
lat, lon = conv_lat_lon(place.get_latitude(),
|
||||||
place.get_longitude(),
|
place.get_longitude(),
|
||||||
@ -123,12 +126,13 @@ class PlaceDetails(Gramplet):
|
|||||||
if lon:
|
if lon:
|
||||||
self.add_row(_('Longitude'), lon)
|
self.add_row(_('Longitude'), lon)
|
||||||
|
|
||||||
def display_location(self, place):
|
def display_alt_names(self, place):
|
||||||
"""
|
"""
|
||||||
Display a location.
|
Display alternative names for the place.
|
||||||
"""
|
"""
|
||||||
lines = get_location_list(self.dbstate.db, place)
|
alt_names = place .get_alternative_names()
|
||||||
self.add_row(_('Location'), '\n'.join(lines))
|
if len(alt_names) > 0:
|
||||||
|
self.add_row(_('Alternative Names'), '\n'.join(alt_names))
|
||||||
|
|
||||||
def display_empty(self):
|
def display_empty(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user