+// Load user settings from autosave.xml
+void
+FGGlobals::loadUserSettings()
+{
+ // dummy method for now.
+ //TODO Move code loading autosave.xml in here after the 2.6.0 release.
+ haveUserSettings = true;
+}
+
+// Save user settings in autosave.xml
+void
+FGGlobals::saveUserSettings()
+{
+ // only save settings when we have (tried) to load the previous
+ // settings (otherwise user data was lost)
+ if (!haveUserSettings)
+ return;
+
+ if (fgGetBool("/sim/startup/save-on-exit")) {
+ // don't save settings more than once on shutdown
+ haveUserSettings = false;
+
+ SGPath autosaveFile(fgGetString("/sim/fg-home"));
+ autosaveFile.append( "autosave.xml" );
+ autosaveFile.create_dir( 0700 );
+ SG_LOG(SG_IO, SG_INFO, "Saving user settings to " << autosaveFile.str());
+ try {
+ writeProperties(autosaveFile.str(), globals->get_props(), false, SGPropertyNode::USERARCHIVE);
+ } catch (const sg_exception &e) {
+ guiErrorMessage("Error writing autosave.xml: ", e);
+ }
+ SG_LOG(SG_INPUT, SG_DEBUG, "Finished Saving user settings");
+ }
+}
+