forked from teamnwah/openmw-tes3coop
set default value for topic when cloning info records
This commit is contained in:
parent
8ce87803c4
commit
8499ceb35d
2 changed files with 19 additions and 0 deletions
|
@ -53,6 +53,22 @@ CSVWorld::InfoCreator::InfoCreator (CSMWorld::Data& data, QUndoStack& undoStack,
|
|||
connect (mTopic, SIGNAL (textChanged (const QString&)), this, SLOT (topicChanged()));
|
||||
}
|
||||
|
||||
void CSVWorld::InfoCreator::cloneMode (const std::string& originId,
|
||||
const CSMWorld::UniversalId::Type type)
|
||||
{
|
||||
CSMWorld::IdTable& infoTable =
|
||||
dynamic_cast<CSMWorld::IdTable&> (*getData().getTableModel (getCollectionId()));
|
||||
|
||||
int topicColumn = infoTable.findColumnIndex (
|
||||
getCollectionId().getType()==CSMWorld::UniversalId::Type_TopicInfos ?
|
||||
CSMWorld::Columns::ColumnId_Topic : CSMWorld::Columns::ColumnId_Journal);
|
||||
|
||||
mTopic->setText (
|
||||
infoTable.data (infoTable.getModelIndex (originId, topicColumn)).toString());
|
||||
|
||||
GenericCreator::cloneMode (originId, type);
|
||||
}
|
||||
|
||||
void CSVWorld::InfoCreator::reset()
|
||||
{
|
||||
mTopic->setText ("");
|
||||
|
|
|
@ -27,6 +27,9 @@ namespace CSVWorld
|
|||
InfoCreator (CSMWorld::Data& data, QUndoStack& undoStack,
|
||||
const CSMWorld::UniversalId& id);
|
||||
|
||||
virtual void cloneMode (const std::string& originId,
|
||||
const CSMWorld::UniversalId::Type type);
|
||||
|
||||
virtual void reset();
|
||||
|
||||
virtual std::string getErrors() const;
|
||||
|
|
Loading…
Reference in a new issue