Merge branch 'master-remote' into SoftFever

# Conflicts:
#	bbl/i18n/BambuStudio.pot
#	bbl/i18n/de/BambuStudio_de.po
#	bbl/i18n/en/BambuStudio_en.po
#	bbl/i18n/es/BambuStudio_es.po
#	bbl/i18n/fr/BambuStudio_fr.po
#	bbl/i18n/hu/BambuStudio_hu.po
#	bbl/i18n/nl/BambuStudio_nl.po
#	bbl/i18n/sv/BambuStudio_sv.po
#	bbl/i18n/zh_cn/BambuStudio_zh_CN.po
#	resources/i18n/de/BambuStudio.mo
#	resources/i18n/en/BambuStudio.mo
#	resources/i18n/es/BambuStudio.mo
#	resources/i18n/fr/BambuStudio.mo
#	resources/i18n/hu/BambuStudio.mo
#	resources/i18n/nl/BambuStudio.mo
#	resources/i18n/sv/BambuStudio.mo
#	resources/i18n/zh_cn/BambuStudio.mo
#	resources/profiles/BBL.json
#	resources/profiles/Creality.json
#	resources/profiles/Voron.json
#	src/libslic3r/PrintConfig.cpp
#	src/libslic3r/TreeSupport.cpp
#	src/slic3r/GUI/DeviceManager.cpp
#	src/slic3r/GUI/ReleaseNote.cpp
#	version.inc
This commit is contained in:
SoftFever 2022-12-31 15:15:58 +08:00
commit 260156648d
104 changed files with 12137 additions and 1384 deletions

View file

@ -1892,6 +1892,9 @@ void GUI_App::init_app_config()
if (! wxGetEnv(wxS("XDG_CONFIG_HOME"), &dir) || dir.empty() )
dir = wxFileName::GetHomeDir() + wxS("/.config");
set_data_dir((dir + "/" + GetAppName()).ToUTF8().data());
boost::filesystem::path data_dir_path(data_dir());
if (!boost::filesystem::exists(data_dir_path))
boost::filesystem::create_directory(data_dir_path);
#endif
} else {
m_datadir_redefined = true;
@ -2492,11 +2495,14 @@ bool GUI_App::on_init_inner()
void GUI_App::copy_network_if_available()
{
if (app_config->get("update_network_plugin") != "true")
return;
std::string network_library, player_library, network_library_dst, player_library_dst;
std::string data_dir_str = data_dir();
boost::filesystem::path data_dir_path(data_dir_str);
auto plugin_folder = data_dir_path / "plugins";
auto cache_folder = data_dir_path / "ota";
std::string changelog_file = cache_folder.string() + "/network_plugins.json";
#if defined(_MSC_VER) || defined(_WIN32)
network_library = cache_folder.string() + "/bambu_networking.dll";
player_library = cache_folder.string() + "/BambuSource.dll";
@ -2545,6 +2551,9 @@ void GUI_App::copy_network_if_available()
fs::remove(player_library);
BOOST_LOG_TRIVIAL(info) << __FUNCTION__<< ": Copying player library from" << player_library << " to " << player_library_dst<<" successfully.";
}
if (boost::filesystem::exists(changelog_file))
fs::remove(changelog_file);
app_config->set("update_network_plugin", "false");
}
bool GUI_App::on_init_network(bool try_backup)
@ -2905,6 +2914,16 @@ void GUI_App::set_label_clr_sys(const wxColour& clr)
*/
}
bool GUI_App::get_side_menu_popup_status()
{
return m_side_popup_status;
}
void GUI_App::set_side_menu_popup_status(bool status)
{
m_side_popup_status = status;
}
bool GUI_App::tabs_as_menu() const
{
return false;
@ -5717,5 +5736,21 @@ void GUI_App::disassociate_files(std::wstring extend)
#endif // __WXMSW__
bool is_support_filament(int extruder_id)
{
auto &filament_presets = Slic3r::GUI::wxGetApp().preset_bundle->filament_presets;
auto &filaments = Slic3r::GUI::wxGetApp().preset_bundle->filaments;
if (extruder_id >= filament_presets.size()) return false;
Slic3r::Preset *filament = filaments.find_preset(filament_presets[extruder_id]);
if (filament == nullptr) return false;
Slic3r::ConfigOptionBools *support_option = dynamic_cast<Slic3r::ConfigOptionBools *>(filament->config.option("filament_is_support"));
if (support_option == nullptr) return false;
return support_option->get_at(0);
};
} // GUI
} //Slic3r