1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 06:35:30 +00:00
OpenMW/apps/opencs/view/doc/loader.hpp

80 lines
1.4 KiB
C++
Raw Normal View History

2014-04-29 14:17:25 +02:00
#ifndef CSV_DOC_LOADER_H
#define CSV_DOC_LOADER_H
#include <map>
#include <QObject>
#include <QWidget>
2014-05-03 16:44:50 +02:00
#include <QSignalMapper>
2014-04-29 14:17:25 +02:00
2014-05-03 13:01:29 +02:00
class QLabel;
class QProgressBar;
2014-04-29 14:17:25 +02:00
namespace CSMDoc
{
class Document;
}
namespace CSVDoc
{
class LoadingDocument : public QWidget
{
Q_OBJECT
2014-05-03 16:44:50 +02:00
CSMDoc::Document *mDocument;
2014-05-03 13:01:29 +02:00
QLabel *mFile;
QProgressBar *mFileProgress;
2014-05-03 15:33:35 +02:00
QProgressBar *mRecordProgress;
2014-05-03 13:01:29 +02:00
private:
void closeEvent (QCloseEvent *event);
2014-04-29 14:17:25 +02:00
public:
LoadingDocument (CSMDoc::Document *document);
2014-05-03 13:01:29 +02:00
2014-05-03 15:33:35 +02:00
void nextStage (const std::string& name, int steps);
void nextRecord();
2014-05-03 16:44:50 +02:00
private slots:
void cancel();
signals:
void cancel (CSMDoc::Document *document);
2014-04-29 14:17:25 +02:00
};
class Loader : public QObject
{
Q_OBJECT
std::map<CSMDoc::Document *, LoadingDocument *> mDocuments;
public:
Loader();
virtual ~Loader();
2014-05-03 16:44:50 +02:00
signals:
void cancel (CSMDoc::Document *document);
2014-04-29 14:17:25 +02:00
public slots:
void add (CSMDoc::Document *document);
2014-04-29 14:17:25 +02:00
void loadingStopped (CSMDoc::Document *document, bool completed,
const std::string& error);
2014-05-03 13:01:29 +02:00
2014-05-03 15:33:35 +02:00
void nextStage (CSMDoc::Document *document, const std::string& name, int steps);
void nextRecord (CSMDoc::Document *document);
2014-04-29 14:17:25 +02:00
};
}
#endif