FGx  1
coresettingswidget.h
1 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-
2 // FGx FlightGear Launcher // coresettingswidget.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 CORESETTINGSWIDGET_H
10 #define CORESETTINGSWIDGET_H
11 
12 #include <QtGui/QWidget>
13 #include <QtGui/QComboBox>
14 #include <QtGui/QCheckBox>
15 #include <QtGui/QLineEdit>
16 #include <QtGui/QGroupBox>
17 #include <QtGui/QButtonGroup>
18 #include <QtGui/QRadioButton>
19 #include <QToolButton>
20 
21 #include "xobjects/mainobject.h"
22 #include "xwidgets/xgroupboxes.h"
23 #include "xwidgets/xmessagelabel.h"
24 
25 class MainObject;
26 
27 class CoreSettingsWidget : public QWidget
28 {
29 Q_OBJECT
30 public:
31  explicit CoreSettingsWidget(MainObject *mOb, QWidget *parent = 0);
32 
33  MainObject *mainObject;
34 
35  bool fgrootcheck;
36 
37  XMessageLabel *messageLabel;
38 
39  //* Images
40  QLabel *imageLabel;
41 
42 
43  //* Callsign
44  QLineEdit *txtCallSign;
45 
46  //* Screen
47  QComboBox *comboScreenSize;
48  QCheckBox *checkBoxDisableSplashScreen;
49  QCheckBox *checkBoxFullScreenStartup;
50 
51  QHBoxLayout *screenSizeBox;
52  QLineEdit *lineEditScreenSizeW;
53  QLineEdit *lineEditScreenSizeH;
54  QLabel *lineEditScreenSizeWLabel;
55  QLabel *lineEditScreenSizeHLabel;
56 
57 
58 
59  //* MpMap
60  QCheckBox *checkBoxShowMpMap;
61  QComboBox *comboMpMapServer;
62 
63 
64  //** Paths
65  QButtonGroup *buttonGroupPaths;
66  XGroupHBox *groupBoxFgFs;
67  XGroupHBox *groupBoxFgRoot;
68 
69  QLineEdit *lineEditFgFsPath;
70  QLineEdit *lineEditFgRootPath;
71  QToolButton *buttonSetFgfsPath;
72  QToolButton *buttonSetFgRootPath;
73  QLabel *labelFgfsProgram;
74  QLabel *labelFgfsCheck;
75 
76  QLabel *labelFgRootData;
77  QLabel *labelFgRootCheck;
78 
79  QCheckBox *checkBoxUseTerrasync;
80  QLabel *labelTerrasyncProgram;
81  QLabel *labelTerrasyncCheck;
82  QToolButton *buttonSetTerrasyncExePath;
83  QToolButton *buttonSetTerrasyncDataPath;
84 
85  QLabel *labelTerrasyncData;
86  QLabel *labelTerrasyncDataCheck;
87 
88  QLineEdit *lineEditTerraSyncDataPath;
89  QLineEdit *lineEditTerraSyncExePath;
90 
91  QCheckBox *checkBoxUseCustomScenery;
92  QLabel *labelCustomScene;
93  QLabel *labelCustomSceneCheck;
94  QLineEdit *lineEditCustomScenePath;
95  QToolButton *buttonSetCustomSceneryPath;
96 
97  QLabel *labelFGComExeInfo;
98  QLineEdit *lineEditFGComExePath;
99 
100  //* Controls
101  QLabel *labelInputs;
102 
103  //* Functions
104  void initialize();
105  QString validate();
106 
107 
108 signals:
109  void setx(QString option, bool enabled, QString value);
110 
111 
112 public slots:
113 
114  void on_callsign_changed(QString);
115 
116  void on_show_mp_map();
117 
118  void on_fgfs_path(QString);
119  void on_fgroot_path(QString);
120  void on_terrasync_path(QString);
121  void on_terrasync_data_path(QString);
122  void on_terrasync_enabled();
123  void terrasync_enabled_checkstate();
124  void on_custom_scenery_enabled();
125  void on_custom_scenery_path(QString);
126  void custom_scenery_enabled_checkstate();
127 
128  void load_joysticks();
129 
130  void on_upx(QString option, bool enabled, QString value);
131 
132  // Path checks
133  void fgfs_check_path();
134  void fgroot_check_path();
135  void terrasync_exe_check_path();
136  void terrasync_data_check_path();
137  void custom_scenery_check_path();
138 
139  // "Set" buttons
140  void on_select_fgfsbutton();
141  void on_select_fgrootbutton();
142  void on_select_terrasyncexebutton();
143  void on_select_terrasyncdatabutton();
144  void on_select_customscenerybutton();
145 
146  void reload_lists();
147 
148  // Emit settings when changed
149  void fgfs_set_path();
150  void fgroot_set_path();
151  void terrasyncexe_set_path();
152  void terrasyncdata_set_path();
153  void customscenery_set_path();
154 
155  int randInt(int low, int high);
156 };
157 
158 #endif // CORESETTINGSWIDGET_H
MainObject
The MainObject is an extended QObject, and the main "controller" for FGx.
Definition: mainobject.h:61
XMessageLabel
Definition: xmessagelabel.h:7
XGroupHBox
A QGroupBox with a QHBoxLyout layout.
Definition: xgroupboxes.h:39
CoreSettingsWidget
Definition: coresettingswidget.h:27