|
|
|
@ -8,6 +8,9 @@
|
|
|
|
|
#include <QSpinBox>
|
|
|
|
|
#include <QLabel>
|
|
|
|
|
|
|
|
|
|
#include "../../model/world/commands.hpp"
|
|
|
|
|
#include "../../model/world/idtree.hpp"
|
|
|
|
|
|
|
|
|
|
std::string CSVWorld::CellCreator::getId() const
|
|
|
|
|
{
|
|
|
|
|
if (mType->currentIndex()==0)
|
|
|
|
@ -20,6 +23,15 @@ std::string CSVWorld::CellCreator::getId() const
|
|
|
|
|
return stream.str();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CSVWorld::CellCreator::configureCreateCommand(CSMWorld::CreateCommand& command) const
|
|
|
|
|
{
|
|
|
|
|
CSMWorld::IdTree *model = dynamic_cast<CSMWorld::IdTree *>(getData().getTableModel(getCollectionId()));
|
|
|
|
|
Q_ASSERT(model != NULL);
|
|
|
|
|
int parentIndex = model->findColumnIndex(CSMWorld::Columns::ColumnId_Cell);
|
|
|
|
|
int index = model->findNestedColumnIndex(parentIndex, CSMWorld::Columns::ColumnId_Interior);
|
|
|
|
|
command.addNestedValue(parentIndex, index, mType->currentIndex() == 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CSVWorld::CellCreator::CellCreator (CSMWorld::Data& data, QUndoStack& undoStack,
|
|
|
|
|
const CSMWorld::UniversalId& id)
|
|
|
|
|
: GenericCreator (data, undoStack, id)
|
|
|
|
@ -95,9 +107,16 @@ void CSVWorld::CellCreator::cloneMode(const std::string& originId,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CSVWorld::CellCreator::toggleWidgets(bool active)
|
|
|
|
|
std::string CSVWorld::CellCreator::getErrors() const
|
|
|
|
|
{
|
|
|
|
|
CSVWorld::GenericCreator::toggleWidgets(active);
|
|
|
|
|
mType->setEnabled(active);
|
|
|
|
|
std::string errors;
|
|
|
|
|
if (mType->currentIndex() == 0)
|
|
|
|
|
{
|
|
|
|
|
errors = GenericCreator::getErrors();
|
|
|
|
|
}
|
|
|
|
|
else if (getData().hasId(getId()))
|
|
|
|
|
{
|
|
|
|
|
errors = "The Exterior Cell is already exist";
|
|
|
|
|
}
|
|
|
|
|
return errors;
|
|
|
|
|
}
|
|
|
|
|