1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-20 11:23:50 +00:00

Disable not needed referencable creator widget when in cloning mode.

This commit is contained in:
Marek Kochanowicz 2014-01-23 16:00:44 +01:00
parent 1b1ecafdd8
commit dda7ddb6f8
6 changed files with 20 additions and 3 deletions

View file

@ -29,6 +29,8 @@ namespace CSVWorld
virtual void setEditLock (bool locked) = 0; virtual void setEditLock (bool locked) = 0;
virtual void toggleWidgets(bool active = true) = 0;
signals: signals:
void done(); void done();

View file

@ -158,3 +158,7 @@ void CSVWorld::GenericCreator::cloneMode(const std::string& originid,
mClonedType = type; mClonedType = type;
mArgumentType = argumentType; mArgumentType = argumentType;
} }
void CSVWorld::GenericCreator::toggleWidgets(bool active)
{
}

View file

@ -62,6 +62,8 @@ namespace CSVWorld
virtual void reset(); virtual void reset();
virtual void toggleWidgets (bool active = true);
virtual void cloneMode(const std::string& originid, virtual void cloneMode(const std::string& originid,
const CSMWorld::UniversalId::Type type, const CSMWorld::UniversalId::Type type,
const CSMWorld::UniversalId::ArgumentType argumentType); const CSMWorld::UniversalId::ArgumentType argumentType);

View file

@ -41,3 +41,9 @@ void CSVWorld::ReferenceableCreator::reset()
mType->setCurrentIndex (0); mType->setCurrentIndex (0);
GenericCreator::reset(); GenericCreator::reset();
} }
void CSVWorld::ReferenceableCreator::toggleWidgets(bool active)
{
CSVWorld::GenericCreator::toggleWidgets(active);
mType->setEnabled(active);
}

View file

@ -23,6 +23,7 @@ namespace CSVWorld
const CSMWorld::UniversalId& id); const CSMWorld::UniversalId& id);
virtual void reset(); virtual void reset();
virtual void toggleWidgets(bool active = true);
}; };
} }

View file

@ -153,6 +153,7 @@ void CSVWorld::TableBottomBox::tableSizeChanged (int size, int deleted, int modi
void CSVWorld::TableBottomBox::createRequest() void CSVWorld::TableBottomBox::createRequest()
{ {
mCreator->reset(); mCreator->reset();
mCreator->toggleWidgets(true);
mLayout->setCurrentWidget (mCreator); mLayout->setCurrentWidget (mCreator);
setVisible (true); setVisible (true);
mCreating = true; mCreating = true;
@ -163,6 +164,7 @@ void CSVWorld::TableBottomBox::cloneRequest(const std::string& id,
const CSMWorld::UniversalId::ArgumentType argumnetType) const CSMWorld::UniversalId::ArgumentType argumnetType)
{ {
mCreator->reset(); mCreator->reset();
mCreator->toggleWidgets(false);
mCreator->cloneMode(id, type, argumnetType); mCreator->cloneMode(id, type, argumnetType);
mLayout->setCurrentWidget(mCreator); mLayout->setCurrentWidget(mCreator);
setVisible (true); setVisible (true);