ui: Indexing UI
* Added DialogView with QtDialogView implementation to handle information dialogs * Implemented QtIndexingDialog class that covers all different dialogs for indexing * Directly communicate with DialogView from Prpject and all Tasks involved in indexing * Block QtMainWindow UI while indexing
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "component/controller/Controller.h"
|
||||
#include "component/view/CodeView.h"
|
||||
#include "component/view/CompositeView.h"
|
||||
#include "component/view/DialogView.h"
|
||||
#include "component/view/GraphView.h"
|
||||
#include "component/view/RefreshView.h"
|
||||
#include "component/view/SearchView.h"
|
||||
@@ -50,6 +51,8 @@ void ComponentManager::setup(ViewLayout* viewLayout)
|
||||
|
||||
std::shared_ptr<Component> featureComponent = m_componentFactory->createFeatureComponent();
|
||||
m_components.push_back(featureComponent);
|
||||
|
||||
m_dialogView = m_componentFactory->getViewFactory()->createDialogView(viewLayout);
|
||||
}
|
||||
|
||||
void ComponentManager::clearComponents()
|
||||
@@ -83,6 +86,11 @@ void ComponentManager::refreshViews()
|
||||
}
|
||||
}
|
||||
|
||||
DialogView* ComponentManager::getDialogView() const
|
||||
{
|
||||
return m_dialogView.get();
|
||||
}
|
||||
|
||||
ComponentManager::ComponentManager()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "component/ComponentFactory.h"
|
||||
|
||||
class CompositeView;
|
||||
class DialogView;
|
||||
class NetworkFactory;
|
||||
class StorageAccess;
|
||||
class View;
|
||||
@@ -26,6 +27,8 @@ public:
|
||||
void clearComponents();
|
||||
void refreshViews();
|
||||
|
||||
DialogView* getDialogView() const;
|
||||
|
||||
private:
|
||||
ComponentManager();
|
||||
ComponentManager(const ComponentManager&);
|
||||
@@ -34,6 +37,8 @@ private:
|
||||
|
||||
std::vector<std::shared_ptr<CompositeView>> m_compositeViews;
|
||||
std::vector<std::shared_ptr<Component>> m_components;
|
||||
|
||||
std::shared_ptr<DialogView> m_dialogView;
|
||||
};
|
||||
|
||||
#endif // COMPONENT_MANAGER_H
|
||||
|
||||
@@ -32,15 +32,6 @@ void StatusBarController::handleMessage(MessageFinishedParsing* message)
|
||||
{
|
||||
ErrorCountInfo errorCount = m_storageAccess->getErrorCount();
|
||||
getView()->setErrorCount(errorCount);
|
||||
|
||||
std::string status = message->getStatusStr();
|
||||
status += "; " + std::to_string(errorCount.total) + " error" + (errorCount.total != 1 ? "s" : "");
|
||||
if (errorCount.fatal > 0)
|
||||
{
|
||||
status += " (" + std::to_string(errorCount.fatal) + " fatal)";
|
||||
}
|
||||
|
||||
MessageStatus(status, false).dispatch();
|
||||
}
|
||||
|
||||
void StatusBarController::handleMessage(MessageRefresh* message)
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
#include "component/view/DialogView.h"
|
||||
|
||||
DialogView::DialogView()
|
||||
{
|
||||
}
|
||||
|
||||
DialogView::~DialogView()
|
||||
{
|
||||
}
|
||||
|
||||
void DialogView::showProgressDialog(const std::string& title, const std::string& message)
|
||||
{
|
||||
}
|
||||
|
||||
void DialogView::hideProgressDialog()
|
||||
{
|
||||
}
|
||||
|
||||
bool DialogView::startIndexingDialog(size_t cleanFileCount, size_t indexFileCount)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void DialogView::updateIndexingDialog(size_t fileCount, size_t totalFileCount, std::string sourcePath)
|
||||
{
|
||||
}
|
||||
|
||||
void DialogView::finishedIndexingDialog(size_t fileCount, size_t totalFileCount, float time, ErrorCountInfo errorInfo)
|
||||
{
|
||||
}
|
||||
|
||||
int DialogView::confirm(const std::string& message)
|
||||
{
|
||||
return confirm(message, std::vector<std::string>());
|
||||
}
|
||||
|
||||
int DialogView::confirm(const std::string& message, const std::vector<std::string>& options)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
#ifndef DIALOG_VIEW_H
|
||||
#define DIALOG_VIEW_H
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "data/ErrorCountInfo.h"
|
||||
|
||||
class DialogView
|
||||
{
|
||||
public:
|
||||
DialogView();
|
||||
virtual ~DialogView();
|
||||
|
||||
virtual void showProgressDialog(const std::string& title, const std::string& message);
|
||||
virtual void hideProgressDialog();
|
||||
|
||||
virtual bool startIndexingDialog(size_t cleanFileCount, size_t indexFileCount);
|
||||
virtual void updateIndexingDialog(size_t fileCount, size_t totalFileCount, std::string sourcePath);
|
||||
virtual void finishedIndexingDialog(size_t fileCount, size_t totalFileCount, float time, ErrorCountInfo errorInfo);
|
||||
|
||||
int confirm(const std::string& message);
|
||||
virtual int confirm(const std::string& message, const std::vector<std::string>& options);
|
||||
};
|
||||
|
||||
#endif // DIALOG_VIEW_H
|
||||
@@ -7,8 +7,3 @@ MainView::MainView()
|
||||
MainView::~MainView()
|
||||
{
|
||||
}
|
||||
|
||||
int MainView::confirm(const std::string& message)
|
||||
{
|
||||
return confirm(message, std::vector<std::string>());
|
||||
}
|
||||
|
||||
@@ -17,9 +17,6 @@ public:
|
||||
virtual void setTitle(const std::string& title) = 0;
|
||||
virtual void activateWindow() = 0;
|
||||
virtual void updateRecentProjectMenu() = 0;
|
||||
|
||||
virtual int confirm(const std::string& message);
|
||||
virtual int confirm(const std::string& message, const std::vector<std::string>& options) = 0;
|
||||
};
|
||||
|
||||
#endif // MAIN_VIEW_H
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "component/view/CompositeView.h"
|
||||
|
||||
class CodeView;
|
||||
class DialogView;
|
||||
class GraphView;
|
||||
class MainView;
|
||||
class RefreshView;
|
||||
@@ -30,6 +31,8 @@ public:
|
||||
virtual std::shared_ptr<SearchView> createSearchView(ViewLayout* viewLayout) const = 0;
|
||||
virtual std::shared_ptr<StatusBarView> createStatusBarView(ViewLayout* viewLayout) const = 0;
|
||||
virtual std::shared_ptr<UndoRedoView> createUndoRedoView(ViewLayout* viewLayout) const = 0;
|
||||
|
||||
virtual std::shared_ptr<DialogView> createDialogView(ViewLayout* viewLayout) const = 0;
|
||||
};
|
||||
|
||||
#endif // VIEW_FACTORY_H
|
||||
|
||||
Reference in New Issue
Block a user