mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-27 10:51:22 +00:00
Merge branch 'main' into feature/filament_id
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
#include <string.h>
|
||||
#include <locale>
|
||||
#include <boost/locale/encoding_utf.hpp>
|
||||
#include <codecvt>
|
||||
#include <regex>
|
||||
|
||||
namespace Slic3r {
|
||||
@@ -1953,8 +1952,7 @@ std::string fold_utf8_to_ascii(const std::string &src, bool is_convert_for_filen
|
||||
for (wchar_t c : wstr)
|
||||
fold_to_ascii(c, out);
|
||||
if (is_convert_for_filename) {
|
||||
std::wstring_convert<std::codecvt_utf8<wchar_t>> converter;
|
||||
auto dstStr = converter.to_bytes(dst);
|
||||
auto dstStr = boost::locale::conv::utf_to_utf<char>(dst.c_str(), dst.c_str() + dst.size());
|
||||
|
||||
std::size_t found = dstStr.find_last_of("/\\");
|
||||
if (found != std::string::npos) {
|
||||
@@ -1964,7 +1962,7 @@ std::string fold_utf8_to_ascii(const std::string &src, bool is_convert_for_filen
|
||||
std::string newFileName = regex_replace(filename, reg, "");
|
||||
dstStr = dir + "\\" + newFileName;
|
||||
}
|
||||
dst = converter.from_bytes(dstStr);
|
||||
dst = boost::locale::conv::utf_to_utf<wchar_t>(dstStr.c_str(), dstStr.c_str() + dstStr.size());
|
||||
}
|
||||
|
||||
return boost::locale::conv::utf_to_utf<char>(dst.c_str(), dst.c_str() + dst.size());
|
||||
|
||||
@@ -21,14 +21,14 @@ public:
|
||||
~CrealityPrint() override = default;
|
||||
|
||||
const char* get_name() const override;
|
||||
virtual bool can_test() const { return true; };
|
||||
virtual bool can_test() const override { return true; };
|
||||
std::string get_host() const override;
|
||||
bool has_auto_discovery() const override { return true; }
|
||||
|
||||
wxString get_test_ok_msg() const override;
|
||||
wxString get_test_failed_msg(wxString& msg) const override;
|
||||
virtual bool test(wxString& curl_msg) const override;
|
||||
PrintHostPostUploadActions get_post_upload_actions() const;
|
||||
PrintHostPostUploadActions get_post_upload_actions() const override;
|
||||
bool upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn, InfoFn info_fn) const override;
|
||||
bool supports_multi_color_print() const;
|
||||
std::string query_boxes_info() const;
|
||||
|
||||
@@ -32,10 +32,10 @@ public:
|
||||
PrintHostPostUploadActions get_post_upload_actions() const override;
|
||||
protected:
|
||||
#ifdef WIN32
|
||||
virtual bool upload_inner_with_resolved_ip(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn, InfoFn info_fn, const boost::asio::ip::address& resolved_addr) const;
|
||||
virtual bool upload_inner_with_resolved_ip(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn, InfoFn info_fn, const boost::asio::ip::address& resolved_addr) const override;
|
||||
#endif
|
||||
virtual bool validate_version_text(const boost::optional<std::string> &version_text) const;
|
||||
virtual bool upload_inner_with_host(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn, InfoFn info_fn) const;
|
||||
virtual bool validate_version_text(const boost::optional<std::string> &version_text) const override;
|
||||
virtual bool upload_inner_with_host(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn, InfoFn info_fn) const override;
|
||||
|
||||
#ifdef WIN32
|
||||
virtual bool test_with_resolved_ip(wxString& curl_msg) const override;
|
||||
|
||||
@@ -20,7 +20,7 @@ public:
|
||||
~Obico() override = default;
|
||||
|
||||
const char* get_name() const override;
|
||||
virtual bool can_test() const { return true; };
|
||||
virtual bool can_test() const override { return true; };
|
||||
bool has_auto_discovery() const override { return false; }
|
||||
bool is_cloud() const override { return true; }
|
||||
bool get_login_url(wxString& auth_url) const override;
|
||||
@@ -30,7 +30,7 @@ public:
|
||||
wxString get_test_failed_msg(wxString& msg) const override;
|
||||
virtual bool test(wxString& curl_msg) const override;
|
||||
bool get_printers(wxArrayString& printers) const override;
|
||||
PrintHostPostUploadActions get_post_upload_actions() const;
|
||||
PrintHostPostUploadActions get_post_upload_actions() const override;
|
||||
bool upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn, InfoFn info_fn) const override;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -572,7 +572,7 @@ int OrcaCloudServiceAgent::set_config_dir(std::string cfg_dir)
|
||||
{
|
||||
config_dir = cfg_dir;
|
||||
wxFileName fallback(wxString::FromUTF8(cfg_dir.c_str()), secret_constants::USER_SECRET_FILENAME);
|
||||
fallback.Normalize();
|
||||
fallback.MakeAbsolute();
|
||||
secret_fallback_path = fallback.GetFullPath().ToStdString();
|
||||
return BAMBU_NETWORK_SUCCESS;
|
||||
}
|
||||
@@ -1564,7 +1564,7 @@ void OrcaCloudServiceAgent::persist_user_secret(const std::string& secret)
|
||||
return;
|
||||
}
|
||||
wxFileName path(wxString::FromUTF8(secret_fallback_path.c_str()));
|
||||
path.Normalize();
|
||||
path.MakeAbsolute();
|
||||
if (!wxFileName::DirExists(path.GetPath())) {
|
||||
wxFileName::Mkdir(path.GetPath(), wxS_DIR_DEFAULT, wxPATH_MKDIR_FULL);
|
||||
}
|
||||
@@ -2487,7 +2487,7 @@ void OrcaCloudServiceAgent::compute_fallback_path()
|
||||
if (wxTheApp == nullptr)
|
||||
return;
|
||||
wxFileName fallback(wxStandardPaths::Get().GetUserDataDir(), "orca_refresh_token.sec");
|
||||
fallback.Normalize();
|
||||
fallback.MakeAbsolute();
|
||||
secret_fallback_path = fallback.GetFullPath().ToStdString();
|
||||
}
|
||||
|
||||
@@ -3581,7 +3581,7 @@ std::string OrcaCloudServiceAgent::token_lock_path() const
|
||||
if (config_dir.empty())
|
||||
return {};
|
||||
wxFileName lock(wxString::FromUTF8(config_dir.c_str()), "orca_refresh_token.lock");
|
||||
lock.Normalize();
|
||||
lock.MakeAbsolute();
|
||||
return lock.GetFullPath().ToStdString();
|
||||
}
|
||||
|
||||
|
||||
@@ -1198,7 +1198,7 @@ Updates PresetUpdater::priv::get_config_updates(const Semver &old_slic3r_version
|
||||
version.config_version = cache_ver;
|
||||
version.comment = description;
|
||||
// Orca: update vendor.json
|
||||
updates.updates.emplace_back(std::move(file_path), std::move(path_in_vendor.string()), std::move(version), vendor_name, changelog, "", force_update, false);
|
||||
updates.updates.emplace_back(std::move(file_path), path_in_vendor.string(), std::move(version), vendor_name, changelog, "", force_update, false);
|
||||
//Orca: update vendor folder
|
||||
updates.updates.emplace_back(cache_profile_path / vendor_name, vendor_path / vendor_name, Version(), vendor_name, "", "", force_update, true);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user