demo license checker
This commit is contained in:
@@ -127,6 +127,22 @@ void App::download(std::string filename, std::function<void(float)> progress)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool App::check_license()
|
||||||
|
{
|
||||||
|
CURL *curl = curl_easy_init();
|
||||||
|
if (curl)
|
||||||
|
{
|
||||||
|
std::string url = "http://omigamedev.com/panopainter/79516B99-8E67-40AD-B12F-149A5A9C2E15";
|
||||||
|
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
|
||||||
|
curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1L);
|
||||||
|
auto err = curl_easy_perform(curl);
|
||||||
|
curl_easy_cleanup(curl);
|
||||||
|
if (err == CURLcode::CURLE_OK)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void App::upload(std::string filename, std::string name, std::function<void(float)> progress)
|
void App::upload(std::string filename, std::string name, std::function<void(float)> progress)
|
||||||
{
|
{
|
||||||
CURL *curl;
|
CURL *curl;
|
||||||
|
|||||||
@@ -148,6 +148,7 @@ public:
|
|||||||
void cloud_browse();
|
void cloud_browse();
|
||||||
void upload(std::string filename, std::string name = "", std::function<void(float)> progress = nullptr);
|
void upload(std::string filename, std::string name = "", std::function<void(float)> progress = nullptr);
|
||||||
void download(std::string filename, std::function<void(float)> progress = nullptr);
|
void download(std::string filename, std::function<void(float)> progress = nullptr);
|
||||||
|
bool check_license();
|
||||||
|
|
||||||
std::shared_ptr<NodeProgressBar> show_progress(const std::string& title);
|
std::shared_ptr<NodeProgressBar> show_progress(const std::string& title);
|
||||||
|
|
||||||
|
|||||||
@@ -911,6 +911,8 @@ void ui::Canvas::import_equirectangular_thread(std::string file_path)
|
|||||||
|
|
||||||
void ui::Canvas::export_equirectangular(std::string file_path)
|
void ui::Canvas::export_equirectangular(std::string file_path)
|
||||||
{
|
{
|
||||||
|
if (!App::I.check_license())
|
||||||
|
return;
|
||||||
std::thread t(&ui::Canvas::export_equirectangular_thread, this, file_path);
|
std::thread t(&ui::Canvas::export_equirectangular_thread, this, file_path);
|
||||||
t.detach();
|
t.detach();
|
||||||
}
|
}
|
||||||
@@ -1152,6 +1154,8 @@ void ui::Canvas::inject_xmp(std::string jpg_path)
|
|||||||
|
|
||||||
void ui::Canvas::export_anim(std::string data_path)
|
void ui::Canvas::export_anim(std::string data_path)
|
||||||
{
|
{
|
||||||
|
if (!App::I.check_license())
|
||||||
|
return;
|
||||||
// save viewport and clear color states
|
// save viewport and clear color states
|
||||||
GLint vp[4];
|
GLint vp[4];
|
||||||
GLfloat cc[4];
|
GLfloat cc[4];
|
||||||
@@ -1263,6 +1267,8 @@ void ui::Canvas::export_anim(std::string data_path)
|
|||||||
|
|
||||||
void ui::Canvas::export_cubes(std::string data_path)
|
void ui::Canvas::export_cubes(std::string data_path)
|
||||||
{
|
{
|
||||||
|
if (!App::I.check_license())
|
||||||
|
return;
|
||||||
#ifdef __OBJC__
|
#ifdef __OBJC__
|
||||||
NSMutableArray* files = [NSMutableArray array];
|
NSMutableArray* files = [NSMutableArray array];
|
||||||
#endif
|
#endif
|
||||||
@@ -1343,6 +1349,8 @@ void ui::Canvas::export_cubes(std::string data_path)
|
|||||||
|
|
||||||
void ui::Canvas::project_save(std::string file_path)
|
void ui::Canvas::project_save(std::string file_path)
|
||||||
{
|
{
|
||||||
|
if (!App::I.check_license())
|
||||||
|
return;
|
||||||
std::thread t(&ui::Canvas::project_save_thread, this, file_path);
|
std::thread t(&ui::Canvas::project_save_thread, this, file_path);
|
||||||
t.detach();
|
t.detach();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -264,6 +264,9 @@ int main(int argc, char** argv)
|
|||||||
WNDCLASS wc;
|
WNDCLASS wc;
|
||||||
PIXELFORMATDESCRIPTOR pfd;
|
PIXELFORMATDESCRIPTOR pfd;
|
||||||
|
|
||||||
|
if (!App::I.check_license())
|
||||||
|
return -1;
|
||||||
|
|
||||||
if (argc == 1)
|
if (argc == 1)
|
||||||
App::I.initLog();
|
App::I.initLog();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user