diff --git a/resources/web/homepage3/css/common.css b/resources/web/homepage3/css/common.css index c7fbf4505..900677573 100644 --- a/resources/web/homepage3/css/common.css +++ b/resources/web/homepage3/css/common.css @@ -94,6 +94,7 @@ html, body { display:flex; margin-bottom: 24px; flex-direction:row-reverse; + align-items: center; } #MenuBtnBlock diff --git a/resources/web/homepage3/css/dark.css b/resources/web/homepage3/css/dark.css index d6c331efc..40098aaa1 100644 --- a/resources/web/homepage3/css/dark.css +++ b/resources/web/homepage3/css/dark.css @@ -86,6 +86,12 @@ html,body box-shadow: 0px 0px 3px #DCDCDC; } +#HotModel_Search_Btn img +{ + filter: brightness(78%); +} + + /*----User Manual------*/ .UG_DESC { @@ -116,18 +122,17 @@ html,body #HotModel_Search_Bar { - border: 1px solid #323A3D; - background-color: #36363A; + border: 1px solid #5C5C5C; + background-color: #242428; } #HotModel_Search_InputArea { - background-color: #36363A; } #HotModel_Search_Input { - background-color: #36363A; + background-color: #242428; caret-color: white; color: #FFFFFF; } @@ -154,3 +159,16 @@ html,body { filter: invert(80%) brightness(20); } + +/*-----Hide Button-----*/ +#HideBtn +{ + background-image: url('../img/arrow_light_left.svg'); + border: 1px solid rgba(48, 48, 51, 1); + background-color: rgba(48, 48, 51, 1); +} + +#HideBtn:hover +{ + background-color: rgba(70, 70, 71, 1); +} diff --git a/resources/web/homepage3/css/left.css b/resources/web/homepage3/css/left.css index 29542e9c7..3fe3710fd 100644 --- a/resources/web/homepage3/css/left.css +++ b/resources/web/homepage3/css/left.css @@ -97,14 +97,10 @@ body display: flex; justify-content: center; user-select: none; -} - -#LoginBtn -{ cursor:pointer; } -#LoginBtn:hover +#Login1:hover #LoginBtn { font-size:17px; } @@ -220,19 +216,6 @@ body display: none; } - -.JumpIcon -{ - display: none; - margin-left:6px; - width: 12px; -} - -.BtnItem[menu="makerlab"]:hover .JumpIcon -{ - display: inline; -} - .BtnItem:hover { background-color: #E0FCEB; @@ -278,3 +261,27 @@ body display: none; } + +/*-----Hide Button-----*/ +#HideBtn +{ + position: absolute; + height: 60px; + width: 12px; + right: 1px; + top: calc(50% - 30px); + cursor: pointer; + background-repeat: no-repeat; + background-position: center; + background-image: url('../img/arrow_dark_left.svg'); + border-left: 1px solid rgba(238, 238, 238, 1); + border-top: 1px solid rgba(238, 238, 238, 1); + border-bottom: 1px solid rgba(238, 238, 238, 1); + border-radius: 4px 0px 0px 4px; +} + +#HideBtn:hover +{ + background-color: rgba(238, 238, 238, 1); +} + diff --git a/resources/web/homepage3/css/left_mini.css b/resources/web/homepage3/css/left_mini.css new file mode 100644 index 000000000..745ca15aa --- /dev/null +++ b/resources/web/homepage3/css/left_mini.css @@ -0,0 +1,67 @@ + +/*----Login----*/ +#LoginBtn +{ + display:none; +} + +#Icon1 +{ + margin-right: 0px; +} + +#UserAvatarIcon +{ + height: 36px; +} + +#UserName +{ + display: none; +} + +#LogoutBtn +{ + display: none; +} + +.BtnItem +{ + padding: 0px; + justify-content:center; +} + +.BtnText +{ + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + display: none; +} + +.BtnIcon +{ + margin:0px; +} + +#NoPluginTip +{ + display:none!important; +} +/*-----Left Menu-------*/ +.JumpIcon +{ + display: none!important; +} + +.BtnNewIcon +{ + display: none!important; +} + +/*-----Hide Button-----*/ +#HideBtn +{ + transform: scaleX(-1); + border-radius: 0px 4px 4px 0px; +} \ No newline at end of file diff --git a/resources/web/homepage3/css/online.css b/resources/web/homepage3/css/online.css index 5488f56ab..848bf215f 100644 --- a/resources/web/homepage3/css/online.css +++ b/resources/web/homepage3/css/online.css @@ -167,14 +167,15 @@ display: none; align-items: center; border-radius: 22px; - border: 1px solid #EEEEEE; + border: 1px solid #C2C2C2; flex-grow: 1; - background-color: #FFFFFF; + background-color: #F7F7F7; + padding-right: 12px; + height: 40px; } #HotModel_Search_InputArea { - background-color: #FFF; display: flex; align-items: center; flex-grow: 1; @@ -188,6 +189,7 @@ flex-grow: 1; outline: none; font-size: 16px; + background-color: #F7F7F7; } diff --git a/resources/web/homepage3/home.html b/resources/web/homepage3/home.html index 008bb964b..10ad11efa 100644 --- a/resources/web/homepage3/home.html +++ b/resources/web/homepage3/home.html @@ -41,7 +41,7 @@
- + diff --git a/resources/web/homepage3/img/arrow_dark_left.svg b/resources/web/homepage3/img/arrow_dark_left.svg new file mode 100644 index 000000000..60bcbc845 --- /dev/null +++ b/resources/web/homepage3/img/arrow_dark_left.svg @@ -0,0 +1,4 @@ + + + + diff --git a/resources/web/homepage3/img/arrow_dark_right.svg b/resources/web/homepage3/img/arrow_dark_right.svg new file mode 100644 index 000000000..7c01b9132 --- /dev/null +++ b/resources/web/homepage3/img/arrow_dark_right.svg @@ -0,0 +1,4 @@ + + + + diff --git a/resources/web/homepage3/img/arrow_light_left.svg b/resources/web/homepage3/img/arrow_light_left.svg new file mode 100644 index 000000000..fa358eca6 --- /dev/null +++ b/resources/web/homepage3/img/arrow_light_left.svg @@ -0,0 +1,4 @@ + + + + diff --git a/resources/web/homepage3/img/arrow_light_right.svg b/resources/web/homepage3/img/arrow_light_right.svg new file mode 100644 index 000000000..b671a10ae --- /dev/null +++ b/resources/web/homepage3/img/arrow_light_right.svg @@ -0,0 +1,4 @@ + + + + diff --git a/resources/web/homepage3/js/left.js b/resources/web/homepage3/js/left.js index b01f92bce..60f083eb2 100644 --- a/resources/web/homepage3/js/left.js +++ b/resources/web/homepage3/js/left.js @@ -84,7 +84,7 @@ function GotoMenu( strMenu ) if( $(OneBtn).attr("menu")==strMenu ) { - if(strMenu!=='makerlab') + //if(strMenu!=='makerlab') { $(".BtnItem").removeClass("BtnItemSelected"); $(OneBtn).addClass("BtnItemSelected"); @@ -220,5 +220,21 @@ function BeginDownloadNetworkPlugin() SendWXMessage( JSON.stringify(tSend) ); } +var WidthBoundary=168; +function ChangeLeftWidth() +{ + var tSend={}; + tSend['sequence_id']=Math.round(new Date() / 1000); + tSend['command']="homepage_leftmenu_change_width"; + + let NowWidth=window.innerWidth; + if(NowWidth<=WidthBoundary) + tSend['width']=224; + else + tSend['width']=64; + + SendWXMessage( JSON.stringify(tSend) ); +} + //---------------Global----------------- window.postMessage = HandleStudio; diff --git a/resources/web/homepage3/left.html b/resources/web/homepage3/left.html index 57dda2817..946f82498 100644 --- a/resources/web/homepage3/left.html +++ b/resources/web/homepage3/left.html @@ -3,10 +3,11 @@ - + homepage + @@ -20,9 +21,9 @@
-
+
-
login/register
+
login/register
@@ -56,7 +57,6 @@
MakerLab
-
New
@@ -69,6 +69,8 @@
+ +
diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index e276c2900..12874ed3e 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -4081,6 +4081,13 @@ std::string GUI_App::handle_web_request(std::string cmd) #endif } else if (command_str.compare("homepage_login_or_register") == 0) { + //Check Plugin + bool bValid = is_compatibility_version(); + if (!bValid) { + CallAfter([this] { handle_web_request("{\"sequence_id\":1,\"command\":\"homepage_need_networkplugin\"}"); + }); + return ""; + } if (root.get_child_optional("makerworld_model_id") != boost::none) { boost::optional ModelID = root.get_optional("makerworld_model_id"); @@ -4317,6 +4324,33 @@ std::string GUI_App::handle_web_request(std::string cmd) if (mainframe && mainframe->m_webview) { mainframe->m_webview->ShowUserPrintTask(true); } + } + else if (command_str.compare("homepage_leftmenu_change_width") == 0) { + int NewWidth = 214; + if (root.get_child_optional("width") != boost::none) NewWidth = root.get("width"); + + if (mainframe && mainframe->m_webview) + { + mainframe->m_webview->SetLeftMenuWidth(NewWidth); + mainframe->m_webview->Layout(); + } + } + else if (command_str.compare("homepage_makerlab_open_3mf_binary") == 0) { + if (root.get_child_optional("3mf") != boost::none) { + std::string str3MFBase64 = root.get_optional("3mf").value(); + + std::string str3MFName = "makerlab"; + if (root.get_child_optional("3mf_name") != boost::none) + { + std::string strTmp = from_u8(root.get_optional("3mf_name").value()).ToStdString(); + if (strTmp != "") str3MFName = strTmp; + } + + if (mainframe && mainframe->m_webview) + { + mainframe->m_webview->OpenMakerlab3mf(str3MFBase64,str3MFName); + } + } } } } diff --git a/src/slic3r/GUI/WebViewDialog.cpp b/src/slic3r/GUI/WebViewDialog.cpp index a04b1df66..6c14e7a3d 100644 --- a/src/slic3r/GUI/WebViewDialog.cpp +++ b/src/slic3r/GUI/WebViewDialog.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -144,11 +145,22 @@ WebViewPanel::WebViewPanel(wxWindow *parent) SetPrintHistoryTaskID(0); m_printhistoryfirst = false; + // MakerLab webview + m_browserML = WebView::CreateWebView(this, "about:blank"); + if (m_browserML == nullptr) { + wxLogError("Could not init m_browserML"); + return; + } + m_browserML->Hide(); + SetMakerlabUrl(""); + m_MakerLabFirst = false; + // Position m_home_web->Add(m_browserLeft, 0, wxEXPAND | wxALL, 0); m_home_web->Add(m_browser, 1, wxEXPAND | wxALL, 0); m_home_web->Add(m_browserMW, 1, wxEXPAND | wxALL, 0); m_home_web->Add(m_browserPH, 1, wxEXPAND | wxALL, 0); + m_home_web->Add(m_browserML, 1, wxEXPAND | wxALL, 0); topsizer->Add(m_home_web,1, wxEXPAND | wxALL, 0); @@ -312,6 +324,10 @@ void WebViewPanel::ResetWholePage() //PrintHistory SetPrintHistoryTaskID(0); m_printhistoryfirst = false; + + //MakerLab + m_MakerLabFirst = false; + SetMakerlabUrl(""); } wxString WebViewPanel::MakeDisconnectUrl(std::string MenuName) @@ -520,8 +536,17 @@ void WebViewPanel::OnFreshLoginStatus(wxTimerEvent &event) { m_loginstatus = 1; - if (m_onlinefirst) + if (m_onlinefirst) + { UpdateMakerworldLoginStatus(); + } + + if (m_MakerLabFirst) + { + SetMakerlabUrl(""); + m_browserML->LoadURL(m_MakerLab_LastUrl); + m_MakerLab_LastUrl = ""; + } } if (m_TaskInfo == "" && m_browser && phShow != "false") @@ -535,6 +560,12 @@ void WebViewPanel::OnFreshLoginStatus(wxTimerEvent &event) if (m_onlinefirst) SetMakerworldPageLoginStatus(false); + + if (m_MakerLabFirst) { + SetMakerlabUrl(""); + m_browserML->LoadURL(m_MakerLab_LastUrl); + m_MakerLab_LastUrl = ""; + } } if (m_TaskInfo != "" && m_browser) ShowUserPrintTask(false); @@ -778,6 +809,112 @@ void WebViewPanel::get_makerlab_list(std::function callback) .perform(); } +void WebViewPanel::SetMakerlabUrl(std::string url) { + auto host = wxGetApp().get_model_http_url(wxGetApp().app_config->get_country_code()); + std::string LabUrl; + if (url == "") + LabUrl = (boost::format("%1%makerlab?from=bambustudio") % host).str(); + else + LabUrl = (boost::format("%1%%2%?from=bambustudio") % host % url).str(); + + m_MakerLab_LastUrl = LabUrl; + NetworkAgent *agent = GUI::wxGetApp().getAgent(); + if (!agent) return; + + if (agent->is_user_login()) { + std::string newticket; + int ret = agent->request_bind_ticket(&newticket); + if (ret == 0) { + GetJumpUrl(true, newticket, m_MakerLab_LastUrl, m_MakerLab_LastUrl); + } else + return; + } else { + GetJumpUrl(false, "", m_MakerLab_LastUrl, m_MakerLab_LastUrl); + } +} + +void WebViewPanel::OpenOneMakerlab(std::string url) +{ + NetworkAgent *agent = GUI::wxGetApp().getAgent(); + if (!agent) return; + + if (!agent->is_user_login()) wxGetApp().ShowUserLogin(true); + + if (agent->is_user_login()) { + SetMakerlabUrl(url); + + SwitchLeftMenu("makerlab"); + } else { + return; + } +} + +std::string GenerateRandomString(int length) +{ + std::string randomString; + srand(static_cast(time(nullptr))); + for (int i = 0; i < length; ++i) { + int randomAscii = rand() % 26 + 65; // 65 - 90的ASCII码范围为可打印字符 + randomString += static_cast(randomAscii); + } + return randomString; +} + +void WebViewPanel::OpenMakerlab3mf(std::string Base64Buf, std::string FileName) +{ + int nSize = wxBase64DecodedSize(Base64Buf.length()); + char *DstBuf = new char[nSize+1]; + memset(DstBuf, 0, nSize + 1); + + int nWrite=wxBase64Decode(DstBuf, nSize+1, Base64Buf.c_str(), Base64Buf.length()); + + // Format Time String + std::time_t currentTime = std::time(nullptr); + std::tm *timeInfo = std::localtime(¤tTime); + int year = timeInfo->tm_year % 100; + int month = timeInfo->tm_mon + 1; // 月份范围是0 - 11,需要加1 + int day = timeInfo->tm_mday; + int hour = timeInfo->tm_hour; + int minute = timeInfo->tm_min; + int second = timeInfo->tm_sec; + + std::stringstream ss; + ss << std::setfill('0') << std::setw(2) << year << std::setw(2) << month << std::setw(2) << day << std::setw(2) << hour << std::setw(2) << minute << std::setw(2) << second; + std::string dateTimeString = ss.str(); + + // Write 3MF to Disk + char separator = boost::filesystem::path::preferred_separator; + std::string separatorStr(1, separator); + + wxString download_path = wxString::FromUTF8(wxGetApp().app_config->get("download_path")); + wxString download_file = download_path + separatorStr + FileName + "_" + ss.str() + "_" + GenerateRandomString(4) + ".3mf"; + + std::ofstream outFile(download_file.ToStdString(), std::ios::binary); + if (!outFile) { + delete DstBuf; + std::cerr << "Error opening file for writing." << std::endl; + return; + } + outFile.write(DstBuf, nWrite); + if (!outFile) { + delete DstBuf; + std::cerr << "Error writing to file." << std::endl; + return; + } + + delete DstBuf; + outFile.close(); + std::cout << "Data written to file successfully." << std::endl; + wxLogMessage("Makerlab Binary Write to %s", download_file.ToStdString()); + + //Open File + download_file = download_file.utf8_string(); + wxGetApp().request_open_project(download_file.ToStdString()); + + //Remove File + //boost::filesystem::remove(download_file.ToStdString()); +} + unsigned char ToHex(unsigned char x) { return x > 9 ? x + 55 : x + 48; } unsigned char FromHex(unsigned char x) @@ -1431,6 +1568,7 @@ void WebViewPanel::OnError(wxWebViewEvent& evt) wxString UrlDisconnect = MakeDisconnectUrl("online"); m_browserMW->LoadURL(UrlDisconnect); + SetWebviewShow("makerlab", false); SetWebviewShow("online", true); SetWebviewShow("right", false); SetWebviewShow("printhistory", false); @@ -1446,12 +1584,29 @@ void WebViewPanel::OnError(wxWebViewEvent& evt) wxString UrlDisconnect = MakeDisconnectUrl("printhistory"); m_browserPH->LoadURL(UrlDisconnect); + SetWebviewShow("makerlab", false); SetWebviewShow("printhistory", true); SetWebviewShow("online", false); SetWebviewShow("right", false); } } + if (evt.GetInt() == wxWEBVIEW_NAV_ERR_CONNECTION && evt.GetId() == m_browserML->GetId()) { + m_MakerLab_LastUrl = m_browserML->GetCurrentURL(); + + if (m_contentname == "makerlab") { + wxString errurl = evt.GetURL(); + + wxString UrlDisconnect = MakeDisconnectUrl("makerlab"); + m_browserML->LoadURL(UrlDisconnect); + + SetWebviewShow("makerlab", true); + SetWebviewShow("printhistory", false); + SetWebviewShow("online", false); + SetWebviewShow("right", false); + } + } + UpdateState(); } @@ -1503,21 +1658,34 @@ void WebViewPanel::SwitchWebContent(std::string modelname, int refresh) wxString strlang = wxGetApp().current_language_code_safe(); - if (modelname.compare("makerlab") == 0) { - auto host = wxGetApp().get_model_http_url(wxGetApp().app_config->get_country_code()); - std::string LabUrl = (boost::format("%1%makerlab?from=bambustudio") % host).str(); + if (modelname.compare("makerlab") == 0) + { + wxString FinalUrl; - wxString FinalUrl = LabUrl; - NetworkAgent *agent = GUI::wxGetApp().getAgent(); - if (agent && agent->is_user_login()) { - std::string BambuHost=agent->get_bambulab_host(); + if (!m_MakerLabFirst) + { + if (m_MakerLab_LastUrl != "") + FinalUrl = m_MakerLab_LastUrl; + else + { + SetMakerlabUrl(""); - std::string newticket; - int ret = agent->request_bind_ticket(&newticket); - if (ret == 0) GetJumpUrl(true, newticket, FinalUrl, FinalUrl); + FinalUrl = m_MakerLab_LastUrl; + } + } + else { + if (m_MakerLab_LastUrl != "") + FinalUrl = m_MakerLab_LastUrl; } - wxLaunchDefaultBrowser(FinalUrl); + m_browserML->LoadURL(FinalUrl); + m_MakerLabFirst = true; + m_MakerLab_LastUrl = ""; + + SetWebviewShow("makerlab", true); + SetWebviewShow("online", false); + SetWebviewShow("right", false); + SetWebviewShow("printhistory", false); // conf save wxGetApp().app_config->set_str("homepage", "makerlab_clicked", "1"); @@ -1544,11 +1712,10 @@ void WebViewPanel::SwitchWebContent(std::string modelname, int refresh) } SetWebviewShow("online", true); + SetWebviewShow("makerlab", false); SetWebviewShow("right", false); SetWebviewShow("printhistory", false); - GetSizer()->Layout(); - // conf save wxGetApp().app_config->set_str("homepage", "online_clicked", "1"); wxGetApp().app_config->save(); @@ -1588,8 +1755,7 @@ void WebViewPanel::SwitchWebContent(std::string modelname, int refresh) SetWebviewShow("online", false); SetWebviewShow("right", false); SetWebviewShow("printhistory", true); - - GetSizer()->Layout(); + SetWebviewShow("makerlab", false); } else if (modelname.compare("home") == 0 || modelname.compare("recent") == 0 || modelname.compare("manual") == 0) { if (!m_browser) return; @@ -1607,9 +1773,10 @@ void WebViewPanel::SwitchWebContent(std::string modelname, int refresh) SetWebviewShow("online", false); SetWebviewShow("printhistory", false); SetWebviewShow("right", true); - - GetSizer()->Layout(); + SetWebviewShow("makerlab", false); } + + GetSizer()->Layout(); } void WebViewPanel::SwitchLeftMenu(std::string strMenu) @@ -1627,22 +1794,6 @@ void WebViewPanel::SwitchLeftMenu(std::string strMenu) WebView::RunScript(m_browserLeft, strJS); } -void WebViewPanel::OpenOneMakerlab(std::string url) { - auto host = wxGetApp().get_model_http_url(wxGetApp().app_config->get_country_code()); - std::string LabUrl = (boost::format("%1%%2%?from=bambustudio") % host % url).str(); - - wxString FinalUrl = LabUrl; - NetworkAgent *agent = GUI::wxGetApp().getAgent(); - if (agent && agent->is_user_login()) { - std::string newticket; - int ret = agent->request_bind_ticket(&newticket); - if (ret == 0) GetJumpUrl(true, newticket, FinalUrl, FinalUrl); - } - - wxLaunchDefaultBrowser(FinalUrl); -} - - void WebViewPanel::CheckMenuNewTag() { std::string sClick = wxGetApp().app_config->get("homepage", "online_clicked"); if (sClick.compare("1")==0) @@ -1694,6 +1845,12 @@ void WebViewPanel::SetLeftMenuShow(std::string menuname, int show) WebView::RunScript(m_browser, strJS); } +void WebViewPanel::SetLeftMenuWidth(int nWidth) { + m_browserLeft->SetSize(wxSize(FromDIP(nWidth), -1)); + m_browserLeft->SetMinSize(wxSize(FromDIP(nWidth), -1)); + m_browserLeft->SetMaxSize(wxSize(FromDIP(nWidth), -1)); +} + void WebViewPanel::SetWebviewShow(wxString name, bool show) { wxWebView *TmpWeb = nullptr; @@ -1705,6 +1862,8 @@ void WebViewPanel::SetWebviewShow(wxString name, bool show) TmpWeb = m_browserMW; else if (name == "printhistory") TmpWeb = m_browserPH; + else if (name == "makerlab") + TmpWeb = m_browserML; if (TmpWeb != nullptr) { diff --git a/src/slic3r/GUI/WebViewDialog.hpp b/src/slic3r/GUI/WebViewDialog.hpp index 48099595c..ad0665b08 100644 --- a/src/slic3r/GUI/WebViewDialog.hpp +++ b/src/slic3r/GUI/WebViewDialog.hpp @@ -96,40 +96,64 @@ public: public: void ResetWholePage(); - void SetMakerworldModelID(std::string ModelID); - void OpenMakerworldSearchPage(std::string KeyWord); - void SetPrintHistoryTaskID(int TaskID); - void SwitchWebContent(std::string modelname, int refresh=0); - void SwitchLeftMenu(std::string strMenu); - void OpenOneMakerlab(std::string url); - - wxString MakeDisconnectUrl(std::string MenuName); - - void CheckMenuNewTag(); - void ShowMenuNewTag(std::string menuname, std::string show); - void SetLeftMenuShow(std::string menuname, int show); - - void SendRecentList(int images); - void SendDesignStaffpick(bool on); - void SendMakerlabList(); - void OpenModelDetail(std::string id, NetworkAgent *agent); + // Login void SendLoginInfo(); void ShowNetpluginTip(); - void SetWebviewShow(wxString name, bool show); + //MW + void SetMakerworldModelID(std::string ModelID); + void OpenMakerworldSearchPage(std::string KeyWord); + void SetPrintHistoryTaskID(int TaskID); + + //DisconnectPage + wxString MakeDisconnectUrl(std::string MenuName); + //LeftMenu + std::string m_contentname; // CurrentMenu + bool m_leftfirst; // Left First Loaded + void CheckMenuNewTag(); + void ShowMenuNewTag(std::string menuname, std::string show); + void SetLeftMenuShow(std::string menuname, int show); + void SetLeftMenuWidth(int nWidth); + void SwitchWebContent(std::string modelname, int refresh = 0); + void SwitchLeftMenu(std::string strMenu); + + //Recent File + void SendRecentList(int images); + + //Online + bool m_onlinefirst; // Online Page First Load + wxString m_online_type; // recommend & browse + wxString m_online_LastUrl; // PageLastError Url + + void SendDesignStaffpick(bool on); void get_design_staffpick(int offset, int limit, std::function callback); void get_user_mw_4u_config(std::function callback); void get_4u_staffpick(int seed, int limit, std::function callback); - void get_makerlab_list(std::function callback); + void OpenModelDetail(std::string id, NetworkAgent *agent); int get_model_mall_detail_url(std::string *url, std::string id); - - std::string m_TaskInfo; - void ShowUserPrintTask(bool bShow); - void UpdateMakerworldLoginStatus(); void SetMakerworldPageLoginStatus(bool login, wxString ticket = ""); + //Makerlab + bool m_MakerLabFirst; + wxString m_MakerLab_LastUrl; + void SendMakerlabList(); + void get_makerlab_list(std::function callback); + void SetMakerlabUrl(std::string url); + void OpenOneMakerlab(std::string url); + void OpenMakerlab3mf(std::string Base64Buf, std::string FileName); + + //Common UI + void SetWebviewShow(wxString name, bool show); + + //PrintHistory + std::string m_TaskInfo; + bool m_printhistoryfirst; // print history first load + wxString m_print_history_LastUrl; + void ShowUserPrintTask(bool bShow); + + // bool GetJumpUrl(bool login, wxString ticket, wxString targeturl, wxString &finalurl); void update_mode(); @@ -144,15 +168,9 @@ private: wxWebView* m_browserLeft; wxWebView * m_browserMW; wxWebView *m_browserPH; //PrintHistory - std::string m_contentname; - bool m_leftfirst; //Left First Loaded - bool m_onlinefirst; //Online Page First Load - bool m_printhistoryfirst; //print history first load - //std::string m_online_spec_id; // Online Page Spec_ID - wxString m_online_type; //recommend & browse - wxString m_online_LastUrl; //PageLastError Url - wxString m_print_history_LastUrl; + wxWebView *m_browserML; //MakerLab + //Basic Browser wxBoxSizer *bSizer_toolbar; wxButton * m_button_back; wxButton * m_button_forward;