From cab85255201b579dad91370844d70e3e70a92cbd Mon Sep 17 00:00:00 2001 From: Paul Franklin Date: Fri, 28 Jun 2013 17:53:19 +0000 Subject: [PATCH] enable suppression of two minor missing-package warnings svn: r22623 --- gramps/gen/config.py | 2 ++ gramps/gui/configure.py | 8 ++++++++ gramps/plugins/gramplet/gramplet.gpr.py | 15 +++++++++------ gramps/plugins/view/geography.gpr.py | 14 ++++++++------ 4 files changed, 27 insertions(+), 12 deletions(-) diff --git a/gramps/gen/config.py b/gramps/gen/config.py index 9f4f64df0..01d95f5ec 100644 --- a/gramps/gen/config.py +++ b/gramps/gen/config.py @@ -140,6 +140,8 @@ register('behavior.date-about-range', 50) register('behavior.date-after-range', 50) register('behavior.date-before-range', 50) register('behavior.generation-depth', 15) +register('behavior.ignore-gexiv2', False) +register('behavior.ignore-osmgpsmap', False) register('behavior.max-age-prob-alive', 110) register('behavior.max-sib-age-diff', 20) register('behavior.min-generation-years', 13) diff --git a/gramps/gui/configure.py b/gramps/gui/configure.py index ec1798a99..deb767234 100644 --- a/gramps/gui/configure.py +++ b/gramps/gui/configure.py @@ -606,6 +606,14 @@ class GrampsPreferences(ConfigureDialog): table, _('Show plugin status dialog on plugin load error.'), 3, 'behavior.pop-plugin-status') + self.add_checkbox( + table, _('Suppress warning when OsmGpsMap not installed.'), + 4, 'behavior.ignore-osmgpsmap') + + self.add_checkbox( + table, _('Suppress warning when GExiv2 not installed.'), + 5, 'behavior.ignore-gexiv2') + return _('Warnings'), table def _build_name_format_model(self, active): diff --git a/gramps/plugins/gramplet/gramplet.gpr.py b/gramps/plugins/gramplet/gramplet.gpr.py index 0440e1da0..558b64d8b 100644 --- a/gramps/plugins/gramplet/gramplet.gpr.py +++ b/gramps/plugins/gramplet/gramplet.gpr.py @@ -405,12 +405,15 @@ if available: navtypes=["Media"], ) else: - import logging - logging.warning(_("GExiv2 module not loaded. " - "Image metadata functionality will not be available.\n" - "To build it for Gramps see http://www.gramps-project.org/" - "wiki/index.php?title=GEPS_029:_GTK3-GObject_introspection" - "_Conversion#GExiv2_for_Image_metadata")) + from gramps.gen.config import config + if not config.get('behavior.ignore-gexiv2'): + import logging + logging.warning(_("GExiv2 module not loaded. Image metadata " + "functionality will not be available.\n" + "To build it for Gramps see " + "http://www.gramps-project.org/wiki/index.php?" + "title=GEPS_029:_GTK3-GObject_introspection" + "_Conversion#GExiv2_for_Image_metadata")) register(GRAMPLET, id="Person Residence", diff --git a/gramps/plugins/view/geography.gpr.py b/gramps/plugins/view/geography.gpr.py index 51e294178..ce917376a 100644 --- a/gramps/plugins/view/geography.gpr.py +++ b/gramps/plugins/view/geography.gpr.py @@ -58,12 +58,14 @@ if repository.enumerate_versions("OsmGpsMap"): pass if not OSMGPSMAP: - _LOG.warning(_("OsmGpsMap module not loaded. " - "Geography functionality will not be available.\n" - "To build it for Gramps see http://www.gramps-project.org" - "/wiki/index.php?" - "title=GEPS_029:_GTK3-GObject_introspection_Conversion" - "#OsmGpsMap_for_Geography")) + from gramps.gen.config import config + if not config.get('behavior.ignore-osmgpsmap'): + _LOG.warning(_("OsmGpsMap module not loaded. " + "Geography functionality will not be available.\n" + "To build it for Gramps see " + "http://www.gramps-project.org/wiki/index.php?" + "title=GEPS_029:_GTK3-GObject_introspection_Conversion" + "#OsmGpsMap_for_Geography")) else: # Load the view only if osmgpsmap library is present. register(VIEW,