Disable internal Error Message
Rely on GameMonitor to display error message.
This commit is contained in:
committed by
Matthias Mailänder
parent
af3e3f795f
commit
beef3242b8
@@ -127,48 +127,5 @@ namespace OpenRA
|
|||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ShowFatalErrorDialog()
|
|
||||||
{
|
|
||||||
var process = "OpenRA.CrashDialog.exe";
|
|
||||||
var args = "";
|
|
||||||
|
|
||||||
if (CurrentPlatform == PlatformType.OSX)
|
|
||||||
{
|
|
||||||
// Winforms requires X11 under OSX, which may not exist.
|
|
||||||
// Show a native dialog using applescript instead.
|
|
||||||
var title = "Fatal Error";
|
|
||||||
var logsButton = "View Logs";
|
|
||||||
var faqButton = "View FAQ";
|
|
||||||
var quitButton = "Quit";
|
|
||||||
var message = "OpenRA has encountered a fatal error.\nRefer to the crash logs and FAQ for more information.";
|
|
||||||
|
|
||||||
var faqPath = Game.Settings.Debug.FatalErrorDialogFaq;
|
|
||||||
var logsPath = "file://" + Platform.SupportDir + "Logs" + Path.DirectorySeparatorChar;
|
|
||||||
|
|
||||||
var iconPath = new [] { "./OpenRA.icns", "./packaging/osx/template.app/Contents/Resources/OpenRA.icns" }.FirstOrDefault(f => File.Exists(f));
|
|
||||||
var icon = iconPath != null ? "with icon alias (POSIX file \\\"file://{0}\\\")".F(Environment.CurrentDirectory + "/" + iconPath) : "";
|
|
||||||
|
|
||||||
process = "/usr/bin/osascript";
|
|
||||||
args = (
|
|
||||||
"-e \"repeat\"\n" +
|
|
||||||
"-e \" tell application \\\"Finder\\\"\"\n" +
|
|
||||||
"-e \" set question to display dialog \\\"{1}\\\" with title \\\"{0}\\\" {2} buttons {{\\\"{3}\\\", \\\"{5}\\\", \\\"{7}\\\"}} default button 3\"\n" +
|
|
||||||
"-e \" if button returned of question is equal to \\\"{3}\\\" then open (POSIX file \\\"{4}\\\")\"\n" +
|
|
||||||
"-e \" if button returned of question is equal to \\\"{5}\\\" then open location \\\"{6}\\\"\"\n" +
|
|
||||||
"-e \" if button returned of question is equal to \\\"{7}\\\" then exit repeat\"\n" +
|
|
||||||
"-e \" activate\"\n" +
|
|
||||||
"-e \" end tell\"\n" +
|
|
||||||
"-e \"end repeat\""
|
|
||||||
).F(title, message, icon, logsButton, logsPath, faqButton, faqPath, quitButton);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (CurrentPlatform == PlatformType.Linux)
|
|
||||||
process = "error-dialog.sh";
|
|
||||||
|
|
||||||
var psi = new ProcessStartInfo(process, args);
|
|
||||||
psi.UseShellExecute = false;
|
|
||||||
psi.CreateNoWindow = true;
|
|
||||||
Process.Start(psi);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,12 +60,6 @@ namespace OpenRA
|
|||||||
var rpt = BuildExceptionReport(e).ToString();
|
var rpt = BuildExceptionReport(e).ToString();
|
||||||
Log.Write("exception", "{0}", rpt);
|
Log.Write("exception", "{0}", rpt);
|
||||||
Console.Error.WriteLine(rpt);
|
Console.Error.WriteLine(rpt);
|
||||||
|
|
||||||
if (Game.Settings.Debug.ShowFatalErrorDialog && !Game.Settings.Server.Dedicated)
|
|
||||||
{
|
|
||||||
Game.Renderer.Device.Dispose();
|
|
||||||
Platform.ShowFatalErrorDialog();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static StringBuilder BuildExceptionReport(Exception e)
|
static StringBuilder BuildExceptionReport(Exception e)
|
||||||
|
|||||||
Reference in New Issue
Block a user