add export message box

This commit is contained in:
2018-09-27 16:15:38 +02:00
parent ea25993f55
commit d80c4e6054
5 changed files with 37 additions and 8 deletions

View File

@@ -20,6 +20,19 @@ std::shared_ptr<NodeProgressBar> App::show_progress(const std::string& title)
return pb;
}
void App::message_box(const std::string &title, const std::string& text)
{
async_start();
auto* m = layout[main_id]->add_child<NodeMessageBox>();
m->m_title->set_text(title.c_str());
m->m_message->set_text(text.c_str());
m->btn_ok->m_text->set_text("Ok");
m->btn_cancel->destroy();
layout[main_id]->update();
async_redraw();
async_end();
}
void App::dialog_usermanual()
{
auto dialog = std::make_shared<NodeUserManual>();
@@ -364,7 +377,15 @@ void App::dialog_export()
{
if (canvas)
{
canvas->m_canvas->export_equirectangular(data_path + "/" + doc_name + ".jpg");
canvas->m_canvas->export_equirectangular(data_path + "/" + doc_name + ".jpg", [this]{
#if defined(__IOS__)
message_box("Export JPG", "Image exported to Photos");
#elif defined(__OSX__)
message_box("Export JPG", "Image exported to Pictures/PanoPainter folder");
#elif defined(_WIN32)
message_box("Export JPG", "Image exported to Images/PanoPainter folder");
#endif
});
}
}