1
0
Fork 0

Remove confusing default (missing) path from 2D panel code.

This commit is contained in:
James Turner 2010-10-28 13:54:45 +01:00
parent 0320010d95
commit e9f4106bc1
2 changed files with 15 additions and 13 deletions

View file

@ -392,9 +392,11 @@ static bool
do_panel_load (const SGPropertyNode * arg) do_panel_load (const SGPropertyNode * arg)
{ {
string panel_path = string panel_path =
arg->getStringValue("path", arg->getStringValue("path", fgGetString("/sim/panel/path"));
fgGetString("/sim/panel/path", if (panel_path.empty()) {
"Panels/Default/default.xml")); return false;
}
FGPanel * new_panel = fgReadPanel(panel_path); FGPanel * new_panel = fgReadPanel(panel_path);
if (new_panel == 0) { if (new_panel == 0) {
SG_LOG(SG_INPUT, SG_ALERT, SG_LOG(SG_INPUT, SG_ALERT,

View file

@ -1414,20 +1414,20 @@ bool fgInitSubsystems() {
// Add a new 2D panel. // Add a new 2D panel.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
string panel_path = fgGetString("/sim/panel/path", string panel_path(fgGetString("/sim/panel/path"));
"Panels/Default/default.xml"); if (!panel_path.empty()) {
FGPanel* p = fgReadPanel(panel_path);
globals->set_current_panel( fgReadPanel(panel_path) ); if (p) {
if (globals->get_current_panel() == 0) { globals->set_current_panel(p);
p->init();
p->bind();
SG_LOG( SG_INPUT, SG_INFO, "Loaded new panel from " << panel_path );
} else {
SG_LOG( SG_INPUT, SG_ALERT, SG_LOG( SG_INPUT, SG_ALERT,
"Error reading new panel from " << panel_path ); "Error reading new panel from " << panel_path );
} else { }
SG_LOG( SG_INPUT, SG_INFO, "Loaded new panel from " << panel_path );
globals->get_current_panel()->init();
globals->get_current_panel()->bind();
} }
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Initialize the controls subsystem. // Initialize the controls subsystem.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////