Merge upstream/main and refine exclusion-volume configuration UI

This commit is contained in:
Harry Loud committed 2026-10-09 18:27:44 +01:00
commit 2c0ce5c38b
4547 files changed
+2646026 -2483438

No files matched your search

+49 -3
View File
@@ -4,7 +4,26 @@
#include "format.hpp"
#include "I18N.hpp"
#include "libslic3r/LocalesUtils.hpp"
#include "libslic3r/Config.hpp"
#include <memory>
#include <vector>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp>
#include "libslic3r/Point.hpp"
#include <exception>
#include <wx/log.h>
#include <cassert>
#include "libslic3r/libslic3r.h"
#include <algorithm>
#include "libslic3r/Preset.hpp"
#include "slic3r/GUI/wxExtensions.hpp"
#include <wx/event.h>
#include <boost/algorithm/string/constants.hpp>
#include <cstddef>
#include <wx/utils.h>
#include <utility>
#include <boost/filesystem/operations.hpp>
#include <wx/string.h>
#ifdef __APPLE__
#include "slic3r/Utils/MacDarkMode.hpp"
#endif
@@ -30,11 +49,14 @@
#include "AboutDialog.hpp"
#include "MsgDialog.hpp"
#include "format.hpp"
#include "Plater.hpp"
#include "WebUserLoginDialog.hpp"
#include "libslic3r/Print.hpp"
#include "libslic3r/Utils.hpp"
namespace fs = boost::filesystem;
namespace Slic3r {
@@ -242,7 +264,9 @@ void change_opt_value(DynamicPrintConfig& config, const t_config_option_key& opt
break;
case coPoints:{
if (opt_key == "bed_exclude_area" && boost::any_cast<std::string>(&value) != nullptr) {
config.option<ConfigOptionPoints>(opt_key)->deserialize(boost::any_cast<std::string>(value));
// Tab handles pasted volume syntax after this callback. Do not
// deserialize it as points: failure would erase the saved area
// before the user can accept or cancel the copy operation.
break;
}
if (opt_key == "printable_area" || opt_key == "bed_exclude_area" || opt_key == "thumbnails" || opt_key == "wrapping_exclude_area" ) {
@@ -651,4 +675,26 @@ void desktop_open_any_folder( const std::string& path )
}
bool desktop_open_project_attachment(wxWindow *parent, const boost::filesystem::path &path)
{
// The auxiliary path is UTF-8, which is what boost::filesystem reads a narrow string as.
const boost::filesystem::path aux_root(wxGetApp().plater()->model().get_auxiliary_file_temp_path());
boost::system::error_code ec;
if (!is_absolute_path_within_root(path, aux_root) || !boost::filesystem::is_regular_file(path, ec))
return false;
// Attachments come with the project and carry no download mark, so the desktop would open them without a warning.
if (!is_safe_to_open_file_name(path.filename().string())) {
MessageDialog dlg(parent,
wxString::Format(_L("\"%s\" is not a plain document, image or model file. Opening it may run it as a "
"program or script on this computer.\n\n"
"Only open attachments from projects you trust. Open it anyway?"),
from_path(path.filename())),
_L("Open attachment"), wxICON_WARNING | wxYES_NO);
if (dlg.ShowModal() != wxID_YES)
return false;
}
return wxLaunchDefaultApplication(from_path(path), 0);
}
} }