diff options
author | Arno <arno@disconnect.de> | 2016-12-03 00:00:16 +0100 |
---|---|---|
committer | Arno <arno@disconnect.de> | 2016-12-03 00:00:16 +0100 |
commit | 0432c09d7889009beb9557e0546d0c4f240bb37e (patch) | |
tree | b401ce1815e4e33e4ef79b9a69727f70a80e6e1b /progressdialog.h | |
parent | c8d8c71460c7e7d403c9dba1addc850a361d3e9c (diff) | |
download | ShemovCleaner-0432c09d7889009beb9557e0546d0c4f240bb37e.tar.gz ShemovCleaner-0432c09d7889009beb9557e0546d0c4f240bb37e.tar.bz2 ShemovCleaner-0432c09d7889009beb9557e0546d0c4f240bb37e.zip |
Actually use Copy Files to...
Create a FileCopier and show a custom, non-modal progress dialog when
we're copying files.
Turns out that a QProgressDialog always shows when it's created. This is
by design, so I had to implement one that fits my needs.
Also, a buffer size of 32K (as used in MKVMerger) is way too small to
max out the available bandwidth, so I set it to an (arbitrary) value of
16MB.
Diffstat (limited to 'progressdialog.h')
-rw-r--r-- | progressdialog.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/progressdialog.h b/progressdialog.h new file mode 100644 index 0000000..6aee406 --- /dev/null +++ b/progressdialog.h @@ -0,0 +1,27 @@ +#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 &text) { mLabel->setText(text); } + void setMaximum(int max) { mProgress->setMaximum(max); } + + public slots: + void setValue(int val); + + signals: + void cancelled(); + + private: + QLabel *mLabel; + QProgressBar *mProgress; + +}; + +#endif // PROGRESSDIALOG_H |