NEW: Disable MWList Before UserGuide Finish

JIRA: none
Change-Id: Id2e71053bddeb02e75b93b6588ff548fe1b5635d
This commit is contained in:
zorro.zhang 2024-03-22 18:45:04 +08:00 committed by Lane.Wei
parent 7641be0569
commit ea82c35a03
2 changed files with 12 additions and 9 deletions

View File

@ -497,6 +497,9 @@ void WebViewPanel::SendDesignStaffpick(bool on)
{
try {
if (on) {
std::string sguide = wxGetApp().app_config->get("firstguide", "finish");
if (sguide != "true") return;
if (!IsShownOnScreen()) {
m_has_pending_staff_pick = true;
return;
@ -597,6 +600,9 @@ void WebViewPanel::SendDesignStaffpick(bool on)
void WebViewPanel::SendMakerlabList( )
{
try {
std::string sguide = wxGetApp().app_config->get("firstguide", "finish");
if (sguide != "true") return;
get_makerlab_list([this](std::string body) {
if (body.empty() || body.front() != '{') {
BOOST_LOG_TRIVIAL(warning) << "get_makerlab_list failed " + body;

View File

@ -211,10 +211,9 @@ wxWebView* WebView::CreateWebView(wxWindow * parent, wxString const & url)
wxString language_code = Slic3r::GUI::wxGetApp().current_language_code().BeforeFirst('_');
language_code = language_code.ToStdString();
#ifdef __WIN32__
webView->SetUserAgent(wxString::Format("BBL-Slicer/v%s BBL-Language/%s (%s) Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
webView->SetUserAgent(wxString::Format("BBL-Slicer/v%s (%s) BBL-Language/%s Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
"AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edg/107.0.1418.52",
SLIC3R_VERSION, language_code.mb_str(),
Slic3r::GUI::wxGetApp().dark_mode() ? "dark" : "light"));
SLIC3R_VERSION, Slic3r::GUI::wxGetApp().dark_mode() ? "dark" : "light", language_code.mb_str()));
webView->Create(parent, wxID_ANY, url2, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE);
// We register the wxfs:// protocol for testing purposes
webView->RegisterHandler(wxSharedPtr<wxWebViewHandler>(new wxWebViewArchiveHandler("bbl")));
@ -226,9 +225,8 @@ wxWebView* WebView::CreateWebView(wxWindow * parent, wxString const & url)
// And the memory: file system
webView->RegisterHandler(wxSharedPtr<wxWebViewHandler>(new wxWebViewFSHandler("memory")));
webView->Create(parent, wxID_ANY, url2, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE);
webView->SetUserAgent(wxString::Format("BBL-Slicer/v%s BBL-Language/%s (%s) Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko)",
SLIC3R_VERSION, language_code.mb_str(),
Slic3r::GUI::wxGetApp().dark_mode() ? "dark" : "light"));
webView->SetUserAgent(wxString::Format("BBL-Slicer/v%s (%s) BBL-Language/%s Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko)",
SLIC3R_VERSION, Slic3r::GUI::wxGetApp().dark_mode() ? "dark" : "light", language_code.mb_str()));
#endif
#ifdef __WXMAC__
WKWebView * wkWebView = (WKWebView *) webView->GetNativeBackend();
@ -320,9 +318,8 @@ void WebView::RecreateAll()
wxString language_code = Slic3r::GUI::wxGetApp().current_language_code().BeforeFirst('_');
language_code = language_code.ToStdString();
for (auto webView : g_webviews) {
webView->SetUserAgent(wxString::Format("BBL-Slicer/v%s BBL-Language/%s (%s) Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko)",
SLIC3R_VERSION, language_code.mb_str(),
dark ? "dark" : "light"));
webView->SetUserAgent(wxString::Format("BBL-Slicer/v%s (%s) BBL-Language/%s Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko)",
SLIC3R_VERSION, dark ? "dark" : "light", language_code.mb_str()));
webView->Reload();
}
}