datadir parameter kept when launching new instance

supermerill/SuperSlicer#1450
This commit is contained in:
supermerill 2021-08-06 11:42:42 +02:00
parent bf3d3ede8c
commit c019e648c7

View File

@ -1,6 +1,7 @@
#include "Process.hpp" #include "Process.hpp"
#include <libslic3r/AppConfig.hpp> #include <libslic3r/AppConfig.hpp>
#include <libslic3r/Utils.hpp>
#include "../GUI/GUI.hpp" #include "../GUI/GUI.hpp"
// for file_wildcards() // for file_wildcards()
@ -49,6 +50,8 @@ static void start_new_slicer_or_gcodeviewer(const NewSlicerInstanceType instance
} }
if (instance_type == NewSlicerInstanceType::Slicer && single_instance) if (instance_type == NewSlicerInstanceType::Slicer && single_instance)
args.emplace_back(L"--single-instance"); args.emplace_back(L"--single-instance");
args.emplace_back(L"--datadir");
args.emplace_back(boost::nowide::widen(Slic3r::data_dir().c_str()).c_str());
args.emplace_back(nullptr); args.emplace_back(nullptr);
BOOST_LOG_TRIVIAL(info) << "Trying to spawn a new slicer \"" << into_u8(path) << "\""; BOOST_LOG_TRIVIAL(info) << "Trying to spawn a new slicer \"" << into_u8(path) << "\"";
// Don't call with wxEXEC_HIDE_CONSOLE, PrusaSlicer in GUI mode would just show the splash screen. It would not open the main window though, it would // Don't call with wxEXEC_HIDE_CONSOLE, PrusaSlicer in GUI mode would just show the splash screen. It would not open the main window though, it would