mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-27 10:51:22 +00:00
FIX: query hms crash while there is updating hms in other thread
jira: [STUDIO-9380] Change-Id: I1b3d94008d4d03d3d41c10e1240fe832755ef9da (cherry picked from commit 0d367638b58c046799f5212f2fca76c15f1d4dfe)
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include "slic3r/Utils/Http.hpp"
|
||||
#include "libslic3r/Thread.hpp"
|
||||
#include "nlohmann/json.hpp"
|
||||
#include <mutex>
|
||||
|
||||
namespace Slic3r {
|
||||
namespace GUI {
|
||||
@@ -20,9 +21,12 @@ namespace GUI {
|
||||
#define QUERY_HMS_ACTION "query_hms_action"
|
||||
|
||||
class HMSQuery {
|
||||
|
||||
protected:
|
||||
json m_hms_info_json;
|
||||
json m_hms_action_json;
|
||||
mutable std::mutex m_hms_mutex;
|
||||
|
||||
int download_hms_related(std::string hms_type, json *receive_json, std::string dev_type);
|
||||
int load_from_local(std::string &version_info, std::string hms_type, json *load_json, std::string dev_type);
|
||||
int save_to_local(std::string lang, std::string hms_type, std::string dev_type, json save_json);
|
||||
@@ -30,6 +34,7 @@ protected:
|
||||
wxString _query_hms_msg(std::string long_error_code, std::string lang_code = std::string("en")) const;
|
||||
bool _query_error_msg(wxString &error_msg, std::string long_error_code, std::string lang_code = std::string("en"));
|
||||
wxString _query_error_url_action(std::string long_error_code, std::string dev_id, std::vector<int>& button_action);
|
||||
|
||||
public:
|
||||
HMSQuery() {}
|
||||
int check_hms_info(std::string dev_type = "00M");
|
||||
|
||||
Reference in New Issue
Block a user