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>
30 #include <Airports/airport.hxx>
37 class AirportSearchModel;
39 class AircraftProxyModel;
40 class AircraftItemModel;
43 class QtLauncher : public QDialog
48 virtual ~QtLauncher();
50 static void initApp(int argc, char** argv);
52 static bool runLauncherDialog();
58 void onSearchAirports();
60 void onAirportChanged();
62 void onAirportChoiceSelected(const QModelIndex& index);
63 void onAircraftSelected(const QModelIndex& index);
65 void onPopupAirportHistory();
66 void onPopupAircraftHistory();
68 void onOpenCustomAircraftDir();
70 void onEditRatingsFilter();
72 void updateAirportDescription();
73 void updateSettingsSummary();
75 void onAirportSearchComplete();
77 void onAddSceneryPath();
78 void onRemoveSceneryPath();
80 void onAddAircraftPath();
81 void onRemoveAircraftPath();
84 void onRembrandtToggled(bool b);
86 void onSubsytemIdleTimeout();
88 void setAirport(FGAirportRef ref);
89 void updateSelectedAircraft();
91 void restoreSettings();
94 QModelIndex proxyIndexForAircraftPath(QString path) const;
95 QModelIndex sourceIndexForAircraftPath(QString path) const;
97 void setEnableDisableOptionFromCheckbox(QCheckBox* cbox, QString name) const;
99 QScopedPointer<Ui::Launcher> m_ui;
100 AirportSearchModel* m_airportsModel;
101 AircraftProxyModel* m_aircraftProxy;
102 AircraftItemModel* m_aircraftModel;
104 FGAirportRef m_selectedAirport;
106 QString m_selectedAircraft;
107 QStringList m_recentAircraft,
109 QString m_customAircraftDir;
110 QTimer* m_subsystemIdleTimer;
112 int m_ratingFilters[4];
115 #endif // of FG_QTLAUNCHER_HXX