]> git.mxchange.org Git - flightgear.git/commitdiff
loadxml, savexml: don't pop up a GUI error message on error, but use a
authormfranz <mfranz>
Tue, 19 Jun 2007 10:10:00 +0000 (10:10 +0000)
committermfranz <mfranz>
Tue, 19 Jun 2007 10:10:00 +0000 (10:10 +0000)
simple SG_LOG instead. The user didn't call the fgcommand, so why should
s/he be bothered with that? And the actually caller of the command gets a
return value and can pop up a dialog if it thinks it's necessary.

src/Main/fg_commands.cxx

index 4926571907ca50f5caf319320f8a48ba74e33103..6fc2a3cd8ab3a0ae62a85514b2349f4fed135fcd 100644 (file)
@@ -1341,8 +1341,7 @@ do_load_xml_to_proptree(const SGPropertyNode * arg)
     try {
         readProperties(file.c_str(), targetnode, true);
     } catch (const sg_exception &e) {
-        string errmsg = "Error reading file " + file.str() + ":\n";
-        guiErrorMessage(errmsg.c_str(), e);
+        SG_LOG(SG_IO, SG_WARN, "Warning: couldn't load file '" << file.str() << '\'');
         return false;
     }
 
@@ -1384,8 +1383,7 @@ do_save_xml_from_proptree(const SGPropertyNode * arg)
     try {
         writeProperties (file.c_str(), sourcenode, true);
     } catch (const sg_exception &e) {
-        string errmsg = "Error writing file " + file.str() + ":\n";
-        guiErrorMessage(errmsg.c_str(), e);
+        SG_LOG(SG_IO, SG_WARN, "Warning: couldn't save file '" << file.str() << '\'');
         return false;
     }