1
0
Fork 0

We never want to know if a dialog is there or not. If we ask for one and

it isn't there, this is a bug. Thus centralize the error message so that it
doesn't have to be repeated everywhere. Of course, the calling code should
still consider that a returned property node may be 0.
This commit is contained in:
mfranz 2005-10-22 16:51:27 +00:00
parent 3188b395c8
commit ec2ff6ae50
2 changed files with 4 additions and 5 deletions

View file

@ -166,10 +166,8 @@ void mkDialog (const char *txt)
{ {
NewGUI *gui = (NewGUI *)globals->get_subsystem("gui"); NewGUI *gui = (NewGUI *)globals->get_subsystem("gui");
SGPropertyNode_ptr dlg = gui->getDialog("message"); SGPropertyNode_ptr dlg = gui->getDialog("message");
if (!dlg) { if (!dlg)
SG_LOG(SG_GENERAL, SG_ALERT, "'message' dialog missing");
return; return;
}
dlg->setStringValue("text/label", txt); dlg->setStringValue("text/label", txt);
dlg->setStringValue("button/legend", "OK"); dlg->setStringValue("button/legend", "OK");

View file

@ -147,8 +147,9 @@ NewGUI::getDialog (const string &name)
{ {
if(_dialog_props.find(name) != _dialog_props.end()) if(_dialog_props.find(name) != _dialog_props.end())
return _dialog_props[name]; return _dialog_props[name];
else
return 0; SG_LOG(SG_GENERAL, SG_ALERT, "dialog '" << name << "' missing");
return 0;
} }
void void