ui: file clearing progress

* display some progress information when clearing files
This commit is contained in:
malte_langkabel
2017-02-06 13:02:15 +01:00
parent 9177073ac3
commit be1a44a763
18 changed files with 256 additions and 94 deletions
+10 -2
View File
@@ -16,7 +16,7 @@ TaskCleanStorage::TaskCleanStorage(
void TaskCleanStorage::doEnter(std::shared_ptr<Blackboard> blackboard)
{
m_dialogView->showProgressDialog("Clearing Files", std::to_string(m_filePaths.size()) + " Files");
m_dialogView->showStatusDialog("Clearing Files", std::to_string(m_filePaths.size()) + " Files");
m_start = utility::durationStart();
@@ -28,7 +28,15 @@ void TaskCleanStorage::doEnter(std::shared_ptr<Blackboard> blackboard)
Task::TaskState TaskCleanStorage::doUpdate(std::shared_ptr<Blackboard> blackboard)
{
m_storage->clearFileElements(m_filePaths);
DialogView* dialogView = m_dialogView;
m_storage->clearFileElements(m_filePaths, [=](int progress)
{
if (dialogView != nullptr)
{
dialogView->showProgressDialog("Clearing", std::to_string(m_filePaths.size()) + " Files", progress);
}
}
);
m_filePaths.clear();