diff --git a/gramps/plugins/lib/maps/geography.py b/gramps/plugins/lib/maps/geography.py index 6492a801d..72bc29140 100644 --- a/gramps/plugins/lib/maps/geography.py +++ b/gramps/plugins/lib/maps/geography.py @@ -401,7 +401,6 @@ class GeoGraphyView(OsmGps, NavigationView): title = _('Add cross hair') add_item = Gtk.MenuItem(label=title) add_item.connect("activate", self.config_crosshair, event, lat, lon) - add_item.show() menu.append(add_item) if config.get("geography.lock"): @@ -411,51 +410,41 @@ class GeoGraphyView(OsmGps, NavigationView): add_item = Gtk.MenuItem(label=title) add_item.connect("activate", self.config_zoom_and_position, event, lat, lon) - add_item.show() menu.append(add_item) add_item = Gtk.MenuItem(label=_("Add place")) add_item.connect("activate", self.add_place, event, lat, lon) - add_item.show() menu.append(add_item) add_item = Gtk.MenuItem(label=_("Link place")) add_item.connect("activate", self.link_place, event, lat, lon) - add_item.show() menu.append(add_item) add_item = Gtk.MenuItem(label=_("Add place from kml")) add_item.connect("activate", self.add_place_from_kml, event, lat, lon) - add_item.show() menu.append(add_item) add_item = Gtk.MenuItem(label=_("Center here")) add_item.connect("activate", self.set_center, event, lat, lon) - add_item.show() menu.append(add_item) # Add specific module menu self.add_specific_menu(menu, event, lat, lon) # Add a separator line - add_item = Gtk.SeparatorMenuItem() - add_item.show() - menu.append(add_item) + menu.append(Gtk.SeparatorMenuItem()) map_name = constants.MAP_TITLE[config.get("geography.map_service")] title = _("Replace '%(map)s' by =>") % {'map': map_name} add_item = Gtk.MenuItem(label=title) - add_item.show() menu.append(add_item) self.changemap = Gtk.Menu() changemap = self.changemap - changemap.show() add_item.set_submenu(changemap) # show in the map menu all available providers for my_map in constants.MAP_TYPE: changemapitem = Gtk.CheckMenuItem(label=constants.MAP_TITLE[my_map]) changemapitem.set_active(constants.MAP_TITLE[my_map] == map_name) - changemapitem.show() changemapitem.connect("activate", self.change_map, my_map) changemap.append(changemapitem) @@ -465,7 +454,6 @@ class GeoGraphyView(OsmGps, NavigationView): reloadtiles = self.reloadtiles reloadtiles.connect("activate", self.reload_visible_tiles) - reloadtiles.show() menu.append(reloadtiles) clear_text = _("Clear the '%(map)s' tiles cache.") % { @@ -476,9 +464,8 @@ class GeoGraphyView(OsmGps, NavigationView): constants.TILES_PATH[config.get( "geography.map_service")]) - clearmap.show() menu.append(clearmap) - menu.show() + menu.show_all() menu.popup(None, None, None, None, event.button, event.time) return 1 diff --git a/gramps/plugins/view/geoclose.py b/gramps/plugins/view/geoclose.py index 09ea12864..02cba62f8 100644 --- a/gramps/plugins/view/geoclose.py +++ b/gramps/plugins/view/geoclose.py @@ -648,13 +648,10 @@ class GeoClose(GeoGraphyView): """ Add specific entry to the navigation menu. """ - add_item = Gtk.SeparatorMenuItem() - add_item.show() - menu.append(add_item) + menu.append(Gtk.SeparatorMenuItem()) add_item = Gtk.MenuItem( label=_("Choose and bookmark the new reference person")) add_item.connect("activate", self.select_person) - add_item.show() menu.append(add_item) return diff --git a/gramps/plugins/view/geoevents.py b/gramps/plugins/view/geoevents.py index 22894aac9..3effc56b9 100644 --- a/gramps/plugins/view/geoevents.py +++ b/gramps/plugins/view/geoevents.py @@ -450,26 +450,20 @@ class GeoEvents(GeoGraphyView): """ Add specific entry to the navigation menu. """ - add_item = Gtk.SeparatorMenuItem() - add_item.show() - menu.append(add_item) + menu.append(Gtk.SeparatorMenuItem()) add_item = Gtk.MenuItem(label=_("Show all events")) add_item.connect("activate", self.show_all_events, event, lat, lon) - add_item.show() menu.append(add_item) add_item = Gtk.MenuItem(label=_("Centering on Place")) - add_item.show() menu.append(add_item) self.itemoption = Gtk.Menu() itemoption = self.itemoption - itemoption.show() add_item.set_submenu(itemoption) oldplace = "" for mark in self.sort: if mark[0] != oldplace: oldplace = mark[0] modify = Gtk.MenuItem(label=mark[0]) - modify.show() modify.connect("activate", self.goto_place, float(mark[3]), float(mark[4])) itemoption.append(modify) diff --git a/gramps/plugins/view/geofamclose.py b/gramps/plugins/view/geofamclose.py index 8bc73e3b5..f7c40b8da 100644 --- a/gramps/plugins/view/geofamclose.py +++ b/gramps/plugins/view/geofamclose.py @@ -831,13 +831,10 @@ class GeoFamClose(GeoGraphyView): """ Add specific entry to the navigation menu. """ - add_item = Gtk.SeparatorMenuItem() - add_item.show() - menu.append(add_item) + menu.append(Gtk.SeparatorMenuItem()) add_item = Gtk.MenuItem( label=_("Choose and bookmark the new reference family")) add_item.connect("activate", self.select_family) - add_item.show() menu.append(add_item) return diff --git a/gramps/plugins/view/geoperson.py b/gramps/plugins/view/geoperson.py index 1529e9c5e..6d3ea1abe 100644 --- a/gramps/plugins/view/geoperson.py +++ b/gramps/plugins/view/geoperson.py @@ -577,12 +577,9 @@ class GeoPerson(GeoGraphyView): """ Add specific entry to the navigation menu. """ - add_item = Gtk.SeparatorMenuItem() - add_item.show() - menu.append(add_item) + menu.append(Gtk.SeparatorMenuItem()) add_item = Gtk.MenuItem(label=_("Animate")) add_item.connect("activate", self.animate, self.sort, 0, 0) - add_item.show() menu.append(add_item) return diff --git a/gramps/plugins/view/geoplaces.py b/gramps/plugins/view/geoplaces.py index 55dae1798..1cf722d86 100644 --- a/gramps/plugins/view/geoplaces.py +++ b/gramps/plugins/view/geoplaces.py @@ -539,27 +539,21 @@ class GeoPlaces(GeoGraphyView): """ Add specific entry to the navigation menu. """ - add_item = Gtk.SeparatorMenuItem() - add_item.show() - menu.append(add_item) + menu.append(Gtk.SeparatorMenuItem()) add_item = Gtk.MenuItem(label=_("Show all places")) add_item.connect("activate", self.show_all_places, event, lat, lon) - add_item.show() menu.append(add_item) add_item = Gtk.MenuItem(label=_("Centering on Place")) - add_item.show() menu.append(add_item) self.itemoption = Gtk.Menu() itemoption = self.itemoption - itemoption.show() add_item.set_submenu(itemoption) oldplace = "" for mark in self.sort: if mark[0] != oldplace: oldplace = mark[0] modify = Gtk.MenuItem(label=mark[0]) - modify.show() modify.connect("activate", self.goto_place, float(mark[3]), float(mark[4])) itemoption.append(modify)