Skip to content

Commit

Permalink
feat: use Dtk::Widget::DWaterProgress as progress bar
Browse files Browse the repository at this point in the history
Change-Id: I574243065d2e96fc4c6a7f6cffc943d995afda7d
  • Loading branch information
Iceyer committed Sep 14, 2017
1 parent 1557a61 commit fcbab6f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 243 deletions.
2 changes: 0 additions & 2 deletions src/app/app.pro
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ HEADERS += \
view/usbselectview.h \
view/deviceinfoitem.h \
view/devicelistwidget.h \
view/dwaterprogress.h \
view/progressview.h \
view/resultview.h \
view/dropframe.h
Expand All @@ -33,7 +32,6 @@ SOURCES += \
view/usbselectview.cpp \
view/deviceinfoitem.cpp \
view/devicelistwidget.cpp \
view/dwaterprogress.cpp \
view/progressview.cpp \
view/resultview.cpp \
view/dropframe.cpp \
Expand Down
179 changes: 0 additions & 179 deletions src/app/view/dwaterprogress.cpp

This file was deleted.

58 changes: 0 additions & 58 deletions src/app/view/dwaterprogress.h

This file was deleted.

9 changes: 5 additions & 4 deletions src/app/view/progressview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
#include <QVBoxLayout>
#include <QCheckBox>
#include <QListWidget>
#include <DWaterProgress>

#include "suggestbutton.h"
#include "widgetutil.h"
#include "deviceinfoitem.h"
#include "devicelistwidget.h"
#include "dwaterprogress.h"

#include <bminterface.h>

Expand All @@ -24,7 +24,8 @@ ProgressView::ProgressView(QWidget *parent) : QWidget(parent)
m_title->setFixedHeight(38);
m_title->setStyleSheet("font-size: 26px;");

auto waterProgress = new DWaterProgress;
auto waterProgress = new Dtk::Widget::DWaterProgress;
waterProgress->setFixedSize(100, 100);

QLabel *m_hitsTitle = new QLabel(tr("Making the disk, please wait..."));
m_hitsTitle->setObjectName("ProgressHitsTitle");
Expand All @@ -49,7 +50,7 @@ ProgressView::ProgressView(QWidget *parent) : QWidget(parent)
mainLayout->addStretch();
mainLayout->addWidget(start, 0, Qt::AlignCenter);

waterProgress->setProgress(0);
waterProgress->setValue(40);
waterProgress->start();

this->setStyleSheet(WidgetUtil::getQss(":/theme/light/ProgressView.theme"));
Expand All @@ -59,7 +60,7 @@ ProgressView::ProgressView(QWidget *parent) : QWidget(parent)
connect(BMInterface::instance(), &BMInterface::reportProgress,
this, [ = ](quint32 current, quint32 error, const QString & title, const QString & description) {
qDebug() << error << current << title << description;
waterProgress->setProgress(static_cast<int>(current));
waterProgress->setValue(static_cast<int>(current));
if (current >= 100) {
qDebug() << "finish" << current << error;
emit finish(error, title, description);
Expand Down

0 comments on commit fcbab6f

Please sign in to comment.