Flightplan delegate hook for clearing the FP.
This allows delegates to take action when the flightlan is cleared, and especially, for the default delegate in the route-manager to deactivate itself, and hence the GPS LEG mode - which fixes bug 940 I hope.
This commit is contained in:
parent
5ff8311acc
commit
369e6b564f
4 changed files with 18 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -1772,6 +1772,11 @@ public:
|
|||
{
|
||||
callDelegateMethod("currentWaypointChanged");
|
||||
}
|
||||
|
||||
virtual void cleared()
|
||||
{
|
||||
callDelegateMethod("cleared");
|
||||
}
|
||||
private:
|
||||
|
||||
void callDelegateMethod(const char* method)
|
||||
|
|
Loading…
Add table
Reference in a new issue