From f65188af1cb0b973e95fc8a780052e5f16051bd1 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sun, 8 Apr 2018 21:01:18 +0100 Subject: [PATCH] Polish crash dialog code and UI. --- packaging/linux/openra.in | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/packaging/linux/openra.in b/packaging/linux/openra.in index 3ab38fa596..e522756c37 100755 --- a/packaging/linux/openra.in +++ b/packaging/linux/openra.in @@ -11,14 +11,12 @@ fi # Run the game mono {DEBUG} OpenRA.Game.exe Game.Mod={MODID} Engine.LaunchPath="{BIN_DIR}/openra-{MODID}" "${JOIN_SERVER}" "$@" -# Show a crash dialog if required -if [ $? != 0 ] && [ $? != 1 ] -then - if which zenity > /dev/null - then - zenity --question --title "{MODNAME}" --text "{MODNAME} has encountered a fatal error.\nLog Files are available in ~/.openra." --ok-label "Quit" --cancel-label "View FAQ" || xdg-open https://github.com/OpenRA/OpenRA/wiki/FAQ - else - printf "{MODNAME} has encountered a fatal error.\n -> Log Files are available in ~/.openra\n -> FAQ is available at https://github.com/OpenRA/OpenRA/wiki/FAQ\n" - fi - exit 1 +# Show a crash dialog if something went wrong +if [ $? != 0 ] && [ $? != 1 ]; then + if command -v zenity > /dev/null; then + zenity --no-wrap --question --title "{MODNAME}" --text "{MODNAME} has encountered a fatal error.\nLog Files are available in ~/.openra." --ok-label "Quit" --cancel-label "View FAQ" || xdg-open https://github.com/OpenRA/OpenRA/wiki/FAQ + else + printf "{MODNAME} has encountered a fatal error.\n -> Log Files are available in ~/.openra\n -> FAQ is available at https://github.com/OpenRA/OpenRA/wiki/FAQ\n" + fi + exit 1 fi