summaryrefslogtreecommitdiffstats
path: root/progressdialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'progressdialog.cpp')
-rw-r--r--progressdialog.cpp40
1 files changed, 0 insertions, 40 deletions
diff --git a/progressdialog.cpp b/progressdialog.cpp
deleted file mode 100644
index 0690d65..0000000
--- a/progressdialog.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-#include <QHBoxLayout>
-#include <QVBoxLayout>
-#include <QPushButton>
-
-#include "progressdialog.h"
-
-ProgressDialog::ProgressDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f){
- mSrc = new QLabel;
- mDst = new QLabel;
- mProgress = new QProgressBar;
- mSum = new QLabel(tr("Wait for it..."));
- QPushButton *cancelBtn = new QPushButton(tr("Cancel"));
- connect(cancelBtn, &QPushButton::clicked, this, &ProgressDialog::cancelled);
- QHBoxLayout *btnLayout = new QHBoxLayout;
- btnLayout->addStretch();
- btnLayout->addWidget(cancelBtn);
- btnLayout->addStretch();
- QVBoxLayout *mainLayout = new QVBoxLayout;
- mainLayout->addWidget(mSrc);
- mainLayout->addWidget(mDst);
- mainLayout->addWidget(mProgress);
- mainLayout->addWidget(mSum);
- mainLayout->addLayout(btnLayout);
- setMaximumWidth(400);
- setMinimumWidth(400);
- setLayout(mainLayout);
-}
-
-void ProgressDialog::setLabelText(const QString &src, const QString &dst){
- QFontMetrics fm(mSrc->font());
- int width = mSrc->width() - 4;
- QString srcElided = fm.elidedText(src, Qt::ElideRight, width);
- mSrc->setText(srcElided);
- QString dstElided = fm.elidedText(dst, Qt::ElideRight, width);
- mDst->setText(dstElided);
-}
-
-void ProgressDialog::setValue(int val){
- mProgress->setValue(val);
-}