]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATCDCL/ATCDialogOld.cxx
properly add librt when clock_gettime is used
[flightgear.git] / src / ATCDCL / ATCDialogOld.cxx
index bb3cc1650fa46eefd11cb9f854e43d2fa61a72e1..e3baf4e66e702be81136e3ae5a3b4486a77b3a8f 100644 (file)
@@ -30,6 +30,7 @@
 #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"
@@ -47,6 +48,7 @@ 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();
@@ -57,6 +59,7 @@ static bool do_ATC_freq_search(const SGPropertyNode* arg) {
        current_atcdialog->FreqDialog();
        return(true);
 }
+#endif
 
 ATCMenuEntry::ATCMenuEntry() {
   stationid    = "";
@@ -205,7 +208,13 @@ void FGATCDialog::PopupDialog() {
        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";
@@ -260,7 +269,13 @@ void FGATCDialog::PopupDialog() {
 }
 
 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;