Crossfire Server, Trunk
AssetOriginAndCreationDialog Class Reference

#include <AssetOriginAndCreationDialog.h>

+ Inheritance diagram for AssetOriginAndCreationDialog:
+ Collaboration diagram for AssetOriginAndCreationDialog:

Public Types

enum  Mode { CreateAsset, DefineOrigin }
 
enum  Type { Quest = 0, Treasure = 1, Archetype = 2 }
 

Public Member Functions

 AssetOriginAndCreationDialog (Type type, Mode mode, const QString &code, const std::vector< std::string > &origins, const std::vector< std::string > &assets)
 
QString code () const
 
QString file () const
 

Private Member Functions

void validate ()
 

Private Attributes

std::vector< std::string > myAssets
 
QLineEdit * myCode
 
QComboBox * myExistingFile
 
QLineEdit * myNewFile
 
QString myRootDirectory
 
Type myType
 

Detailed Description

Helper dialog to input origin of an asset, and maybe create a new one.

Definition at line 21 of file AssetOriginAndCreationDialog.h.

Member Enumeration Documentation

◆ Mode

Enumerator
CreateAsset 
DefineOrigin 

Definition at line 25 of file AssetOriginAndCreationDialog.h.

◆ Type

Enumerator
Quest 
Treasure 
Archetype 

Definition at line 24 of file AssetOriginAndCreationDialog.h.

Constructor & Destructor Documentation

◆ AssetOriginAndCreationDialog()

AssetOriginAndCreationDialog::AssetOriginAndCreationDialog ( Type  type,
Mode  mode,
const QString &  code,
const std::vector< std::string > &  origins,
const std::vector< std::string > &  assets 
)

Standard constructor.

Parameters
typeasset type, to adjust messages.
modedialog mode to operate in.
codeasset code, used in DefineOrigin mode only.
originslist of existing files for the asset.
assetsexisting assets.

Definition at line 44 of file AssetOriginAndCreationDialog.cpp.

References addTitles, code(), CreateAsset, Settings::datadir, DefineOrigin, extensions, isArch, Settings::mapdir, myCode, myExistingFile, myNewFile, myRootDirectory, myType, names, originTitles, settings, is_valid_types_gen::type, and validate().

+ Here is the call graph for this function:

Member Function Documentation

◆ code()

QString AssetOriginAndCreationDialog::code ( ) const
inline

Definition at line 37 of file AssetOriginAndCreationDialog.h.

References myCode.

Referenced by ArchetypesWrapper::addArchetype(), QuestsWrapper::addQuest(), and AssetOriginAndCreationDialog().

+ Here is the caller graph for this function:

◆ file()

QString AssetOriginAndCreationDialog::file ( ) const
inline

Definition at line 38 of file AssetOriginAndCreationDialog.h.

References myExistingFile, and myNewFile.

Referenced by ArchetypesWrapper::addArchetype(), QuestsWrapper::addQuest(), and ResourcesManager::saveTreasures().

+ Here is the caller graph for this function:

◆ validate()

void AssetOriginAndCreationDialog::validate ( )
private

Check if data is complete. If yes then close the dialog, else explain to the user what is wrong.

Definition at line 109 of file AssetOriginAndCreationDialog.cpp.

References altar_valkyrie::accept(), extensions, myAssets, myCode, myNewFile, myRootDirectory, myType, and names.

Referenced by AssetOriginAndCreationDialog().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ myAssets

std::vector<std::string> AssetOriginAndCreationDialog::myAssets
private

Existing assets, to avoid duplication.

Definition at line 46 of file AssetOriginAndCreationDialog.h.

Referenced by validate().

◆ myCode

QLineEdit* AssetOriginAndCreationDialog::myCode
private

Quest code.

Definition at line 43 of file AssetOriginAndCreationDialog.h.

Referenced by AssetOriginAndCreationDialog(), code(), and validate().

◆ myExistingFile

QComboBox* AssetOriginAndCreationDialog::myExistingFile
private

Selected current file.

Definition at line 44 of file AssetOriginAndCreationDialog.h.

Referenced by AssetOriginAndCreationDialog(), and file().

◆ myNewFile

QLineEdit* AssetOriginAndCreationDialog::myNewFile
private

New file path.

Definition at line 45 of file AssetOriginAndCreationDialog.h.

Referenced by AssetOriginAndCreationDialog(), file(), and validate().

◆ myRootDirectory

QString AssetOriginAndCreationDialog::myRootDirectory
private

Base path for this asset type.

Definition at line 42 of file AssetOriginAndCreationDialog.h.

Referenced by AssetOriginAndCreationDialog(), and validate().

◆ myType

Type AssetOriginAndCreationDialog::myType
private

Asset type.

Definition at line 41 of file AssetOriginAndCreationDialog.h.

Referenced by AssetOriginAndCreationDialog(), and validate().


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