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>
28 #include <Navaids/positioned.hxx>
29 #include <Airports/airports_fwd.hxx>
31 #include "QtLauncher_fwd.hxx"
39 class LocationWidget : public QWidget
44 explicit LocationWidget(QWidget *parent = 0);
48 void restoreSettings();
50 QString locationDescription() const;
52 void setBaseLocation(FGPositionedRef ref);
54 void setAircraftType(LauncherAircraftType ty);
56 bool shouldStartPaused() const;
58 void setLocationOptions();
60 void descriptionChanged(QString t);
63 void updateDescription();
64 void onLocationChanged();
65 void onOffsetDataChanged();
66 void onHeadingChanged();
70 void onSearchResultSelected(const QModelIndex& index);
71 void onSearchComplete();
73 void onAirportRunwayClicked(FGRunwayRef rwy);
74 void onAirportParkingClicked(FGParkingRef park);
76 void onOffsetBearingTrueChanged(bool on);
78 void addToRecent(FGPositionedRef pos);
80 void onOffsetEnabledToggled(bool on);
81 void onBackToSearch();
82 void setNavRadioOption();
85 Ui::LocationWidget *m_ui;
87 NavSearchModel* m_searchModel;
89 FGPositionedRef m_location;
90 bool m_locationIsLatLon;
91 SGGeod m_geodLocation;
93 QToolButton* m_backButton;
95 FGPositionedList m_recentLocations;
96 LauncherAircraftType m_aircraftType;
99 #endif // LOCATIONWIDGET_H