Fork me on GitHub
2.15.20
FGx
A cross-platform launcher for FlightGear
XSettingsModel Class Reference

The XSettingsModel is an extended QStandardItemModel, and the main "setting and state" for FGx. More...

#include <xsettingsmodel.h>

Inheritance diagram for XSettingsModel:

Public Types

enum  COLS {
  C_OPTION = 0, C_ENABLED = 1, C_VALUE = 2, C_DEFAULT = 3,
  C_LEVEL = 4, C_DESCRIPTION = 5, C_AREA = 6
}
 

Public Slots

void load_last_profile (QString profile)
 Opens last used profile. More...
 
bool load_profile ()
 Opens Profile Dialog for loading a .ini File. More...
 
QString profile ()
 Path to fgfs executable. More...
 
void read_default_ini ()
 Read Values from ini. More...
 
bool save_profile ()
 Opens Profile Dialog for loading a .ini File. More...
 
void set_enabled (QString option, bool enabled)
 
void set_option (QString option, bool enabled, QString value)
 
void set_value (QString option, QString value)
 

Signals

void updated (QStringList lines)
 
void upx (QString option, bool enabled, QString value)
 

Public Member Functions

void add_option (QString option, bool enabled, QString value, QString preset, int level, QString description, QString area)
 
QString aircraft_path ()
 The path to the /Aircraft directory. More...
 
QString aircraft_path (QString dir)
 Path to the /Aircraft directory with a dir appended. More...
 
QString airports_path ()
 Return the absolute path to the /Airports directory. More...
 
bool custom_scenery_enabled ()
 
QString custom_scenery_path ()
 
bool fgcom_enabled ()
 
QString fgcom_exe_path ()
 Path to fgcom executable. More...
 
QString fgfs_path ()
 Path to fgfs executable. More...
 
QString fgroot ()
 
QString fgroot (QString append_path)
 Path to FG_ROOT with appended path. More...
 
QString fgroot_path ()
 
bool fgroot_use_default ()
 
bool get_ena (QString option)
 
QStringList get_fgfs_args ()
 
QString get_fgfs_command_string ()
 
QStringList get_fgfs_env ()
 
QStringList get_fgfs_list ()
 
QModelIndex get_index (QString option)
 
XOpt get_opt (QString option)
 
QString getLastUsed ()
 
QStringList getSceneryDirs ()
 
QString getx (QString option)
 
QString getx (QString option, bool return_default)
 
QString getx (QString option, QString default_string)
 
QString jsdemo_exe_path ()
 
bool paths_sane ()
 Checks whether the executablem FG_ROOT paths are sane. More...
 
QString scenery_path ()
 Returns the absolute path to the /Scenery file. More...
 
void set_row_bg (int row_idx, QColor bgcolor)
 
void setLastUsed (QString previous)
 
QString terrasync_data_path ()
 Path to terrasync executable. More...
 
QString terrasync_default_path ()
 
bool terrasync_enabled ()
 Sert terrasync enabled/disabled. More...
 
QString terrasync_exe_path ()
 Path to terrasync executable. More...
 
 XSettingsModel (MainObject *mob, QObject *parent=0)
 

Public Attributes

bool _loading
 
MainObjectmainObject
 

Detailed Description

The XSettingsModel is an extended QStandardItemModel, and the main "setting and state" for FGx.

Authors
: Peter Morgan

Definition at line 23 of file xsettingsmodel.h.

Member Enumeration Documentation

Enumerator
C_OPTION 
C_ENABLED 
C_VALUE 
C_DEFAULT 
C_LEVEL 
C_DESCRIPTION 
C_AREA 

Definition at line 28 of file xsettingsmodel.h.

Constructor & Destructor Documentation

XSettingsModel::XSettingsModel ( MainObject mob,
QObject parent = 0 
)
explicit

Definition at line 29 of file xsettingsmodel.cpp.

Member Function Documentation

void XSettingsModel::add_option ( QString  option,
bool  enabled,
QString  value,
QString  preset,
int  level,
QString  description,
QString  area 
)

Definition at line 178 of file xsettingsmodel.cpp.

Referenced by XSettingsModel().

QString XSettingsModel::aircraft_path ( )

The path to the /Aircraft directory.

Returns
fgroot/Aircraft absolute path –fg-aircraft path in case

Definition at line 916 of file xsettingsmodel.cpp.

Referenced by AircraftWidget::AircraftWidget(), AircraftData::import(), AircraftWidget::load_aircraft(), and AircraftWidget::on_tree_selection_changed().

QString XSettingsModel::aircraft_path ( QString  dir)

Path to the /Aircraft directory with a dir appended.

Returns
absolute path.

Definition at line 926 of file xsettingsmodel.cpp.

QString XSettingsModel::airports_path ( )

Return the absolute path to the /Airports directory.

Returns
If TerraSync is enabled, then returns a terrasync folder, otherwise the default.

Definition at line 938 of file xsettingsmodel.cpp.

Referenced by AirportsData::import().

bool XSettingsModel::custom_scenery_enabled ( )

Definition at line 976 of file xsettingsmodel.cpp.

Referenced by get_fgfs_args(), and getSceneryDirs().

QString XSettingsModel::custom_scenery_path ( )
bool XSettingsModel::fgcom_enabled ( )

Definition at line 806 of file xsettingsmodel.cpp.

Referenced by get_fgfs_args().

QString XSettingsModel::fgcom_exe_path ( )

Path to fgcom executable.

Definition at line 816 of file xsettingsmodel.cpp.

Referenced by NetworkWidget::NetworkWidget(), and NetworkWidget::on_upx().

QString XSettingsModel::fgroot ( QString  append_path)

Path to FG_ROOT with appended path.

Returns the path to the FG_ROOT. If the default install is selected, then that is returned, otherwise the custom selected fg_data path. The file is appended with the append_path

Returns
The absolute path.

Definition at line 887 of file xsettingsmodel.cpp.

QString XSettingsModel::fgroot_path ( )
bool XSettingsModel::fgroot_use_default ( )
bool XSettingsModel::get_ena ( QString  option)
QStringList XSettingsModel::get_fgfs_args ( )
QString XSettingsModel::get_fgfs_command_string ( )

Definition at line 684 of file xsettingsmodel.cpp.

Referenced by MainObject::start_fgfs().

QStringList XSettingsModel::get_fgfs_env ( )
QStringList XSettingsModel::get_fgfs_list ( )
QModelIndex XSettingsModel::get_index ( QString  option)

Definition at line 283 of file xsettingsmodel.cpp.

Referenced by XDebugTreeWidget::on_select_a_node().

QStringList XSettingsModel::getSceneryDirs ( )

Definition at line 989 of file xsettingsmodel.cpp.

Referenced by AirportsWidget::load_info_tree().

QString XSettingsModel::getx ( QString  option,
bool  return_default 
)

Definition at line 302 of file xsettingsmodel.cpp.

QString XSettingsModel::getx ( QString  option,
QString  default_string 
)

Definition at line 313 of file xsettingsmodel.cpp.

QString XSettingsModel::jsdemo_exe_path ( )

Definition at line 839 of file xsettingsmodel.cpp.

void XSettingsModel::load_last_profile ( QString  profile)
slot

Opens last used profile.

Definition at line 400 of file xsettingsmodel.cpp.

Referenced by LauncherWindow::initialize(), MenuWidget::on_menu_reset_profile(), and LauncherWindow::reset_profile().

bool XSettingsModel::load_profile ( )
slot

Opens Profile Dialog for loading a .ini File.

Definition at line 460 of file xsettingsmodel.cpp.

Referenced by LauncherWindow::load_profile(), and MenuWidget::on_menu_load_profile().

bool XSettingsModel::paths_sane ( )

Checks whether the executablem FG_ROOT paths are sane.

Returns
true if sane

Definition at line 898 of file xsettingsmodel.cpp.

Referenced by LauncherWindow::initialize().

QString XSettingsModel::profile ( )
slot

Path to fgfs executable.

Definition at line 731 of file xsettingsmodel.cpp.

Referenced by load_last_profile().

void XSettingsModel::read_default_ini ( )
slot

Read Values from ini.

Definition at line 351 of file xsettingsmodel.cpp.

Referenced by LauncherWindow::initialize(), and MenuWidget::on_menu_default_profile().

bool XSettingsModel::save_profile ( )
slot

Opens Profile Dialog for loading a .ini File.

Definition at line 513 of file xsettingsmodel.cpp.

Referenced by LauncherWindow::closeEvent(), LauncherWindow::initialize(), MenuWidget::on_menu_save_profile(), and LauncherWindow::save_profile().

QString XSettingsModel::scenery_path ( )

Returns the absolute path to the /Scenery file.

Returns
The absolute path.

Definition at line 964 of file xsettingsmodel.cpp.

Referenced by get_fgfs_args().

void XSettingsModel::set_enabled ( QString  option,
bool  enabled 
)
slot

Definition at line 231 of file xsettingsmodel.cpp.

void XSettingsModel::set_option ( QString  option,
bool  enabled,
QString  value 
)
slot
void XSettingsModel::set_row_bg ( int  row_idx,
QColor  bgcolor 
)
void XSettingsModel::set_value ( QString  option,
QString  value 
)
slot

Definition at line 257 of file xsettingsmodel.cpp.

void XSettingsModel::setLastUsed ( QString  previous)

Definition at line 448 of file xsettingsmodel.cpp.

Referenced by load_profile(), and save_profile().

QString XSettingsModel::terrasync_data_path ( )
QString XSettingsModel::terrasync_default_path ( )
bool XSettingsModel::terrasync_enabled ( )
QString XSettingsModel::terrasync_exe_path ( )

Path to terrasync executable.

Definition at line 776 of file xsettingsmodel.cpp.

Referenced by CoreSettingsWidget::CoreSettingsWidget(), and CoreSettingsWidget::on_upx().

void XSettingsModel::updated ( QStringList  lines)
signal
void XSettingsModel::upx ( QString  option,
bool  enabled,
QString  value 
)
signal

Member Data Documentation

bool XSettingsModel::_loading

The documentation for this class was generated from the following files: