2012-12-03 21:03:02 +00:00
|
|
|
|
|
|
|
#include "tablesubview.hpp"
|
|
|
|
|
2013-07-23 19:59:02 +00:00
|
|
|
#include <QVBoxLayout>
|
|
|
|
|
2012-12-11 12:22:43 +00:00
|
|
|
#include "../../model/doc/document.hpp"
|
|
|
|
|
2012-12-03 21:03:02 +00:00
|
|
|
#include "table.hpp"
|
|
|
|
|
2012-12-11 12:22:43 +00:00
|
|
|
CSVWorld::TableSubView::TableSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document,
|
2012-12-03 21:03:02 +00:00
|
|
|
bool createAndDelete)
|
|
|
|
: SubView (id)
|
|
|
|
{
|
2013-07-23 19:59:02 +00:00
|
|
|
QVBoxLayout *layout = new QVBoxLayout;
|
|
|
|
|
|
|
|
layout->setContentsMargins (QMargins (0, 0, 0, 0));
|
|
|
|
|
|
|
|
layout->addWidget (
|
|
|
|
mTable = new Table (id, document.getData(), document.getUndoStack(), createAndDelete), 2);
|
|
|
|
|
|
|
|
QWidget *widget = new QWidget;
|
|
|
|
|
|
|
|
widget->setLayout (layout);
|
|
|
|
|
|
|
|
setWidget (widget);
|
2012-12-13 12:35:08 +00:00
|
|
|
|
2013-07-21 15:53:39 +00:00
|
|
|
connect (mTable, SIGNAL (editRequest (int)), this, SLOT (editRequest (int)));
|
2012-12-03 21:03:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CSVWorld::TableSubView::setEditLock (bool locked)
|
|
|
|
{
|
|
|
|
mTable->setEditLock (locked);
|
2012-12-13 12:35:08 +00:00
|
|
|
}
|
|
|
|
|
2013-07-21 15:53:39 +00:00
|
|
|
void CSVWorld::TableSubView::editRequest (int row)
|
2012-12-13 12:35:08 +00:00
|
|
|
{
|
2013-07-21 15:53:39 +00:00
|
|
|
focusId (mTable->getUniversalId (row));
|
2013-06-15 11:40:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CSVWorld::TableSubView::updateEditorSetting(const QString &settingName, const QString &settingValue)
|
|
|
|
{
|
2013-07-21 15:53:39 +00:00
|
|
|
mTable->updateEditorSetting(settingName, settingValue);
|
2013-06-15 11:40:18 +00:00
|
|
|
}
|