File->Open Project allows to load .amf files

This commit is contained in:
Enrico Turri 2019-05-15 10:23:02 +02:00
parent 68bffee102
commit 8ae1dfd4d0
4 changed files with 23 additions and 11 deletions

View file

@ -7,6 +7,7 @@
#include <regex>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/algorithm/string/trim.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/optional.hpp>
#include <boost/filesystem/path.hpp>
@ -2947,7 +2948,16 @@ const wxString& Plater::priv::get_project_filename() const
void Plater::priv::set_project_filename(const wxString& filename)
{
m_project_filename = filename;
wxString copy = filename;
if (boost::algorithm::iends_with(copy, ".zip.amf"))
// we remove the .zip part of the extension
copy = boost::ireplace_last_copy(copy, ".zip.", ".");
// we force 3mf extension
boost::filesystem::path full_path = into_path(copy);
full_path.replace_extension("3mf");
m_project_filename = from_path(full_path);
wxGetApp().mainframe->update_title();
}