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:
@@ -0,0 +1,55 @@
|
||||
#ifndef QT_DIALOG_VIEW_H
|
||||
#define QT_DIALOG_VIEW_H
|
||||
|
||||
#include "component/view/DialogView.h"
|
||||
|
||||
#include "qt/utility/QtThreadedFunctor.h"
|
||||
#include "qt/window/QtWindowStack.h"
|
||||
|
||||
#include "utility/messaging/MessageListener.h"
|
||||
#include "utility/messaging/type/MessageInterruptTasks.h"
|
||||
#include "utility/messaging/type/MessageShowErrors.h"
|
||||
|
||||
class QtMainWindow;
|
||||
|
||||
class QtDialogView
|
||||
: public QObject
|
||||
, public DialogView
|
||||
, public MessageListener<MessageInterruptTasks>
|
||||
, public MessageListener<MessageShowErrors>
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QtDialogView(QtMainWindow* mainWindow);
|
||||
virtual ~QtDialogView();
|
||||
|
||||
void showProgressDialog(const std::string& title, const std::string& message) override;
|
||||
void hideProgressDialog() override;
|
||||
|
||||
bool startIndexingDialog(size_t cleanFileCount, size_t indexFileCount) override;
|
||||
void updateIndexingDialog(size_t fileCount, size_t totalFileCount, std::string sourcePath) override;
|
||||
void finishedIndexingDialog(size_t fileCount, size_t totalFileCount, float time, ErrorCountInfo errorInfo) override;
|
||||
|
||||
int confirm(const std::string& message, const std::vector<std::string>& options) override;
|
||||
|
||||
private:
|
||||
void handleMessage(MessageInterruptTasks* message) override;
|
||||
void handleMessage(MessageShowErrors* message) override;
|
||||
|
||||
void updateErrorCount(size_t errorCount, size_t fatalCount);
|
||||
|
||||
template<typename T>
|
||||
T* createWindow();
|
||||
|
||||
void setUIBlocked(bool blocked);
|
||||
|
||||
QtMainWindow* m_mainWindow;
|
||||
|
||||
QtWindowStack m_windowStack;
|
||||
|
||||
QtThreadedLambdaFunctor m_onQtThread;
|
||||
QtThreadedLambdaFunctor m_onQtThread2;
|
||||
};
|
||||
|
||||
#endif // QT_DIALOG_VIEW_H
|
||||
Reference in New Issue
Block a user