]> git.mxchange.org Git - flightgear.git/blob - src/GUI/QtLauncher.hxx
Very crude work on GUI base package selection.
[flightgear.git] / src / GUI / QtLauncher.hxx
1
2 #include <QDialog>
3 #include <QScopedPointer>
4 #include <QStringList>
5 #include <QModelIndex>
6
7 #include <Airports/airport.hxx>
8
9 namespace Ui
10 {
11     class Launcher;
12 }
13
14 class AirportSearchModel;
15 class QModelIndex;
16 class AircraftProxyModel;
17 class QCheckBox;
18
19 class QtLauncher : public QDialog
20 {
21     Q_OBJECT
22 public:
23     QtLauncher();
24     virtual ~QtLauncher();
25
26     static void initApp(int argc, char** argv);
27
28     static bool runLauncherDialog();
29
30 private slots:
31     void onRun();
32     void onQuit();
33
34     void onSearchAirports();
35
36     void onAirportChanged();
37
38     void onAirportChoiceSelected(const QModelIndex& index);
39     void onAircraftSelected(const QModelIndex& index);
40
41     void onPopupAirportHistory();
42     void onPopupAircraftHistory();
43
44     void onOpenCustomAircraftDir();
45
46     void onEditRatingsFilter();
47
48     void updateAirportDescription();
49     void updateSettingsSummary();
50
51     void onAirportSearchComplete();
52
53     void onAddSceneryPath();
54     void onRemoveSceneryPath();
55
56     void onRembrandtToggled(bool b);
57 private:
58     void setAirport(FGAirportRef ref);
59     void updateSelectedAircraft();
60
61     void restoreSettings();
62     void saveSettings();
63     
64     QModelIndex proxyIndexForAircraftPath(QString path) const;
65     QModelIndex sourceIndexForAircraftPath(QString path) const;
66
67     void setEnableDisableOptionFromCheckbox(QCheckBox* cbox, QString name) const;
68
69     QScopedPointer<Ui::Launcher> m_ui;
70     AirportSearchModel* m_airportsModel;
71     AircraftProxyModel* m_aircraftProxy;
72
73     FGAirportRef m_selectedAirport;
74
75     QString m_selectedAircraft;
76     QStringList m_recentAircraft,
77         m_recentAirports;
78     QString m_customAircraftDir;
79
80     int m_ratingFilters[4];
81 };