Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync codes to 1.9.0.59 #3764

Merged
merged 6 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion resources/web/homepage2/js/left.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function OnInit()
TranslatePage();

SendMsg_GetLoginInfo();
GotoMenu( 'home' );
GotoMenu( 'home' );
}

function HandleStudio( pVal )
Expand Down
15 changes: 14 additions & 1 deletion resources/web/include/globalapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,4 +424,17 @@ function ExecuteDarkMode( DarkCssPath )
}
}

SwitchDarkMode( "./css/dark.css" );
SwitchDarkMode( "./css/dark.css" );

/*-------KeyBoard------*/
function DisableCtrlHotkey()
{
document.onkeydown = function(event) {
event = event || window.event;
if (event.ctrlKey ) {
event.preventDefault();
}
}
}

DisableCtrlHotkey();
10 changes: 6 additions & 4 deletions src/slic3r/GUI/Jobs/FillBedJob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,12 @@ void FillBedJob::finalize()
else
ap.bed_idx = cur_plate;

ap.row = ap.bed_idx / plate_cols;
ap.col = ap.bed_idx % plate_cols;
ap.translation(X) += bed_stride_x(m_plater) * ap.col;
ap.translation(Y) -= bed_stride_y(m_plater) * ap.row;
if (m_selected.size() <= 100) {
ap.row = ap.bed_idx / plate_cols;
ap.col = ap.bed_idx % plate_cols;
ap.translation(X) += bed_stride_x(m_plater) * ap.col;
ap.translation(Y) -= bed_stride_y(m_plater) * ap.row;
}

ap.apply();

Expand Down
4 changes: 2 additions & 2 deletions src/slic3r/GUI/Plater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12738,8 +12738,8 @@ std::vector<Vec2f> Plater::get_empty_cells(const Vec2f step)
Vec2d vmin(box.min.x(), box.min.y()), vmax(box.max.x(), box.max.y());
exclude_boxs.emplace_back(vmin, vmax);
}
for (float x = min_x; x < bbox.max.x() - step(0) / 2; x += step(0))
for (float y = min_y; y < bbox.max.y() - step(1) / 2; y += step(1)) {
for (float x = min_x + bbox.min.x(); x < bbox.max.x() - step(0) / 2; x += step(0))
for (float y = min_y + bbox.min.y(); y < bbox.max.y() - step(1) / 2; y += step(1)) {
bool in_exclude = false;
BoundingBoxf cell(Vec2d(x - step(0) / 2, y - step(1) / 2), Vec2d(x + step(0) / 2, y + step(1) / 2));
for (auto& box : exclude_boxs) {
Expand Down
61 changes: 17 additions & 44 deletions src/slic3r/GUI/WebViewDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ WebViewPanel::WebViewPanel(wxWindow *parent)
m_browserLeft->SetMinSize(wxSize(FromDIP(224), -1));
m_browserLeft->SetMaxSize(wxSize(FromDIP(224), -1));

this->SetBackgroundColour(*wxWHITE);
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);
Expand Down Expand Up @@ -271,6 +270,10 @@ WebViewPanel::~WebViewPanel()
void WebViewPanel::ResetWholePage()
{
if (m_browserLeft != nullptr && m_leftfirst) m_browserLeft->Reload();

auto host = wxGetApp().get_model_http_url(wxGetApp().app_config->get_country_code());
std::string mwurl = (boost::format("%1%studio/webview?from=bambustudio") % host).str();
m_browserMW->LoadURL(mwurl);
}

void WebViewPanel::load_url(wxString& url)
Expand Down Expand Up @@ -610,10 +613,19 @@ void WebViewPanel::SendMakerlabList( )
}
CallAfter([this, body] {
auto body2 = from_u8(body);
body2.insert(1, "\"command\": \"homepage_makerlab_get\", ");
RunScript(wxString::Format("window.postMessage(%s)", body2));

SetLeftMenuShow("makerlab", 1);
json jLab = json::parse(body2);
if (jLab.contains("list"))
{
int nSize = jLab["list"].size();
if (nSize > 0)
{
body2.insert(1, "\"command\": \"homepage_makerlab_get\", ");
RunScript(wxString::Format("window.postMessage(%s)", body2));

SetLeftMenuShow("makerlab", 1);
}
}
});
});
} catch (nlohmann::detail::parse_error &err) {
Expand All @@ -627,22 +639,6 @@ void WebViewPanel::SendMakerlabList( )
}
}

//void WebViewPanel::OpenModelDetail(std::string id, NetworkAgent *agent)
//{
// std::string url;
// if ((agent ? agent->get_model_mall_detail_url(&url, id) : get_model_mall_detail_url(&url, id)) == 0)
// {
// if (url.find("?") != std::string::npos)
// {
// url += "&from=bambustudio";
// } else {
// url += "?from=bambustudio";
// }
//
// wxLaunchDefaultBrowser(url);
// }
//}

void WebViewPanel::OpenModelDetail(std::string id, NetworkAgent *agent)
{
SwitchLeftMenu("online");
Expand Down Expand Up @@ -760,29 +756,6 @@ std::string UrlDecode(const std::string &str)
return strTemp;
}

//void WebViewPanel::UpdateMakerworldLoginStatus() {
// NetworkAgent *agent = GUI::wxGetApp().getAgent();
// if (agent == nullptr) return;
//
// int ret = agent->get_login_ticket([this](std::string body) {
// if (body.empty() || body.front() != '{') {
// BOOST_LOG_TRIVIAL(warning) << "get_login_ticket failed " + body;
//
// SetMakerworldPageLoginStatus(false);
//
// return;
// }
// CallAfter([this, body] {
// json jticket = json::parse(body);
//
// std::string ticket = jticket["ticket"];
//
// SetMakerworldPageLoginStatus(true, ticket);
// });
// }
// );
//}

bool WebViewPanel::GetJumpUrl(bool login, wxString ticket, wxString targeturl, wxString &finalurl)
{
std::string h = wxGetApp().get_model_http_url(wxGetApp().app_config->get_country_code());
Expand Down Expand Up @@ -1258,7 +1231,7 @@ void WebViewPanel::OnError(wxWebViewEvent& evt)

// Show the info bar with an error
}
m_info->ShowMessage(_L("An error occurred loading ") + evt.GetURL() + "\n" + "'" + category + "'", wxICON_ERROR);
//m_info->ShowMessage(_L("An error occurred loading ") + evt.GetURL() + "\n" + "'" + category + "'", wxICON_ERROR);

if (evt.GetInt() == wxWEBVIEW_NAV_ERR_CONNECTION && evt.GetId() == m_browserMW->GetId())
{
Expand Down
2 changes: 1 addition & 1 deletion src/slic3r/Utils/bambu_networking.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ namespace BBL {
#define BAMBU_NETWORK_LIBRARY "bambu_networking"
#define BAMBU_NETWORK_AGENT_NAME "bambu_network_agent"

#define BAMBU_NETWORK_AGENT_VERSION "01.09.00.01"
#define BAMBU_NETWORK_AGENT_VERSION "01.09.00.03"

//iot preset type strings
#define IOT_PRINTER_TYPE_STRING "printer"
Expand Down
2 changes: 1 addition & 1 deletion version.inc
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ endif()

# The build_version should start from 50 in master branch

set(SLIC3R_VERSION "01.09.00.57")
set(SLIC3R_VERSION "01.09.00.59")