add message when failed to load thumbs from cloud
This commit is contained in:
@@ -53,6 +53,22 @@ void NodeDialogCloud::load_thumbs_thread()
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curl_data_handler);
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://omigamedev.ddns.net:8080/panoview/cloud-list.php");
|
||||
auto err = curl_easy_perform(curl);
|
||||
if (err != CURLE_OK)
|
||||
{
|
||||
async_start();
|
||||
auto* align = container->add_child<Node>();
|
||||
align->SetWidthP(100.f);
|
||||
align->SetHeightP(100.f);
|
||||
align->SetAlign(YGAlignCenter);
|
||||
align->SetJustify(YGJustifyCenter);
|
||||
auto* t = align->add_child<NodeText>();
|
||||
t->set_font(kFont::Arial_30);
|
||||
t->set_text("Could not connect to the server");
|
||||
async_update();
|
||||
async_end();
|
||||
return;
|
||||
}
|
||||
|
||||
LOG("CLOUD LIST: %s", res.c_str());
|
||||
|
||||
auto names = split(res, ',');
|
||||
@@ -62,6 +78,8 @@ void NodeDialogCloud::load_thumbs_thread()
|
||||
std::string url = "http://omigamedev.ddns.net:8080/panoview/cloud-info.php?file=" + n;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
|
||||
auto err = curl_easy_perform(curl);
|
||||
if (err != CURLE_OK)
|
||||
break; // TODO: handle this error with a message or something
|
||||
auto info = split(res, ',', 3);
|
||||
int width = atoi(info[0].c_str());
|
||||
int height = atoi(info[1].c_str());
|
||||
|
||||
Reference in New Issue
Block a user