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;
42 class CatalogListModel;
44 class QtLauncher : public QDialog
49 virtual ~QtLauncher();
51 static void initApp(int& argc, char** argv);
53 static bool runLauncherDialog();
59 void onSearchAirports();
61 void onAirportChanged();
63 void onAirportChoiceSelected(const QModelIndex& index);
64 void onAircraftSelected(const QModelIndex& index);
66 void onPopupAirportHistory();
67 void onPopupAircraftHistory();
69 void onEditRatingsFilter();
71 void updateAirportDescription();
72 void updateSettingsSummary();
74 void onAirportSearchComplete();
76 void onRembrandtToggled(bool b);
77 void onToggleTerrasync(bool enabled);
79 void onSubsytemIdleTimeout();
83 void onAirportDiagramClicked(FGRunwayRef rwy);
85 void setAirport(FGAirportRef ref);
86 void updateSelectedAircraft();
88 void restoreSettings();
91 QModelIndex proxyIndexForAircraftPath(QString path) const;
92 QModelIndex sourceIndexForAircraftPath(QString path) const;
94 void setEnableDisableOptionFromCheckbox(QCheckBox* cbox, QString name) const;
96 QScopedPointer<Ui::Launcher> m_ui;
97 AirportSearchModel* m_airportsModel;
98 AircraftProxyModel* m_aircraftProxy;
99 AircraftItemModel* m_aircraftModel;
100 FGAirportRef m_selectedAirport;
102 QString m_selectedAircraft;
103 QStringList m_recentAircraft,
105 QTimer* m_subsystemIdleTimer;
107 int m_ratingFilters[4];
110 #endif // of FG_QTLAUNCHER_HXX