mirror of
https://github.com/QIDITECH/QIDIStudio.git
synced 2026-02-07 04:11:50 +03:00
update slic3r
This commit is contained in:
@@ -1282,12 +1282,28 @@ void WebViewPanel::OnNavigationComplete(wxWebViewEvent& evt)
|
||||
SetWebviewShow("right", false);
|
||||
SetWebviewShow("online", true);
|
||||
}
|
||||
|
||||
// search page jump to online page
|
||||
if (m_online_last_url.find("/studio/webview/search") != std::string::npos) {
|
||||
if ((TmpNowUrl.find("/studio/webview") != std::string::npos) &&
|
||||
(TmpNowUrl.find("/studio/webview/search") == std::string::npos)) {
|
||||
SwitchLeftMenu("online");
|
||||
}
|
||||
}
|
||||
// jump to search page
|
||||
if (TmpNowUrl.find("/studio/webview/search") != std::string::npos ) {
|
||||
SwitchLeftMenu("search");
|
||||
}
|
||||
m_online_last_url = TmpNowUrl;
|
||||
}
|
||||
|
||||
if (m_browser != nullptr && evt.GetId() == m_browser->GetId())
|
||||
{
|
||||
SwitchWebContent("home");
|
||||
SendDesignStaffpick(true);
|
||||
if (wxGetApp().app_config->get("staff_pick_switch") == "true")
|
||||
SendDesignStaffpick(true);
|
||||
else
|
||||
SendDesignStaffpick(false);
|
||||
SendMakerlabList();
|
||||
}
|
||||
|
||||
@@ -1685,9 +1701,12 @@ void WebViewPanel::OpenMakerworldSearchPage(std::string KeyWord)
|
||||
wxString language_code = wxString::FromUTF8(GetStudioLanguage()).BeforeFirst('_');
|
||||
|
||||
|
||||
m_online_LastUrl = (boost::format("%1%%2%/studio/webview/search?keyword=%3%&from=qidistudio") % host % language_code.mb_str() % UrlEncode(KeyWord)).str();
|
||||
//m_online_LastUrl = (boost::format("%1%%2%/studio/webview/search?keyword=%3%&from=qidistudio") % host % language_code.mb_str() % UrlEncode(KeyWord)).str();
|
||||
//SwitchLeftMenu("online");
|
||||
|
||||
SwitchLeftMenu("online");
|
||||
m_online_LastUrl = (boost::format("%1%%2%/studio/webview/search?from=qidistudio&keyword=%3%&from_studio_home=true") % host % language_code.mb_str() % UrlEncode(KeyWord)).str();
|
||||
SwitchWebContent("online");
|
||||
//SwitchLeftMenu("online");
|
||||
}
|
||||
|
||||
void WebViewPanel::SetMakerworldModelID(std::string ModelID)
|
||||
@@ -1774,7 +1793,19 @@ void WebViewPanel::SwitchWebContent(std::string modelname, int refresh)
|
||||
|
||||
m_online_LastUrl = "";
|
||||
} else {
|
||||
//m_browserMW->Reload();
|
||||
std::string TmpNowUrl = m_browserMW->GetCurrentURL().ToStdString();
|
||||
// If you click Online on the search page, navigate back to the Online page.
|
||||
if (auto pos = TmpNowUrl.find("/search"); pos != std::string::npos){
|
||||
TmpNowUrl.erase(pos, 7);
|
||||
}
|
||||
if (auto pos = TmpNowUrl.find("&from_studio_home=true"); pos != std::string::npos) {
|
||||
TmpNowUrl.erase(pos, 22);
|
||||
}
|
||||
std::regex pattern("&keyword=[^&]*");
|
||||
TmpNowUrl = std::regex_replace(TmpNowUrl, pattern, "");
|
||||
if(TmpNowUrl != m_browserMW->GetCurrentURL().ToStdString()) {
|
||||
m_browserMW->LoadURL(TmpNowUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user