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:
@@ -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());
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user