mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 09:35:28 +00:00
Disable reference creator widget when in the clone mode.
This commit is contained in:
parent
dda7ddb6f8
commit
c87d9ff38d
@ -29,11 +29,13 @@ namespace CSVWorld
|
|||||||
std::string mErrors;
|
std::string mErrors;
|
||||||
QHBoxLayout *mLayout;
|
QHBoxLayout *mLayout;
|
||||||
bool mLocked;
|
bool mLocked;
|
||||||
bool mCloneMode;
|
|
||||||
std::string mClonedId;
|
std::string mClonedId;
|
||||||
CSMWorld::UniversalId::Type mClonedType;
|
CSMWorld::UniversalId::Type mClonedType;
|
||||||
CSMWorld::UniversalId::ArgumentType mArgumentType;
|
CSMWorld::UniversalId::ArgumentType mArgumentType;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool mCloneMode;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
void update();
|
void update();
|
||||||
|
@ -49,8 +49,13 @@ std::string CSVWorld::ReferenceCreator::getErrors() const
|
|||||||
{
|
{
|
||||||
std::string errors = GenericCreator::getErrors();
|
std::string errors = GenericCreator::getErrors();
|
||||||
|
|
||||||
|
if (mCloneMode)
|
||||||
|
{
|
||||||
|
return errors;
|
||||||
|
}
|
||||||
|
|
||||||
std::string cell = mCell->text().toUtf8().constData();
|
std::string cell = mCell->text().toUtf8().constData();
|
||||||
|
|
||||||
if (cell.empty())
|
if (cell.empty())
|
||||||
{
|
{
|
||||||
if (!errors.empty())
|
if (!errors.empty())
|
||||||
@ -72,4 +77,16 @@ std::string CSVWorld::ReferenceCreator::getErrors() const
|
|||||||
void CSVWorld::ReferenceCreator::cellChanged()
|
void CSVWorld::ReferenceCreator::cellChanged()
|
||||||
{
|
{
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSVWorld::ReferenceCreator::toggleWidgets(bool active)
|
||||||
|
{
|
||||||
|
CSVWorld::GenericCreator::toggleWidgets(active);
|
||||||
|
mCell->setEnabled(active);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSVWorld::ReferenceCreator::cloneMode(const std::string& originid, const CSMWorld::UniversalId::Type type, const CSMWorld::UniversalId::ArgumentType argumentType)
|
||||||
|
{
|
||||||
|
CSVWorld::GenericCreator::cloneMode(originid, type, argumentType);
|
||||||
|
cellChanged(); //otherwise ok button will remain disabled
|
||||||
|
}
|
||||||
|
@ -25,7 +25,12 @@ namespace CSVWorld
|
|||||||
ReferenceCreator (CSMWorld::Data& data, QUndoStack& undoStack,
|
ReferenceCreator (CSMWorld::Data& data, QUndoStack& undoStack,
|
||||||
const CSMWorld::UniversalId& id);
|
const CSMWorld::UniversalId& id);
|
||||||
|
|
||||||
|
virtual void cloneMode(const std::string& originid,
|
||||||
|
const CSMWorld::UniversalId::Type type,
|
||||||
|
const CSMWorld::UniversalId::ArgumentType argumentType);
|
||||||
|
|
||||||
virtual void reset();
|
virtual void reset();
|
||||||
|
virtual void toggleWidgets(bool active = true);
|
||||||
|
|
||||||
virtual std::string getErrors() const;
|
virtual std::string getErrors() const;
|
||||||
///< Return formatted error descriptions for the current state of the creator. if an empty
|
///< Return formatted error descriptions for the current state of the creator. if an empty
|
||||||
|
Loading…
x
Reference in New Issue
Block a user