1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 09:35:28 +00:00
OpenMW/apps/opencs/view/tools/reportsubview.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

42 lines
1.2 KiB
C++
Raw Normal View History

2012-12-11 15:35:47 +01:00
#include "reportsubview.hpp"
2014-12-06 13:01:55 +01:00
#include "reporttable.hpp"
2013-09-22 13:54:01 +02:00
2022-08-19 19:19:42 +02:00
#include "../../model/doc/state.hpp"
#include "../../model/doc/document.hpp"
2012-12-11 15:35:47 +01:00
CSVTools::ReportSubView::ReportSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document)
: CSVDoc::SubView (id), mDocument (document), mRefreshState (0)
2012-12-11 15:35:47 +01:00
{
if (id.getType()==CSMWorld::UniversalId::Type_VerificationResults)
mRefreshState = CSMDoc::State_Verifying;
setWidget (mTable = new ReportTable (document, id, false, mRefreshState, this));
2013-09-22 13:54:01 +02:00
connect (mTable, &ReportTable::editRequest, this, &ReportSubView::focusId);
if (mRefreshState==CSMDoc::State_Verifying)
{
connect (mTable, &ReportTable::refreshRequest, this, &ReportSubView::refreshRequest);
connect (&document, &CSMDoc::Document::stateChanged, mTable, &ReportTable::stateChanged);
}
2012-12-11 15:35:47 +01:00
}
void CSVTools::ReportSubView::setEditLock (bool locked)
{
// ignored. We don't change document state anyway.
}
void CSVTools::ReportSubView::refreshRequest()
{
if (!(mDocument.getState() & mRefreshState))
{
if (mRefreshState==CSMDoc::State_Verifying)
{
mTable->clear();
mDocument.verify (getUniversalId());
}
}
}