2022-08-05 09:57:07 +00:00
|
|
|
#ifndef slic3r_HMS_hpp_
|
|
|
|
#define slic3r_HMS_hpp_
|
|
|
|
|
|
|
|
#include "GUI_App.hpp"
|
|
|
|
#include "GUI.hpp"
|
|
|
|
#include "I18N.hpp"
|
|
|
|
#include "Widgets/Label.hpp"
|
|
|
|
#include "Widgets/Button.hpp"
|
|
|
|
#include "Widgets/StepCtrl.hpp"
|
|
|
|
#include "BitmapCache.hpp"
|
|
|
|
#include "slic3r/Utils/Http.hpp"
|
|
|
|
#include "libslic3r/Thread.hpp"
|
|
|
|
#include "nlohmann/json.hpp"
|
|
|
|
|
|
|
|
namespace Slic3r {
|
|
|
|
namespace GUI {
|
|
|
|
|
|
|
|
#define HMS_INFO_FILE "hms.json"
|
|
|
|
|
|
|
|
class HMSQuery {
|
|
|
|
protected:
|
|
|
|
json m_hms_json;
|
|
|
|
int download_hms_info();
|
|
|
|
int load_from_local(std::string& version_info);
|
|
|
|
int save_to_local();
|
|
|
|
std::string get_hms_file();
|
2022-11-18 02:24:04 +00:00
|
|
|
wxString _query_hms_msg(std::string long_error_code, std::string lang_code = "en");
|
|
|
|
wxString _query_error_msg(std::string long_error_code, std::string lang_code = "en");
|
2022-08-05 09:57:07 +00:00
|
|
|
public:
|
|
|
|
HMSQuery() {}
|
|
|
|
int check_hms_info();
|
|
|
|
wxString query_hms_msg(std::string long_error_code);
|
|
|
|
wxString query_print_error_msg(int print_error);
|
2022-11-18 02:24:04 +00:00
|
|
|
static std::string hms_language_code();
|
2022-08-05 09:57:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
int get_hms_info_version(std::string &version);
|
|
|
|
|
2022-08-11 11:01:56 +00:00
|
|
|
std::string get_hms_wiki_url(std::string code);
|
2022-08-05 09:57:07 +00:00
|
|
|
|
|
|
|
std::string get_error_message(int error_code);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|