diff --git a/resources/web/guide/21/21.js b/resources/web/guide/21/21.js index 6dd7218e25..5a37c4c32e 100644 --- a/resources/web/guide/21/21.js +++ b/resources/web/guide/21/21.js @@ -59,13 +59,17 @@ function HandleModelList( pVal ) //Add Vendor Html Node if($(".OneVendorBlock[vendor='"+strVendor+"']").length==0) { + let sVV=strVendor; + if( sVV=="BBL" ) + sVV="Bambu Lab"; + let HtmlNewVendor='
'+ '
'+ '
'+ '
all
'+ '
none
'+ '
'+ -' Bambu Lab'+ +' '+sVV+''+ '
'+ '
'+ '
'+ diff --git a/resources/web/guide/24/24.js b/resources/web/guide/24/24.js index ccfdd6164b..43dffda130 100644 --- a/resources/web/guide/24/24.js +++ b/resources/web/guide/24/24.js @@ -59,13 +59,17 @@ function HandleModelList( pVal ) //Add Vendor Html Node if($(".OneVendorBlock[vendor='"+strVendor+"']").length==0) { + let sVV=strVendor; + if( sVV=="BBL" ) + sVV="Bambu Lab"; + let HtmlNewVendor='
'+ '
'+ '
'+ '
all
'+ '
none
'+ '
'+ -' Bambu Lab'+ +' '+sVV+''+ '
'+ '
'+ '
'+ diff --git a/resources/web/guide/6/6.css b/resources/web/guide/6/6.css index ca27c8eaa0..b60480520e 100644 --- a/resources/web/guide/6/6.css +++ b/resources/web/guide/6/6.css @@ -3,6 +3,7 @@ padding: 0; border: 0; margin: 0; + font-family: "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-sans; } html,body diff --git a/resources/web/guide/css/common.css b/resources/web/guide/css/common.css index c7e2cc0b62..4f0a2ae795 100644 --- a/resources/web/guide/css/common.css +++ b/resources/web/guide/css/common.css @@ -3,6 +3,7 @@ padding: 0; border: 0; margin: 0; + font-family: "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-sans; } html diff --git a/resources/web/homepage/css/home.css b/resources/web/homepage/css/home.css index e287a76cbd..c03c76f4e5 100644 --- a/resources/web/homepage/css/home.css +++ b/resources/web/homepage/css/home.css @@ -4,6 +4,7 @@ border: 0px; margin: 0px; font-size: 16px; + font-family: "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-sans; } html, body { diff --git a/src/slic3r/GUI/WebDownPluginDlg.cpp b/src/slic3r/GUI/WebDownPluginDlg.cpp index ee5ce10577..b651323df5 100644 --- a/src/slic3r/GUI/WebDownPluginDlg.cpp +++ b/src/slic3r/GUI/WebDownPluginDlg.cpp @@ -319,7 +319,12 @@ int DownPluginFrame::InstallPlugin() int DownPluginFrame::ShowPluginStatus(int status, int percent, bool &cancel) { - // TODO + static int nPercent = 0; + if (nPercent == percent) + return 0; + + nPercent = percent; + json m_Data = json::object(); m_Data["status"] = status; m_Data["percent"] = percent; diff --git a/src/slic3r/GUI/WebGuideDialog.cpp b/src/slic3r/GUI/WebGuideDialog.cpp index 4b83a48b3e..1095a7b50a 100644 --- a/src/slic3r/GUI/WebGuideDialog.cpp +++ b/src/slic3r/GUI/WebGuideDialog.cpp @@ -19,6 +19,7 @@ #include #include +#include #include "MainFrame.hpp" #include @@ -850,25 +851,63 @@ int GuideFrame::LoadProfile() //} while (_findnext(handle, &findData) == 0); // 查找目录中的下一个文件 // BBS: change directories by design - vendor_dir = (boost::filesystem::path(Slic3r::data_dir()) / PRESET_SYSTEM_DIR).make_preferred(); - rsrc_vendor_dir = (boost::filesystem::path(resources_dir()) / "profiles").make_preferred(); - - // BBS: add BBL as default - // BBS: add json logic for vendor bundle - auto bbl_bundle_path = (vendor_dir / PresetBundle::BBL_BUNDLE).replace_extension(".json"); - bbl_bundle_rsrc = false; - if (!boost::filesystem::exists(bbl_bundle_path)) { - bbl_bundle_path = (rsrc_vendor_dir / PresetBundle::BBL_BUNDLE).replace_extension(".json"); - bbl_bundle_rsrc = true; - } - BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(", will load config from %1%.")% bbl_bundle_path; + //BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(", will load config from %1%.") % bbl_bundle_path; m_ProfileJson = json::parse("{}"); m_ProfileJson["model"] = json::array(); m_ProfileJson["machine"] = json::array(); m_ProfileJson["filament"] = json::object(); m_ProfileJson["process"] = json::array(); - LoadProfileFamily(PresetBundle::BBL_BUNDLE, bbl_bundle_path.string()); + vendor_dir = (boost::filesystem::path(Slic3r::data_dir()) / PRESET_SYSTEM_DIR ).make_preferred(); + rsrc_vendor_dir = (boost::filesystem::path(resources_dir()) / "profiles").make_preferred(); + + // BBS: add BBL as default + // BBS: add json logic for vendor bundle + auto bbl_bundle_path = vendor_dir; + bbl_bundle_rsrc = false; + if (!boost::filesystem::exists((vendor_dir / PresetBundle::BBL_BUNDLE).replace_extension(".json"))) { + bbl_bundle_path = rsrc_vendor_dir; + bbl_bundle_rsrc = true; + } + + // intptr_t handle; + //_finddata_t findData; + + //handle = _findfirst((bbl_bundle_path / "*.json").make_preferred().string().c_str(), &findData); // 查找目录中的第一个文件 + // if (handle == -1) { return -1; } + + // do { + // if (findData.attrib & _A_SUBDIR && strcmp(findData.name, ".") == 0 && strcmp(findData.name, "..") == 0) // 是否是子目录并且不为"."或".." + // { + // // cout << findData.name << "\t\n"; + // } else { + // wxString strVendor = wxString(findData.name).BeforeLast('.'); + // LoadProfileFamily(w2s(strVendor), vendor_dir.make_preferred().string() + "\\"+ findData.name); + // } + + //} while (_findnext(handle, &findData) == 0); // 查找目录中的下一个文件 + + + string targetPath = bbl_bundle_path.make_preferred().string(); + boost::filesystem::path myPath(targetPath); + boost::filesystem::directory_iterator endIter; + for (boost::filesystem::directory_iterator iter(myPath); iter != endIter; iter++) { + if (boost::filesystem::is_directory(*iter)) { + //cout << "is dir" << endl; + //cout << iter->path().string() << endl; + } else { + //cout << "is a file" << endl; + //cout << iter->path().string() << endl; + wxString strVendor = wxString(iter->path().string()).BeforeLast('.'); + strVendor = strVendor.AfterLast( '\\'); + strVendor = strVendor.AfterLast('\/'); + + LoadProfileFamily(w2s(strVendor), iter->path().string()); + } + } + + + //LoadProfileFamily(PresetBundle::BBL_BUNDLE, bbl_bundle_path.string()); const auto enabled_filaments = wxGetApp().app_config->has_section(AppConfig::SECTION_FILAMENTS) ? wxGetApp().app_config->get_section(AppConfig::SECTION_FILAMENTS) : std::map(); m_appconfig_new.set_vendors(*wxGetApp().app_config);