WSF
wizard::RunManager Class Reference

#include <RunManager.hpp>

Collaboration diagram for wizard::RunManager:

Public Member Functions

const QList< QStringList > & GetRecentScenarios () const
void RemoveRecentScenario (const QStringList &aFileList)
void ClearRecentScenarios ()
QString GetMostRecentDirectory ()
bool ReloadScenario ()
bool LoadScenario (const QStringList &aFileList)
void Shutdown ()
const QList< QStringList > & GetRecents ()

Static Public Member Functions

static RunManagerGetInstance ()
static void Create ()
static QString GetScenarioDisplayName (const QStringList &aFileList, bool aDisplayFullPath)

Current project path routines

int mMaxRecentScenarios
QList< QStringList > mRecentScenarios
QStringList mFileList
QString mCurrentProjectPath
 the working directory for the current project
const QString mApplicationPath
 the working directory for the application
static RunManagermInstancePtr = nullptr
QString GetCurrentProjectPath () const noexcept
 Get the current project's path.
bool SetWorkingDirectoryToProject (const QString &aMainScenarioFile) noexcept
bool SetWorkingDirectoryToProject (const std::string &aMainScenarioFile) noexcept
 Overload of SetCurrentProjectDirectory for std::string.
bool SetWorkingDirectoryToProject (const UtPath &aMainScenarioFile) noexcept
 Overload of SetCurrentProjectDirectory for UtPath.
bool IsWorkingDirectoryProject () const noexcept
 RunManager ()
virtual ~RunManager ()
void ReadSettings ()
void WriteHistory ()
void SetMostRecentScenario (const QStringList &aFileList)
static QStringList StandardizeFilePaths (const QStringList &aFileList, bool *aFilesExist=nullptr)

Application path routines

QString GetApplicationPath () const noexcept
bool SetWorkingDirectoryToApplication () noexcept
bool IsWorkingDirectoryApplication () const noexcept

Constructor & Destructor Documentation

◆ RunManager()

wizard::RunManager::RunManager ( )
protected

◆ ~RunManager()

wizard::RunManager::~RunManager ( )
protectedvirtual

References mInstancePtr.

Member Function Documentation

◆ ClearRecentScenarios()

void wizard::RunManager::ClearRecentScenarios ( )

◆ Create()

void wizard::RunManager::Create ( )
static

References mInstancePtr, and RunManager().

Referenced by wizard::Runner::run().

◆ GetApplicationPath()

QString wizard::RunManager::GetApplicationPath ( ) const
noexcept

Get the application path

Returns
the application path

References mApplicationPath.

◆ GetCurrentProjectPath()

QString wizard::RunManager::GetCurrentProjectPath ( ) const
noexcept

Get the current project's path.

References mCurrentProjectPath.

◆ GetInstance()

wizard::RunManager & wizard::RunManager::GetInstance ( )
static

References mInstancePtr.

◆ GetMostRecentDirectory()

QString wizard::RunManager::GetMostRecentDirectory ( )

References mRecentScenarios.

◆ GetRecents()

const QList< QStringList > & wizard::RunManager::GetRecents ( )
inline

References mRecentScenarios.

◆ GetRecentScenarios()

const QList< QStringList > & wizard::RunManager::GetRecentScenarios ( ) const
inline

References mRecentScenarios.

◆ GetScenarioDisplayName()

QString wizard::RunManager::GetScenarioDisplayName ( const QStringList & aFileList,
bool aDisplayFullPath )
static
Note
For window title and recent menu actions/links

Referenced by LoadScenario().

◆ IsWorkingDirectoryApplication()

bool wizard::RunManager::IsWorkingDirectoryApplication ( ) const
noexcept

Determine whether or not the application path is set as the working directory

Returns
whether or not the application path is set as the working directory

References mApplicationPath.

Referenced by SetWorkingDirectoryToApplication().

◆ IsWorkingDirectoryProject()

bool wizard::RunManager::IsWorkingDirectoryProject ( ) const
noexcept

Determine whether or not the current project's path is set as the working directory

Returns
whether or not the current project's path is set as the working directory

References mCurrentProjectPath.

◆ LoadScenario()

bool wizard::RunManager::LoadScenario ( const QStringList & aFileList)

◆ ReadSettings()

void wizard::RunManager::ReadSettings ( )
protected

References mMaxRecentScenarios, mRecentScenarios, and settings().

Referenced by RunManager().

◆ ReloadScenario()

bool wizard::RunManager::ReloadScenario ( )

References LoadScenario(), and mFileList.

◆ RemoveRecentScenario()

void wizard::RunManager::RemoveRecentScenario ( const QStringList & aFileList)

◆ SetMostRecentScenario()

void wizard::RunManager::SetMostRecentScenario ( const QStringList & aFileList)
protected

◆ SetWorkingDirectoryToApplication()

bool wizard::RunManager::SetWorkingDirectoryToApplication ( )
noexcept

Sets the working directory to where the application is

Precondition
mApplicationPath contains the application path for Wizard
Returns
whether or not the write-protection was removed

References IsWorkingDirectoryApplication(), mApplicationPath, and mCurrentProjectPath.

◆ SetWorkingDirectoryToProject() [1/3]

bool wizard::RunManager::SetWorkingDirectoryToProject ( const QString & aMainScenarioFile)
noexcept

Sets the working directory to where the "soon-to-be-current" project is

Parameters
aMainScenarioFileis the "soon-to-be-current" project (or the start-up file for the project)
Postcondition
the application path for Wizard is stored in mApplicationPath
Returns
whether or not the write-protection was set
Note
another side-effect of QDir::setCurrent on Windows is that the working directory is write-protected (just the directory, not the files in the directory)
See also
warlock::RunManager

References mCurrentProjectPath.

Referenced by LoadScenario(), SetWorkingDirectoryToProject(), and SetWorkingDirectoryToProject().

◆ SetWorkingDirectoryToProject() [2/3]

bool wizard::RunManager::SetWorkingDirectoryToProject ( const std::string & aMainScenarioFile)
noexcept

Overload of SetCurrentProjectDirectory for std::string.

References SetWorkingDirectoryToProject().

◆ SetWorkingDirectoryToProject() [3/3]

bool wizard::RunManager::SetWorkingDirectoryToProject ( const UtPath & aMainScenarioFile)
noexcept

Overload of SetCurrentProjectDirectory for UtPath.

References SetWorkingDirectoryToProject().

◆ Shutdown()

void wizard::RunManager::Shutdown ( )

References mInstancePtr.

◆ StandardizeFilePaths()

QStringList wizard::RunManager::StandardizeFilePaths ( const QStringList & aFileList,
bool * aFilesExist = nullptr )
staticprotected

◆ WriteHistory()

void wizard::RunManager::WriteHistory ( )
protected

Member Data Documentation

◆ mApplicationPath

const QString wizard::RunManager::mApplicationPath
protected

the working directory for the application

Referenced by GetApplicationPath(), IsWorkingDirectoryApplication(), RunManager(), and SetWorkingDirectoryToApplication().

◆ mCurrentProjectPath

QString wizard::RunManager::mCurrentProjectPath
protected

◆ mFileList

QStringList wizard::RunManager::mFileList
protected

◆ mInstancePtr

wizard::RunManager * wizard::RunManager::mInstancePtr = nullptr
staticprotected

◆ mMaxRecentScenarios

int wizard::RunManager::mMaxRecentScenarios
protected

◆ mRecentScenarios

QList<QStringList> wizard::RunManager::mRecentScenarios
protected

The documentation for this class was generated from the following files:
Copyrights Multiple, All Rights Reserved