1 // QtLauncher.hxx - GUI launcher dialog using Qt5
3 // Written by James Turner, started December 2014.
5 // Copyright (C) 2014 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 FG_QTLAUNCHER_HXX
22 #define FG_QTLAUNCHER_HXX
25 #include <QScopedPointer>
26 #include <QStringList>
27 #include <QModelIndex>
29 #include <Airports/airport.hxx>
36 class AirportSearchModel;
38 class AircraftProxyModel;
41 class QtLauncher : public QDialog
46 virtual ~QtLauncher();
48 static void initApp(int argc, char** argv);
50 static bool runLauncherDialog();
56 void onSearchAirports();
58 void onAirportChanged();
60 void onAirportChoiceSelected(const QModelIndex& index);
61 void onAircraftSelected(const QModelIndex& index);
63 void onPopupAirportHistory();
64 void onPopupAircraftHistory();
66 void onOpenCustomAircraftDir();
68 void onEditRatingsFilter();
70 void updateAirportDescription();
71 void updateSettingsSummary();
73 void onAirportSearchComplete();
75 void onAddSceneryPath();
76 void onRemoveSceneryPath();
78 void onRembrandtToggled(bool b);
80 void setAirport(FGAirportRef ref);
81 void updateSelectedAircraft();
83 void restoreSettings();
86 QModelIndex proxyIndexForAircraftPath(QString path) const;
87 QModelIndex sourceIndexForAircraftPath(QString path) const;
89 void setEnableDisableOptionFromCheckbox(QCheckBox* cbox, QString name) const;
91 QScopedPointer<Ui::Launcher> m_ui;
92 AirportSearchModel* m_airportsModel;
93 AircraftProxyModel* m_aircraftProxy;
95 FGAirportRef m_selectedAirport;
97 QString m_selectedAircraft;
98 QStringList m_recentAircraft,
100 QString m_customAircraftDir;
102 int m_ratingFilters[4];
105 #endif // of FG_QTLAUNCHER_HXX