]> git.mxchange.org Git - flightgear.git/blob - src/GUI/LocationWidget.hxx
Start-paused for in-air starts
[flightgear.git] / src / GUI / LocationWidget.hxx
1 // LocationWidget.hxx - GUI launcher dialog using Qt5
2 //
3 // Written by James Turner, started October 2015.
4 //
5 // Copyright (C) 2015 James Turner <zakalawe@mac.com>
6 //
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.
11 //
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.
16 //
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.
20
21 #ifndef LOCATIONWIDGET_H
22 #define LOCATIONWIDGET_H
23
24 #include <QWidget>
25
26 #include <QToolButton>
27 #include <Navaids/positioned.hxx>
28 #include <Airports/airports_fwd.hxx>
29
30 namespace Ui {
31     class LocationWidget;
32 }
33
34 class NavSearchModel;
35
36 class LocationWidget : public QWidget
37 {
38     Q_OBJECT
39
40 public:
41     explicit LocationWidget(QWidget *parent = 0);
42     ~LocationWidget();
43
44     void saveSettings();
45     void restoreSettings();
46
47     QString locationDescription() const;
48
49     void setBaseLocation(FGPositionedRef ref);
50
51     bool shouldStartPaused() const;
52
53     void setLocationOptions();
54 Q_SIGNALS:
55     void descriptionChanged(QString t);
56
57 private Q_SLOTS:
58     void updateDescription();
59
60     void onLocationChanged();
61
62     void onOffsetDataChanged();
63
64 private:
65
66     void onSearch();
67
68
69     void onSearchResultSelected(const QModelIndex& index);
70     void onPopupHistory();
71     void onSearchComplete();
72
73     void onAirportDiagramClicked(FGRunwayRef rwy);
74     void onOffsetBearingTrueChanged(bool on);
75
76
77     Ui::LocationWidget *m_ui;
78
79     NavSearchModel* m_searchModel;
80
81     FGPositionedRef m_location;
82     QVector<PositionedID> m_recentAirports;
83
84     QToolButton* m_backButton;
85
86     void onOffsetEnabledToggled(bool on);
87     void onBackToSearch();
88 };
89
90 #endif // LOCATIONWIDGET_H