Fork me on GitHub
2.15.20
FGx
A cross-platform launcher for FlightGear
xsettingsmodel.h
Go to the documentation of this file.
1 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-
2 // FGx FlightGear Launcher // xsettingsmodel.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 XSETTINGSMODEL_H
10 #define XSETTINGSMODEL_H
11 
12 #include <QString>
13 #include <QStringList>
14 
15 #include <QStandardItemModel>
16 #include <QModelIndex>
17 
18 #include "xobjects/xopt.h"
19 #include "xobjects/mainobject.h"
20 class MainObject;
21 
22 
24 {
25 Q_OBJECT
26 public:
27 
28  enum COLS{
29  C_OPTION = 0,
30  C_ENABLED = 1,
31  C_VALUE = 2,
32  C_DEFAULT = 3,
33  C_LEVEL = 4,
35  C_AREA = 6
36  };
37 
38  explicit XSettingsModel(MainObject *mob, QObject *parent = 0);
39 
41  bool _loading;
42 
43  void add_option(QString option, bool enabled, QString value, QString preset, int level, QString description, QString area);
44 
45  QModelIndex get_index(QString option);
46 
47  QString getx(QString option);
48  QString getx(QString option, bool return_default);
49  QString getx(QString option, QString default_string);
50 
51  XOpt get_opt(QString option);
52  bool get_ena(QString option);
53 
54 
55  QStringList get_fgfs_args();
56  QStringList get_fgfs_list();
57  QString get_fgfs_command_string();
58  QStringList get_fgfs_env();
59 
60  QString terrasync_default_path();
61  QString fgfs_path();
62 
63 
64  QString fgroot();
65  QString fgroot(QString append_path);
66  bool fgroot_use_default();
67  QString fgroot_path();
68 
69  QString aircraft_path();
70  QString aircraft_path(QString dir);
71 
72  QString airports_path();
73 
74  QString scenery_path();
75 
76  bool terrasync_enabled();
77  QString terrasync_exe_path();
78  QString terrasync_data_path();
79 
81  QString custom_scenery_path();
82 
83  bool fgcom_enabled();
84  QString fgcom_exe_path();
85  QString jsdemo_exe_path();
86 
87 
88  bool paths_sane();
89 
90  void set_row_bg(int row_idx, QColor bgcolor);
91 
92  QString getLastUsed();
93  void setLastUsed(QString previous);
94 
95  QStringList getSceneryDirs(); // return list of 'valid' scenery directories
96 
97 signals:
98  void upx(QString option, bool enabled, QString value);
99  void updated(QStringList lines);
100 
101 
102 public slots:
103 
104  void set_option(QString option, bool enabled, QString value);
105  void set_enabled(QString option, bool enabled);
106  void set_value(QString option, QString value);
107 
108  QString profile();
109  void read_default_ini();
110  void load_last_profile(QString profile);
111  bool load_profile(); // true if load done, else false
112  bool save_profile(); // true if save done, else false
113 };
114 
115 #endif // XSETTINGSMODEL_H
void set_option(QString option, bool enabled, QString value)
QString terrasync_default_path()
QStringList getSceneryDirs()
QString jsdemo_exe_path()
bool paths_sane()
Checks whether the executablem FG_ROOT paths are sane.
QStringList get_fgfs_args()
The MainObject is an extended QObject, and the main "controller" for FGx.
Definition: mainobject.h:66
bool load_profile()
Opens Profile Dialog for loading a .ini File.
QString fgcom_exe_path()
Path to fgcom executable.
The XSettingsModel is an extended QStandardItemModel, and the main "setting and state" for FGx...
QString scenery_path()
Returns the absolute path to the /Scenery file.
void add_option(QString option, bool enabled, QString value, QString preset, int level, QString description, QString area)
QString get_fgfs_command_string()
bool fgroot_use_default()
Definition: xopt.h:14
bool get_ena(QString option)
void set_enabled(QString option, bool enabled)
QString aircraft_path()
The path to the /Aircraft directory.
void load_last_profile(QString profile)
Opens last used profile.
QString profile()
Path to fgfs executable.
void set_value(QString option, QString value)
void read_default_ini()
Read Values from ini.
QStringList get_fgfs_env()
QString getLastUsed()
QString fgroot_path()
QString fgfs_path()
Path to fgfs executable.
void upx(QString option, bool enabled, QString value)
void set_row_bg(int row_idx, QColor bgcolor)
bool save_profile()
Opens Profile Dialog for loading a .ini File.
void updated(QStringList lines)
QString airports_path()
Return the absolute path to the /Airports directory.
QStringList get_fgfs_list()
bool custom_scenery_enabled()
QModelIndex get_index(QString option)
bool terrasync_enabled()
Sert terrasync enabled/disabled.
QString terrasync_exe_path()
Path to terrasync executable.
XSettingsModel(MainObject *mob, QObject *parent=0)
QString terrasync_data_path()
Path to terrasync executable.
QString custom_scenery_path()
XOpt get_opt(QString option)
void setLastUsed(QString previous)
MainObject * mainObject
QString getx(QString option)