7229: change active person upon a bookmark select

Port the more general fix [c7c0b2]^..[6caf08] from gramps34.
This commit is contained in:
Vassilii Khachaturov 2013-12-16 21:54:04 +02:00
parent 0254f7006d
commit 56965d4095
3 changed files with 22 additions and 24 deletions

View File

@ -315,21 +315,21 @@ class Bookmarks :
class ListBookmarks(Bookmarks):
def __init__(self, dbstate, uistate, goto_handle):
self.goto_handle = goto_handle
def __init__(self, dbstate, uistate, change_active):
self.change_active = change_active
Bookmarks.__init__(self, dbstate, uistate)
def callback(self, handle):
return make_callback(handle, self.do_callback)
def do_callback(self, handle):
self.goto_handle(handle)
self.change_active(handle)
class PersonBookmarks(ListBookmarks) :
"Handle the bookmarks interface for Gramps."
def __init__(self, dbstate, uistate, goto_handle):
ListBookmarks.__init__(self, dbstate, uistate, goto_handle)
def __init__(self, dbstate, uistate, change_active):
ListBookmarks.__init__(self, dbstate, uistate, change_active)
def make_label(self, handle):
return navigation_label(self.dbstate.db, 'Person', handle)
@ -343,8 +343,8 @@ class PersonBookmarks(ListBookmarks) :
class FamilyBookmarks(ListBookmarks) :
"Handle the bookmarks interface for Gramps."
def __init__(self, dbstate, uistate, goto_handle):
ListBookmarks.__init__(self, dbstate, uistate, goto_handle)
def __init__(self, dbstate, uistate, change_active):
ListBookmarks.__init__(self, dbstate, uistate, change_active)
def make_label(self, handle):
return navigation_label(self.dbstate.db, 'Family', handle)
@ -358,8 +358,8 @@ class FamilyBookmarks(ListBookmarks) :
class EventBookmarks(ListBookmarks) :
"Handle the bookmarks interface for Gramps."
def __init__(self, dbstate, uistate, goto_handle):
ListBookmarks.__init__(self, dbstate, uistate, goto_handle)
def __init__(self, dbstate, uistate, change_active):
ListBookmarks.__init__(self, dbstate, uistate, change_active)
def make_label(self, handle):
return navigation_label(self.dbstate.db, 'Event', handle)
@ -373,8 +373,8 @@ class EventBookmarks(ListBookmarks) :
class SourceBookmarks(ListBookmarks) :
"Handle the bookmarks interface for Gramps."
def __init__(self, dbstate, uistate, goto_handle):
ListBookmarks.__init__(self, dbstate, uistate, goto_handle)
def __init__(self, dbstate, uistate, change_active):
ListBookmarks.__init__(self, dbstate, uistate, change_active)
def make_label(self, handle):
return navigation_label(self.dbstate.db, 'Source', handle)
@ -388,8 +388,8 @@ class SourceBookmarks(ListBookmarks) :
class CitationBookmarks(ListBookmarks) :
"Handle the bookmarks interface for Gramps."
def __init__(self, dbstate, uistate, goto_handle):
ListBookmarks.__init__(self, dbstate, uistate, goto_handle)
def __init__(self, dbstate, uistate, change_active):
ListBookmarks.__init__(self, dbstate, uistate, change_active)
def make_label(self, handle):
return navigation_label(self.dbstate.db, 'Citation', handle)
@ -426,8 +426,8 @@ class CitationBookmarks(ListBookmarks) :
class MediaBookmarks(ListBookmarks) :
"Handle the bookmarks interface for Gramps."
def __init__(self, dbstate, uistate, goto_handle):
ListBookmarks.__init__(self, dbstate, uistate, goto_handle)
def __init__(self, dbstate, uistate, change_active):
ListBookmarks.__init__(self, dbstate, uistate, change_active)
def make_label(self, handle):
return navigation_label(self.dbstate.db, 'Media', handle)
@ -441,8 +441,8 @@ class MediaBookmarks(ListBookmarks) :
class RepoBookmarks(ListBookmarks) :
"Handle the bookmarks interface for Gramps."
def __init__(self, dbstate, uistate, goto_handle):
ListBookmarks.__init__(self, dbstate, uistate, goto_handle)
def __init__(self, dbstate, uistate, change_active):
ListBookmarks.__init__(self, dbstate, uistate, change_active)
def make_label(self, handle):
return navigation_label(self.dbstate.db, 'Repository', handle)
@ -456,8 +456,8 @@ class RepoBookmarks(ListBookmarks) :
class PlaceBookmarks(ListBookmarks) :
"Handle the bookmarks interface for Gramps."
def __init__(self, dbstate, uistate, goto_handle):
ListBookmarks.__init__(self, dbstate, uistate, goto_handle)
def __init__(self, dbstate, uistate, change_active):
ListBookmarks.__init__(self, dbstate, uistate, change_active)
def make_label(self, handle):
return navigation_label(self.dbstate.db, 'Place', handle)
@ -471,8 +471,8 @@ class PlaceBookmarks(ListBookmarks) :
class NoteBookmarks(ListBookmarks) :
"Handle the bookmarks interface for Gramps."
def __init__(self, dbstate, uistate, goto_handle):
ListBookmarks.__init__(self, dbstate, uistate, goto_handle)
def __init__(self, dbstate, uistate, change_active):
ListBookmarks.__init__(self, dbstate, uistate, change_active)
def make_label(self, handle):
return navigation_label(self.dbstate.db, 'Note', handle)

View File

@ -83,7 +83,7 @@ class NavigationView(PageView):
def __init__(self, title, pdata, state, uistate, bm_type, nav_group):
PageView.__init__(self, title, pdata, state, uistate)
self.bookmarks = bm_type(self.dbstate, self.uistate, self.goto_handle)
self.bookmarks = bm_type(self.dbstate, self.uistate, self.change_active)
self.fwd_action = None
self.back_action = None
@ -368,7 +368,6 @@ class NavigationView(PageView):
handle = self.get_handle_from_gramps_id(gid)
if handle is not None:
self.change_active(handle)
self.goto_handle(handle)
else:
self.uistate.push_message(
self.dbstate,

View File

@ -748,7 +748,6 @@ class PedigreeView(NavigationView):
if handle:
person = self.dbstate.db.get_person_from_handle(handle)
if person:
self.change_active(handle)
self.rebuild_trees(handle)
else:
self.rebuild_trees(None)