add share button and implement AirDrop share in OSX, update info.plist to set on Mac OS the default app for PPI, on iOS include the Documents/Inbox subfolder used to store the received files from AirDrop

This commit is contained in:
2018-10-12 11:37:08 +02:00
parent bc0ac5d893
commit ce344126be
17 changed files with 234 additions and 29 deletions

View File

@@ -208,15 +208,13 @@ int progress_callback_upload(void *clientp, curl_off_t dltotal,
return 0;
}
void App::download(std::string filename, std::function<void(float)> progress)
void App::download(std::string url, std::string dest_filepath, std::function<void(float)> progress)
{
CURL *curl = curl_easy_init();
if (curl)
{
auto dest = data_path + "/" + filename;
FILE* fp = fopen(dest.c_str(), "wb");
std::string url = "https://panopainter.com/cloud/cloud-dwl.php?file=" + filename;
LOG("download %s to %s", url.c_str(), dest.c_str());
FILE* fp = fopen(dest_filepath.c_str(), "wb");
LOG("download %s to %s", url.c_str(), dest_filepath.c_str());
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curl_data_write);