1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-20 08:23:51 +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

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

View file

@ -157,4 +157,8 @@ void CSVWorld::GenericCreator::cloneMode(const std::string& originid,
mClonedId = originid; mClonedId = originid;
mClonedType = type; mClonedType = type;
mArgumentType = argumentType; mArgumentType = argumentType;
} }
void CSVWorld::GenericCreator::toggleWidgets(bool active)
{
}

View file

@ -48,7 +48,7 @@ namespace CSVWorld
virtual std::string getId() const; virtual std::string getId() const;
virtual void configureCreateCommand (CSMWorld::CreateCommand& command) const; virtual void configureCreateCommand (CSMWorld::CreateCommand& command) const;
CSMWorld::Data& getData() const; CSMWorld::Data& getData() const;
const CSMWorld::UniversalId& getCollectionId() const; const CSMWorld::UniversalId& getCollectionId() const;
@ -61,6 +61,8 @@ namespace CSVWorld
virtual void setEditLock (bool locked); virtual void setEditLock (bool locked);
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,

View file

@ -40,4 +40,10 @@ 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);