]> git.mxchange.org Git - flightgear.git/blobdiff - src/GUI/apt_dlg.cxx
Viewer update from Jim Wilson:
[flightgear.git] / src / GUI / apt_dlg.cxx
index 6a5581dd8f22d86f7dd87196e91253ed631bd635..41d2e21c572a0114ec549acc1f9aec40ae753e54 100644 (file)
@@ -55,6 +55,8 @@ void AptDialog_OK (puObject *)
        = fgGetNode("/position/longitude-deg");
     static const SGPropertyNode *latitude
        = fgGetNode("/position/latitude-deg");
+    static const SGPropertyNode *master_freeze
+       = fgGetNode("/sim/freeze/master");
 
     SGPath path( globals->get_fg_root() );
     path.append( "Airports" );
@@ -63,9 +65,10 @@ void AptDialog_OK (puObject *)
 
     FGAirport a;
 
-    int freeze = globals->get_freeze();
-    if(!freeze)
-        globals->set_freeze( true );
+    bool freeze = master_freeze->getBoolValue();
+    if ( !freeze ) {
+        fgSetBool("/sim/freeze/master", true);
+    }
 
     char *s;
     AptDialogInput->getValue(&s);
@@ -95,25 +98,18 @@ void AptDialog_OK (puObject *)
             fgSetPosFromAirportIDandHdg( AptId, 
                                          cur_fdm_state->get_Psi() *
                                          SGD_RADIANS_TO_DEGREES);
-            BusyCursor(0);
+            // BusyCursor(0);
             fgReInitSubsystems();
-            // if ( global_tile_mgr.init() ) {
-            // Load the local scenery data
             global_tile_mgr.update( longitude->getDoubleValue(),
                                     latitude->getDoubleValue() );
-            // } else {
-            // SG_LOG( SG_GENERAL, SG_ALERT, 
-            // "Error in Tile Manager initialization!" );
-            // exit(-1);
-            // }
-            BusyCursor(1);
+            // BusyCursor(1);
         } else {
             AptId  += " not in database.";
             mkDialog(AptId.c_str());
         }
     }
     if ( !freeze ) {
-        globals->set_freeze( false );
+        fgSetBool("/sim/freeze/master", false);
     }
 }
 
@@ -121,7 +117,7 @@ void AptDialog_OK (puObject *)
 void AptDialog_Reset(puObject *)
 {
     //  strncpy( NewAirportId, fgGetString("/sim/startup/airport-id").c_str(), 16 );
-    sprintf( NewAirportId, "%s", fgGetString("/sim/startup/airport-id").c_str() );
+    sprintf( NewAirportId, "%s", fgGetString("/sim/startup/airport-id") );
     AptDialogInput->setValue ( NewAirportId );
     AptDialogInput->setCursor( 0 ) ;
 }
@@ -129,7 +125,7 @@ void AptDialog_Reset(puObject *)
 void NewAirport(puObject *cb)
 {
     //  strncpy( NewAirportId, fgGetString("/sim/startup/airport-id").c_str(), 16 );
-    sprintf( NewAirportId, "%s", fgGetString("/sim/startup/airport-id").c_str() );
+    sprintf( NewAirportId, "%s", fgGetString("/sim/startup/airport-id") );
     // cout << "NewAirport " << NewAirportId << endl;
     AptDialogInput->setValue( NewAirportId );
 
@@ -138,7 +134,7 @@ void NewAirport(puObject *cb)
 
 void NewAirportInit(void)
 {
-    sprintf( NewAirportId, "%s", fgGetString("/sim/startup/airport-id").c_str() );
+    sprintf( NewAirportId, "%s", fgGetString("/sim/startup/airport-id") );
     int len = 150
         - puGetDefaultLabelFont().getStringWidth( NewAirportLabel ) / 2;