Maybe one day we will be able to run PrusaGCodeViewer, but for now the Apple notarization

process refuses Apps with multiple binaries and Vojtech does not know any workaround.
Just run PrusaSlicer and give it a --gcodeviewer parameter.
This commit is contained in:
bubnikv 2020-10-01 15:11:56 +02:00
parent e8325a8e2d
commit b71e5c2763

View file

@ -56,11 +56,17 @@ static void start_new_slicer_or_gcodeviewer(const NewSlicerInstanceType instance
boost::filesystem::path bin_path = into_path(wxStandardPaths::Get().GetExecutablePath()); boost::filesystem::path bin_path = into_path(wxStandardPaths::Get().GetExecutablePath());
#if defined(__APPLE__) #if defined(__APPLE__)
{ {
bin_path = bin_path.parent_path() / ((instance_type == NewSlicerInstanceType::Slicer) ? "PrusaSlicer" : "PrusaGCodeViewer"); // Maybe one day we will be able to run PrusaGCodeViewer, but for now the Apple notarization
// process refuses Apps with multiple binaries and Vojtech does not know any workaround.
// ((instance_type == NewSlicerInstanceType::Slicer) ? "PrusaSlicer" : "PrusaGCodeViewer");
// Just run PrusaSlicer and give it a --gcodeviewer parameter.
bin_path = bin_path.parent_path() / "PrusaSlicer";
// On Apple the wxExecute fails, thus we use boost::process instead. // On Apple the wxExecute fails, thus we use boost::process instead.
BOOST_LOG_TRIVIAL(info) << "Trying to spawn a new slicer \"" << bin_path.string() << "\""; BOOST_LOG_TRIVIAL(info) << "Trying to spawn a new slicer \"" << bin_path.string() << "\"";
try { try {
std::vector<std::string> args; std::vector<std::string> args;
if (instance_type == NewSlicerInstanceType::GCodeViewer)
args.emplace_back("--gcodeviewer");
if (path_to_open) if (path_to_open)
args.emplace_back(into_u8(*path_to_open)); args.emplace_back(into_u8(*path_to_open));
boost::process::spawn(bin_path, args); boost::process::spawn(bin_path, args);