Merge branch 'master' into tgm
@ -0,0 +1,46 @@
|
||||
#include "idtypedelegate.hpp"
|
||||
|
||||
#include "../../model/world/universalid.hpp"
|
||||
|
||||
CSVWorld::IdTypeDelegate::IdTypeDelegate
|
||||
(const ValueList &values, const IconList &icons, QUndoStack& undoStack, QObject *parent)
|
||||
: DataDisplayDelegate (values, icons, undoStack, parent)
|
||||
{}
|
||||
|
||||
bool CSVWorld::IdTypeDelegate::updateEditorSetting (const QString &settingName, const QString &settingValue)
|
||||
{
|
||||
/// \todo make the setting key a member variable, that is initialised from a constructor argument
|
||||
if (settingName == "Referenceable ID Type Display")
|
||||
{
|
||||
if (settingValue == "Icon and Text")
|
||||
mDisplayMode = Mode_IconAndText;
|
||||
|
||||
else if (settingValue == "Icon Only")
|
||||
mDisplayMode = Mode_IconOnly;
|
||||
|
||||
else if (settingValue == "Text Only")
|
||||
mDisplayMode = Mode_TextOnly;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
CSVWorld::IdTypeDelegateFactory::IdTypeDelegateFactory()
|
||||
{
|
||||
for (int i=0; i<CSMWorld::UniversalId::NumberOfTypes; ++i)
|
||||
{
|
||||
CSMWorld::UniversalId id (static_cast<CSMWorld::UniversalId::Type> (i));
|
||||
|
||||
DataDisplayDelegateFactory::add (id.getType(), QString::fromUtf8 (id.getTypeName().c_str()),
|
||||
QString::fromUtf8 (id.getIcon().c_str()));
|
||||
}
|
||||
}
|
||||
|
||||
CSVWorld::CommandDelegate *CSVWorld::IdTypeDelegateFactory::makeDelegate (QUndoStack& undoStack,
|
||||
QObject *parent) const
|
||||
{
|
||||
return new IdTypeDelegate (mValues, mIcons, undoStack, parent);
|
||||
}
|
@ -1,62 +0,0 @@
|
||||
#include "refidtypedelegate.hpp"
|
||||
|
||||
#include "../../model/world/universalid.hpp"
|
||||
|
||||
CSVWorld::RefIdTypeDelegate::RefIdTypeDelegate
|
||||
(const ValueList &values, const IconList &icons, QUndoStack& undoStack, QObject *parent)
|
||||
: DataDisplayDelegate (values, icons, undoStack, parent)
|
||||
{}
|
||||
|
||||
bool CSVWorld::RefIdTypeDelegate::updateEditorSetting (const QString &settingName, const QString &settingValue)
|
||||
{
|
||||
if (settingName == "Referenceable ID Type Display")
|
||||
{
|
||||
if (settingValue == "Icon and Text")
|
||||
mDisplayMode = Mode_IconAndText;
|
||||
|
||||
else if (settingValue == "Icon Only")
|
||||
mDisplayMode = Mode_IconOnly;
|
||||
|
||||
else if (settingValue == "Text Only")
|
||||
mDisplayMode = Mode_TextOnly;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
CSVWorld::RefIdTypeDelegateFactory::RefIdTypeDelegateFactory()
|
||||
{
|
||||
UidTypeList uIdList = buildUidTypeList();
|
||||
|
||||
for (UidTypeList::const_iterator it = uIdList.begin(); it != uIdList.end(); it++)
|
||||
{
|
||||
int i = it->first;
|
||||
DataDisplayDelegateFactory::add (i, QString::fromStdString(CSMWorld::UniversalId(it->first, "").getTypeName()), it->second);
|
||||
}
|
||||
}
|
||||
|
||||
CSVWorld::CommandDelegate *CSVWorld::RefIdTypeDelegateFactory::makeDelegate (QUndoStack& undoStack,
|
||||
QObject *parent) const
|
||||
{
|
||||
return new RefIdTypeDelegate (mValues, mIcons, undoStack, parent);
|
||||
}
|
||||
|
||||
CSVWorld::RefIdTypeDelegateFactory::UidTypeList CSVWorld::RefIdTypeDelegateFactory::buildUidTypeList() const
|
||||
{
|
||||
UidTypeList list;
|
||||
|
||||
std::vector<CSMWorld::UniversalId::Type> types = CSMWorld::UniversalId::listReferenceableTypes();
|
||||
|
||||
for (std::vector<CSMWorld::UniversalId::Type>::const_iterator iter (types.begin());
|
||||
iter!=types.end(); ++iter)
|
||||
{
|
||||
CSMWorld::UniversalId id (*iter, "");
|
||||
|
||||
list.push_back (std::make_pair (id.getType(), id.getIcon().c_str()));
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
After Width: | Height: | Size: 820 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 862 B After Width: | Height: | Size: 615 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 747 B After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 671 B After Width: | Height: | Size: 671 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 587 B After Width: | Height: | Size: 587 B |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 952 B |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1003 B After Width: | Height: | Size: 1003 B |