From 8c7b0f858593400c664354da61ddd8880372f371 Mon Sep 17 00:00:00 2001 From: SNoiraud Date: Mon, 5 Dec 2016 14:22:56 +0100 Subject: [PATCH] 7309: Jump to Gramps ID functionality added to *fanchart* --- gramps/plugins/view/fanchart2wayview.py | 14 ++++++++++++++ gramps/plugins/view/fanchartdescview.py | 14 ++++++++++++++ gramps/plugins/view/fanchartview.py | 14 ++++++++++++++ 3 files changed, 42 insertions(+) diff --git a/gramps/plugins/view/fanchart2wayview.py b/gramps/plugins/view/fanchart2wayview.py index 6684a489d..e05bcbab8 100644 --- a/gramps/plugins/view/fanchart2wayview.py +++ b/gramps/plugins/view/fanchart2wayview.py @@ -104,9 +104,23 @@ class FanChart2WayView(fanchart2way.FanChart2WayGrampsGUI, NavigationView): self.additional_uis.append(self.additional_ui()) self.allfonts = [x for x in enumerate(SystemFonts().get_system_fonts())] + self.func_list.update({ + 'J' : self.jump, + }) + def navigation_type(self): return 'Person' + def get_handle_from_gramps_id(self, gid): + """ + returns the handle of the specified object + """ + obj = self.dbstate.db.get_person_from_gramps_id(gid) + if obj: + return obj.get_handle() + else: + return None + def build_widget(self): self.set_fan(fanchart2way.FanChart2WayWidget(self.dbstate, self.uistate, self.on_popup)) diff --git a/gramps/plugins/view/fanchartdescview.py b/gramps/plugins/view/fanchartdescview.py index 57adde49f..4132b0253 100644 --- a/gramps/plugins/view/fanchartdescview.py +++ b/gramps/plugins/view/fanchartdescview.py @@ -99,9 +99,23 @@ class FanChartDescView(fanchartdesc.FanChartDescGrampsGUI, NavigationView): self.additional_uis.append(self.additional_ui()) self.allfonts = [x for x in enumerate(SystemFonts().get_system_fonts())] + self.func_list.update({ + 'J' : self.jump, + }) + def navigation_type(self): return 'Person' + def get_handle_from_gramps_id(self, gid): + """ + returns the handle of the specified object + """ + obj = self.dbstate.db.get_person_from_gramps_id(gid) + if obj: + return obj.get_handle() + else: + return None + def build_widget(self): self.set_fan(fanchartdesc.FanChartDescWidget(self.dbstate, self.uistate, self.on_popup)) diff --git a/gramps/plugins/view/fanchartview.py b/gramps/plugins/view/fanchartview.py index aad0b2174..4adfa6454 100644 --- a/gramps/plugins/view/fanchartview.py +++ b/gramps/plugins/view/fanchartview.py @@ -96,9 +96,23 @@ class FanChartView(fanchart.FanChartGrampsGUI, NavigationView): self.additional_uis.append(self.additional_ui()) self.allfonts = [x for x in enumerate(SystemFonts().get_system_fonts())] + self.func_list.update({ + 'J' : self.jump, + }) + def navigation_type(self): return 'Person' + def get_handle_from_gramps_id(self, gid): + """ + returns the handle of the specified object + """ + obj = self.dbstate.db.get_person_from_gramps_id(gid) + if obj: + return obj.get_handle() + else: + return None + def build_widget(self): self.set_fan(fanchart.FanChartWidget(self.dbstate, self.uistate, self.on_popup)) self.scrolledwindow = Gtk.ScrolledWindow(hadjustment=None,