Crossfire Server, Trunk
|
#include <MessageFile.h>
Public Member Functions | |
void | copy (const MessageFile *other) |
virtual QString | displayName () const override |
MessageFile * | duplicate () const |
bool | isModified () const |
const QString & | location () const |
QList< CREMapInformation * > & | maps () |
MessageFile (AssetWrapper *parent, const QString &path) | |
bool | parseFile () |
const QString & | path () const |
QList< MessageRule * > & | rules () |
void | save () |
void | setLocation (const QString &location) |
void | setModified (bool modified=true) |
void | setPath (const QString &path) |
virtual PossibleUse | uses (const AssetWrapper *asset, std::string &) const override |
virtual | ~MessageFile () |
Public Member Functions inherited from AssetWrapper | |
AssetWrapper (AssetWrapper *parent, const QString &panelName="empty") | |
virtual bool | canDrag () const |
virtual bool | canDrop (const QMimeData *, int) const |
virtual AssetWrapper * | child (int) |
virtual int | childIndex (AssetWrapper *) |
virtual int | childrenCount () const |
virtual QIcon | displayIcon () const |
virtual QString | displayPanelName () const |
AssetWrapper * | displayParent () const |
virtual void | drag (QMimeData *) const |
virtual void | drop (const QMimeData *, int) |
virtual void | fillMenu (QMenu *) |
void | markModified (ChangeType change, int extra=0) |
AssetWrapper * | self () |
void | setDisplayParent (AssetWrapper *parent) |
virtual | ~AssetWrapper () override |
Properties | |
QString | location |
QString | path |
Properties inherited from AssetWrapper | |
QString | displayName |
AssetWrapper | self |
Private Attributes | |
bool | myIsModified |
QString | myLocation |
QList< CREMapInformation * > | myMaps |
QString | myPath |
QList< MessageRule * > | myRules |
Additional Inherited Members | |
Public Types inherited from AssetWrapper | |
enum | ChangeType { AssetUpdated, BeforeChildAdd, AfterChildAdd, BeforeChildRemove, AfterChildRemove, BeforeLayoutChange, AfterLayoutChange } |
enum | PossibleUse { Uses, ChildrenMayUse, DoesntUse } |
Public Slots inherited from AssetWrapper | |
virtual void | removeChild (AssetWrapper *) |
Signals inherited from AssetWrapper | |
void | dataModified (AssetWrapper *asset, AssetWrapper::ChangeType type, int extra) |
void | modified () |
Static Public Member Functions inherited from AssetWrapper | |
static bool | compareByDisplayName (const AssetWrapper *left, const AssetWrapper *right) |
Static Public Attributes inherited from AssetWrapper | |
static const char * | tipProperty = "_cre_internal" |
Protected Member Functions inherited from AssetWrapper | |
virtual void | wasModified (AssetWrapper *asset, ChangeType type, int extra) |
Protected Attributes inherited from AssetWrapper | |
QString | myPanelName |
AssetWrapper * | myParent |
One NPC dialog file, mostly a collection of MessageRule. Once a MessageFile is created, parseFile() must be called.
Definition at line 68 of file MessageFile.h.
MessageFile::MessageFile | ( | AssetWrapper * | parent, |
const QString & | path | ||
) |
Standard constructor.
parent | parent of this item. |
path | NPC dialog path. |
Definition at line 127 of file MessageFile.cpp.
References myIsModified, myPath, and path.
Referenced by duplicate().
|
virtual |
Definition at line 132 of file MessageFile.cpp.
References myRules.
void MessageFile::copy | ( | const MessageFile * | other | ) |
Definition at line 147 of file MessageFile.cpp.
References myLocation, myMaps, myPath, myRules, and npc_dialog::rule.
Referenced by duplicate(), and CREMessagePanel::onReset().
|
inlineoverridevirtual |
MessageFile * MessageFile::duplicate | ( | ) | const |
Definition at line 137 of file MessageFile.cpp.
References copy(), MessageFile(), myLocation, myMaps, myPath, myRules, and npc_dialog::rule.
Referenced by CREMessagePanel::updateItem().
bool MessageFile::isModified | ( | ) | const |
Definition at line 389 of file MessageFile.cpp.
References myIsModified.
const QString& MessageFile::location | ( | ) | const |
QList< CREMapInformation * > & MessageFile::maps | ( | ) |
Definition at line 271 of file MessageFile.cpp.
References myMaps.
Referenced by CREMessagePanel::updateItem().
bool MessageFile::parseFile | ( | ) |
Parse the message file.
Definition at line 203 of file MessageFile.cpp.
References convert(), navar-midane_time::data, Settings::datadir, mad_mage_user::file, lists, Settings::mapdir, myLocation, myPath, myRules, ring_occidental_mages::r, npc_dialog::rule, rules(), settings, and autojail::value.
const QString& MessageFile::path | ( | ) | const |
QList< MessageRule * > & MessageFile::rules | ( | ) |
Definition at line 266 of file MessageFile.cpp.
References myRules.
Referenced by CREMessageItemModel::data(), CREMessageItemModel::duplicateRow(), CREMessageItemModel::insertRows(), CREMessageItemModel::moveUpDown(), CREMessagePanel::onDuplicate(), CREMessagePanel::onMoveDown(), CREMessagePanel::onMoveUp(), parseFile(), CREMessageItemModel::removeRows(), CREMessageItemModel::rowCount(), save(), CREMessageItemModel::setData(), and CREMessageItemModel::setSelectedRule().
void MessageFile::save | ( | ) |
Definition at line 349 of file MessageFile.cpp.
References convert(), navar-midane_time::data, Settings::datadir, mad_mage_user::file, Settings::mapdir, myIsModified, myLocation, myPath, myRules, npc_dialog::rule, rules(), setModified(), and settings.
void MessageFile::setLocation | ( | const QString & | location | ) |
Definition at line 177 of file MessageFile.cpp.
References location, myLocation, and setModified().
void MessageFile::setModified | ( | bool | modified = true | ) |
Definition at line 394 of file MessageFile.cpp.
References AssetWrapper::modified(), and myIsModified.
Referenced by CREMessageItemModel::duplicateRow(), CREMessageItemModel::insertRows(), CREMessageItemModel::moveUpDown(), CREMessageItemModel::removeRows(), save(), CREMessageItemModel::setData(), setLocation(), and setPath().
void MessageFile::setPath | ( | const QString & | path | ) |
Definition at line 168 of file MessageFile.cpp.
References myPath, path, and setModified().
|
overridevirtual |
Reimplemented from AssetWrapper.
Definition at line 399 of file MessageFile.cpp.
References AssetWrapper::DoesntUse, guildoracle::list, myRules, npc_dialog::rule, and AssetWrapper::Uses.
|
private |
Definition at line 110 of file MessageFile.h.
Referenced by isModified(), MessageFile(), save(), and setModified().
|
private |
Definition at line 112 of file MessageFile.h.
Referenced by copy(), duplicate(), parseFile(), save(), and setLocation().
|
private |
Definition at line 114 of file MessageFile.h.
Referenced by copy(), duplicate(), and maps().
|
private |
Definition at line 111 of file MessageFile.h.
Referenced by copy(), displayName(), duplicate(), MessageFile(), parseFile(), save(), and setPath().
|
private |
Definition at line 113 of file MessageFile.h.
Referenced by copy(), duplicate(), parseFile(), rules(), save(), uses(), and ~MessageFile().
|
readwrite |
Definition at line 72 of file MessageFile.h.
Referenced by setLocation().
|
readwrite |
Definition at line 71 of file MessageFile.h.
Referenced by MessageFile(), setPath(), and CREMessagePanel::updateItem().