1
0
Fork 0

Launcher: FlightPlann: fix ‘view route’ enable

This commit is contained in:
Automatic Release Builder 2020-12-06 18:45:44 +00:00 committed by James Turner
parent 499dc79584
commit 769dcb1454
2 changed files with 13 additions and 0 deletions

View file

@ -32,12 +32,15 @@ const int LegAltitudeTypeRole = Qt::UserRole + 8;
class LegsModel : public QAbstractListModel
{
Q_OBJECT
Q_PROPERTY(int numLegs READ numLegs NOTIFY numLegsChanged)
public:
void setFlightPlan(flightgear::FlightPlanRef f)
{
beginResetModel();
_fp = f;
endResetModel();
emit numLegsChanged();
}
int rowCount(const QModelIndex &parent) const override
@ -132,6 +135,7 @@ public:
{
beginResetModel();
endResetModel();
numLegsChanged();
}
QHash<int, QByteArray> roleNames() const override
@ -152,6 +156,14 @@ public:
return result;
}
int numLegs() const
{
return _fp->numLegs();
}
signals:
void numLegsChanged();
private:
flightgear::FlightPlanRef _fp;
};

View file

@ -322,6 +322,7 @@ Item {
Button {
text: qsTr("View route")
enabled: _launcher.flightPlan.legs.numLegs > 0
onClicked: {
detailLoader.airportGuid = 0
detailLoader.sourceComponent = routeDetails;