2013-09-28 09:25:54 +02:00
|
|
|
|
|
|
|
#include "scenesubview.hpp"
|
|
|
|
|
|
|
|
#include <QVBoxLayout>
|
|
|
|
#include <QHBoxLayout>
|
|
|
|
#include <QLabel>
|
|
|
|
|
|
|
|
#include "../../model/doc/document.hpp"
|
|
|
|
|
|
|
|
#include "../filter/filterbox.hpp"
|
|
|
|
|
2014-03-06 10:13:39 +01:00
|
|
|
#include "../render/pagedworldspacewidget.hpp"
|
|
|
|
#include "../render/unpagedworldspacewidget.hpp"
|
2013-11-02 02:48:30 +01:00
|
|
|
|
2013-09-28 09:25:54 +02:00
|
|
|
#include "tablebottombox.hpp"
|
|
|
|
#include "creator.hpp"
|
|
|
|
#include "scenetoolbar.hpp"
|
2013-09-28 11:27:24 +02:00
|
|
|
#include "scenetoolmode.hpp"
|
2013-09-28 09:25:54 +02:00
|
|
|
|
|
|
|
CSVWorld::SceneSubView::SceneSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document)
|
|
|
|
: SubView (id)
|
|
|
|
{
|
|
|
|
QVBoxLayout *layout = new QVBoxLayout;
|
|
|
|
|
|
|
|
layout->setContentsMargins (QMargins (0, 0, 0, 0));
|
|
|
|
|
|
|
|
layout->addWidget (mBottom =
|
|
|
|
new TableBottomBox (NullCreatorFactory(), document.getData(), document.getUndoStack(), id,
|
|
|
|
this), 0);
|
|
|
|
|
|
|
|
QHBoxLayout *layout2 = new QHBoxLayout;
|
|
|
|
|
|
|
|
layout2->setContentsMargins (QMargins (0, 0, 0, 0));
|
|
|
|
|
2013-10-07 11:14:11 +02:00
|
|
|
SceneToolbar *toolbar = new SceneToolbar (48, this);
|
2014-02-25 14:59:46 +01:00
|
|
|
|
2014-03-06 10:13:39 +01:00
|
|
|
if (id.getId()[0]=='#')
|
|
|
|
mScene = new CSVRender::PagedWorldspaceWidget (this);
|
|
|
|
else
|
2014-03-06 13:02:21 +01:00
|
|
|
mScene = new CSVRender::UnpagedWorldspaceWidget (id.getId(), document, this);
|
2014-03-06 10:01:23 +01:00
|
|
|
|
|
|
|
SceneToolMode *tool = mScene->makeNavigationSelector (toolbar);
|
2014-02-25 14:59:46 +01:00
|
|
|
toolbar->addTool (tool);
|
|
|
|
|
2013-09-28 09:25:54 +02:00
|
|
|
layout2->addWidget (toolbar, 0);
|
|
|
|
|
2014-02-25 14:59:46 +01:00
|
|
|
layout2->addWidget (mScene, 1);
|
2013-09-28 09:25:54 +02:00
|
|
|
|
|
|
|
layout->insertLayout (0, layout2, 1);
|
|
|
|
|
|
|
|
CSVFilter::FilterBox *filterBox = new CSVFilter::FilterBox (document.getData(), this);
|
|
|
|
|
|
|
|
layout->insertWidget (0, filterBox);
|
|
|
|
|
|
|
|
QWidget *widget = new QWidget;
|
|
|
|
|
|
|
|
widget->setLayout (layout);
|
|
|
|
|
|
|
|
setWidget (widget);
|
2014-02-27 15:23:14 +01:00
|
|
|
|
2014-03-06 10:01:23 +01:00
|
|
|
mScene->selectDefaultNavigationMode();
|
2014-03-06 16:40:08 +01:00
|
|
|
|
|
|
|
connect (mScene, SIGNAL (closeRequest()), this, SLOT (closeRequest()));
|
2013-09-28 09:25:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void CSVWorld::SceneSubView::setEditLock (bool locked)
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void CSVWorld::SceneSubView::updateEditorSetting(const QString &settingName, const QString &settingValue)
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void CSVWorld::SceneSubView::setStatusBar (bool show)
|
|
|
|
{
|
|
|
|
mBottom->setStatusBar (show);
|
2013-11-02 02:48:30 +01:00
|
|
|
}
|
2014-03-06 16:40:08 +01:00
|
|
|
|
|
|
|
void CSVWorld::SceneSubView::closeRequest()
|
|
|
|
{
|
|
|
|
deleteLater();
|
|
|
|
}
|