2013-11-06 23:49:58 +00:00
|
|
|
#ifndef FG_GUI_MESSAGE_BOX_HXX
|
|
|
|
#define FG_GUI_MESSAGE_BOX_HXX
|
|
|
|
|
|
|
|
#include <string>
|
2017-04-09 16:38:38 +00:00
|
|
|
#include <cstdlib>
|
2013-11-06 23:49:58 +00:00
|
|
|
|
|
|
|
namespace flightgear
|
|
|
|
{
|
|
|
|
|
2020-07-14 11:05:53 +00:00
|
|
|
// set a global value indicating we're in headless mode.
|
|
|
|
void setHeadlessMode(bool headless);
|
|
|
|
bool isHeadlessMode();
|
|
|
|
|
2020-06-24 14:47:56 +00:00
|
|
|
// special exception class used to signal an exit. Must not inherit
|
|
|
|
// std::exception or similar, since we want to handle it specially
|
|
|
|
class FatalErrorException
|
|
|
|
{
|
|
|
|
};
|
|
|
|
|
2017-04-08 11:49:55 +00:00
|
|
|
enum MessageBoxResult
|
2013-11-06 23:49:58 +00:00
|
|
|
{
|
|
|
|
MSG_BOX_OK,
|
|
|
|
MSG_BOX_YES,
|
|
|
|
MSG_BOX_NO
|
|
|
|
};
|
|
|
|
|
|
|
|
MessageBoxResult modalMessageBox(const std::string& caption,
|
|
|
|
const std::string& msg,
|
|
|
|
const std::string& moreText = std::string());
|
|
|
|
|
2017-04-09 16:38:38 +00:00
|
|
|
MessageBoxResult fatalMessageBoxWithoutExit(
|
|
|
|
const std::string& caption,
|
2013-11-06 23:49:58 +00:00
|
|
|
const std::string& msg,
|
|
|
|
const std::string& moreText = std::string());
|
2017-04-08 11:49:55 +00:00
|
|
|
|
2017-04-09 16:38:38 +00:00
|
|
|
[[noreturn]] void fatalMessageBoxThenExit(
|
|
|
|
const std::string& caption,
|
|
|
|
const std::string& msg,
|
|
|
|
const std::string& moreText = std::string(),
|
|
|
|
int exitStatus = EXIT_FAILURE);
|
|
|
|
|
|
|
|
|
2013-11-06 23:49:58 +00:00
|
|
|
} // of namespace flightgear
|
|
|
|
|
|
|
|
#endif // of FG_GUI_MESSAGE_BOX_HXX
|