2012-12-13 12:35:08 +00:00
|
|
|
|
|
|
|
#include "dialoguesubview.hpp"
|
|
|
|
|
2012-12-30 13:01:52 +00:00
|
|
|
#include <QGridLayout>
|
|
|
|
#include <QLabel>
|
|
|
|
#include <QAbstractTableModel>
|
|
|
|
|
|
|
|
#include "../../model/world/columnbase.hpp"
|
|
|
|
|
2012-12-13 12:35:08 +00:00
|
|
|
CSVWorld::DialogueSubView::DialogueSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document,
|
|
|
|
bool createAndDelete)
|
|
|
|
: SubView (id)
|
|
|
|
{
|
2012-12-30 13:01:52 +00:00
|
|
|
QWidget *widget = new QWidget (this);
|
|
|
|
|
|
|
|
setWidget (widget);
|
|
|
|
|
|
|
|
QGridLayout *layout = new QGridLayout;
|
|
|
|
|
|
|
|
widget->setLayout (layout);
|
|
|
|
|
|
|
|
QAbstractTableModel *model = document.getData().getTableModel (id);
|
|
|
|
|
|
|
|
int columns = model->columnCount();
|
|
|
|
|
|
|
|
for (int i=0; i<columns; ++i)
|
|
|
|
{
|
|
|
|
int flags = model->headerData (i, Qt::Horizontal, CSMWorld::ColumnBase::Role_Flags).toInt();
|
2012-12-13 12:35:08 +00:00
|
|
|
|
2012-12-30 13:01:52 +00:00
|
|
|
if (flags & CSMWorld::ColumnBase::Flag_Dialogue)
|
|
|
|
{
|
|
|
|
layout->addWidget (new QLabel (model->headerData (i, Qt::Horizontal).toString()), i, 0);
|
|
|
|
}
|
|
|
|
}
|
2012-12-13 12:35:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CSVWorld::DialogueSubView::setEditLock (bool locked)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|