#define PROGRESSBAR_H
#include <QProgressBar>
+#include <QIcon>
-class FileManipulatorThread;
-
class ProgressBar : public QProgressBar {
Q_OBJECT;
-signals:
- void abortOperation(FileManipulatorThread*);
- void togglePauseOperation(FileManipulatorThread*);
-
public:
- explicit ProgressBar(FileManipulatorThread *thread, QWidget *parent = 0);
+ explicit ProgressBar(const QPixmap &icon, const QPixmap &inverseIcon);
+
+ QString mainText, fromText, toText;
+ QPixmap bgIcon, fgIcon;
+ bool paused;
+
+public slots:
+ void updateProgress(int val);
+ void updateMainText(const QString &text);
+ void setBottomTexts(const QString &left, const QString &right);
+ void setStartTime(time_t t);
+ void pause();
+ void resume(time_t stallTime);
+ void showRemoveNotice();
protected:
void mouseReleaseEvent(QMouseEvent *);
void contextMenuEvent(QContextMenuEvent *);
bool contextEvent;
- FileManipulatorThread *thread;
+
+ // stamp of the last ETA recalculation - done every second
+ time_t lastTimeUpdate;
+ time_t startTime;
+ char timeBuf[10];
+
+signals:
+ void abortOperation(ProgressBar*);
+ void togglePauseOperation(ProgressBar*);
};
#endif // PROGRESSBAR_H