ui: added info screen for indexer crash investigation

* in case Coati crashes while indexing this screen will inform the user of further steps to take in order to find out what happened
This commit is contained in:
malte_langkabel
2016-11-21 12:36:42 +01:00
parent 6b1e3c6b7f
commit 9084d3bd7c
13 changed files with 204 additions and 66 deletions
+25
View File
@@ -1,6 +1,9 @@
#include "data/parser/TaskParse.h"
#include "component/view/DialogView.h"
#include "utility/file/FileRegister.h"
#include "utility/scheduling/Blackboard.h"
#include "ApplicationStateMonitor.h"
TaskParse::TaskParse(
std::shared_ptr<StorageProvider> storageProvider,
@@ -28,6 +31,28 @@ void TaskParse::doEnter(std::shared_ptr<Blackboard> blackboard)
}
}
Task::TaskState TaskParse::doUpdate(std::shared_ptr<Blackboard> blackboard)
{
FilePath sourcePath = m_fileRegister->consumeSourceFile();
if (sourcePath.empty())
{
return STATE_FAILURE;
}
else
{
ApplicationStateMonitor::getInstance()->addIndexingFile(sourcePath);
m_dialogView->updateIndexingDialog(
m_fileRegister->getParsedSourceFilesCount(), m_fileRegister->getSourceFilesCount(), sourcePath.str()
);
indexFile(sourcePath);
ApplicationStateMonitor::getInstance()->removeIndexingFile(sourcePath);
}
return (m_interrupted ? STATE_FAILURE : STATE_SUCCESS);
}
void TaskParse::doExit(std::shared_ptr<Blackboard> blackboard)
{
std::lock_guard<std::mutex> lock(blackboard->getMutex());
+2
View File
@@ -25,10 +25,12 @@ public:
protected:
virtual void doEnter(std::shared_ptr<Blackboard> blackboard);
virtual TaskState doUpdate(std::shared_ptr<Blackboard> blackboard);
virtual void doExit(std::shared_ptr<Blackboard> blackboard);
virtual void doReset(std::shared_ptr<Blackboard> blackboard);
virtual void handleMessage(MessageInterruptTasks* message);
virtual void indexFile(FilePath sourcePath) = 0;
std::shared_ptr<StorageProvider> m_storageProvider;
std::shared_ptr<FileRegister> m_fileRegister;