Fork me on GitHub
2.15.20
FGx
A cross-platform launcher for FlightGear
aircraftwidget.h
Go to the documentation of this file.
1 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-
2 // FGx FlightGear Launcher // aircraftwidget.h
3 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-
4 // (c) 2010-2012
5 // Yves Sablonier, Pete Morgan
6 // Geoff McLane
7 // GNU GPLv2, see main.cpp and shipped licence.txt for further information
8 
9 #ifndef AIRCRAFTWIDGET_H
10 #define AIRCRAFTWIDGET_H
11 
12 #include <QString>
13 #include <QStringList>
14 
15 #include <QWidget>
16 #include <QAbstractButton>
17 #include <QButtonGroup>
18 #include <QActionGroup>
19 #include <QCheckBox>
20 #include <QLineEdit>
21 #include <QTreeView>
22 #include <QStandardItemModel>
23 #include <QStandardItem>
24 #include <QSortFilterProxyModel>
25 #include <QTabBar>
26 #include <QLabel>
27 #include <QStatusBar>
28 #include <QToolButton>
29 
30 #include "xobjects/mainobject.h"
31 #include "xwidgets/toolbargroup.h"
32 class ToolBarGroup;
33 
35 class AircraftProxyModel;
36 
37 /*! \class AircraftWidget
38 * \brief Aircraft panel with a left/right splitter, model/proxy/tree vs selected
39 * \todo need to abtract out the aircraft custom directories, ie built in and custom
40 * \todo qt5 need to serialise airarft cache to json
41 * \todo future is run next vs master vs others and detect versions..
42 * \todo download aircraft from remote.. WIP at https://github.com/fgx/fgx-installer
43 */
44 
45 class AircraftWidget : public QWidget
46 {
47 Q_OBJECT
48 public:
49  //directory << aero << description << fdm << author << xml_file << file_path;
50  enum COLS{
61  };
62 
63 
64  explicit AircraftWidget(MainObject *mOb, QWidget *parent = 0);
65 
67 
69 
70  /* \brief Toggle buttons to show hide aircraft */
71  QButtonGroup *buttGroupShowDirs;
72  /* \brief Delete dropdown actions */
73  QActionGroup *actGroupDeleteCustomDirs;
74  /* \brief List of pointers to custon Buttons */
75  QList<QToolButton*> lstCustomDirButtons;
76  QLineEdit *txtFilter;
77  QToolButton * buttShowBase;
78 
83  QCheckBox *checkViewNested;
84  QToolButton *buttOpenAeroDir;
85 
86 
87  QLineEdit *txtNav1;
88  QLineEdit *txtNav2;
89  QLineEdit *txtAdf1;
90  QLineEdit *txtAdf2;
91  QLineEdit *txtCom1;
92  QLineEdit *txtCom2;
93 
95  QCheckBox *checkBoxFuelFreeze;
96  QLineEdit *txtTank1;
97  QLineEdit *txtTank2;
98  QLineEdit *txtTank3;
99 
100  void initialize();
101 
102  QString validate();
103  void select_node(QString aero);
104  QString selected_aircraft();
105  QList<QStandardItem*> create_model_row();
106 
107  void load_custom_aircraft();
108 
109 private:
111  //QSortFilterProxyModel *proxyModel;
113  QTreeView *treeView;
114 
115 
116  QStatusBar *statusBar;
117 
118  QToolButton *buttonAeroPath;
119 
120  QSplitter *splitter;
121 
122 signals:
123  void setx( QString option, bool enabled,QString value);
124 
125 public slots:
126  void load_aircraft();
127 
128 
130  void on_reload_cache();
131 
133 
134  void on_navs_changed();
135  void on_fuel_changed();
136 
137  void on_upx(QString option, bool enabled, QString value);
138  void on_debug_mode();
139 
140 
141  void on_open_aircraft_path();
142  void on_view_aircraft_cache();
143 
144  void on_filter_text_changed(const QString);
145  void on_clear_filter();
146 
147  void on_splitter_moved();
148 
149  void on_add_custom_dir();
150  void on_remove_custom_dir(QAction*);
152  void on_toggle_directory();
153 
154 
155 };
156 
157 #endif // AIRCRAFTWIDGET_H
QLineEdit * txtCom2
void on_filter_text_changed(const QString)
MainObject * mainObject
ToolBarGroup * grpCustomDirs
QActionGroup * actGroupDeleteCustomDirs
void on_remove_custom_dir(QAction *)
QLineEdit * txtTank3
void on_toggle_directory()
QCheckBox * checkViewNested
The MainObject is an extended QObject, and the main "controller" for FGx.
Definition: mainobject.h:66
QList< QStandardItem * > create_model_row()
void on_enable_fuel_freeze_clicked()
QToolButton * buttShowBase
QLabel * aeroImageLabel
void on_upx(QString option, bool enabled, QString value)
Aircraft panel with a left/right splitter, model/proxy/tree vs selected.
QLabel * lblAeroXml
void load_custom_dir_buttons()
QLineEdit * txtNav2
QSplitter * splitter
void select_node(QString aero)
QLineEdit * txtCom1
void on_tree_selection_changed()
QCheckBox * checkBoxUseDefaultFuel
AircraftWidget(MainObject *mOb, QWidget *parent=0)
QLabel * lblAeroDescription
void load_custom_aircraft()
void setx(QString option, bool enabled, QString value)
QToolButton * buttOpenAeroDir
AircraftProxyModel * proxyModel
QLineEdit * txtTank1
QCheckBox * checkBoxFuelFreeze
void on_view_aircraft_cache()
QStandardItemModel * model
QString selected_aircraft()
QList< QToolButton * > lstCustomDirButtons
QLineEdit * txtTank2
QLineEdit * txtAdf2
QLabel * lblAero
QLineEdit * txtNav1
QTreeView * treeView
QButtonGroup * buttGroupShowDirs
QLineEdit * txtAdf1
QStatusBar * statusBar
QLineEdit * txtFilter
void on_open_aircraft_path()
QToolButton * buttonAeroPath