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. --- progressdialog.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 progressdialog.cpp (limited to 'progressdialog.cpp') diff --git a/progressdialog.cpp b/progressdialog.cpp new file mode 100644 index 0000000..778a3b4 --- /dev/null +++ b/progressdialog.cpp @@ -0,0 +1,25 @@ +#include +#include +#include + +#include "progressdialog.h" + +ProgressDialog::ProgressDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f){ + mLabel = new QLabel; + mProgress = new QProgressBar; + QPushButton *cancelBtn = new QPushButton(tr("Cancel")); + connect(cancelBtn, SIGNAL(clicked()), this, SIGNAL(cancelled())); + QHBoxLayout *btnLayout = new QHBoxLayout; + btnLayout->addStretch(); + btnLayout->addWidget(cancelBtn); + btnLayout->addStretch(); + QVBoxLayout *mainLayout = new QVBoxLayout; + mainLayout->addWidget(mLabel); + mainLayout->addWidget(mProgress); + mainLayout->addLayout(btnLayout); + setLayout(mainLayout); +} + +void ProgressDialog::setValue(int val){ + mProgress->setValue(val); +} -- cgit v1.2.3-70-g09d2