forked from mirror/openmw-tes3mp
InfoCreator accepts drops of Topic/Journal ID
This commit is contained in:
parent
5b82b9d9d0
commit
d282bead23
2 changed files with 9 additions and 5 deletions
|
@ -4,7 +4,6 @@
|
|||
#include <algorithm>
|
||||
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QUuid>
|
||||
|
||||
#include <components/misc/stringops.hpp>
|
||||
|
@ -17,6 +16,8 @@
|
|||
#include "../../model/world/idtable.hpp"
|
||||
#include "../../model/world/idcompletionmanager.hpp"
|
||||
|
||||
#include "../widget/droplineedit.hpp"
|
||||
|
||||
std::string CSVWorld::InfoCreator::getId() const
|
||||
{
|
||||
std::string id = Misc::StringUtils::lowerCase (mTopic->text().toUtf8().constData());
|
||||
|
@ -48,12 +49,12 @@ CSVWorld::InfoCreator::InfoCreator (CSMWorld::Data& data, QUndoStack& undoStack,
|
|||
QLabel *label = new QLabel ("Topic", this);
|
||||
insertBeforeButtons (label, false);
|
||||
|
||||
mTopic = new QLineEdit (this);
|
||||
CSMWorld::ColumnBase::Display displayType = CSMWorld::ColumnBase::Display_Topic;
|
||||
if (getCollectionId().getType() == CSMWorld::UniversalId::Type_JournalInfos)
|
||||
{
|
||||
displayType = CSMWorld::ColumnBase::Display_Journal;
|
||||
}
|
||||
mTopic = new CSVWidget::DropLineEdit(displayType, this);
|
||||
mTopic->setCompleter(completionManager.getCompleter(displayType).get());
|
||||
insertBeforeButtons (mTopic, true);
|
||||
|
||||
|
|
|
@ -3,21 +3,24 @@
|
|||
|
||||
#include "genericcreator.hpp"
|
||||
|
||||
class QLineEdit;
|
||||
|
||||
namespace CSMWorld
|
||||
{
|
||||
class InfoCollection;
|
||||
class IdCompletionManager;
|
||||
}
|
||||
|
||||
namespace CSVWidget
|
||||
{
|
||||
class DropLineEdit;
|
||||
}
|
||||
|
||||
namespace CSVWorld
|
||||
{
|
||||
class InfoCreator : public GenericCreator
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
QLineEdit *mTopic;
|
||||
CSVWidget::DropLineEdit *mTopic;
|
||||
|
||||
virtual std::string getId() const;
|
||||
|
||||
|
|
Loading…
Reference in a new issue