Escape ampersand characters in error message dialogs

This commit is contained in:
Mathieu Comandon 2016-10-31 13:24:16 -07:00
parent 4c3627a7ae
commit 0361c9fcc2

View file

@ -19,15 +19,18 @@ from lutris.gui import dialogs
def show_error_message(message):
"""Display an error message based on the runner's output."""
if "CUSTOM" == message['error']:
dialogs.ErrorDialog(message['text'])
message_text = message['file'].replace('&', '&')
dialogs.ErrorDialog(message_text)
elif "RUNNER_NOT_INSTALLED" == message['error']:
dialogs.ErrorDialog('Error the runner is not installed')
elif "NO_BIOS" == message['error']:
dialogs.ErrorDialog("A bios file is required to run this game")
elif "FILE_NOT_FOUND" == message['error']:
dialogs.ErrorDialog("The file %s could not be found" % message['file'])
message_text = message['file'].replace('&', '&')
dialogs.ErrorDialog("The file %s could not be found" % message_text)
elif "NOT_EXECUTABLE" == message['error']:
dialogs.ErrorDialog("The file %s is not executable" % message['file'])
message_text = message['file'].replace('&', '&')
dialogs.ErrorDialog("The file %s is not executable" % message_text)
class Game(object):