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

The XSettings is an extended QSetttings, but also includes most to the FGx configuration. More...

#include <xsettings.h>

Inheritance diagram for XSettings:

Public Member Functions

QString default_fgcom_no ()
 
QString default_fgcom_port ()
 
QString fgcom_exe_path ()
 
QString fgcom_no ()
 
QString fgcom_port ()
 
QString fgx_path ()
 
void restoreSplitter (QSplitter *splitter)
 Restores a splitters dimensions. More...
 
void restoreWindow (QWidget *widget)
 Restores a size window position. More...
 
void saveSplitter (QSplitter *splitter)
 Saves a splitters dimensions. More...
 
void saveWindow (QWidget *widget)
 Saves a window's size and position. More...
 
QString style_current ()
 return the currently selected style or the default More...
 
QString style_default ()
 
 XSettings (QObject *parent=0)
 

Static Public Member Functions

static QString cache_dir ()
 shortcut to cache directory More...
 
static bool dev_mode ()
 The "Special Developer Flag". More...
 
static QString fgx_current_dir ()
 this should be used, yves ? More...
 
static QString log_file_path ()
 

Private Member Functions

QString _windowName (QWidget *widget)
 Extracts the settings_namespace property. More...
 

Detailed Description

The XSettings is an extended QSetttings, but also includes most to the FGx configuration.

The general idea of the class is to provide one central place to access settings. It is for this reason that methods are created to hide some of the completities, such as aircraft_path().

Definition at line 15 of file xsettings.h.

Constructor & Destructor Documentation

XSettings::XSettings ( QObject parent = 0)
explicit

Definition at line 29 of file xsettings.cpp.

Member Function Documentation

QString XSettings::_windowName ( QWidget widget)
private

Extracts the settings_namespace property.

Definition at line 121 of file xsettings.cpp.

Referenced by restoreWindow(), and saveWindow().

QString XSettings::cache_dir ( )
static

shortcut to cache directory

Definition at line 152 of file xsettings.cpp.

Referenced by XBrowser::XBrowser().

QString XSettings::default_fgcom_no ( )
QString XSettings::default_fgcom_port ( )
bool XSettings::dev_mode ( )
static

The "Special Developer Flag".

This is one of those magic workaround functions to detect if in development mode. The functions detects if the file "DEV_MODE.txt" exists in the current directory. eg in fgx/src/DEV_MODE.txt The precense of this file make a few things happen.. such as redirecting login to shell Reading stuff from files in stead of resources etc..

Returns
developer mode enabled

Definition at line 138 of file xsettings.cpp.

Referenced by main().

QString XSettings::fgcom_exe_path ( )
QString XSettings::fgcom_no ( )
QString XSettings::fgcom_port ( )
QString XSettings::fgx_current_dir ( )
static

this should be used, yves ?

Definition at line 145 of file xsettings.cpp.

Referenced by dev_mode().

QString XSettings::fgx_path ( )

Definition at line 51 of file xsettings.cpp.

static QString XSettings::log_file_path ( )
static
void XSettings::restoreSplitter ( QSplitter *  splitter)

Restores a splitters dimensions.

Todo:
check for settings_namespace
Bug:
no namespace problem

Definition at line 76 of file xsettings.cpp.

Referenced by AircraftWidget::AircraftWidget().

void XSettings::saveSplitter ( QSplitter *  splitter)

Saves a splitters dimensions.

The settings_namespace property needs to be set

Todo:
check for settings_namespace
Bug:
no namespace problem

Definition at line 65 of file xsettings.cpp.

Referenced by AircraftWidget::on_splitter_moved().

QString XSettings::style_current ( )

return the currently selected style or the default

Definition at line 39 of file xsettings.cpp.

Referenced by MainObject::MainObject().

QString XSettings::style_default ( )

Definition at line 43 of file xsettings.cpp.

Referenced by style_current().


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