#include <Main/globals.hxx>
#include <GUI/gui.h> // mkDialog
#include <GUI/new_gui.hxx>
+#include <Main/fg_props.hxx>
#include "ATCDialogOld.hxx"
#include "ATC.hxx"
#include <sstream>
using std::ostringstream;
+using std::cerr;
+using std::endl;
FGATCDialog *current_atcdialog;
// For the command manager - maybe eventually this should go in the built in command list
+#if 0
static bool do_ATC_dialog(const SGPropertyNode* arg) {
cerr << "Running ATCDCL do_ATC_dialog" << endl;
current_atcdialog->PopupDialog();
current_atcdialog->FreqDialog();
return(true);
}
+#endif
ATCMenuEntry::ATCMenuEntry() {
stationid = "";
button_group->removeChildren("button", false);
string label;
- FGATC* atcptr = globals->get_ATC_mgr()->GetComm1ATCPointer(); // Hardwired to comm1 at the moment
+ FGATCMgr* pAtcMgr = globals->get_ATC_mgr();
+ if (!pAtcMgr)
+ {
+ SG_LOG(SG_ATC, SG_ALERT, "ERROR! No ATC manager! Oops...");
+ return;
+ }
+ FGATC* atcptr = pAtcMgr->GetComm1ATCPointer(); // Hardwired to comm1 at the moment
if (!atcptr) {
label = "Not currently tuned to any ATC service";
}
void FGATCDialog::PopupCallback(int num) {
- FGATC* atcptr = globals->get_ATC_mgr()->GetComm1ATCPointer(); // FIXME - Hardwired to comm1 at the moment
+ FGATCMgr* pAtcMgr = globals->get_ATC_mgr();
+ if (!pAtcMgr)
+ {
+ SG_LOG(SG_ATC, SG_ALERT, "ERROR! No ATC manager! Oops...");
+ return;
+ }
+ FGATC* atcptr = pAtcMgr->GetComm1ATCPointer(); // FIXME - Hardwired to comm1 at the moment
if (!atcptr)
return;