Merge branch 'next' of ssh://git.code.sf.net/p/flightgear/flightgear into next
This commit is contained in:
commit
f54e03d7c6
9 changed files with 23 additions and 19 deletions
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
|
|
@ -124,7 +124,7 @@ main(int argc, char** argv)
|
|||
SGSharedPtr<SGPropertyNode> 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 :)
|
||||
|
|
|
@ -85,7 +85,7 @@ main(int argc, char** argv)
|
|||
SGSharedPtr<SGPropertyNode> 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 :)
|
||||
|
|
Loading…
Reference in a new issue