FGx  1
mainobject.h
1 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-
2 // FGx FlightGear Launcher // mainobject.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 MAINOBJECT_H
10 #define MAINOBJECT_H
11 
12 #include <QtCore/QObject>
13 
14 
15 #include <QtGui/QSystemTrayIcon>
16 #include <QtGui/QAction>
17 #include <QtGui/QMenu>
18 #include <QtGui/QMenuBar>
19 #include <QtGui/QLabel>
20 #include <QtGui/QWidgetAction>
21 
22 #include "xobjects/xsettings.h"
23 
24 #include "xobjects/xsettingsmodel.h"
25 class XSettingsModel;
26 
27 #include "xobjects/xprocess.h"
28 class XProcess;
29 
30 
31 
32 #include "launcher/launcherwindow.h"
33 class LauncherWindow;
34 
35 #include "mpmap/mpmapwidget.h"
36 #include "mpmap/mpmapxwidget.h"
37 #include "logs/viewlogswidget.h"
38 #include "props/propstreewidget.h"
39 #include "xwidgets/fgxdebugwidget.h"
40 
41 //class MpMapWidget;
42 //class MpMapXWidget;
43 class ViewLogsWidget;
44 class PropsTreeWidget;
45 class FgxDebugWidget;
46 
47 
61 class MainObject : public QObject
62 {
63 Q_OBJECT
64 public:
65  explicit MainObject(QObject *parent = 0);
66  ~MainObject();
67 
68  static int runningOs();
69 
70  bool debug_mode;
71 
72  static QString log_file_path();
73 
74  QString data_file(QString file_name);
75  QString default_file(QString file_name);
76 
77  static QString temp_dir();
78  static QString temp_dir(QString append_path);
79 
80  XSettings *settings;
81  XSettingsModel *X;
82 
83 
84  LauncherWindow *launcherWindow;
85  //MpMapWidget *mpMapWidget;
86  //MpMapXWidget *mpMapXWidget;
87 
88  ViewLogsWidget *viewLogsWidget;
89  PropsTreeWidget *propertiesBrowser;
90  FgxDebugWidget *fgxDebugWidget;
91 
92  XProcess *processFgFs;
93  XProcess *processTerraSync;
94  XProcess *processFgCom;
95 
96 
97  QSystemTrayIcon *trayIcon;
98  QMenu *popupMenu;
99 
100  QWidgetAction *actionCallsign;
101  QLabel *lblCallsign;
102 
103  QAction *actionLauncher;
104  QAction *actionMpMap;
105  QAction *actionPropsBrowser;
106  QAction *actionSetupWizard;
107 
108  QAction *actionViewLogs;
109  QAction *actionViewFgxDebug;
110  QAction *actionBrowserMap;
111 
112  QAction *actionQuit;
113 
114  QString get_fgfs_command();
115  QStringList get_fgfs_args();
116  QStringList get_env();
117 
118 signals:
119  void show_settings(int);
120  void reload_paths();
121  void on_debug_mode(bool enabled);
122  void setx(QString option, bool enabled, QString value);
123 
124 public slots:
125 
126  void initialize();
127 
128  void on_tray_icon(QSystemTrayIcon::ActivationReason reason);
129 
130  void on_launcher();
131  void on_browsermap();
132  void on_properties_browser();
133 
134  void on_view_logs();
135  void clear_log(QString log_name);
136  void add_log(QString log_name, QString data);
137 
138  void start_all();
139  void start_fgfs();
140  void start_fgcom();
141  void start_terrasync();
142  void stop_all();
143 
144  void on_quit();
145 
146  void on_view_fgx_debug();
147  void set_debug_mode(bool);
148 
149  void on_action_open_url(QAction*);
150 
151  void on_about_qt();
152  void on_about_fgx();
153 
154  void on_upx(QString option, bool enabled, QString value);
155 
156 };
157 
158 
159 
160 
161 
162 #endif // MAINOBJECT_H
Definition: xprocess.h:20
static QString log_file_path()
Log File.
Definition: mainobject.cpp:425
The XSettings is an extended QSetttings, but also includes most to the FGx configuration.
Definition: xsettings.h:14
The MainObject is an extended QObject, and the main "controller" for FGx.
Definition: mainobject.h:61
static int runningOs()
What OS is running.
Definition: mainobject.cpp:404
Definition: propstreewidget.h:34
The XSettingsModel is an extended QStandardItemModel, and the main "setting and state" for FGx...
Definition: xsettingsmodel.h:23
static QString temp_dir()
location if temp directoty , os specific
Definition: mainobject.cpp:451
Definition: launcherwindow.h:60
Definition: viewlogswidget.h:22
QString data_file(QString file_name)
Path to a data file eg data_file("airports.txt")
Definition: mainobject.cpp:475
Definition: fgxdebugwidget.h:26