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

c++11
Stanislav Bas 10 years ago
parent cad4ce4e0f
commit cbb124ab4f

@ -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();
}
}

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

Loading…
Cancel
Save