![]() |
Crossfire Resources Editor
|
Helper dialog to input origin of an asset, and maybe create a new one. More...
#include <AssetOriginAndCreationDialog.h>
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) | |
Standard constructor. More... | |
QString | code () const |
QString | file () const |
Private Member Functions | |
void | validate () |
Check if data is complete. More... | |
Private Attributes | |
std::vector< std::string > | myAssets |
Existing assets, to avoid duplication. More... | |
QLineEdit * | myCode |
Quest code. More... | |
QComboBox * | myExistingFile |
Selected current file. More... | |
QLineEdit * | myNewFile |
New file path. More... | |
QString | myRootDirectory |
Base path for this asset type. More... | |
Type | myType |
Asset type. More... | |
Helper dialog to input origin of an asset, and maybe create a new one.
Definition at line 21 of file AssetOriginAndCreationDialog.h.
Enumerator | |
---|---|
CreateAsset | |
DefineOrigin |
Definition at line 25 of file AssetOriginAndCreationDialog.h.
Enumerator | |
---|---|
Quest | |
Treasure | |
Archetype |
Definition at line 24 of file AssetOriginAndCreationDialog.h.
AssetOriginAndCreationDialog::AssetOriginAndCreationDialog | ( | Type | type, |
Mode | mode, | ||
const QString & | code, | ||
const std::vector< std::string > & | origins, | ||
const std::vector< std::string > & | assets | ||
) |
Standard constructor.
type | asset type, to adjust messages. |
mode | dialog mode to operate in. |
code | asset code, used in DefineOrigin mode only. |
origins | list of existing files for the asset. |
assets | existing assets. |
Definition at line 44 of file AssetOriginAndCreationDialog.cpp.
References addTitles, code(), CreateAsset, DefineOrigin, extensions, isArch, myCode, myExistingFile, myNewFile, myRootDirectory, myType, names, originTitles, and validate().
|
inline |
Definition at line 37 of file AssetOriginAndCreationDialog.h.
References myCode.
Referenced by ArchetypesWrapper::addArchetype(), QuestsWrapper::addQuest(), TreasuresWrapper::addTreasureList(), and AssetOriginAndCreationDialog().
|
inline |
Definition at line 38 of file AssetOriginAndCreationDialog.h.
References myExistingFile, and myNewFile.
Referenced by ArchetypesWrapper::addArchetype(), QuestsWrapper::addQuest(), TreasuresWrapper::addTreasureList(), and ResourcesManager::saveTreasures().
|
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 extensions, myAssets, myCode, myNewFile, myRootDirectory, myType, and names.
Referenced by AssetOriginAndCreationDialog().
|
private |
Existing assets, to avoid duplication.
Definition at line 46 of file AssetOriginAndCreationDialog.h.
Referenced by validate().
|
private |
Quest code.
Definition at line 43 of file AssetOriginAndCreationDialog.h.
Referenced by AssetOriginAndCreationDialog(), code(), and validate().
|
private |
Selected current file.
Definition at line 44 of file AssetOriginAndCreationDialog.h.
Referenced by AssetOriginAndCreationDialog(), and file().
|
private |
New file path.
Definition at line 45 of file AssetOriginAndCreationDialog.h.
Referenced by AssetOriginAndCreationDialog(), file(), and validate().
|
private |
Base path for this asset type.
Definition at line 42 of file AssetOriginAndCreationDialog.h.
Referenced by AssetOriginAndCreationDialog(), and validate().
|
private |
Asset type.
Definition at line 41 of file AssetOriginAndCreationDialog.h.
Referenced by AssetOriginAndCreationDialog(), and validate().