From ec2ff6ae504fbfe10cc882d0b505f63613d96b83 Mon Sep 17 00:00:00 2001 From: mfranz Date: Sat, 22 Oct 2005 16:51:27 +0000 Subject: [PATCH] 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. --- src/GUI/gui_funcs.cxx | 4 +--- src/GUI/new_gui.cxx | 5 +++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/GUI/gui_funcs.cxx b/src/GUI/gui_funcs.cxx index 8ee2d9b44..bc6bdc9c8 100644 --- a/src/GUI/gui_funcs.cxx +++ b/src/GUI/gui_funcs.cxx @@ -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"); diff --git a/src/GUI/new_gui.cxx b/src/GUI/new_gui.cxx index a0885b845..f45b17ba7 100644 --- a/src/GUI/new_gui.cxx +++ b/src/GUI/new_gui.cxx @@ -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