tasks now emit floats rather than integers
Simplifies code for tasks.
This commit is contained in:
@@ -60,7 +60,7 @@ TaskViewItem::TaskViewItem(Task* task, QWidget *parent) :
|
||||
layout->addWidget(task_status_lbl_);
|
||||
|
||||
// Connect to the task
|
||||
connect(task_, &Task::ProgressChanged, progress_bar_, &QProgressBar::setValue);
|
||||
connect(task_, &Task::ProgressChanged, this, &TaskViewItem::UpdateProgress);
|
||||
connect(cancel_btn_, &QPushButton::clicked, task_, &Task::Cancel, Qt::DirectConnection);
|
||||
}
|
||||
|
||||
@@ -69,4 +69,9 @@ void TaskViewItem::Failed()
|
||||
task_status_lbl_->setText(task_->GetError());
|
||||
}
|
||||
|
||||
void TaskViewItem::UpdateProgress(double d)
|
||||
{
|
||||
progress_bar_->setValue(qRound(100.0 * d));
|
||||
}
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
Reference in New Issue
Block a user