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:
parent
3188b395c8
commit
ec2ff6ae50
2 changed files with 4 additions and 5 deletions
|
@ -166,10 +166,8 @@ void mkDialog (const char *txt)
|
|||
{
|
||||
NewGUI *gui = (NewGUI *)globals->get_subsystem("gui");
|
||||
SGPropertyNode_ptr dlg = gui->getDialog("message");
|
||||
if (!dlg) {
|
||||
SG_LOG(SG_GENERAL, SG_ALERT, "'message' dialog missing");
|
||||
if (!dlg)
|
||||
return;
|
||||
}
|
||||
|
||||
dlg->setStringValue("text/label", txt);
|
||||
dlg->setStringValue("button/legend", "OK");
|
||||
|
|
|
@ -147,8 +147,9 @@ NewGUI::getDialog (const string &name)
|
|||
{
|
||||
if(_dialog_props.find(name) != _dialog_props.end())
|
||||
return _dialog_props[name];
|
||||
else
|
||||
return 0;
|
||||
|
||||
SG_LOG(SG_GENERAL, SG_ALERT, "dialog '" << name << "' missing");
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Add table
Reference in a new issue