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:
2019-07-29 22:54:50 +02:00
parent 73485cde01
commit f2d2ef1067
31 changed files with 1206 additions and 36 deletions

View File

@@ -25,7 +25,7 @@ void App::cloud_upload()
if (Canvas::I->m_unsaved)
{
Canvas::I->project_save_thread(doc_path);
Canvas::I->project_save_thread(doc_path, true);
}
auto pb = show_progress("Uploading");

View File

@@ -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;

View File

@@ -210,7 +210,7 @@ public:
void export_cubes();
void project_save(std::function<void(bool)> on_complete = nullptr);
void project_save(std::string file_path, std::function<void(bool)> on_complete = nullptr);
bool project_save_thread(std::string file_path);
bool project_save_thread(std::string file_path, bool show_progress);
void project_open(std::string file_path, std::function<void(bool)> on_complete = nullptr);
bool project_open_thread(std::string file_path);
void inject_xmp(std::string jpg_path);

View File

@@ -531,7 +531,7 @@ static void SetupExceptionHandler()
oss << std::put_time(&tm, "%d-%m-%Y %H-%M-%S");
auto path = App::I->data_path + "/" + App::I->doc_name + "-recovery (" + oss.str() + ").ppi";
Canvas::I->project_save_thread(path);
Canvas::I->project_save_thread(path, false);
static char abspath[MAX_PATH];
GetFullPathNameA(path.c_str(), MAX_PATH, abspath, NULL);
static char message[4096];

View File

@@ -137,13 +137,10 @@ void NodePanelGrid::init_controls()
};
m_commit->on_click = [this](Node*)
{
gl_state gl;
gl.save();
Canvas::I->draw_objects([this](const glm::mat4& camera, const glm::mat4& proj, int i) {
draw_heightmap(proj, camera, true);
});
m_groud_opacity->set_value(0);
gl.restore();
};
m_hm_texres->on_select = [this](Node*, int index) {
int texres = get_texres();