improve progress bar, refactor node destruction, simplify layers export

This commit is contained in:
2019-08-16 10:15:14 +02:00
parent bb7d681dc3
commit fa94aa632f
17 changed files with 66 additions and 169 deletions

View File

@@ -31,7 +31,7 @@ void App::cloud_upload()
auto pb = show_progress("Uploading");
upload(doc_path, doc_filename, [this,pb](float p){
pb->m_progress->SetWidthP(p * 100.f);
pb->set_progress(p);
});
pb->destroy();
@@ -70,32 +70,20 @@ void App::cloud_upload_all()
gl_state gl;
std::shared_ptr<NodeProgressBar> pb;
if (layout.m_loaded)
{
pb = show_progress("Export Pano Image");
}
int progress = 0;
int total = (int)names.size();
pb = show_progress("Export Pano Image", names.size());
for (const auto& n : names)
{
std::string path = data_path + "/" + n;
upload(path);
progress++;
float p = (float)progress / total * 100.f;
LOG("progress: %f", p);
if (layout.m_loaded)
{
pb->m_progress->SetWidthP(p);
}
pb->increment();
}
if (layout.m_loaded)
{
pb->destroy();
}
}).detach();
}