single file cloud upload

This commit is contained in:
2017-11-06 22:19:24 +00:00
parent fc402d584a
commit 33ea544f0b
6 changed files with 72 additions and 38 deletions

View File

@@ -6,6 +6,39 @@
using namespace ui;
void App::cloud_upload()
{
if (!canvas)
return;
if (doc_name.empty())
{
auto msgbox = new NodeMessageBox();
msgbox->m_manager = &layout;
msgbox->init();
msgbox->m_title->set_text("Warning");
msgbox->m_message->set_text("This document needs to be saved before upload.");
layout[main_id]->add_child(msgbox);
layout[main_id]->update();
}
else
{
std::thread([this] {
std::string path = data_path + "/" + doc_name + ".pano";
Canvas::I->project_save_thread(path);
upload(path);
async_start();
auto msgbox = new NodeMessageBox();
msgbox->m_manager = &layout;
msgbox->init();
msgbox->m_title->set_text("Success");
msgbox->m_message->set_text("This document has been succesfully uploaded.");
layout[main_id]->add_child(msgbox);
layout[main_id]->update();
async_end();
}).detach();
}
}
void App::cloud_upload_all()
{
std::thread([] {