diff --git a/src/plugins/view/geoevents.py b/src/plugins/view/geoevents.py index 7ec686688..819d26da0 100644 --- a/src/plugins/view/geoevents.py +++ b/src/plugins/view/geoevents.py @@ -171,6 +171,17 @@ class GeoEvents(GeoGraphyView): """ return self.dbstate.db.get_event_bookmarks() + def add_bookmark(self, obj): + mlist = self.selected_handles() + if mlist: + self.bookmarks.add(mlist[0]) + else: + from QuestionDialog import WarningDialog + WarningDialog( + _("Could Not Set a Bookmark"), + _("A bookmark could not be set because " + "no one was selected.")) + def goto_handle(self, handle=None): """ Rebuild the tree with the given events handle as the root. @@ -205,8 +216,11 @@ class GeoEvents(GeoGraphyView): """ dbstate = self.dbstate descr = descr2 = "" - place_handle = event.get_place_handle() - eventyear = event.get_date_object().to_calendar(self.cal).get_year() + if event: + place_handle = event.get_place_handle() + eventyear = event.get_date_object().to_calendar(self.cal).get_year() + else: + place_handle = None if place_handle: place = dbstate.db.get_place_from_handle(place_handle) if place: diff --git a/src/plugins/view/geofamily.py b/src/plugins/view/geofamily.py index 72142bbd0..880723560 100644 --- a/src/plugins/view/geofamily.py +++ b/src/plugins/view/geofamily.py @@ -170,6 +170,18 @@ class GeoFamily(GeoGraphyView): """ return self.dbstate.db.get_family_bookmarks() + def add_bookmark(self, obj): + mlist = self.selected_handles() + print mlist + if mlist: + self.bookmarks.add(mlist[0]) + else: + from QuestionDialog import WarningDialog + WarningDialog( + _("Could Not Set a Bookmark"), + _("A bookmark could not be set because " + "no one was selected.")) + def goto_handle(self, handle=None): """ Rebuild the tree with the given person handle as the root. diff --git a/src/plugins/view/geoperson.py b/src/plugins/view/geoperson.py index b51604f9f..1c37291c3 100644 --- a/src/plugins/view/geoperson.py +++ b/src/plugins/view/geoperson.py @@ -198,6 +198,17 @@ class GeoPerson(GeoGraphyView): """ return self.dbstate.db.get_bookmarks() + def add_bookmark(self, obj): + mlist = self.selected_handles() + if mlist: + self.bookmarks.add(mlist[0]) + else: + from QuestionDialog import WarningDialog + WarningDialog( + _("Could Not Set a Bookmark"), + _("A bookmark could not be set because " + "no one was selected.")) + def goto_handle(self, handle=None): """ Rebuild the tree with the given person handle as the root. diff --git a/src/plugins/view/geoplaces.py b/src/plugins/view/geoplaces.py index 5d4cacb89..b7fc60915 100644 --- a/src/plugins/view/geoplaces.py +++ b/src/plugins/view/geoplaces.py @@ -171,6 +171,17 @@ class GeoPlaces(GeoGraphyView): """ return self.dbstate.db.get_place_bookmarks() + def add_bookmark(self, obj): + mlist = self.selected_handles() + if mlist: + self.bookmarks.add(mlist[0]) + else: + from QuestionDialog import WarningDialog + WarningDialog( + _("Could Not Set a Bookmark"), + _("A bookmark could not be set because " + "no one was selected.")) + def goto_handle(self, handle=None): """ Rebuild the tree with the given places handle as the root.