ENH: [STUDIO-4135] only sync user preset that need update
Change-Id: I9a1c0f9c34a5f5950beffa1c5e8f63c4cf7be6c6
This commit is contained in:
parent
dcb006535a
commit
d9de09bba6
|
@ -1386,7 +1386,7 @@ bool PresetCollection::reset_project_embedded_presets()
|
||||||
return re_select;
|
return re_select;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PresetCollection::set_sync_info_and_save(std::string name, std::string setting_id, std::string syncinfo)
|
void PresetCollection::set_sync_info_and_save(std::string name, std::string setting_id, std::string syncinfo, long long update_time)
|
||||||
{
|
{
|
||||||
lock();
|
lock();
|
||||||
for (auto it = m_presets.begin(); it != m_presets.end(); it++) {
|
for (auto it = m_presets.begin(); it != m_presets.end(); it++) {
|
||||||
|
@ -1397,6 +1397,8 @@ void PresetCollection::set_sync_info_and_save(std::string name, std::string sett
|
||||||
else
|
else
|
||||||
preset->sync_info = syncinfo;
|
preset->sync_info = syncinfo;
|
||||||
preset->setting_id = setting_id;
|
preset->setting_id = setting_id;
|
||||||
|
if (update_time > 0)
|
||||||
|
preset->updated_time = update_time;
|
||||||
preset->save_info();
|
preset->save_info();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1404,6 +1406,15 @@ void PresetCollection::set_sync_info_and_save(std::string name, std::string sett
|
||||||
unlock();
|
unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool PresetCollection::need_sync(std::string name, std::string setting_id, long long update_time)
|
||||||
|
{
|
||||||
|
lock();
|
||||||
|
auto preset = find_preset(name, false, true);
|
||||||
|
bool need = preset == nullptr || preset->setting_id != setting_id || preset->updated_time < update_time;
|
||||||
|
unlock();
|
||||||
|
return need;
|
||||||
|
}
|
||||||
|
|
||||||
//BBS: get user presets
|
//BBS: get user presets
|
||||||
int PresetCollection::get_user_presets(std::vector<Preset>& result_presets)
|
int PresetCollection::get_user_presets(std::vector<Preset>& result_presets)
|
||||||
{
|
{
|
||||||
|
@ -1449,6 +1460,8 @@ void PresetCollection::save_user_presets(const std::string& dir_path, const std:
|
||||||
for (auto it = m_presets.begin(); it != m_presets.end(); it++) {
|
for (auto it = m_presets.begin(); it != m_presets.end(); it++) {
|
||||||
Preset* preset = &m_presets[it - m_presets.begin()];
|
Preset* preset = &m_presets[it - m_presets.begin()];
|
||||||
if (!preset->is_user()) continue;
|
if (!preset->is_user()) continue;
|
||||||
|
if (preset->sync_info != "save") continue;
|
||||||
|
preset->sync_info.clear();
|
||||||
preset->file = path_from_name(preset->name);
|
preset->file = path_from_name(preset->name);
|
||||||
|
|
||||||
if (preset->is_custom_defined()) {
|
if (preset->is_custom_defined()) {
|
||||||
|
@ -1565,7 +1578,6 @@ bool PresetCollection::load_user_preset(std::string name, std::map<std::string,
|
||||||
else {
|
else {
|
||||||
//update the one from cloud which is newer
|
//update the one from cloud which is newer
|
||||||
need_update = true;
|
need_update = true;
|
||||||
iter->sync_info.clear();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1614,7 +1626,8 @@ bool PresetCollection::load_user_preset(std::string name, std::map<std::string,
|
||||||
}
|
}
|
||||||
iter->config = new_config;
|
iter->config = new_config;
|
||||||
iter->updated_time = cloud_update_time;
|
iter->updated_time = cloud_update_time;
|
||||||
iter->version = cloud_version.value();
|
iter->sync_info = "save";
|
||||||
|
iter->version = cloud_version.value();
|
||||||
iter->user_id = cloud_user_id;
|
iter->user_id = cloud_user_id;
|
||||||
iter->setting_id = cloud_setting_id;
|
iter->setting_id = cloud_setting_id;
|
||||||
iter->base_id = cloud_base_id;
|
iter->base_id = cloud_base_id;
|
||||||
|
@ -1630,7 +1643,8 @@ bool PresetCollection::load_user_preset(std::string name, std::map<std::string,
|
||||||
preset.loaded = true;
|
preset.loaded = true;
|
||||||
preset.config = new_config;
|
preset.config = new_config;
|
||||||
preset.updated_time = cloud_update_time;
|
preset.updated_time = cloud_update_time;
|
||||||
preset.version = cloud_version.value();
|
preset.sync_info = "save";
|
||||||
|
preset.version = cloud_version.value();
|
||||||
preset.user_id = cloud_user_id;
|
preset.user_id = cloud_user_id;
|
||||||
preset.setting_id = cloud_setting_id;
|
preset.setting_id = cloud_setting_id;
|
||||||
preset.base_id = cloud_base_id;
|
preset.base_id = cloud_base_id;
|
||||||
|
@ -2102,7 +2116,6 @@ void PresetCollection::save_current_preset(const std::string &new_name, bool det
|
||||||
this->get_selected_preset().base_id = parent_preset->setting_id;
|
this->get_selected_preset().base_id = parent_preset->setting_id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this->get_selected_preset().updated_time = (long long)Slic3r::Utils::get_current_time_utc();
|
|
||||||
if (parent_preset)
|
if (parent_preset)
|
||||||
this->get_selected_preset().save(&(parent_preset->config));
|
this->get_selected_preset().save(&(parent_preset->config));
|
||||||
else
|
else
|
||||||
|
|
|
@ -429,7 +429,8 @@ public:
|
||||||
void update_after_user_presets_loaded();
|
void update_after_user_presets_loaded();
|
||||||
//BBS: get user presets
|
//BBS: get user presets
|
||||||
int get_user_presets(std::vector<Preset>& result_presets);
|
int get_user_presets(std::vector<Preset>& result_presets);
|
||||||
void set_sync_info_and_save(std::string name, std::string setting_id, std::string syncinfo);
|
void set_sync_info_and_save(std::string name, std::string setting_id, std::string syncinfo, long long update_time);
|
||||||
|
bool need_sync(std::string name, std::string setting_id, long long update_time);
|
||||||
|
|
||||||
//BBS: add function to generate differed preset for save
|
//BBS: add function to generate differed preset for save
|
||||||
//the pointer should be freed by the caller
|
//the pointer should be freed by the caller
|
||||||
|
|
|
@ -4475,17 +4475,19 @@ void GUI_App::sync_preset(Preset* preset)
|
||||||
int result = -1;
|
int result = -1;
|
||||||
unsigned int http_code = 200;
|
unsigned int http_code = 200;
|
||||||
std::string updated_info;
|
std::string updated_info;
|
||||||
|
long long update_time = 0;
|
||||||
// only sync user's preset
|
// only sync user's preset
|
||||||
if (!preset->is_user()) return;
|
if (!preset->is_user()) return;
|
||||||
if (preset->is_custom_defined()) return;
|
if (preset->is_custom_defined()) return;
|
||||||
|
|
||||||
if (preset->setting_id.empty() && preset->sync_info.empty() && !preset->base_id.empty()) {
|
auto setting_id = preset->setting_id;
|
||||||
|
if (setting_id.empty() && preset->sync_info.empty() && !preset->base_id.empty()) {
|
||||||
std::map<std::string, std::string> values_map;
|
std::map<std::string, std::string> values_map;
|
||||||
int ret = preset_bundle->get_differed_values_to_update(*preset, values_map);
|
int ret = preset_bundle->get_differed_values_to_update(*preset, values_map);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
std::string new_setting_id = m_agent->request_setting_id(preset->name, &values_map, &http_code);
|
std::string new_setting_id = m_agent->request_setting_id(preset->name, &values_map, &http_code);
|
||||||
if (!new_setting_id.empty()) {
|
if (!new_setting_id.empty()) {
|
||||||
preset->setting_id = new_setting_id;
|
setting_id = new_setting_id;
|
||||||
result = 0;
|
result = 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -4511,7 +4513,7 @@ void GUI_App::sync_preset(Preset* preset)
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
std::string new_setting_id = m_agent->request_setting_id(preset->name, &values_map, &http_code);
|
std::string new_setting_id = m_agent->request_setting_id(preset->name, &values_map, &http_code);
|
||||||
if (!new_setting_id.empty()) {
|
if (!new_setting_id.empty()) {
|
||||||
preset->setting_id = new_setting_id;
|
setting_id = new_setting_id;
|
||||||
result = 0;
|
result = 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -4530,21 +4532,24 @@ void GUI_App::sync_preset(Preset* preset)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ((preset->sync_info.compare("update") == 0) && !preset->base_id.empty()) {
|
else if ((preset->sync_info.compare("update") == 0) && !preset->base_id.empty()) {
|
||||||
if (!preset->setting_id.empty()) {
|
if (!setting_id.empty()) {
|
||||||
std::map<std::string, std::string> values_map;
|
std::map<std::string, std::string> values_map;
|
||||||
int ret = preset_bundle->get_differed_values_to_update(*preset, values_map);
|
int ret = preset_bundle->get_differed_values_to_update(*preset, values_map);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
if (values_map[BBL_JSON_KEY_BASE_ID] == preset->setting_id) {
|
if (values_map[BBL_JSON_KEY_BASE_ID] == setting_id) {
|
||||||
//clear the setting_id in this case
|
//clear the setting_id in this case
|
||||||
preset->setting_id.clear();
|
setting_id.clear();
|
||||||
result = 0;
|
result = 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
result = m_agent->put_setting(preset->setting_id, preset->name, &values_map, &http_code);
|
result = m_agent->put_setting(setting_id, preset->name, &values_map, &http_code);
|
||||||
if (http_code >= 400) {
|
if (http_code >= 400) {
|
||||||
result = 0;
|
result = 0;
|
||||||
updated_info = "hold";
|
updated_info = "hold";
|
||||||
BOOST_LOG_TRIVIAL(error) << "[sync_preset] put setting_id = " << preset->setting_id << " failed, http_code = " << http_code;
|
BOOST_LOG_TRIVIAL(error) << "[sync_preset] put setting_id = " << setting_id << " failed, http_code = " << http_code;
|
||||||
|
auto update_time_str = values_map[BBL_JSON_KEY_UPDATE_TIME];
|
||||||
|
if (!update_time_str.empty())
|
||||||
|
update_time = std::atoll(update_time_str.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4568,11 +4573,11 @@ void GUI_App::sync_preset(Preset* preset)
|
||||||
|
|
||||||
BOOST_LOG_TRIVIAL(trace) << "sync_preset: sync operation: " << preset->sync_info << " success! preset = " << preset->name;
|
BOOST_LOG_TRIVIAL(trace) << "sync_preset: sync operation: " << preset->sync_info << " success! preset = " << preset->name;
|
||||||
if (preset->type == Preset::Type::TYPE_FILAMENT) {
|
if (preset->type == Preset::Type::TYPE_FILAMENT) {
|
||||||
preset_bundle->filaments.set_sync_info_and_save(preset->name, preset->setting_id, updated_info);
|
preset_bundle->filaments.set_sync_info_and_save(preset->name, setting_id, updated_info, update_time);
|
||||||
} else if (preset->type == Preset::Type::TYPE_PRINT) {
|
} else if (preset->type == Preset::Type::TYPE_PRINT) {
|
||||||
preset_bundle->prints.set_sync_info_and_save(preset->name, preset->setting_id, updated_info);
|
preset_bundle->prints.set_sync_info_and_save(preset->name, setting_id, updated_info, update_time);
|
||||||
} else if (preset->type == Preset::Type::TYPE_PRINTER) {
|
} else if (preset->type == Preset::Type::TYPE_PRINTER) {
|
||||||
preset_bundle->printers.set_sync_info_and_save(preset->name, preset->setting_id, updated_info);
|
preset_bundle->printers.set_sync_info_and_save(preset->name, setting_id, updated_info, update_time);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4621,7 +4626,24 @@ void GUI_App::start_sync_user_preset(bool with_progress_dlg)
|
||||||
[this, progressFn, cancelFn, finishFn] {
|
[this, progressFn, cancelFn, finishFn] {
|
||||||
// get setting list, update setting list
|
// get setting list, update setting list
|
||||||
std::string version = preset_bundle->get_vendor_profile_version(PresetBundle::BBL_BUNDLE).to_string();
|
std::string version = preset_bundle->get_vendor_profile_version(PresetBundle::BBL_BUNDLE).to_string();
|
||||||
int ret = m_agent->get_setting_list(version, progressFn, cancelFn);
|
int ret = m_agent->get_setting_list2(version, [this](auto info) {
|
||||||
|
auto type = info[BBL_JSON_KEY_TYPE];
|
||||||
|
auto name = info[BBL_JSON_KEY_NAME];
|
||||||
|
auto setting_id = info[BBL_JSON_KEY_SETTING_ID];
|
||||||
|
auto update_time_str = info[BBL_JSON_KEY_UPDATE_TIME];
|
||||||
|
long long update_time = 0;
|
||||||
|
if (!update_time_str.empty())
|
||||||
|
update_time = std::atoll(update_time_str.c_str());
|
||||||
|
if (type == "filament") {
|
||||||
|
return preset_bundle->filaments.need_sync(name, setting_id, update_time);
|
||||||
|
} else if (type == "machine") {
|
||||||
|
return preset_bundle->prints.need_sync(name, setting_id, update_time);
|
||||||
|
} else if (type == "printer") {
|
||||||
|
return preset_bundle->printers.need_sync(name, setting_id, update_time);
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}, progressFn, cancelFn);
|
||||||
finishFn(ret == 0);
|
finishFn(ret == 0);
|
||||||
|
|
||||||
int count = 0, sync_count = 0;
|
int count = 0, sync_count = 0;
|
||||||
|
|
|
@ -4136,7 +4136,7 @@ bool Tab::select_preset(std::string preset_name, bool delete_current /*=false*/,
|
||||||
Preset ¤t_preset = m_presets->get_selected_preset();
|
Preset ¤t_preset = m_presets->get_selected_preset();
|
||||||
if (!current_preset.setting_id.empty()) {
|
if (!current_preset.setting_id.empty()) {
|
||||||
BOOST_LOG_TRIVIAL(info) << "delete preset = " << current_preset.name << ", setting_id = " << current_preset.setting_id;
|
BOOST_LOG_TRIVIAL(info) << "delete preset = " << current_preset.name << ", setting_id = " << current_preset.setting_id;
|
||||||
m_presets->set_sync_info_and_save(current_preset.name, current_preset.setting_id, "delete");
|
m_presets->set_sync_info_and_save(current_preset.name, current_preset.setting_id, "delete", 0);
|
||||||
wxGetApp().delete_preset_from_cloud(current_preset.setting_id);
|
wxGetApp().delete_preset_from_cloud(current_preset.setting_id);
|
||||||
}
|
}
|
||||||
BOOST_LOG_TRIVIAL(info) << boost::format("will delete current preset...");
|
BOOST_LOG_TRIVIAL(info) << boost::format("will delete current preset...");
|
||||||
|
|
|
@ -79,6 +79,7 @@ func_get_user_presets NetworkAgent::get_user_presets_ptr = nullptr
|
||||||
func_request_setting_id NetworkAgent::request_setting_id_ptr = nullptr;
|
func_request_setting_id NetworkAgent::request_setting_id_ptr = nullptr;
|
||||||
func_put_setting NetworkAgent::put_setting_ptr = nullptr;
|
func_put_setting NetworkAgent::put_setting_ptr = nullptr;
|
||||||
func_get_setting_list NetworkAgent::get_setting_list_ptr = nullptr;
|
func_get_setting_list NetworkAgent::get_setting_list_ptr = nullptr;
|
||||||
|
func_get_setting_list2 NetworkAgent::get_setting_list2_ptr = nullptr;
|
||||||
func_delete_setting NetworkAgent::delete_setting_ptr = nullptr;
|
func_delete_setting NetworkAgent::delete_setting_ptr = nullptr;
|
||||||
func_get_studio_info_url NetworkAgent::get_studio_info_url_ptr = nullptr;
|
func_get_studio_info_url NetworkAgent::get_studio_info_url_ptr = nullptr;
|
||||||
func_set_extra_http_header NetworkAgent::set_extra_http_header_ptr = nullptr;
|
func_set_extra_http_header NetworkAgent::set_extra_http_header_ptr = nullptr;
|
||||||
|
@ -233,7 +234,8 @@ int NetworkAgent::initialize_network_module(bool using_backup)
|
||||||
get_user_presets_ptr = reinterpret_cast<func_get_user_presets>(get_network_function("bambu_network_get_user_presets"));
|
get_user_presets_ptr = reinterpret_cast<func_get_user_presets>(get_network_function("bambu_network_get_user_presets"));
|
||||||
request_setting_id_ptr = reinterpret_cast<func_request_setting_id>(get_network_function("bambu_network_request_setting_id"));
|
request_setting_id_ptr = reinterpret_cast<func_request_setting_id>(get_network_function("bambu_network_request_setting_id"));
|
||||||
put_setting_ptr = reinterpret_cast<func_put_setting>(get_network_function("bambu_network_put_setting"));
|
put_setting_ptr = reinterpret_cast<func_put_setting>(get_network_function("bambu_network_put_setting"));
|
||||||
get_setting_list_ptr = reinterpret_cast<func_get_setting_list>(get_network_function("bambu_network_get_setting_list"));
|
get_setting_list_ptr = reinterpret_cast<func_get_setting_list>(get_network_function("bambu_network_get_setting_list"));
|
||||||
|
get_setting_list2_ptr = reinterpret_cast<func_get_setting_list2>(get_network_function("bambu_network_get_setting_list2"));
|
||||||
delete_setting_ptr = reinterpret_cast<func_delete_setting>(get_network_function("bambu_network_delete_setting"));
|
delete_setting_ptr = reinterpret_cast<func_delete_setting>(get_network_function("bambu_network_delete_setting"));
|
||||||
get_studio_info_url_ptr = reinterpret_cast<func_get_studio_info_url>(get_network_function("bambu_network_get_studio_info_url"));
|
get_studio_info_url_ptr = reinterpret_cast<func_get_studio_info_url>(get_network_function("bambu_network_get_studio_info_url"));
|
||||||
set_extra_http_header_ptr = reinterpret_cast<func_set_extra_http_header>(get_network_function("bambu_network_set_extra_http_header"));
|
set_extra_http_header_ptr = reinterpret_cast<func_set_extra_http_header>(get_network_function("bambu_network_set_extra_http_header"));
|
||||||
|
@ -343,6 +345,7 @@ int NetworkAgent::unload_network_module()
|
||||||
request_setting_id_ptr = nullptr;
|
request_setting_id_ptr = nullptr;
|
||||||
put_setting_ptr = nullptr;
|
put_setting_ptr = nullptr;
|
||||||
get_setting_list_ptr = nullptr;
|
get_setting_list_ptr = nullptr;
|
||||||
|
get_setting_list2_ptr = nullptr;
|
||||||
delete_setting_ptr = nullptr;
|
delete_setting_ptr = nullptr;
|
||||||
get_studio_info_url_ptr = nullptr;
|
get_studio_info_url_ptr = nullptr;
|
||||||
set_extra_http_header_ptr = nullptr;
|
set_extra_http_header_ptr = nullptr;
|
||||||
|
@ -967,8 +970,19 @@ int NetworkAgent::get_setting_list(std::string bundle_version, ProgressFn pro_fn
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
if (network_agent && get_setting_list_ptr) {
|
if (network_agent && get_setting_list_ptr) {
|
||||||
ret = get_setting_list_ptr(network_agent, bundle_version, pro_fn, cancel_fn);
|
ret = get_setting_list_ptr(network_agent, bundle_version, pro_fn, cancel_fn);
|
||||||
if (ret)
|
if (ret) BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(" error: network_agent=%1%, ret=%2%, bundle_version=%3%") % network_agent % ret % bundle_version;
|
||||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(" error: network_agent=%1%, ret=%2%, bundle_version=%3%")%network_agent %ret %bundle_version ;
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
int NetworkAgent::get_setting_list2(std::string bundle_version, CheckFn chk_fn, ProgressFn pro_fn, WasCancelledFn cancel_fn)
|
||||||
|
{
|
||||||
|
int ret = 0;
|
||||||
|
if (network_agent && get_setting_list2_ptr) {
|
||||||
|
ret = get_setting_list2_ptr(network_agent, bundle_version, chk_fn, pro_fn, cancel_fn);
|
||||||
|
if (ret) BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(" error: network_agent=%1%, ret=%2%, bundle_version=%3%") % network_agent % ret % bundle_version;
|
||||||
|
} else {
|
||||||
|
ret = get_setting_list(bundle_version, pro_fn, cancel_fn);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,6 +59,7 @@ typedef int (*func_get_user_presets)(void *agent, std::map<std::string, std::map
|
||||||
typedef std::string (*func_request_setting_id)(void *agent, std::string name, std::map<std::string, std::string>* values_map, unsigned int* http_code);
|
typedef std::string (*func_request_setting_id)(void *agent, std::string name, std::map<std::string, std::string>* values_map, unsigned int* http_code);
|
||||||
typedef int (*func_put_setting)(void *agent, std::string setting_id, std::string name, std::map<std::string, std::string>* values_map, unsigned int* http_code);
|
typedef int (*func_put_setting)(void *agent, std::string setting_id, std::string name, std::map<std::string, std::string>* values_map, unsigned int* http_code);
|
||||||
typedef int (*func_get_setting_list)(void *agent, std::string bundle_version, ProgressFn pro_fn, WasCancelledFn cancel_fn);
|
typedef int (*func_get_setting_list)(void *agent, std::string bundle_version, ProgressFn pro_fn, WasCancelledFn cancel_fn);
|
||||||
|
typedef int (*func_get_setting_list2)(void *agent, std::string bundle_version, CheckFn chk_fn, ProgressFn pro_fn, WasCancelledFn cancel_fn);
|
||||||
typedef int (*func_delete_setting)(void *agent, std::string setting_id);
|
typedef int (*func_delete_setting)(void *agent, std::string setting_id);
|
||||||
typedef std::string (*func_get_studio_info_url)(void *agent);
|
typedef std::string (*func_get_studio_info_url)(void *agent);
|
||||||
typedef int (*func_set_extra_http_header)(void *agent, std::map<std::string, std::string> extra_headers);
|
typedef int (*func_set_extra_http_header)(void *agent, std::map<std::string, std::string> extra_headers);
|
||||||
|
@ -158,6 +159,7 @@ public:
|
||||||
std::string request_setting_id(std::string name, std::map<std::string, std::string>* values_map, unsigned int* http_code);
|
std::string request_setting_id(std::string name, std::map<std::string, std::string>* values_map, unsigned int* http_code);
|
||||||
int put_setting(std::string setting_id, std::string name, std::map<std::string, std::string>* values_map, unsigned int* http_code);
|
int put_setting(std::string setting_id, std::string name, std::map<std::string, std::string>* values_map, unsigned int* http_code);
|
||||||
int get_setting_list(std::string bundle_version, ProgressFn pro_fn = nullptr, WasCancelledFn cancel_fn = nullptr);
|
int get_setting_list(std::string bundle_version, ProgressFn pro_fn = nullptr, WasCancelledFn cancel_fn = nullptr);
|
||||||
|
int get_setting_list2(std::string bundle_version, CheckFn chk_fn, ProgressFn pro_fn = nullptr, WasCancelledFn cancel_fn = nullptr);
|
||||||
int delete_setting(std::string setting_id);
|
int delete_setting(std::string setting_id);
|
||||||
std::string get_studio_info_url();
|
std::string get_studio_info_url();
|
||||||
int set_extra_http_header(std::map<std::string, std::string> extra_headers);
|
int set_extra_http_header(std::map<std::string, std::string> extra_headers);
|
||||||
|
@ -245,6 +247,7 @@ private:
|
||||||
static func_request_setting_id request_setting_id_ptr;
|
static func_request_setting_id request_setting_id_ptr;
|
||||||
static func_put_setting put_setting_ptr;
|
static func_put_setting put_setting_ptr;
|
||||||
static func_get_setting_list get_setting_list_ptr;
|
static func_get_setting_list get_setting_list_ptr;
|
||||||
|
static func_get_setting_list2 get_setting_list2_ptr;
|
||||||
static func_delete_setting delete_setting_ptr;
|
static func_delete_setting delete_setting_ptr;
|
||||||
static func_get_studio_info_url get_studio_info_url_ptr;
|
static func_get_studio_info_url get_studio_info_url_ptr;
|
||||||
static func_set_extra_http_header set_extra_http_header_ptr;
|
static func_set_extra_http_header set_extra_http_header_ptr;
|
||||||
|
|
|
@ -128,6 +128,7 @@ typedef std::function<void(int progress)> ProgressFn;
|
||||||
typedef std::function<void(int retcode, std::string info)> LoginFn;
|
typedef std::function<void(int retcode, std::string info)> LoginFn;
|
||||||
typedef std::function<void(int result, std::string info)> ResultFn;
|
typedef std::function<void(int result, std::string info)> ResultFn;
|
||||||
typedef std::function<bool()> CancelFn;
|
typedef std::function<bool()> CancelFn;
|
||||||
|
typedef std::function<bool(std::map<std::string, std::string> info)> CheckFn;
|
||||||
|
|
||||||
enum SendingPrintJobStage {
|
enum SendingPrintJobStage {
|
||||||
PrintingStageCreate = 0,
|
PrintingStageCreate = 0,
|
||||||
|
|
Loading…
Reference in New Issue