mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 00:37:51 -06:00
WIP: Drag and drop of G-codes on OSX onto Docker icon
This commit is contained in:
parent
67d0072bc8
commit
466f882cd8
1 changed files with 11 additions and 3 deletions
|
@ -47,6 +47,7 @@
|
||||||
|
|
||||||
#include "../Utils/PresetUpdater.hpp"
|
#include "../Utils/PresetUpdater.hpp"
|
||||||
#include "../Utils/PrintHost.hpp"
|
#include "../Utils/PrintHost.hpp"
|
||||||
|
#include "../Utils/Process.hpp"
|
||||||
#include "../Utils/MacDarkMode.hpp"
|
#include "../Utils/MacDarkMode.hpp"
|
||||||
#include "slic3r/Config/Snapshot.hpp"
|
#include "slic3r/Config/Snapshot.hpp"
|
||||||
#include "ConfigSnapshotDialog.hpp"
|
#include "ConfigSnapshotDialog.hpp"
|
||||||
|
@ -1575,9 +1576,16 @@ bool GUI_App::OnExceptionInMainLoop()
|
||||||
void GUI_App::MacOpenFiles(const wxArrayString &fileNames)
|
void GUI_App::MacOpenFiles(const wxArrayString &fileNames)
|
||||||
{
|
{
|
||||||
std::vector<std::string> files;
|
std::vector<std::string> files;
|
||||||
for (size_t i = 0; i < fileNames.GetCount(); ++ i)
|
const std::regex pattern_gcode_drop(".*[.](gcode|g)", std::regex::icase);
|
||||||
files.emplace_back(fileNames[i].ToUTF8().data());
|
for (const auto& filename : fileNames) {
|
||||||
this->plater()->load_files(files, true, true);
|
boost::filesystem::path path(into_path(filename));
|
||||||
|
if (std::regex_match(path.string(), pattern_gcode_drop))
|
||||||
|
start_new_gcodeviewer(&filename);
|
||||||
|
else
|
||||||
|
files.emplace_back(path.string());
|
||||||
|
}
|
||||||
|
if (! files.empty())
|
||||||
|
this->plater()->load_files(files, true, true);
|
||||||
}
|
}
|
||||||
#endif /* __APPLE */
|
#endif /* __APPLE */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue