mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-25 20:02:17 +00:00
fix build errors on Linux with Clang 20 and GTK warnings (#12507)
* guard -Wno-error=enum-constexpr-conversion behind compiler flag check * Fix: Suppress GTK critical warnings and prevent multiple URI scheme registrations in WebView
This commit is contained in:
@@ -65,20 +65,20 @@ void Label::initSysFont()
|
||||
wxString font_path = wxString::FromUTF8(resource_path + "/fonts/HarmonyOS_Sans_SC_Bold.ttf");
|
||||
bool result = wxFont::AddPrivateFont(font_path);
|
||||
// BOOST_LOG_TRIVIAL(info) << boost::format("add font of HarmonyOS_Sans_SC_Bold returns %1%")%result;
|
||||
printf("add font of HarmonyOS_Sans_SC_Bold returns %d\n", result);
|
||||
// printf("add font of HarmonyOS_Sans_SC_Bold returns %d\n", result);
|
||||
font_path = wxString::FromUTF8(resource_path + "/fonts/HarmonyOS_Sans_SC_Regular.ttf");
|
||||
result = wxFont::AddPrivateFont(font_path);
|
||||
// BOOST_LOG_TRIVIAL(info) << boost::format("add font of HarmonyOS_Sans_SC_Regular returns %1%")%result;
|
||||
printf("add font of HarmonyOS_Sans_SC_Regular returns %d\n", result);
|
||||
// printf("add font of HarmonyOS_Sans_SC_Regular returns %d\n", result);
|
||||
// Adding NanumGothic Regular and Bold
|
||||
font_path = wxString::FromUTF8(resource_path + "/fonts/NanumGothic-Regular.ttf");
|
||||
result = wxFont::AddPrivateFont(font_path);
|
||||
// BOOST_LOG_TRIVIAL(info) << boost::format("add font of NanumGothic-Regular returns %1%")%result;
|
||||
printf("add font of NanumGothic-Regular returns %d\n", result);
|
||||
// printf("add font of NanumGothic-Regular returns %d\n", result);
|
||||
font_path = wxString::FromUTF8(resource_path + "/fonts/NanumGothic-Bold.ttf");
|
||||
result = wxFont::AddPrivateFont(font_path);
|
||||
// BOOST_LOG_TRIVIAL(info) << boost::format("add font of NanumGothic-Bold returns %1%")%result;
|
||||
printf("add font of NanumGothic-Bold returns %d\n", result);
|
||||
// printf("add font of NanumGothic-Bold returns %d\n", result);
|
||||
#endif
|
||||
Head_48 = Label::sysFont(48, true);
|
||||
Head_32 = Label::sysFont(32, true);
|
||||
|
||||
@@ -277,10 +277,15 @@ wxWebView* WebView::CreateWebView(wxWindow * parent, wxString const & url)
|
||||
// And the memory: file system
|
||||
webView->RegisterHandler(wxSharedPtr<wxWebViewHandler>(new wxWebViewFSHandler("memory")));
|
||||
#else
|
||||
// With WKWebView handlers need to be registered before creation
|
||||
webView->RegisterHandler(wxSharedPtr<wxWebViewHandler>(new wxWebViewArchiveHandler("wxfs")));
|
||||
// And the memory: file system
|
||||
webView->RegisterHandler(wxSharedPtr<wxWebViewHandler>(new wxWebViewFSHandler("memory")));
|
||||
// With WKWebView handlers need to be registered before creation.
|
||||
// On Linux (WebKit2GTK), URI schemes are registered globally and can only
|
||||
// be registered once, so guard against multiple registrations.
|
||||
static bool s_schemes_registered = false;
|
||||
if (!s_schemes_registered) {
|
||||
webView->RegisterHandler(wxSharedPtr<wxWebViewHandler>(new wxWebViewArchiveHandler("wxfs")));
|
||||
webView->RegisterHandler(wxSharedPtr<wxWebViewHandler>(new wxWebViewFSHandler("memory")));
|
||||
s_schemes_registered = true;
|
||||
}
|
||||
webView->Create(parent, wxID_ANY, url2, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE);
|
||||
webView->SetUserAgent(wxString::Format("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) BBL-Slicer/v%s (%s) BBL-Language/%s",
|
||||
SLIC3R_VERSION, Slic3r::GUI::wxGetApp().dark_mode() ? "dark" : "light", language_code.mb_str()));
|
||||
|
||||
Reference in New Issue
Block a user