mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-22 22:24:01 -06:00
Modifiers Gallery (#6703)
* Added GalleryDialog * GalleryDialog improvements: * Added DnD functionality * Added "Delete custom shapes" function
This commit is contained in:
parent
569b7d7dab
commit
d6fdf2d5c2
23 changed files with 528 additions and 7 deletions
|
@ -45,6 +45,11 @@ void set_local_dir(const std::string &path);
|
|||
// Return a full path to the localization directory.
|
||||
const std::string& localization_dir();
|
||||
|
||||
// Set a path with shapes gallery files.
|
||||
void set_gallery_dir(const std::string &path);
|
||||
// Return a full path to the gallery directory.
|
||||
const std::string& gallery_dir();
|
||||
|
||||
// Set a path with preset files.
|
||||
void set_data_dir(const std::string &path);
|
||||
// Return a full path to the GUI resource files.
|
||||
|
@ -91,6 +96,9 @@ extern bool is_plain_file(const boost::filesystem::directory_entry &path);
|
|||
extern bool is_ini_file(const boost::filesystem::directory_entry &path);
|
||||
extern bool is_idx_file(const boost::filesystem::directory_entry &path);
|
||||
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);
|
||||
|
||||
// File path / name / extension splitting utilities, working with UTF-8,
|
||||
// to be published to Perl.
|
||||
|
|
|
@ -175,6 +175,18 @@ const std::string& localization_dir()
|
|||
return g_local_dir;
|
||||
}
|
||||
|
||||
static std::string g_gallery_dir;
|
||||
|
||||
void set_gallery_dir(const std::string &dir)
|
||||
{
|
||||
g_gallery_dir = dir;
|
||||
}
|
||||
|
||||
const std::string& gallery_dir()
|
||||
{
|
||||
return g_gallery_dir;
|
||||
}
|
||||
|
||||
// Translate function callback, to call wxWidgets translate function to convert non-localized UTF8 string to a localized one.
|
||||
Slic3r::I18N::translate_fn_type Slic3r::I18N::translate_fn = nullptr;
|
||||
|
||||
|
@ -744,6 +756,21 @@ bool is_gcode_file(const std::string &path)
|
|||
boost::iends_with(path, ".g") || boost::iends_with(path, ".ngc");
|
||||
}
|
||||
|
||||
bool is_img_file(const std::string &path)
|
||||
{
|
||||
return boost::iends_with(path, ".png") || boost::iends_with(path, ".svg");
|
||||
}
|
||||
|
||||
bool is_stl_file(const boost::filesystem::directory_entry& dir_entry)
|
||||
{
|
||||
return is_plain_file(dir_entry) && strcasecmp(dir_entry.path().extension().string().c_str(), ".stl") == 0;
|
||||
}
|
||||
|
||||
bool is_stl_file(const std::string &path)
|
||||
{
|
||||
return boost::iends_with(path, ".stl");
|
||||
}
|
||||
|
||||
} // namespace Slic3r
|
||||
|
||||
#ifdef WIN32
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue