diff --git a/src/Aircraft/flightrecorder.cxx b/src/Aircraft/flightrecorder.cxx index 075ba17a3..9ac2169dd 100644 --- a/src/Aircraft/flightrecorder.cxx +++ b/src/Aircraft/flightrecorder.cxx @@ -167,7 +167,7 @@ FGFlightRecorder::getDefault(void) const char* Path = m_RecorderNode->getStringValue("default-config",NULL); if (!Path) { - SG_LOG(SG_SYSTEMS, SG_ALERT, "FlightRecorder: No default flight recorder specified! Check preferences.xml!"); + SG_LOG(SG_SYSTEMS, SG_ALERT, "FlightRecorder: No default flight recorder specified! Check defaults.xml!"); } else { diff --git a/src/GUI/SetupRootDialog.cxx b/src/GUI/SetupRootDialog.cxx index e1cb65be8..7d7613254 100644 --- a/src/GUI/SetupRootDialog.cxx +++ b/src/GUI/SetupRootDialog.cxx @@ -126,7 +126,7 @@ bool SetupRootDialog::validatePath(QString path) // no harm QStringList files = QStringList() << "version" - << "preferences.xml" + << "defaults.xml" << "Materials/base/materials-base.xml" << "gui/menubar.xml" << "Timezone/zone.tab"; diff --git a/src/Instrumentation/transponder.cxx b/src/Instrumentation/transponder.cxx index 00d4d80ac..07594c0fd 100644 --- a/src/Instrumentation/transponder.cxx +++ b/src/Instrumentation/transponder.cxx @@ -104,7 +104,7 @@ void Transponder::init() _idCode_node = node->getChild("id-code", 0, true); _idCode_node->addChangeListener(this); - // set default, but don't overwrite value from preferences.xml or -set.xml + // set default, but don't overwrite value from defaults.xml or -set.xml if (!_idCode_node->hasValue()) { _idCode_node->setIntValue(1200); } diff --git a/src/Main/fg_commands.cxx b/src/Main/fg_commands.cxx index 93c5d0686..b513a673e 100644 --- a/src/Main/fg_commands.cxx +++ b/src/Main/fg_commands.cxx @@ -395,15 +395,12 @@ do_panel_load (const SGPropertyNode * arg) static bool do_preferences_load (const SGPropertyNode * arg) { - try { - fgLoadProps(arg->getStringValue("path", "preferences.xml"), - globals->get_props()); - } catch (const sg_exception &e) { - guiErrorMessage("Error reading global preferences: ", e); + // disabling this command which was formerly used to reload 'preferences.xml' + // reloading the defaults doesn't make sense (better to reset the simulator), + // and loading arbitrary XML docs into the property-tree can be done via + // the standard load-xml command. + SG_LOG(SG_GENERAL, SG_ALERT, "preferences-load command is deprecated and non-functional"); return false; - } - SG_LOG(SG_INPUT, SG_INFO, "Successfully read global preferences."); - return true; } static void diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index c8dc9ec1b..2dc5cfdb0 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -472,10 +472,17 @@ int fgInitConfig ( int argc, char **argv, bool reinit ) options->init(argc, argv, dataPath); } - // Read global preferences from $FG_ROOT/preferences.xml - SG_LOG(SG_GENERAL, SG_INFO, "Reading global preferences"); - fgLoadProps("preferences.xml", globals->get_props()); - SG_LOG(SG_GENERAL, SG_INFO, "Finished Reading global preferences"); + // Read global defaults from $FG_ROOT/defaults + SG_LOG(SG_GENERAL, SG_INFO, "Reading global defaults"); + SGPath defaultsXML = globals->get_fg_root() / "defaults.xml"; + if (!defaultsXML.exists()) { + flightgear::fatalMessageBox("Missing files", + "Couldn't load an essential simulator data file", + defaultsXML.utf8Str()); + } + + fgLoadProps("defaults.xml", globals->get_props()); + SG_LOG(SG_GENERAL, SG_INFO, "Finished Reading global defaults"); // do not load user settings when reset to default is requested, or if // told to explicitly ignore diff --git a/src/Main/locale.cxx b/src/Main/locale.cxx index fd7a5f2b5..b8a02cd2a 100644 --- a/src/Main/locale.cxx +++ b/src/Main/locale.cxx @@ -190,7 +190,7 @@ FGLocale::selectLanguage(const char *language) if (!_currentLocale) { SG_LOG(SG_GENERAL, SG_ALERT, - "System locale not found or no internationalization settings specified in preferences.xml. Using default (en)." ); + "System locale not found or no internationalization settings specified in defaults.xml. Using default (en)." ); return false; } diff --git a/src/Main/options.cxx b/src/Main/options.cxx index a9aa034b1..01de7eb3a 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -112,7 +112,7 @@ static int fgSetupProxy( const char *arg ); /** * Set a few fail-safe default property values. * - * These should all be set in $FG_ROOT/preferences.xml, but just + * These should all be set in $FG_ROOT/defaults.xml, but just * in case, we provide some initial sane values here. This method * should be invoked *before* reading any init files. */ diff --git a/utils/fgelev/fgelev.cxx b/utils/fgelev/fgelev.cxx index 599f26d98..fb6d8cd1b 100644 --- a/utils/fgelev/fgelev.cxx +++ b/utils/fgelev/fgelev.cxx @@ -124,7 +124,7 @@ main(int argc, char** argv) SGSharedPtr props = new SGPropertyNode; try { SGPath preferencesFile = fg_root; - preferencesFile.append("preferences.xml"); + preferencesFile.append("defaults.xml"); readProperties(preferencesFile, props); } catch (...) { // In case of an error, at least make summer :) diff --git a/utils/fgviewer/fgviewer.cxx b/utils/fgviewer/fgviewer.cxx index 3b1053061..30725f36f 100644 --- a/utils/fgviewer/fgviewer.cxx +++ b/utils/fgviewer/fgviewer.cxx @@ -85,7 +85,7 @@ main(int argc, char** argv) SGSharedPtr props = new SGPropertyNode; try { SGPath preferencesFile = fg_root; - preferencesFile.append("preferences.xml"); + preferencesFile.append("defaults.xml"); readProperties(preferencesFile, props); } catch (...) { // In case of an error, at least make summer :)