mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-13 01:37:53 -06:00
Start PrusaSlicer in gcode viewer mode when dragging and dropping a .gcode file on the application icon
This commit is contained in:
parent
0435993309
commit
11d8a2ad8e
3 changed files with 29 additions and 2 deletions
|
@ -154,6 +154,17 @@ int CLI::run(int argc, char **argv)
|
|||
|
||||
// Read input file(s) if any.
|
||||
#if ENABLE_GCODE_VIEWER
|
||||
#if ENABLE_GCODE_DRAG_AND_DROP_GCODE_FILES
|
||||
for (const std::string& file : m_input_files) {
|
||||
std::string ext = boost::filesystem::path(file).extension().string();
|
||||
if (boost::filesystem::path(file).extension().string() == ".gcode") {
|
||||
if (boost::filesystem::exists(file)) {
|
||||
start_as_gcodeviewer = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // ENABLE_GCODE_DRAG_AND_DROP_GCODE_FILES
|
||||
if (!start_as_gcodeviewer) {
|
||||
#endif // ENABLE_GCODE_VIEWER
|
||||
for (const std::string& file : m_input_files) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue