fix iOS text input and export ppbr

This commit is contained in:
2019-09-19 15:25:33 +02:00
parent 77a3bdde03
commit b8c646f748
6 changed files with 27 additions and 22 deletions

View File

@@ -602,19 +602,20 @@ void App::dialog_ppbr_export()
auto root = layout[main_id];
auto dialog = root->add_child_ref<NodeDialogExportPPBR>();
dialog->btn_ok->on_click = [this, dialog] (Node*) {
NodePanelBrushPreset::PPBRInfo info;
info.author = dialog->txt_author->m_text;
info.url = dialog->txt_url->m_text;
info.email = dialog->txt_email->m_text;
info.descr = dialog->txt_descr->m_text;
info.header_image = dialog->m_header_image;
#if __IOS__
App::I->pick_file_save("ppbr", [this, dialog] (std::string path) {
presets->export_ppbr(path, dialog->m_header_image);
App::I->pick_file_save("ppbr", [this, dialog, info] (std::string path) {
presets->export_ppbr(path, info);
});
#else
App::I->pick_file_save({ "ppbr" }, [this, dialog] (std::string path) {
std::thread([this, path, dialog] {
App::I->pick_file_save({ "ppbr" }, [this, dialog, info] (std::string path) {
std::thread([this, path, dialog, info] {
BT_SetTerminate();
NodePanelBrushPreset::PPBRInfo info;
info.author = dialog->txt_author->m_text;
info.url = dialog->txt_url->m_text;
info.email = dialog->txt_email->m_text;
info.descr = dialog->txt_descr->m_text;
presets->export_ppbr(path, info);
dialog->destroy();
App::I->message_box("Export PPBR", "Brushes exported to:\n" + path);
@@ -622,4 +623,4 @@ void App::dialog_ppbr_export()
});
#endif
};
}
}