From 0432c09d7889009beb9557e0546d0c4f240bb37e Mon Sep 17 00:00:00 2001 From: Arno Date: Sat, 3 Dec 2016 00:00:16 +0100 Subject: 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. --- filewidget.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'filewidget.h') diff --git a/filewidget.h b/filewidget.h index 296944e..6d427ff 100644 --- a/filewidget.h +++ b/filewidget.h @@ -22,6 +22,8 @@ class FileDisplay; class OriginDialog; class QMenu; class QSignalMapper; +class FileCopier; +class ProgressDialog; class FileWidget : public QWidget { Q_OBJECT @@ -63,6 +65,11 @@ class FileWidget : public QWidget { void paste(); void selectFirst(); void addAsOrigin(); + void setupProgress(QString file, qint64 size); + void setCopyProgress(qint64 bytes); + void copyFiles(QString destDir); + void hideCopyProgress(); + void copySuccess(bool success, QString source); protected: virtual void keyPressEvent(QKeyEvent *e); @@ -107,9 +114,11 @@ class FileWidget : public QWidget { QAction *mPasteA; QAction *mDeleteA; QAction *mAddAsOriginA; + ProgressDialog *mCopyProgress; FileDisplay *mFileDisplay; VideoSorter *mProxy; OriginDialog *mOrignDlg; + FileCopier *mFileCopier; int mFileAction; }; -- cgit v1.2.3-70-g09d2