1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 18:35:20 +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.

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