1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-30 21:32:42 +00:00
OpenMW/apps/opencs/view/doc/operation.hpp

52 lines
941 B
C++
Raw Normal View History

2012-11-23 12:20:35 +01:00
#ifndef CSV_DOC_OPERATION_H
#define CSV_DOC_OPERATION_H
#include <QObject>
class QHBoxLayout;
class QPushButton;
class QProgressBar;
2012-11-23 12:20:35 +01:00
namespace CSVDoc
{
class Operation : public QObject
2012-11-23 12:20:35 +01:00
{
2022-09-22 21:26:05 +03:00
Q_OBJECT
2012-11-23 12:20:35 +01:00
2022-09-22 21:26:05 +03:00
int mType;
bool mStalling;
QProgressBar* mProgressBar;
QPushButton* mAbortButton;
QHBoxLayout* mLayout;
2012-11-23 12:20:35 +01:00
2022-09-22 21:26:05 +03:00
// not implemented
Operation(const Operation&);
Operation& operator=(const Operation&);
2012-11-23 12:20:35 +01:00
2022-09-22 21:26:05 +03:00
void updateLabel(int threads = -1);
2012-11-23 12:20:35 +01:00
2022-09-22 21:26:05 +03:00
public:
Operation(int type, QWidget* parent);
~Operation() override;
2012-11-23 12:20:35 +01:00
2022-09-22 21:26:05 +03:00
void setProgress(int current, int max, int threads);
2012-11-23 12:20:35 +01:00
2022-09-22 21:26:05 +03:00
int getType() const;
QHBoxLayout* getLayout() const;
2012-11-23 12:20:35 +01:00
2022-09-22 21:26:05 +03:00
private:
void setBarColor(int type);
void initWidgets();
2022-09-22 21:26:05 +03:00
signals:
2022-09-22 21:26:05 +03:00
void abortOperation(int type);
2022-09-22 21:26:05 +03:00
private slots:
2022-09-22 21:26:05 +03:00
void abortOperation();
2012-11-23 12:20:35 +01:00
};
}
#endif