diff options
author | Max Horn | 2010-04-11 19:04:02 +0000 |
---|---|---|
committer | Max Horn | 2010-04-11 19:04:02 +0000 |
commit | f2ff555996b2711685c86d5332e9899a2d2511b4 (patch) | |
tree | b0e6d4a2bc05ad338e91c7d14b6574b0541bf741 /base | |
parent | b928da4418d7acf05cc1b0889b0142fee177681e (diff) | |
download | scummvm-rg350-f2ff555996b2711685c86d5332e9899a2d2511b4.tar.gz scummvm-rg350-f2ff555996b2711685c86d5332e9899a2d2511b4.tar.bz2 scummvm-rg350-f2ff555996b2711685c86d5332e9899a2d2511b4.zip |
Rest of patch #2982224: GSoC: Added unit test and unified error message display
svn-id: r48627
Diffstat (limited to 'base')
-rw-r--r-- | base/main.cpp | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/base/main.cpp b/base/main.cpp index 71a5f96382..fb456f38a2 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -49,6 +49,7 @@ #include "gui/GuiManager.h" #include "gui/message.h" +#include "gui/error.h" #include "sound/audiocd.h" @@ -134,21 +135,12 @@ static Common::Error runGame(const EnginePlugin *plugin, OSystem &system, const // Check for errors if (!engine || err != Common::kNoError) { - // TODO: Show an error dialog or so? - // TODO: Also take 'err' into consideration... - //GUI::MessageDialog alert("ScummVM could not find any game in the specified directory!"); - //alert.runModal(); - const char *errMsg = 0; - switch (err) { - case Common::kInvalidPathError: - errMsg = "Invalid game path"; - break; - case Common::kNoGameDataFoundError: - errMsg = "Unable to locate game data"; - break; - default: - errMsg = "Unknown error"; - } + + // TODO: An errorDialog for this and engine related errors is displayed already in the scummvm_main function + // Is a separate dialog here still required? + + //GUI::displayErrorDialog("ScummVM could not find any game in the specified directory!"); + const char *errMsg = Common::errorToString(err); warning("%s failed to instantiate engine: %s (target '%s', path '%s')", plugin->getName(), @@ -391,7 +383,8 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) { // Did an error occur ? if (result != Common::kNoError) { - // TODO: Show an informative error dialog if starting the selected game failed. + // Shows an informative error dialog if starting the selected game failed. + GUI::displayErrorDialog(result, "Error running game:"); } // Quit unless an error occurred, or Return to launcher was requested @@ -418,6 +411,7 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) { // A dialog would be nicer, but we don't have any // screen to draw on yet. warning("Could not find any engine capable of running the selected game"); + GUI::displayErrorDialog("Could not find any engine capable of running the selected game"); } // We will destroy the AudioCDManager singleton here to save some memory. |