add focus project, fix recovery save on ui thread, fix grid commit, wave_sdk submodule, use PlatformActivity as base for android/quest/focus and extend VRActivity on focus.
This commit is contained in:
@@ -2275,7 +2275,7 @@ void Canvas::project_save(std::function<void(bool)> on_complete)
|
||||
{
|
||||
std::thread t([=] {
|
||||
BT_SetTerminate();
|
||||
bool ret = project_save_thread(App::I->doc_path);
|
||||
bool ret = project_save_thread(App::I->doc_path, true);
|
||||
if (on_complete)
|
||||
on_complete(ret);
|
||||
});
|
||||
@@ -2290,7 +2290,7 @@ void Canvas::project_save(std::string file_path, std::function<void(bool)> on_co
|
||||
{
|
||||
std::thread t([=] {
|
||||
BT_SetTerminate();
|
||||
bool ret = project_save_thread(file_path);
|
||||
bool ret = project_save_thread(file_path, true);
|
||||
if (on_complete)
|
||||
on_complete(ret);
|
||||
});
|
||||
@@ -2302,7 +2302,7 @@ void Canvas::project_save(std::string file_path, std::function<void(bool)> on_co
|
||||
}
|
||||
}
|
||||
|
||||
bool Canvas::project_save_thread(std::string file_path)
|
||||
bool Canvas::project_save_thread(std::string file_path, bool show_progress)
|
||||
{
|
||||
// already saved, nothing to do
|
||||
if (!m_unsaved && file_path == App::I->doc_path)
|
||||
@@ -2355,14 +2355,10 @@ bool Canvas::project_save_thread(std::string file_path)
|
||||
|
||||
// load thumbnail
|
||||
Image thumb = thumbnail_generate(ppi_header.thumb_header.width, ppi_header.thumb_header.height);
|
||||
auto pb = std::make_shared<NodeProgressBar>();
|
||||
pb->m_manager = &App::I->layout;
|
||||
pb->init();
|
||||
pb->create();
|
||||
pb->loaded();
|
||||
pb->m_progress->SetWidthP(0);
|
||||
pb->m_title->set_text("Saving Pano Project");
|
||||
App::I->layout[App::I->main_id]->add_child(pb);
|
||||
|
||||
std::shared_ptr<NodeProgressBar> pb;
|
||||
if (show_progress)
|
||||
pb = App::I->show_progress("Saving Pano Project");
|
||||
|
||||
thumb.flip();
|
||||
fwrite(thumb.data(), thumb.size(), 1, fp);
|
||||
@@ -2423,7 +2419,8 @@ bool Canvas::project_save_thread(std::string file_path)
|
||||
}
|
||||
progress++;
|
||||
float p = (float)progress / total * 100.f;
|
||||
pb->m_progress->SetWidthP(p);
|
||||
if (show_progress)
|
||||
pb->m_progress->SetWidthP(p);
|
||||
LOG("progress: %f", p);
|
||||
}
|
||||
}
|
||||
@@ -2464,7 +2461,8 @@ bool Canvas::project_save_thread(std::string file_path)
|
||||
m_newdoc = false;
|
||||
}
|
||||
|
||||
pb->destroy();
|
||||
if (show_progress)
|
||||
pb->destroy();
|
||||
App::I->title_update();
|
||||
|
||||
return success;
|
||||
|
||||
Reference in New Issue
Block a user