gui.WelcomeDialog.run()\r
if globalVars.configFileError:\r
gui.ConfigFileErrorDialog.run()\r
- if globalVars.gestureMapFileError:\r
+ import inputCore\r
+ if inputCore.manager.userGestureMap.lastUpdateContainedError:\r
import wx\r
gui.scriptUI.MessageDialog(_("Your gesture map file contains errors.\n"\r
"More details about the errors can be found in the log file."),\r
@type entries: mapping of str to mapping\r
"""\r
self._map = {}\r
+ #: Indicates that the last load or update contained an error.\r
+ #: @type: bool\r
+ self.lastUpdateContainedError = False\r
if entries:\r
self.update(entries)\r
\r
"""Clear this map.\r
"""\r
self._map.clear()\r
+ self.lastUpdateContainedError = False\r
\r
def add(self, gesture, module, className, script,replace=False):\r
"""Add a gesture mapping.\r
conf = configobj.ConfigObj(filename, file_error=True, encoding="UTF-8")\r
except configobj.ConfigObjError, e:\r
log.warning("Error in gesture map '%s': %s"%(filename, e))\r
- globalVars.gestureMapFileError=True\r
- else:\r
- self.update(conf)\r
- globalVars.gestureMapFileError=False\r
+ self.lastUpdateContainedError = True\r
+ return\r
+ self.update(conf)\r
\r
def update(self, entries):\r
"""Add multiple map entries.\r
@param entries: The items to add.\r
@type entries: mapping of str to mapping\r
"""\r
+ self.lastUpdateContainedError = False\r
for locationName, location in entries.iteritems():\r
try:\r
module, className = locationName.rsplit(".", 1)\r
except:\r
log.error("Invalid module/class specification: %s" % locationName)\r
+ self.lastUpdateContainedError = True\r
continue\r
for script, gestures in location.iteritems():\r
if script == "None":\r
self.add(gesture, module, className, script)\r
except:\r
log.error("Invalid gesture: %s" % gesture)\r
+ self.lastUpdateContainedError = True\r
continue\r
\r
def getScriptsForGesture(self, gesture):\r