From 8a3b884b8c276bc6cc2103cfb0c8e69819cfadff Mon Sep 17 00:00:00 2001 From: Paul Franklin Date: Tue, 4 Feb 2014 20:30:10 -0800 Subject: [PATCH] 7439: pre-load alert dialogs crash w/o DISPLAY --- gramps/plugins/gramplet/gramplet.gpr.py | 18 ++++++++++-------- gramps/plugins/view/geography.gpr.py | 18 ++++++++++-------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/gramps/plugins/gramplet/gramplet.gpr.py b/gramps/plugins/gramplet/gramplet.gpr.py index 9bf3fd47b..be4f794ef 100644 --- a/gramps/plugins/gramplet/gramplet.gpr.py +++ b/gramps/plugins/gramplet/gramplet.gpr.py @@ -389,15 +389,17 @@ if available: ) else: from gramps.gen.config import config - from gramps.gui.dialog import MessageHideDialog if not config.get('interface.ignore-gexiv2'): - title = _("GExiv2 module not loaded.") - message = _("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") - MessageHideDialog(title, message, 'interface.ignore-gexiv2') + from gramps.gen.constfunc import has_display + if has_display(): + from gramps.gui.dialog import MessageHideDialog + title = _("GExiv2 module not loaded.") + message = _("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") + MessageHideDialog(title, message, 'interface.ignore-gexiv2') register(GRAMPLET, id="Person Residence", diff --git a/gramps/plugins/view/geography.gpr.py b/gramps/plugins/view/geography.gpr.py index b14dc8072..b02538259 100644 --- a/gramps/plugins/view/geography.gpr.py +++ b/gramps/plugins/view/geography.gpr.py @@ -59,15 +59,17 @@ if repository.enumerate_versions("OsmGpsMap"): if not OSMGPSMAP: from gramps.gen.config import config - from gramps.gui.dialog import MessageHideDialog if not config.get('interface.ignore-osmgpsmap'): - title = _("OsmGpsMap module not loaded.") - message = _("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") - MessageHideDialog(title, message, 'interface.ignore-osmgpsmap') + from gramps.gen.constfunc import has_display + if has_display(): + from gramps.gui.dialog import MessageHideDialog + title = _("OsmGpsMap module not loaded.") + message = _("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") + MessageHideDialog(title, message, 'interface.ignore-osmgpsmap') else: # Load the view only if osmgpsmap library is present. register(VIEW,