ENH: do not block GUI when downloading hms file
Change-Id: I2175c86caba66c54e8a708a402bc3595e1e77ac9 Signed-off-by: Stone Li <stone.li@bambulab.com>
This commit is contained in:
parent
e7ea07944f
commit
dd792048a0
|
@ -248,9 +248,8 @@ wxString HMSQuery::query_print_error_msg(int print_error)
|
|||
|
||||
int HMSQuery::check_hms_info()
|
||||
{
|
||||
int result = 0;
|
||||
boost::thread check_thread = boost::thread([this] {
|
||||
bool download_new_hms_info = true;
|
||||
|
||||
// load local hms json file
|
||||
std::string version = "";
|
||||
if (load_from_local(version) == 0) {
|
||||
|
@ -265,9 +264,11 @@ int HMSQuery::check_hms_info()
|
|||
BOOST_LOG_TRIVIAL(info) << "HMS: check_hms_info need download new hms info = " << download_new_hms_info;
|
||||
// download if version is update
|
||||
if (download_new_hms_info) {
|
||||
result = download_hms_info();
|
||||
download_hms_info();
|
||||
}
|
||||
return result;
|
||||
return;
|
||||
});
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string get_hms_wiki_url(std::string error_code)
|
||||
|
|
Loading…
Reference in New Issue