From 7bfbec139f87c9aedac40a6fd29d06aec68e23f2 Mon Sep 17 00:00:00 2001 From: Mathieu Date: Wed, 6 Nov 2019 21:22:01 +0100 Subject: [PATCH] Provide an option to "hide" the LDS tab Immplements #3872. --- gramps/gen/config.py | 1 + gramps/gui/configure.py | 5 +++++ gramps/gui/editors/editfamily.py | 3 ++- gramps/gui/editors/editperson.py | 3 ++- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gramps/gen/config.py b/gramps/gen/config.py index d53141685..4540dc9ea 100644 --- a/gramps/gen/config.py +++ b/gramps/gen/config.py @@ -220,6 +220,7 @@ register('interface.size-checked', False) register('interface.statusbar', 1) register('interface.toolbar-on', True) register('interface.toolbar-text', False) +register('interface.hide-lds', False) register('interface.view', True) register('interface.surname-box-height', 150) register('interface.treemodel-cache-size', 1000) diff --git a/gramps/gui/configure.py b/gramps/gui/configure.py index 2e0f8db47..e62916167 100644 --- a/gramps/gui/configure.py +++ b/gramps/gui/configure.py @@ -1374,6 +1374,11 @@ class GrampsPreferences(ConfigureDialog): grid.attach(lwidget, 1, row, 1, 1) grid.attach(obox, 2, row, 2, 1) + row += 1 + self.add_checkbox(grid, + _('Hide LDS tab in person and family editors'), + row, 'interface.hide-lds') + row += 1 label = self.add_text( grid, _("* Requires Restart"), row, diff --git a/gramps/gui/editors/editfamily.py b/gramps/gui/editors/editfamily.py index 25e715786..dda6d3bc6 100644 --- a/gramps/gui/editors/editfamily.py +++ b/gramps/gui/editors/editfamily.py @@ -793,7 +793,8 @@ class EditFamily(EditPrimary): self.uistate, self.track, self.obj.get_lds_ord_list()) - self._add_tab(notebook, self.lds_embed) + if not (config.get('interface.hide-lds') and self.lds_embed.is_empty()): + self._add_tab(notebook, self.lds_embed) self.track_ref_for_deletion("lds_embed") self._setup_notebook_tabs( notebook) diff --git a/gramps/gui/editors/editperson.py b/gramps/gui/editors/editperson.py index f1c996d3c..d17b3fe13 100644 --- a/gramps/gui/editors/editperson.py +++ b/gramps/gui/editors/editperson.py @@ -529,7 +529,8 @@ class EditPerson(EditPrimary): self.uistate, self.track, self.obj.get_lds_ord_list()) - self._add_tab(notebook, self.lds_list) + if not (config.get('interface.hide-lds') and self.lds_list.is_empty()): + self._add_tab(notebook, self.lds_list) self.track_ref_for_deletion("lds_list") self.backref_tab = PersonBackRefList(self.dbstate,