ENH: Open Login Dialog When Open Model in MW
JIRA: none Change-Id: I962e93570bfdb137a01b2ec64f963b347765faf0
This commit is contained in:
parent
bce7bc9a97
commit
d94c87879d
|
@ -4030,6 +4030,19 @@ std::string GUI_App::handle_web_request(std::string cmd)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else if (command_str.compare("homepage_login_or_register") == 0) {
|
else if (command_str.compare("homepage_login_or_register") == 0) {
|
||||||
|
|
||||||
|
if (root.get_child_optional("makerworld_model_id") != boost::none) {
|
||||||
|
boost::optional<std::string> ModelID = root.get_optional<std::string>("makerworld_model_id");
|
||||||
|
if (ModelID.has_value()) {
|
||||||
|
if (mainframe) {
|
||||||
|
if (mainframe->m_webview)
|
||||||
|
{
|
||||||
|
mainframe->m_webview->SetMakerworldModelID(ModelID.value());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
CallAfter([this] {
|
CallAfter([this] {
|
||||||
this->request_login(true);
|
this->request_login(true);
|
||||||
});
|
});
|
||||||
|
|
|
@ -802,9 +802,22 @@ void WebViewPanel::SetMakerworldPageLoginStatus(bool login ,wxString ticket)
|
||||||
{
|
{
|
||||||
if (m_browserMW == nullptr) return;
|
if (m_browserMW == nullptr) return;
|
||||||
|
|
||||||
std::string h = wxGetApp().get_model_http_url(wxGetApp().app_config->get_country_code());
|
wxString mw_currenturl;
|
||||||
wxString mw_currenturl = m_browserMW->GetCurrentURL();
|
if (m_online_spec_id != "") {
|
||||||
mw_currenturl.Replace("modelid=", "");
|
auto host = wxGetApp().get_model_http_url(wxGetApp().app_config->get_country_code());
|
||||||
|
|
||||||
|
wxString language_code = wxGetApp().current_language_code().BeforeFirst('_');
|
||||||
|
language_code = language_code.ToStdString();
|
||||||
|
|
||||||
|
mw_currenturl = (boost::format("%1%%2%/studio/webview?modelid=%3%&from=%4%") % host % language_code.mb_str() % m_online_spec_id % m_online_type.mb_str()).str();
|
||||||
|
|
||||||
|
m_onlinefirst = true;
|
||||||
|
m_online_spec_id = "";
|
||||||
|
} else {
|
||||||
|
mw_currenturl = m_browserMW->GetCurrentURL();
|
||||||
|
}
|
||||||
|
|
||||||
|
//mw_currenturl.Replace("modelid=", "");
|
||||||
wxString mw_jumpurl = "";
|
wxString mw_jumpurl = "";
|
||||||
|
|
||||||
bool b = GetJumpUrl(login, ticket, mw_currenturl, mw_jumpurl);
|
bool b = GetJumpUrl(login, ticket, mw_currenturl, mw_jumpurl);
|
||||||
|
|
|
@ -96,6 +96,7 @@ public:
|
||||||
public:
|
public:
|
||||||
void ResetWholePage();
|
void ResetWholePage();
|
||||||
|
|
||||||
|
void SetMakerworldModelID(std::string ModelID) { m_online_spec_id = ModelID; }
|
||||||
void SwitchWebContent(std::string modelname, int refresh=0);
|
void SwitchWebContent(std::string modelname, int refresh=0);
|
||||||
void SwitchLeftMenu(std::string strMenu);
|
void SwitchLeftMenu(std::string strMenu);
|
||||||
void OpenOneMakerlab(std::string url);
|
void OpenOneMakerlab(std::string url);
|
||||||
|
|
Loading…
Reference in New Issue