X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FGUI%2Fgui.cxx;h=853b9516d8ebcd6119a785865c64a664e91233b6;hb=dd440e78292ccda6423aff9adfe63915be2c0a65;hp=059b813b2f4999cfd42ec64d966cd178f789b161;hpb=96b88e539f769c0e0d70d112d7f98f6843760e10;p=flightgear.git diff --git a/src/GUI/gui.cxx b/src/GUI/gui.cxx index 059b813b2..853b9516d 100644 --- a/src/GUI/gui.cxx +++ b/src/GUI/gui.cxx @@ -153,6 +153,30 @@ void mkDialog (const char *txt) FG_PUSH_PUI_DIALOG( dialogBox ); } +// Message Box to report an error. +void guiErrorMessage (const char *txt) +{ + SG_LOG(SG_GENERAL, SG_ALERT, txt); + if (dialogBox != 0) + mkDialog(txt); +} + +// Message Box to report a throwable (usually an exception). +void guiErrorMessage (const char *txt, const sg_throwable &throwable) +{ + string msg = txt; + msg += '\n'; + msg += throwable.getFormattedMessage(); + if (throwable.getOrigin() != "") { + msg += "\n (reported by "; + msg += throwable.getOrigin(); + msg += ')'; + } + SG_LOG(SG_GENERAL, SG_ALERT, msg); + if (dialogBox != 0) + mkDialog(msg.c_str()); +} + // Toggle the Menu and Mouse display state void guiToggleMenu(void) {