Add the proper getErrors() method to CellCreator.

Fix the impossibility of the Exterior Cell creation.
c++11
Stanislav Bas 10 years ago
parent cbb124ab4f
commit 81c7ce5b06

@ -106,3 +106,17 @@ void CSVWorld::CellCreator::cloneMode(const std::string& originId,
mType->setCurrentIndex(0);
}
}
std::string CSVWorld::CellCreator::getErrors() const
{
std::string errors;
if (mType->currentIndex() == 0)
{
errors = GenericCreator::getErrors();
}
else if (getData().hasId(getId()))
{
errors = "The Exterior Cell is already exist";
}
return errors;
}

@ -35,6 +35,10 @@ namespace CSVWorld
virtual void cloneMode(const std::string& originId,
const CSMWorld::UniversalId::Type type);
virtual std::string getErrors() const;
///< Return formatted error descriptions for the current state of the creator. if an empty
/// string is returned, there is no error.
private slots:
void setType (int index);

Loading…
Cancel
Save