Fixed update of the default menu after changing of the mode.

+ Added check for the output directory for the G-code extport.
This commit is contained in:
YuSanka 2021-07-26 14:40:19 +02:00
parent 4a9602b073
commit e79bcee739
8 changed files with 29 additions and 8 deletions

View file

@ -542,7 +542,7 @@ void AppConfig::update_config_dir(const std::string &dir)
void AppConfig::update_skein_dir(const std::string &dir)
{
if (dir == sys_shapes_dir() || dir == custom_shapes_dir())
if (is_shapes_dir(dir))
return; // do not save "shapes gallery" directory
this->set("recent", "skein_directory", dir);
}
@ -576,7 +576,7 @@ std::string AppConfig::get_last_output_dir(const std::string& alt, const bool re
if (it2 != it->second.end() && it3 != it->second.end() && !it2->second.empty() && it3->second == "1")
return it2->second;
}
return alt;
return is_shapes_dir(alt) ? get_last_dir() : alt;
}
void AppConfig::update_last_output_dir(const std::string& dir, const bool removable)

View file

@ -102,6 +102,7 @@ extern bool is_gcode_file(const std::string &path);
extern bool is_img_file(const std::string& path);
extern bool is_stl_file(const boost::filesystem::directory_entry& path);
extern bool is_stl_file(const std::string& path);
extern bool is_shapes_dir(const std::string& dir);
// File path / name / extension splitting utilities, working with UTF-8,
// to be published to Perl.

View file

@ -776,6 +776,11 @@ bool is_stl_file(const std::string &path)
return boost::iends_with(path, ".stl");
}
bool is_shapes_dir(const std::string& dir)
{
return dir == sys_shapes_dir() || dir == custom_shapes_dir();
}
} // namespace Slic3r
#ifdef WIN32