Geography : bug7240 : create a bookmark via GeoEvents leads to an empty link
This commit is contained in:
parent
33c9e7e043
commit
2972b0d9c0
@ -196,6 +196,17 @@ class GeoClose(GeoGraphyView):
|
||||
"""
|
||||
return 'Person'
|
||||
|
||||
def add_bookmark(self, obj):
|
||||
mlist = self.selected_handles()
|
||||
if mlist:
|
||||
self.bookmarks.add(mlist[0])
|
||||
else:
|
||||
from gramps.gui.dialog 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.
|
||||
|
@ -168,6 +168,17 @@ class GeoEvents(GeoGraphyView):
|
||||
"""
|
||||
return 'Event'
|
||||
|
||||
def add_bookmark(self, obj):
|
||||
mlist = self.selected_handles()
|
||||
if mlist:
|
||||
self.bookmarks.add(mlist[0])
|
||||
else:
|
||||
from gramps.gui.dialog 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.
|
||||
@ -202,8 +213,11 @@ class GeoEvents(GeoGraphyView):
|
||||
if self.nbplaces >= self._config.get("geography.max_places"):
|
||||
return
|
||||
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:
|
||||
|
@ -194,6 +194,17 @@ class GeoFamClose(GeoGraphyView):
|
||||
"""
|
||||
return 'Family'
|
||||
|
||||
def add_bookmark(self, obj):
|
||||
mlist = self.selected_handles()
|
||||
if mlist:
|
||||
self.bookmarks.add(mlist[0])
|
||||
else:
|
||||
from gramps.gui.dialog import WarningDialog
|
||||
WarningDialog(
|
||||
_("Could Not Set a Bookmark"),
|
||||
_("A bookmark could not be set because "
|
||||
"no one was selected."))
|
||||
|
||||
def family_label(self,family):
|
||||
if family is None:
|
||||
return "Unknown"
|
||||
|
@ -167,6 +167,18 @@ class GeoFamily(GeoGraphyView):
|
||||
"""
|
||||
return 'Family'
|
||||
|
||||
def add_bookmark(self, obj):
|
||||
mlist = self.selected_handles()
|
||||
print mlist
|
||||
if mlist:
|
||||
self.bookmarks.add(mlist[0])
|
||||
else:
|
||||
from gramps.gui.dialog 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.
|
||||
|
@ -198,6 +198,17 @@ class GeoMoves(GeoGraphyView):
|
||||
"""
|
||||
return 'Person'
|
||||
|
||||
def add_bookmark(self, obj):
|
||||
mlist = self.selected_handles()
|
||||
if mlist:
|
||||
self.bookmarks.add(mlist[0])
|
||||
else:
|
||||
from gramps.gui.dialog 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 family handle as reference.
|
||||
|
@ -197,6 +197,17 @@ class GeoPerson(GeoGraphyView):
|
||||
"""
|
||||
return 'Person'
|
||||
|
||||
def add_bookmark(self, obj):
|
||||
mlist = self.selected_handles()
|
||||
if mlist:
|
||||
self.bookmarks.add(mlist[0])
|
||||
else:
|
||||
from gramps.gui.dialog 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.
|
||||
|
@ -168,6 +168,17 @@ class GeoPlaces(GeoGraphyView):
|
||||
"""
|
||||
return 'Place'
|
||||
|
||||
def add_bookmark(self, obj):
|
||||
mlist = self.selected_handles()
|
||||
if mlist:
|
||||
self.bookmarks.add(mlist[0])
|
||||
else:
|
||||
from gramps.gui.dialog 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.
|
||||
|
Loading…
Reference in New Issue
Block a user