Emergency 20 Dokumentation  4.1.0
Public Member Functions | Static Public Attributes | Protected Slots | Protected Member Functions | Protected Attributes | List of all members
qsf::editor::NewAssetDialog Class Reference

QSF editor new asset dialog. More...

#include <NewAssetDialog.h>

Inheritance diagram for qsf::editor::NewAssetDialog:
Inheritance graph
[legend]
Collaboration diagram for qsf::editor::NewAssetDialog:
Collaboration graph
[legend]

Public Member Functions

 NewAssetDialog (DialogManager *dialogManager, QWidget *qWidgetParent, bool performDuplicateCheck=true)
 Constructor. More...
 
virtual ~NewAssetDialog ()
 Destructor. More...
 
int startupNewAssetCreation (const std::string &assetTypeName, bool allowCopyFrom=true, GlobalAssetId copyFromGlobalAssetId=getUninitialized< GlobalAssetId >())
 Startup the new asset creation. More...
 
const AssetgetNewAsset () const
 Return the dialog internal new asset instance which is not registered inside the asset system. More...
 
- Public Member Functions inherited from qsf::editor::Dialog
virtual ~Dialog ()
 Destructor. More...
 
ApplicationgetApplication () const
 Return the QSF editor application. More...
 
MainWindowgetMainWindow () const
 Return the main window. More...
 
virtual void setVisible (bool visible) override
 
- Public Member Functions inherited from qsf::Pluginable< DialogManager >
virtual ~Pluginable ()
 Destructor. More...
 
DialogManager & getManager () const
 Return the pluginable manager this pluginable is in. More...
 
- Public Member Functions inherited from qsf::PluginableBase
virtual ~PluginableBase ()
 Destructor. More...
 
template<typename T >
T & getPluginableManager () const
 Return the pluginable manager this pluginable is in. More...
 
- Public Member Functions inherited from qsf::Object
virtual ~Object ()
 Destructor. More...
 
const camp::Class & getCampClass () const
 Return the CAMP class. More...
 
int getPropertyIndexById (const StringHash &propertyId) const
 Return the CAMP property index by using the unique class property ID. More...
 
uint32 getPropertyIdByIndex (int index) const
 Return the unique class property ID with the given index. More...
 
std::string getPropertyNameById (const StringHash &propertyId) const
 Return the CAMP property name by using the unique class property ID. More...
 
const camp::Property * getCampPropertyById (const StringHash &propertyId) const
 Return the CAMP property by using the unique class property ID. More...
 
void setPropertyValuesByString (const std::string &values)
 Set CAMP reflection property values by using a given string. More...
 
void setPropertiesToDefaultValues ()
 Set all CAMP reflection system properties to their default values. More...
 
void serializeToBoostPTree (boost::property_tree::ptree &pTree, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL) const
 
void serializeToBoostPTree (boost::property_tree::ptree &pTree, const camp::Class &campClass, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL) const
 
bool deserializeFromBoostPTree (const boost::property_tree::ptree &pTree, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL)
 
bool deserializeFromBoostPTree (const boost::property_tree::ptree &pTree, const camp::Class &campClass, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL)
 
void serializeToBinarySerializer (BinarySerializer &serializer, SerializationMode mode=MODE_MINIMAL, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL) const
 
void deserializeFromBinarySerializer (BinarySerializer &serializer, SerializationMode mode=MODE_MINIMAL, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL, bool setOverrideState=true)
 
virtual camp::Value getPropertyDefaultValue (const StringHash &propertyId) const
 
virtual PropertyOverrideState getPropertyOverrideState (const StringHash &propertyId) const
 
virtual bool setPropertyOverrideState (const StringHash &propertyId, PropertyOverrideState overrideState)
 
virtual void onPreDeserialize ()
 Called right before the object is deserialized using any of the above methods. Default implementation is empty. More...
 
virtual void onPostDeserialize ()
 Called right after the object was deserialized using any of the above methods. Default implementation is empty. More...
 
virtual ScriptgetAssociatedScript () const
 Return the script instance associated with this object instance. More...
 

Static Public Attributes

static const uint32 PLUGINABLE_ID
 "qsf::editor::NewAssetDialog" unique pluginable dialog ID More...
 

Protected Slots

void onClickedOk (bool checked)
 
void onClickedCancel (bool checked)
 
void onCurrentIndexChangedCopyFrom (int index)
 

Protected Member Functions

virtual void retranslateUi () override
 Retranslate the UI. More...
 
virtual void changeVisibility (bool visible) override
 Change visibility. More...
 
- Protected Member Functions inherited from qsf::editor::Dialog
virtual void readSettings (QSettings &qSettings)
 Read settings by using Qt's "QSettings". More...
 
virtual void writeSettings (QSettings &qSettings)
 Write settings by using Qt's "QSettings". More...
 
virtual bool preChangeVisibility (bool visible)
 Filter method called before "qsf::editor::Dialog::changeVisibility()" is called. More...
 
 Dialog (DialogManager *dialogManager, QWidget *qWidgetParent)
 Constructor. More...
 
virtual void changeEvent (QEvent *qEvent) override
 
- Protected Member Functions inherited from qsf::Pluginable< DialogManager >
 Pluginable (DialogManager *pluginableManager)
 Constructor. More...
 
- Protected Member Functions inherited from qsf::PluginableBase
 PluginableBase (PluginableManager *pluginableManager)
 Constructor. More...
 
- Protected Member Functions inherited from qsf::Object
 Object ()
 Default constructor. More...
 

Protected Attributes

Ui::NewAssetDialog * mUiNewAssetDialog
 UI new asset dialog instance, can be a null pointer, we have to destroy the instance in case we no longer need it. More...
 
std::string mAssetTypeName
 Asset type name of the new asset. More...
 
bool mAllowCopyFrom
 Allow copy from feature? More...
 
GlobalAssetId mCopyFromGlobalAssetId
 Global asset ID of the asset the new asset is a copy from. More...
 
AssetmNewAsset
 Dialog internal new asset instance which is not registered inside the asset system, always valid, destroy the instance in case you no longer need it. More...
 
bool mPerformDuplicateCheck
 

Additional Inherited Members

- Public Types inherited from qsf::Object
enum  PropertyOverrideState { PROPERTY_INVALID, PROPERTY_DEFAULT, PROPERTY_OVERRIDE, PROPERTY_REMOVED }
 
enum  SerializationMethod { SERIALIZE_FLAT, SERIALIZE_COMPLETE, SERIALIZE_DIFFERENTIAL, SERIALIZE_IGNORE_UNKNOWN }
 
enum  SerializationMode { MODE_MINIMAL, MODE_COMPATIBLE }
 

Detailed Description

QSF editor new asset dialog.

Remarks
Think of the new asset dialog as a kind of save file as dialog - which does not write the file (asset in our case) itself, but only collects all necessary information for the dialog caller.
Todo:
  • TODO(co) Make it possible to select project and asset package where the new asset should be in

Constructor & Destructor Documentation

qsf::editor::NewAssetDialog::NewAssetDialog ( DialogManager dialogManager,
QWidget *  qWidgetParent,
bool  performDuplicateCheck = true 
)

Constructor.

Parameters
[in]dialogManagerThe dialog manager this dialog instance is in, no null pointer allowed (the CAMP reflection system does not like references in constructors, so we have to use a pointer instead)
[in]qWidgetParentPointer to parent Qt widget, can be a null pointer (in this case you're responsible for destroying this dialog instance)
[in]performDuplicateCheckWhether to check for duplicate local asset names or not
virtual qsf::editor::NewAssetDialog::~NewAssetDialog ( )
virtual

Destructor.

Member Function Documentation

virtual void qsf::editor::NewAssetDialog::changeVisibility ( bool  visible)
overrideprotectedvirtual

Change visibility.

Parameters
[in]visibleThe new visibility state
Note
  • Unlike "QWidget::setVisible()" this method is only called if there was a real visibility state change
  • The default implementation is empty

Reimplemented from qsf::editor::Dialog.

Reimplemented in qsf::editor::NewMapAssetDialog.

const Asset& qsf::editor::NewAssetDialog::getNewAsset ( ) const

Return the dialog internal new asset instance which is not registered inside the asset system.

Returns
The dialog internal new asset instance which is not registered inside the asset system, do not destroy the instance
void qsf::editor::NewAssetDialog::onClickedCancel ( bool  checked)
protectedslot
void qsf::editor::NewAssetDialog::onClickedOk ( bool  checked)
protectedslot
void qsf::editor::NewAssetDialog::onCurrentIndexChangedCopyFrom ( int  index)
protectedslot
virtual void qsf::editor::NewAssetDialog::retranslateUi ( )
overrideprotectedvirtual

Retranslate the UI.

Note
  • This method is only called in case the dialog is visible
  • The default implementation is empty

Reimplemented from qsf::editor::Dialog.

int qsf::editor::NewAssetDialog::startupNewAssetCreation ( const std::string &  assetTypeName,
bool  allowCopyFrom = true,
GlobalAssetId  copyFromGlobalAssetId = getUninitializedGlobalAssetId >() 
)

Startup the new asset creation.

Parameters
[in]assetTypeNameAsset type name of the new asset
[in]allowCopyFromAllow copy from feature?
[in]copyFromGlobalAssetIdGlobal asset ID of the asset the new asset is a copy from, can be "qsf::getUninitialized<GlobalAssetId>()" if it's no initially known copy and the user has to decide
Returns
Return code of the modal dialog, "QDialog::Rejected" on error. On success, use "qsf::editor::NewAssetDialog::getNewAsset()" in order to get query the new asset medatadata.

Member Data Documentation

bool qsf::editor::NewAssetDialog::mAllowCopyFrom
protected

Allow copy from feature?

std::string qsf::editor::NewAssetDialog::mAssetTypeName
protected

Asset type name of the new asset.

GlobalAssetId qsf::editor::NewAssetDialog::mCopyFromGlobalAssetId
protected

Global asset ID of the asset the new asset is a copy from.

Asset* qsf::editor::NewAssetDialog::mNewAsset
protected

Dialog internal new asset instance which is not registered inside the asset system, always valid, destroy the instance in case you no longer need it.

bool qsf::editor::NewAssetDialog::mPerformDuplicateCheck
protected
Ui::NewAssetDialog* qsf::editor::NewAssetDialog::mUiNewAssetDialog
protected

UI new asset dialog instance, can be a null pointer, we have to destroy the instance in case we no longer need it.

const uint32 qsf::editor::NewAssetDialog::PLUGINABLE_ID
static

"qsf::editor::NewAssetDialog" unique pluginable dialog ID


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