diff --git a/src/Instrumentation/gps.cxx b/src/Instrumentation/gps.cxx index 158b87c6c..21485d4eb 100644 --- a/src/Instrumentation/gps.cxx +++ b/src/Instrumentation/gps.cxx @@ -716,7 +716,7 @@ void GPS::routeManagerSequenced() if ((index < 0) || (index >= count)) { _currentWaypt=NULL; _prevWaypt=NULL; - SG_LOG(SG_INSTR, SG_ALERT, "GPS: malformed route, index=" << index); + // no active leg on the route return; } diff --git a/src/Navaids/FlightPlan.cxx b/src/Navaids/FlightPlan.cxx index b66108fbb..eda1e2db5 100644 --- a/src/Navaids/FlightPlan.cxx +++ b/src/Navaids/FlightPlan.cxx @@ -226,6 +226,9 @@ void FlightPlan::clear() } _legs.clear(); + if (_delegate) { + _delegate->runCleared(); + } unlockDelegate(); } @@ -1205,5 +1208,11 @@ void FlightPlan::Delegate::runCurrentWaypointChanged() if (_inner) _inner->runCurrentWaypointChanged(); currentWaypointChanged(); } + +void FlightPlan::Delegate::runCleared() +{ + if (_inner) _inner->runCleared(); + cleared(); +} } // of namespace flightgear diff --git a/src/Navaids/FlightPlan.hxx b/src/Navaids/FlightPlan.hxx index 3eeb02cf6..84944069a 100644 --- a/src/Navaids/FlightPlan.hxx +++ b/src/Navaids/FlightPlan.hxx @@ -104,7 +104,7 @@ public: virtual void departureChanged() { } virtual void arrivalChanged() { } virtual void waypointsChanged() { } - + virtual void cleared() { } virtual void currentWaypointChanged() { } protected: @@ -117,7 +117,8 @@ public: void runArrivalChanged(); void runWaypointsChanged(); void runCurrentWaypointChanged(); - + void runCleared(); + friend class FlightPlan; bool _deleteWithPlan; diff --git a/src/Scripting/NasalPositioned.cxx b/src/Scripting/NasalPositioned.cxx index 252342516..cfdadf68f 100644 --- a/src/Scripting/NasalPositioned.cxx +++ b/src/Scripting/NasalPositioned.cxx @@ -1772,6 +1772,11 @@ public: { callDelegateMethod("currentWaypointChanged"); } + + virtual void cleared() + { + callDelegateMethod("cleared"); + } private: void callDelegateMethod(const char* method)