1 // LocationWidget.hxx - GUI launcher dialog using Qt5
3 // Written by James Turner, started October 2015.
5 // Copyright (C) 2015 James Turner <zakalawe@mac.com>
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 #ifndef LOCATIONWIDGET_H
22 #define LOCATIONWIDGET_H
26 #include <QToolButton>
27 #include <Navaids/positioned.hxx>
28 #include <Airports/airports_fwd.hxx>
36 class LocationWidget : public QWidget
41 explicit LocationWidget(QWidget *parent = 0);
45 void restoreSettings();
47 QString locationDescription() const;
49 void setBaseLocation(FGPositionedRef ref);
51 bool shouldStartPaused() const;
53 void setLocationOptions();
55 void descriptionChanged(QString t);
58 void updateDescription();
60 void onLocationChanged();
62 void onOffsetDataChanged();
69 void onSearchResultSelected(const QModelIndex& index);
70 void onPopupHistory();
71 void onSearchComplete();
73 void onAirportDiagramClicked(FGRunwayRef rwy);
74 void onOffsetBearingTrueChanged(bool on);
77 Ui::LocationWidget *m_ui;
79 NavSearchModel* m_searchModel;
81 FGPositionedRef m_location;
82 QVector<PositionedID> m_recentAirports;
84 QToolButton* m_backButton;
86 void onOffsetEnabledToggled(bool on);
87 void onBackToSearch();
90 #endif // LOCATIONWIDGET_H