Updraft  1.0
Open source glider flight visualisation tool.
Updraft::Core::Updraft Class Reference

Top level object of updraft project. More...

#include <updraft.h>

Collaboration diagram for Updraft::Core::Updraft:

List of all members.

Public Member Functions

 Updraft (int argc, char **argv)
 ~Updraft ()
int exec ()
 Executes the application.
void hideSplash ()
 Hides the splash screen when the application is done loading.
QDir getDataDirectory ()
 Gets the data directory.
QDir getResourcesDirectory ()
 Gets the resources directory.
QDir getTranslationDirectory ()
 Gets the directory where the translations are located.
Util::EllipsoidgetUsedEllipsoid ()

Public Attributes

QDir currentDataDirectory
SettingInterfacedataDirectory
MainWindowmainWindow
FileTypeManagerfileTypeManager
PluginManagerpluginManager
SceneManagersceneManager
SettingsManagersettingsManager
TranslationManagertranslationManager
StateSaverstateSaver
QList< Util::Ellipsoid * > ellipsoids
SettingInterfaceusedEllipsoid

Private Slots

void dataDirectoryChanged ()

Private Member Functions

void coreSettings ()
bool checkDataDirectory ()
 Checks and possibly creates the data directory.
void createEllipsoids ()
 Initializes the ellipsoids used for the measurements inside the application.
bool copyDirectory (QDir srcDir, QDir dstDir, int *progress=NULL, QProgressDialog *dialog=NULL)
 An auxilliary method for directory copying.
bool moveDataDirectory (QDir oldDir, QDir newDir, QProgressDialog *dialog)
 Moves the data directory from one location to another.

Private Attributes

SplashScreen splash
bool dataDirectoryChangeInProgress

Detailed Description

Top level object of updraft project.


Constructor & Destructor Documentation

Updraft::Core::Updraft::Updraft ( int  argc,
char **  argv 
)

Member Function Documentation

Checks and possibly creates the data directory.

Returns:
Whether the data directory exists or it was successfully created
bool Updraft::Core::Updraft::copyDirectory ( QDir  srcDir,
QDir  dstDir,
int *  progress = NULL,
QProgressDialog *  dialog = NULL 
) [private]

An auxilliary method for directory copying.

If the destination directory exists, the method fails.

Parameters:
srcDirThe source directory of the copying.
dstDirThe destination directory.
progressPointer to an integer variable that should be increased every time a file is copied. Can be NULL to disable the progressbar feature.
dialogPointer to the progress dialog that displays the progress stored in the progress parameter. It can be NULL, in which case no progress dialog is shown.
Returns:
True when the copying succeeds.

Initializes the ellipsoids used for the measurements inside the application.

Executes the application.

Pull the lever.

Returns:
The return value of the QApplication

Shows main window, and enters event loop.

Gets the data directory.

This directory is saved in settings and its default location is next to the settings file.

Returns:
The application data directory.

Gets the resources directory.

The resources directory is a directory with permanent data that should not be overwritten. It is stored next to the executable file.

Returns:
The resources directory

Gets the directory where the translations are located.

Returns:
The translation directory

Hides the splash screen when the application is done loading.

bool Updraft::Core::Updraft::moveDataDirectory ( QDir  oldDir,
QDir  newDir,
QProgressDialog *  dialog 
) [private]

Moves the data directory from one location to another.

This method first tries to rename the directory and if that fails (e.g. because the source and destination directory would be on different disk partitions), it tries to do a copy using the copyDirectory() method. If the copying succeeds, the data directory setting is updated and the old data directory is deleted.

Parameters:
oldDirThe source data directory that should be copied.
newDirThe QDir object with the name of the new data directory. It should not exist, otherwise, the movement fails.
dialogPoiter to a progress dialog that will be shown, should the copying take too long.
Returns:
True when the movement succeeds.

Member Data Documentation


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines