From 56965d409542fbaf662d6edfebab07f87b544ae6 Mon Sep 17 00:00:00 2001 From: Vassilii Khachaturov Date: Mon, 16 Dec 2013 21:54:04 +0200 Subject: [PATCH] 7229: change active person upon a bookmark select Port the more general fix [c7c0b2]^..[6caf08] from gramps34. --- gramps/gui/views/bookmarks.py | 42 ++++++++++++++--------------- gramps/gui/views/navigationview.py | 3 +-- gramps/plugins/view/pedigreeview.py | 1 - 3 files changed, 22 insertions(+), 24 deletions(-) diff --git a/gramps/gui/views/bookmarks.py b/gramps/gui/views/bookmarks.py index 1d9daa200..837381f64 100644 --- a/gramps/gui/views/bookmarks.py +++ b/gramps/gui/views/bookmarks.py @@ -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) diff --git a/gramps/gui/views/navigationview.py b/gramps/gui/views/navigationview.py index a08588df6..9259d2adf 100644 --- a/gramps/gui/views/navigationview.py +++ b/gramps/gui/views/navigationview.py @@ -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, diff --git a/gramps/plugins/view/pedigreeview.py b/gramps/plugins/view/pedigreeview.py index e89af93d5..9a4f75f7b 100644 --- a/gramps/plugins/view/pedigreeview.py +++ b/gramps/plugins/view/pedigreeview.py @@ -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)