Something went wrong. Try again.
OpenMW is an open implementation of the Morrowind engine
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546#include "reportsubview.hpp"
#include "reporttable.hpp"
#include <apps/opencs/view/doc/subview.hpp>
#include "../../model/doc/document.hpp"#include "../../model/doc/state.hpp"
CSVTools::ReportSubView::ReportSubView(const CSMWorld::UniversalId& id, CSMDoc::Document& document) : CSVDoc::SubView(id) , mDocument(document) , mRefreshState(0){ if (id.getType() == CSMWorld::UniversalId::Type_VerificationResults) mRefreshState = CSMDoc::State_Verifying;
setWidget(mTable = new ReportTable(document, id, false, mRefreshState, this));
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); }}
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()); } }}