Geography : bug7240 : create a bookmark via GeoEvents leads to an empty link

This commit is contained in:
noirauds 2013-11-27 21:18:42 +01:00
parent 91424cfec7
commit efb318b433
4 changed files with 50 additions and 2 deletions

View File

@ -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:

View File

@ -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.

View File

@ -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.

View File

@ -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.