]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/atcdialog.cxx
prepare for festival volume
[flightgear.git] / src / ATC / atcdialog.cxx
index a4c75a6113ebd89323af00ac7c7308447e6d84e7..912f35446d017346abb498275c00e61273bb0250 100644 (file)
 //
 // $Id$
 
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
 #include <Main/fg_commands.hxx>
 #include <Main/globals.hxx>
 
 
 FGATCDialogNew *currentATCDialog;
 
-static bool doATCDialog(const SGPropertyNode* arg) {
-        cerr << "Running doATCDialog" << endl;
+/*static bool doATCDialog(const SGPropertyNode* arg) {
+        //cerr << "Running doATCDialog" << endl;
        currentATCDialog->PopupDialog();
        return(true);
-}
+}*/
+FGATCDialogNew * FGATCDialogNew::_instance = NULL;
 
 FGATCDialogNew::FGATCDialogNew()
 {
-  dialogVisible = false;
+  dialogVisible = true;
 }
 
 FGATCDialogNew::~FGATCDialogNew()
@@ -54,7 +59,7 @@ FGATCDialogNew::~FGATCDialogNew()
 
 void FGATCDialogNew::init() {
        // Add ATC-dialog to the command list
-       globals->get_commands()->addCommand("ATC-dialog", doATCDialog);
+    globals->get_commands()->addCommand("ATC-dialog", FGATCDialogNew::popup );
        // Add ATC-freq-search to the command list
        //globals->get_commands()->addCommand("ATC-freq-search", do_ATC_freq_search);
 
@@ -89,11 +94,22 @@ static SGPropertyNode *getNamedNode(SGPropertyNode *prop, const char *name) {
 void FGATCDialogNew::addEntry(int nr, string txt) {
     commands.clear();
     commands.push_back(txt);
+    commands.push_back(string("Toggle ground network visibility"));
+}
+
+void FGATCDialogNew::removeEntry(int nr) {
+    commands.clear();
 }
 
 
+
 void FGATCDialogNew::PopupDialog() {
-    double onBoardRadioFreq0 =
+    dialogVisible = !dialogVisible;
+    return;
+}
+
+void FGATCDialogNew::update(double dt) {
+ double onBoardRadioFreq0 =
         fgGetDouble("/instrumentation/comm[0]/frequencies/selected-mhz");
     double onBoardRadioFreq1 =
         fgGetDouble("/instrumentation/comm[1]/frequencies/selected-mhz");
@@ -136,11 +152,8 @@ void FGATCDialogNew::PopupDialog() {
     } else {
         _gui->showDialog(dialog_name);
     }
-    dialogVisible = !dialogVisible;
+    //dialogVisible = !dialogVisible;
     return;
-}
-
-void FGATCDialogNew::update(double dt) {
     /*
     static SGPropertyNode_ptr trans_num = globals->get_props()->getNode("/sim/atc/transmission-num", true);
     int n = trans_num->getIntValue();