small fixes
This commit is contained in:
@@ -22,7 +22,7 @@ void App::cloud_upload()
|
||||
}
|
||||
else
|
||||
{
|
||||
std::thread([this] {
|
||||
auto upload_thread = [this] {
|
||||
std::string path = data_path + "/" + doc_name + ".ppi";
|
||||
if (ui::Canvas::I->m_unsaved)
|
||||
{
|
||||
@@ -52,7 +52,25 @@ void App::cloud_upload()
|
||||
layout[main_id]->update();
|
||||
async_redraw();
|
||||
async_end();
|
||||
}).detach();
|
||||
};
|
||||
|
||||
auto m = layout[main_id]->add_child<NodeMessageBox>();
|
||||
m->m_title->set_text("Publish document");
|
||||
m->m_message->set_text("Would you like to upload this document to the public domain?");
|
||||
m->btn_ok->m_text->set_text("Yes");
|
||||
m->btn_cancel->m_text->set_text("No");
|
||||
m->btn_ok->on_click = [this, m, upload_thread](Node*) {
|
||||
std::thread(upload_thread).detach();
|
||||
async_start();
|
||||
m->destroy();
|
||||
async_end();
|
||||
};
|
||||
m->btn_cancel->on_click = [this, m, upload_thread](Node*) {
|
||||
async_start();
|
||||
m->destroy();
|
||||
async_end();
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user