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