mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 23:53:52 +00:00
Editor: document subclasses without ID checks
- Removes ID validation for PathgridCreator. - Adds comments explaining why ID validation isn't used in some cases.
This commit is contained in:
parent
9653b99add
commit
8d4441bb5e
5 changed files with 10 additions and 10 deletions
|
@ -48,6 +48,8 @@ CSVWorld::InfoCreator::InfoCreator (CSMWorld::Data& data, QUndoStack& undoStack,
|
||||||
QLabel *label = new QLabel ("Topic", this);
|
QLabel *label = new QLabel ("Topic", this);
|
||||||
insertBeforeButtons (label, false);
|
insertBeforeButtons (label, false);
|
||||||
|
|
||||||
|
// Add topic/journal ID input with auto-completion.
|
||||||
|
// Only existing topic/journal IDs are accepted so no ID validation is performed.
|
||||||
CSMWorld::ColumnBase::Display displayType = CSMWorld::ColumnBase::Display_Topic;
|
CSMWorld::ColumnBase::Display displayType = CSMWorld::ColumnBase::Display_Topic;
|
||||||
if (getCollectionId().getType() == CSMWorld::UniversalId::Type_JournalInfos)
|
if (getCollectionId().getType() == CSMWorld::UniversalId::Type_JournalInfos)
|
||||||
{
|
{
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
#include "../../model/world/idtable.hpp"
|
#include "../../model/world/idtable.hpp"
|
||||||
|
|
||||||
#include "../widget/droplineedit.hpp"
|
#include "../widget/droplineedit.hpp"
|
||||||
#include "idvalidator.hpp"
|
|
||||||
|
|
||||||
std::string CSVWorld::PathgridCreator::getId() const
|
std::string CSVWorld::PathgridCreator::getId() const
|
||||||
{
|
{
|
||||||
|
@ -28,9 +27,8 @@ CSVWorld::PathgridCreator::PathgridCreator(
|
||||||
CSMWorld::Data& data,
|
CSMWorld::Data& data,
|
||||||
QUndoStack& undoStack,
|
QUndoStack& undoStack,
|
||||||
const CSMWorld::UniversalId& id,
|
const CSMWorld::UniversalId& id,
|
||||||
CSMWorld::IdCompletionManager& completionManager,
|
CSMWorld::IdCompletionManager& completionManager
|
||||||
bool relaxedIdRules
|
) : GenericCreator(data, undoStack, id)
|
||||||
) : GenericCreator(data, undoStack, id, relaxedIdRules)
|
|
||||||
{
|
{
|
||||||
setManualEditing(false);
|
setManualEditing(false);
|
||||||
|
|
||||||
|
@ -38,10 +36,10 @@ CSVWorld::PathgridCreator::PathgridCreator(
|
||||||
insertBeforeButtons(label, false);
|
insertBeforeButtons(label, false);
|
||||||
|
|
||||||
// Add cell ID input with auto-completion.
|
// Add cell ID input with auto-completion.
|
||||||
|
// Only existing cell IDs are accepted so no ID validation is performed.
|
||||||
CSMWorld::ColumnBase::Display displayType = CSMWorld::ColumnBase::Display_Cell;
|
CSMWorld::ColumnBase::Display displayType = CSMWorld::ColumnBase::Display_Cell;
|
||||||
mCell = new CSVWidget::DropLineEdit(displayType, this);
|
mCell = new CSVWidget::DropLineEdit(displayType, this);
|
||||||
mCell->setCompleter(completionManager.getCompleter(displayType).get());
|
mCell->setCompleter(completionManager.getCompleter(displayType).get());
|
||||||
mCell->setValidator(new IdValidator(relaxedIdRules, this));
|
|
||||||
insertBeforeButtons(mCell, true);
|
insertBeforeButtons(mCell, true);
|
||||||
|
|
||||||
connect(mCell, SIGNAL (textChanged(const QString&)), this, SLOT (cellChanged()));
|
connect(mCell, SIGNAL (textChanged(const QString&)), this, SLOT (cellChanged()));
|
||||||
|
@ -65,8 +63,6 @@ std::string CSVWorld::PathgridCreator::getErrors() const
|
||||||
std::string cellId = getId();
|
std::string cellId = getId();
|
||||||
|
|
||||||
// Check user input for any errors.
|
// Check user input for any errors.
|
||||||
// The last two checks, cell with existing pathgrid and non-existent cell,
|
|
||||||
// shouldn't be needed but we absolutely want to make sure they never happen.
|
|
||||||
std::string errors;
|
std::string errors;
|
||||||
if (cellId.empty())
|
if (cellId.empty())
|
||||||
{
|
{
|
||||||
|
|
|
@ -44,8 +44,7 @@ namespace CSVWorld
|
||||||
CSMWorld::Data& data,
|
CSMWorld::Data& data,
|
||||||
QUndoStack& undoStack,
|
QUndoStack& undoStack,
|
||||||
const CSMWorld::UniversalId& id,
|
const CSMWorld::UniversalId& id,
|
||||||
CSMWorld::IdCompletionManager& completionManager,
|
CSMWorld::IdCompletionManager& completionManager);
|
||||||
bool relaxedIdRules = false);
|
|
||||||
|
|
||||||
/// \brief Set cell ID input widget to ID of record to be cloned.
|
/// \brief Set cell ID input widget to ID of record to be cloned.
|
||||||
/// \param originId Cell ID to be cloned.
|
/// \param originId Cell ID to be cloned.
|
||||||
|
|
|
@ -35,6 +35,8 @@ CSVWorld::ReferenceCreator::ReferenceCreator (CSMWorld::Data& data, QUndoStack&
|
||||||
QLabel *label = new QLabel ("Cell", this);
|
QLabel *label = new QLabel ("Cell", this);
|
||||||
insertBeforeButtons (label, false);
|
insertBeforeButtons (label, false);
|
||||||
|
|
||||||
|
// Add cell ID input with auto-completion.
|
||||||
|
// Only existing cell IDs are accepted so no ID validation is performed.
|
||||||
mCell = new CSVWidget::DropLineEdit(CSMWorld::ColumnBase::Display_Cell, this);
|
mCell = new CSVWidget::DropLineEdit(CSMWorld::ColumnBase::Display_Cell, this);
|
||||||
mCell->setCompleter(completionManager.getCompleter(CSMWorld::ColumnBase::Display_Cell).get());
|
mCell->setCompleter(completionManager.getCompleter(CSMWorld::ColumnBase::Display_Cell).get());
|
||||||
insertBeforeButtons (mCell, true);
|
insertBeforeButtons (mCell, true);
|
||||||
|
|
|
@ -29,7 +29,7 @@ CSVWorld::StartScriptCreator::StartScriptCreator(
|
||||||
QUndoStack &undoStack,
|
QUndoStack &undoStack,
|
||||||
const CSMWorld::UniversalId &id,
|
const CSMWorld::UniversalId &id,
|
||||||
CSMWorld::IdCompletionManager& completionManager
|
CSMWorld::IdCompletionManager& completionManager
|
||||||
) : GenericCreator(data, undoStack, id, true)
|
) : GenericCreator(data, undoStack, id)
|
||||||
{
|
{
|
||||||
setManualEditing(false);
|
setManualEditing(false);
|
||||||
|
|
||||||
|
@ -38,6 +38,7 @@ CSVWorld::StartScriptCreator::StartScriptCreator(
|
||||||
insertBeforeButtons(label, false);
|
insertBeforeButtons(label, false);
|
||||||
|
|
||||||
// Add script ID input with auto-completion.
|
// Add script ID input with auto-completion.
|
||||||
|
// Only existing script IDs are accepted so no ID validation is performed.
|
||||||
CSMWorld::ColumnBase::Display displayType = CSMWorld::ColumnBase::Display_Script;
|
CSMWorld::ColumnBase::Display displayType = CSMWorld::ColumnBase::Display_Script;
|
||||||
mScript = new CSVWidget::DropLineEdit(displayType, this);
|
mScript = new CSVWidget::DropLineEdit(displayType, this);
|
||||||
mScript->setCompleter(completionManager.getCompleter(displayType).get());
|
mScript->setCompleter(completionManager.getCompleter(displayType).get());
|
||||||
|
|
Loading…
Reference in a new issue