forked from mirror/openmw-tes3mp
size limits for meta data strings
This commit is contained in:
parent
a4c2c75d1f
commit
4487bda702
4 changed files with 22 additions and 3 deletions
|
@ -100,7 +100,8 @@ bool CSMWorld::ColumnBase::isId (Display display)
|
||||||
|
|
||||||
bool CSMWorld::ColumnBase::isText (Display display)
|
bool CSMWorld::ColumnBase::isText (Display display)
|
||||||
{
|
{
|
||||||
return display==Display_String || display==Display_LongString;
|
return display==Display_String || display==Display_LongString ||
|
||||||
|
display==Display_String32 || display==Display_LongString256;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CSMWorld::ColumnBase::isScript (Display display)
|
bool CSMWorld::ColumnBase::isScript (Display display)
|
||||||
|
|
|
@ -123,6 +123,8 @@ namespace CSMWorld
|
||||||
Display_InfoCondVar,
|
Display_InfoCondVar,
|
||||||
Display_InfoCondComp,
|
Display_InfoCondComp,
|
||||||
Display_RaceSkill,
|
Display_RaceSkill,
|
||||||
|
Display_String32,
|
||||||
|
Display_LongString256,
|
||||||
|
|
||||||
//top level columns that nest other columns
|
//top level columns that nest other columns
|
||||||
Display_NestedHeader
|
Display_NestedHeader
|
||||||
|
|
|
@ -2331,7 +2331,7 @@ namespace CSMWorld
|
||||||
struct AuthorColumn : public Column<ESXRecordT>
|
struct AuthorColumn : public Column<ESXRecordT>
|
||||||
{
|
{
|
||||||
AuthorColumn()
|
AuthorColumn()
|
||||||
: Column<ESXRecordT> (Columns::ColumnId_Author, ColumnBase::Display_String)
|
: Column<ESXRecordT> (Columns::ColumnId_Author, ColumnBase::Display_String32)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
virtual QVariant get (const Record<ESXRecordT>& record) const
|
virtual QVariant get (const Record<ESXRecordT>& record) const
|
||||||
|
@ -2358,7 +2358,7 @@ namespace CSMWorld
|
||||||
struct FileDescriptionColumn : public Column<ESXRecordT>
|
struct FileDescriptionColumn : public Column<ESXRecordT>
|
||||||
{
|
{
|
||||||
FileDescriptionColumn()
|
FileDescriptionColumn()
|
||||||
: Column<ESXRecordT> (Columns::ColumnId_FileDescription, ColumnBase::Display_LongString)
|
: Column<ESXRecordT> (Columns::ColumnId_FileDescription, ColumnBase::Display_LongString256)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
virtual QVariant get (const Record<ESXRecordT>& record) const
|
virtual QVariant get (const Record<ESXRecordT>& record) const
|
||||||
|
|
|
@ -232,6 +232,14 @@ QWidget *CSVWorld::CommandDelegate::createEditor (QWidget *parent, const QStyleO
|
||||||
return edit;
|
return edit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case CSMWorld::ColumnBase::Display_LongString256:
|
||||||
|
{
|
||||||
|
/// \todo implement size limit. QPlainTextEdit does not support a size limit.
|
||||||
|
QPlainTextEdit *edit = new QPlainTextEdit(parent);
|
||||||
|
edit->setUndoRedoEnabled (false);
|
||||||
|
return edit;
|
||||||
|
}
|
||||||
|
|
||||||
case CSMWorld::ColumnBase::Display_Boolean:
|
case CSMWorld::ColumnBase::Display_Boolean:
|
||||||
|
|
||||||
return new QCheckBox(parent);
|
return new QCheckBox(parent);
|
||||||
|
@ -245,6 +253,14 @@ QWidget *CSVWorld::CommandDelegate::createEditor (QWidget *parent, const QStyleO
|
||||||
|
|
||||||
return new CSVWidget::DropLineEdit(display, parent);
|
return new CSVWidget::DropLineEdit(display, parent);
|
||||||
|
|
||||||
|
case CSMWorld::ColumnBase::Display_String32:
|
||||||
|
{
|
||||||
|
// For other Display types (that represent record IDs) with drop support IdCompletionDelegate is used
|
||||||
|
CSVWidget::DropLineEdit *widget = new CSVWidget::DropLineEdit(display, parent);
|
||||||
|
widget->setMaxLength (32);
|
||||||
|
return widget;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
||||||
return QStyledItemDelegate::createEditor (parent, option, index);
|
return QStyledItemDelegate::createEditor (parent, option, index);
|
||||||
|
|
Loading…
Reference in a new issue