From f80bf8eb15337fef5de7ab0779f97ca96531e24a Mon Sep 17 00:00:00 2001 From: Serge Noiraud Date: Mon, 10 Jun 2013 20:45:40 +0000 Subject: [PATCH] Geography : Gtk.Menu didn't work with gtk3. svn: r22488 --- gramps/plugins/lib/maps/geography.py | 9 ++++++--- gramps/plugins/view/geoclose.py | 9 ++++++--- gramps/plugins/view/geoevents.py | 12 ++++++++---- gramps/plugins/view/geofamclose.py | 6 ++++-- gramps/plugins/view/geofamily.py | 6 ++++-- gramps/plugins/view/geomoves.py | 6 ++++-- gramps/plugins/view/geoperson.py | 12 ++++++++---- gramps/plugins/view/geoplaces.py | 12 ++++++++---- 8 files changed, 48 insertions(+), 24 deletions(-) diff --git a/gramps/plugins/lib/maps/geography.py b/gramps/plugins/lib/maps/geography.py index 5d0c2e5cd..f43163473 100644 --- a/gramps/plugins/lib/maps/geography.py +++ b/gramps/plugins/lib/maps/geography.py @@ -270,7 +270,8 @@ class GeoGraphyView(OsmGps, NavigationView): """ Builds the menu for actions on the map. """ - menu = Gtk.Menu() + self.menu = Gtk.Menu() + menu = self.menu menu.set_title(_('Map Menu')) if config.get("geography.show_cross"): @@ -322,7 +323,8 @@ class GeoGraphyView(OsmGps, NavigationView): add_item.show() menu.append(add_item) - changemap = Gtk.Menu() + self.changemap = Gtk.Menu() + changemap = self.changemap changemap.set_title(title) changemap.show() add_item.set_submenu(changemap) @@ -744,7 +746,8 @@ class GeoGraphyView(OsmGps, NavigationView): add_item = Gtk.MenuItem(label=message) add_item.show() menu.append(add_item) - itemoption = Gtk.Menu() + self.itemoption = Gtk.Menu() + itemoption = self.itemoption itemoption.set_title(message) itemoption.show() add_item.set_submenu(itemoption) diff --git a/gramps/plugins/view/geoclose.py b/gramps/plugins/view/geoclose.py index 0e574a64f..8fc6ccbdf 100644 --- a/gramps/plugins/view/geoclose.py +++ b/gramps/plugins/view/geoclose.py @@ -460,7 +460,8 @@ class GeoClose(GeoGraphyView): """ Create the menu for the selected marker """ - menu = Gtk.Menu() + self.newmenu = Gtk.Menu() + menu = self.newmenu menu.set_title("person") events = [] message = "" @@ -499,10 +500,12 @@ class GeoClose(GeoGraphyView): descr = _('No description') message = "(%s) %s => %s" % ( date, plce[11], descr) prevmark = plce - add_item = Gtk.MenuItem(label=message) + self.add_item = Gtk.MenuItem(label=message) + add_item = self.add_item add_item.show() menu.append(add_item) - itemoption = Gtk.Menu() + self.itemoption = Gtk.Menu() + itemoption = self.itemoption itemoption.set_title(message) itemoption.show() add_item.set_submenu(itemoption) diff --git a/gramps/plugins/view/geoevents.py b/gramps/plugins/view/geoevents.py index a7ab6dd7d..3b4af8c29 100644 --- a/gramps/plugins/view/geoevents.py +++ b/gramps/plugins/view/geoevents.py @@ -295,7 +295,8 @@ class GeoEvents(GeoGraphyView): self._create_markers() def bubble_message(self, event, lat, lon, marks): - menu = Gtk.Menu() + self.menu = Gtk.Menu() + menu = self.menu menu.set_title("events") message = "" oldplace = "" @@ -305,7 +306,8 @@ class GeoEvents(GeoGraphyView): add_item = Gtk.MenuItem(label=message) add_item.show() menu.append(add_item) - itemoption = Gtk.Menu() + self.itemoption = Gtk.Menu() + itemoption = self.itemoption itemoption.set_title(message) itemoption.show() add_item.set_submenu(itemoption) @@ -332,7 +334,8 @@ class GeoEvents(GeoGraphyView): add_item = Gtk.MenuItem(label=message) add_item.show() menu.append(add_item) - itemoption = Gtk.Menu() + self.itemoption = Gtk.Menu() + itemoption = self.itemoption itemoption.set_title(message) itemoption.show() add_item.set_submenu(itemoption) @@ -364,7 +367,8 @@ class GeoEvents(GeoGraphyView): add_item = Gtk.MenuItem(label=_("Centering on Place")) add_item.show() menu.append(add_item) - itemoption = Gtk.Menu() + self.itemoption = Gtk.Menu() + itemoption = self.itemoption itemoption.set_title(_("Centering on Place")) itemoption.show() add_item.set_submenu(itemoption) diff --git a/gramps/plugins/view/geofamclose.py b/gramps/plugins/view/geofamclose.py index 8aa817a77..b72ccf40e 100644 --- a/gramps/plugins/view/geofamclose.py +++ b/gramps/plugins/view/geofamclose.py @@ -604,7 +604,8 @@ class GeoFamClose(GeoGraphyView): """ Create the menu for the selected marker """ - menu = Gtk.Menu() + self.menu = Gtk.Menu() + menu = self.menu menu.set_title("family") events = [] message = "" @@ -646,7 +647,8 @@ class GeoFamClose(GeoGraphyView): add_item = Gtk.MenuItem(label=message) add_item.show() menu.append(add_item) - itemoption = Gtk.Menu() + self.itemoption = Gtk.Menu() + itemoption = self.itemoption itemoption.set_title(message) itemoption.show() add_item.set_submenu(itemoption) diff --git a/gramps/plugins/view/geofamily.py b/gramps/plugins/view/geofamily.py index ea2b810d8..2673e80fc 100644 --- a/gramps/plugins/view/geofamily.py +++ b/gramps/plugins/view/geofamily.py @@ -377,7 +377,8 @@ class GeoFamily(GeoGraphyView): self._create_markers() def add_event_bubble_message(self, event, lat, lon, mark, menu): - itemoption = Gtk.Menu() + self.itemoption = Gtk.Menu() + itemoption = self.itemoption itemoption.show() menu.set_submenu(itemoption) modify = Gtk.MenuItem(label=_("Edit Family")) @@ -398,7 +399,8 @@ class GeoFamily(GeoGraphyView): itemoption.append(center) def bubble_message(self, event, lat, lon, marks): - menu = Gtk.Menu() + self.menu = Gtk.Menu() + menu = self.menu menu.set_title("family") message = "" oldplace = "" diff --git a/gramps/plugins/view/geomoves.py b/gramps/plugins/view/geomoves.py index 2b2f71893..4d0218e87 100644 --- a/gramps/plugins/view/geomoves.py +++ b/gramps/plugins/view/geomoves.py @@ -544,7 +544,8 @@ class GeoMoves(GeoGraphyView): """ Create the menu for the selected marker """ - menu = Gtk.Menu() + self.menu = Gtk.Menu() + menu = self.menu menu.set_title("descendance") events = [] message = "" @@ -585,7 +586,8 @@ class GeoMoves(GeoGraphyView): add_item = Gtk.MenuItem(label=message) add_item.show() menu.append(add_item) - itemoption = Gtk.Menu() + self.itemoption = Gtk.Menu() + itemoption = self.itemoption itemoption.set_title(message) itemoption.show() add_item.set_submenu(itemoption) diff --git a/gramps/plugins/view/geoperson.py b/gramps/plugins/view/geoperson.py index b62474def..f18ee9915 100644 --- a/gramps/plugins/view/geoperson.py +++ b/gramps/plugins/view/geoperson.py @@ -390,7 +390,8 @@ class GeoPerson(GeoGraphyView): self._create_markers() def bubble_message(self, event, lat, lon, marks): - menu = Gtk.Menu() + self.menu = Gtk.Menu() + menu = self.menu menu.set_title("person") message = "" oldplace = "" @@ -400,7 +401,8 @@ class GeoPerson(GeoGraphyView): add_item = Gtk.MenuItem(label=message) add_item.show() menu.append(add_item) - itemoption = Gtk.Menu() + self.itemoption = Gtk.Menu() + itemoption = self.itemoption itemoption.set_title(message) itemoption.show() message = "" @@ -420,7 +422,8 @@ class GeoPerson(GeoGraphyView): add_item = Gtk.MenuItem() add_item.show() menu.append(add_item) - itemoption = Gtk.Menu() + self.itemoption = Gtk.Menu() + itemoption = self.itemoption itemoption.set_title(message) itemoption.show() message = "" @@ -459,7 +462,8 @@ class GeoPerson(GeoGraphyView): add_item = Gtk.MenuItem(label=message) add_item.show() menu.append(add_item) - itemoption = Gtk.Menu() + self.itemoption = Gtk.Menu() + itemoption = self.itemoption itemoption.set_title(message) itemoption.show() add_item.set_submenu(itemoption) diff --git a/gramps/plugins/view/geoplaces.py b/gramps/plugins/view/geoplaces.py index 3f6570c3d..0df1ad722 100644 --- a/gramps/plugins/view/geoplaces.py +++ b/gramps/plugins/view/geoplaces.py @@ -297,7 +297,8 @@ class GeoPlaces(GeoGraphyView): self._create_markers() def bubble_message(self, event, lat, lon, marks): - menu = Gtk.Menu() + self.menu = Gtk.Menu() + menu = self.menu menu.set_title("places") message = "" prevmark = None @@ -306,7 +307,8 @@ class GeoPlaces(GeoGraphyView): add_item = Gtk.MenuItem(label=message) add_item.show() menu.append(add_item) - itemoption = Gtk.Menu() + self.itemoption = Gtk.Menu() + itemoption = self.itemoption itemoption.set_title(message) itemoption.show() add_item.set_submenu(itemoption) @@ -325,7 +327,8 @@ class GeoPlaces(GeoGraphyView): add_item = Gtk.MenuItem(label=message) add_item.show() menu.append(add_item) - itemoption = Gtk.Menu() + self.itemoption = Gtk.Menu() + itemoption = self.itemoption itemoption.set_title(message) itemoption.show() add_item.set_submenu(itemoption) @@ -357,7 +360,8 @@ class GeoPlaces(GeoGraphyView): add_item = Gtk.MenuItem(label=_("Centering on Place")) add_item.show() menu.append(add_item) - itemoption = Gtk.Menu() + self.itemoption = Gtk.Menu() + itemoption = self.itemoption itemoption.set_title(_("Centering on Place")) itemoption.show() add_item.set_submenu(itemoption)