1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-22 18:53:52 +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.

46 lines
1.2 KiB
C++
Raw Normal View History

2012-12-11 14:35:47 +00:00
#include "reportsubview.hpp"
2014-12-06 12:01:55 +00:00
#include "reporttable.hpp"
2013-09-22 11:54:01 +00:00
2022-10-19 17:02:00 +00:00
#include <apps/opencs/view/doc/subview.hpp>
2022-08-19 17:19:42 +00:00
#include "../../model/doc/document.hpp"
#include "../../model/doc/state.hpp"
2012-12-11 14:35:47 +00:00
CSVTools::ReportSubView::ReportSubView(const CSMWorld::UniversalId& id, CSMDoc::Document& document)
: CSVDoc::SubView(id)
, mDocument(document)
, mRefreshState(0)
2012-12-11 14:35:47 +00:00
{
if (id.getType() == CSMWorld::UniversalId::Type_VerificationResults)
mRefreshState = CSMDoc::State_Verifying;
setWidget(mTable = new ReportTable(document, id, false, mRefreshState, this));
2022-09-22 18:26:05 +00:00
connect(mTable, &ReportTable::editRequest, this, &ReportSubView::focusId);
2013-09-22 11:54:01 +00:00
if (mRefreshState == CSMDoc::State_Verifying)
{
connect(mTable, &ReportTable::refreshRequest, this, &ReportSubView::refreshRequest);
connect(&document, &CSMDoc::Document::stateChanged, mTable, &ReportTable::stateChanged);
}
2012-12-11 14:35:47 +00: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());
}
}
}