1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 17:19:56 +00:00

Close the creator when the original record is removed (in clone mode)

This commit is contained in:
Stanislav Bas 2015-06-27 12:26:19 +03:00 committed by cc9cii
parent 3a6f708405
commit 9ef3dced90
2 changed files with 13 additions and 0 deletions

View file

@ -161,6 +161,8 @@ CSVWorld::GenericCreator::GenericCreator (CSMWorld::Data& data, QUndoStack& undo
connect (mCreate, SIGNAL (clicked (bool)), this, SLOT (create()));
connect (mId, SIGNAL (textChanged (const QString&)), this, SLOT (textChanged (const QString&)));
connect (&mData, SIGNAL (idListChanged()), this, SLOT (dataIdListChanged()));
}
void CSVWorld::GenericCreator::setEditLock (bool locked)
@ -291,3 +293,12 @@ void CSVWorld::GenericCreator::scopeChanged (int index)
update();
updateNamespace();
}
void CSVWorld::GenericCreator::dataIdListChanged()
{
// If the original ID of cloned record was removed, cancel the creator
if (mCloneMode && !mData.hasId(mClonedId))
{
emit done();
}
}

View file

@ -113,6 +113,8 @@ namespace CSVWorld
void create();
void scopeChanged (int index);
void dataIdListChanged();
};
}