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
|
|
|
|
2012-12-11 14:35:47 +00:00
|
|
|
CSVTools::ReportSubView::ReportSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document)
|
2015-06-25 10:03:40 +00:00
|
|
|
: CSVDoc::SubView (id), mDocument (document), mRefreshState (0)
|
2012-12-11 14:35:47 +00:00
|
|
|
{
|
2015-06-25 10:03:40 +00:00
|
|
|
if (id.getType()==CSMWorld::UniversalId::Type_VerificationResults)
|
|
|
|
mRefreshState = CSMDoc::State_Verifying;
|
|
|
|
|
|
|
|
setWidget (mTable = new ReportTable (document, id, false, mRefreshState, this));
|
2013-09-22 11:54:01 +00:00
|
|
|
|
2014-12-06 12:01:55 +00:00
|
|
|
connect (mTable, SIGNAL (editRequest (const CSMWorld::UniversalId&, const std::string&)),
|
|
|
|
SIGNAL (focusId (const CSMWorld::UniversalId&, const std::string&)));
|
2015-06-25 10:03:40 +00:00
|
|
|
|
|
|
|
if (mRefreshState==CSMDoc::State_Verifying)
|
2015-06-25 11:05:57 +00:00
|
|
|
{
|
2015-06-25 10:03:40 +00:00
|
|
|
connect (mTable, SIGNAL (refreshRequest()), this, SLOT (refreshRequest()));
|
2015-06-25 11:05:57 +00:00
|
|
|
|
|
|
|
connect (&document, SIGNAL (stateChanged (int, CSMDoc::Document *)),
|
|
|
|
mTable, SLOT (stateChanged (int, CSMDoc::Document *)));
|
|
|
|
}
|
2012-12-11 14:35:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CSVTools::ReportSubView::setEditLock (bool locked)
|
|
|
|
{
|
|
|
|
// ignored. We don't change document state anyway.
|
2012-12-12 21:36:20 +00:00
|
|
|
}
|
|
|
|
|
2015-06-25 10:03:40 +00:00
|
|
|
void CSVTools::ReportSubView::refreshRequest()
|
|
|
|
{
|
|
|
|
if (!(mDocument.getState() & mRefreshState))
|
|
|
|
{
|
|
|
|
if (mRefreshState==CSMDoc::State_Verifying)
|
|
|
|
{
|
|
|
|
mTable->clear();
|
2015-12-14 16:38:33 +00:00
|
|
|
mDocument.verify (getUniversalId());
|
2015-06-25 10:03:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|