|
|
|
@ -9,10 +9,13 @@
|
|
|
|
|
|
|
|
|
|
#include <components/misc/stringops.hpp>
|
|
|
|
|
|
|
|
|
|
#include "../../model/doc/document.hpp"
|
|
|
|
|
|
|
|
|
|
#include "../../model/world/data.hpp"
|
|
|
|
|
#include "../../model/world/commands.hpp"
|
|
|
|
|
#include "../../model/world/columns.hpp"
|
|
|
|
|
#include "../../model/world/idtable.hpp"
|
|
|
|
|
#include "../../model/world/idcompletionmanager.hpp"
|
|
|
|
|
|
|
|
|
|
std::string CSVWorld::InfoCreator::getId() const
|
|
|
|
|
{
|
|
|
|
@ -39,13 +42,20 @@ void CSVWorld::InfoCreator::configureCreateCommand (CSMWorld::CreateCommand& com
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CSVWorld::InfoCreator::InfoCreator (CSMWorld::Data& data, QUndoStack& undoStack,
|
|
|
|
|
const CSMWorld::UniversalId& id)
|
|
|
|
|
const CSMWorld::UniversalId& id, CSMWorld::IdCompletionManager& completionManager)
|
|
|
|
|
: GenericCreator (data, undoStack, id)
|
|
|
|
|
{
|
|
|
|
|
QLabel *label = new QLabel ("Topic", this);
|
|
|
|
|
insertBeforeButtons (label, false);
|
|
|
|
|
|
|
|
|
|
mTopic = new QLineEdit (this);
|
|
|
|
|
CSMWorld::ColumnBase::Display displayType = CSMWorld::ColumnBase::Display_Topic;
|
|
|
|
|
if (id.getType() == CSMWorld::UniversalId::Type_JournalInfo || // For Dialogue SubView
|
|
|
|
|
id.getType() == CSMWorld::UniversalId::Type_JournalInfos) // For Table SubView
|
|
|
|
|
{
|
|
|
|
|
displayType = CSMWorld::ColumnBase::Display_Journal;
|
|
|
|
|
}
|
|
|
|
|
mTopic->setCompleter(completionManager.getCompleter(displayType).get());
|
|
|
|
|
insertBeforeButtons (mTopic, true);
|
|
|
|
|
|
|
|
|
|
setManualEditing (false);
|
|
|
|
@ -100,3 +110,12 @@ void CSVWorld::InfoCreator::topicChanged()
|
|
|
|
|
{
|
|
|
|
|
update();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CSVWorld::Creator *CSVWorld::InfoCreatorFactory::makeCreator(CSMDoc::Document& document,
|
|
|
|
|
const CSMWorld::UniversalId& id) const
|
|
|
|
|
{
|
|
|
|
|
return new InfoCreator(document.getData(),
|
|
|
|
|
document.getUndoStack(),
|
|
|
|
|
id,
|
|
|
|
|
document.getIdCompletionManager());
|
|
|
|
|
}
|
|
|
|
|