summaryrefslogtreecommitdiffstats
path: root/progressdialog.h
blob: 01657c874a2021b2f4214b62b4ee2a8a6fffd306 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef PROGRESSDIALOG_H
#define PROGRESSDIALOG_H

#include <QDialog>
#include <QLabel>
#include <QProgressBar>

class ProgressDialog : public QDialog {
    Q_OBJECT
    public:
        ProgressDialog(QWidget *parent = 0, Qt::WindowFlags f = 0);
        void setLabelText(const QString &src, const QString &dst);
        void setMaximum(int max) { mProgress->setMaximum(max); }
        void setSummary(const QString &sum) { mSum->setText(sum); }

    public slots:
        void setValue(int val);
        void setTotal(int total) { mTotal = total; }
        void setCopied(int copied) { mCopied = copied; }

    signals:
        void cancelled();

    private:
        QLabel *mSrc;
        QLabel *mDst;
        QLabel *mSum;
        QProgressBar *mProgress;
        int mTotal;
        int mCopied;

};

#endif // PROGRESSDIALOG_H