7439: pre-load alert dialogs crash w/o DISPLAY

This commit is contained in:
Paul Franklin
2014-02-04 20:22:47 -08:00
parent e4abd21dae
commit 7f757e0304

View File

@@ -27,7 +27,9 @@
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
try : from constfunc import has_display
if has_display():
try :
import osmgpsmap import osmgpsmap
OSMGPSMAP = True OSMGPSMAP = True
if osmgpsmap.__version__ < '0.7.0': if osmgpsmap.__version__ < '0.7.0':
@@ -36,7 +38,7 @@ try :
logging.warning( _("WARNING: osmgpsmap module not loaded. " logging.warning( _("WARNING: osmgpsmap module not loaded. "
"osmgpsmap must be >= 0.7.0. yours is %s") % "osmgpsmap must be >= 0.7.0. yours is %s") %
osmgpsmap.__version__) osmgpsmap.__version__)
except: except:
OSMGPSMAP = False OSMGPSMAP = False
import config import config
if not config.get('interface.ignore-osmgpsmap'): if not config.get('interface.ignore-osmgpsmap'):
@@ -44,6 +46,8 @@ except:
title = _("OsmGpsMap module not loaded.") title = _("OsmGpsMap module not loaded.")
message = _("Geography functionality will not be available.") message = _("Geography functionality will not be available.")
MessageHideDialog(title, message, 'interface.ignore-osmgpsmap') MessageHideDialog(title, message, 'interface.ignore-osmgpsmap')
else:
OSMGPSMAP = False
if OSMGPSMAP: if OSMGPSMAP:
# Load the view only if osmgpsmap library is present. # Load the view only if osmgpsmap library is present.