From 56431d26e5b01d9f206ad52a7eff4de443ec8038 Mon Sep 17 00:00:00 2001 From: Slic3rPE Date: Wed, 26 Aug 2020 14:56:26 +0200 Subject: [PATCH] Starting a new Slicer instance from the menu --- src/slic3r/GUI/MainFrame.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index bbc1da534..122d9c610 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -8,9 +8,12 @@ #include #include //#include +#include +#include #include #include +#include #include "libslic3r/Print.hpp" #include "libslic3r/Polygon.hpp" @@ -979,6 +982,18 @@ void MainFrame::init_menubar() append_menu_item(windowMenu, wxID_ANY, _(L("Print &Host Upload Queue")) + "\tCtrl+J", _(L("Display the Print Host Upload Queue window")), [this](wxCommandEvent&) { m_printhost_queue_dlg->Show(); }, "upload_queue", nullptr, [this]() {return true; }, this); + + windowMenu->AppendSeparator(); + append_menu_item(windowMenu, wxID_ANY, _(L("Open new instance")) + "\tCtrl+I", _(L("Open a new PrusaSlicer instance")), + [this](wxCommandEvent&) { + wxString path = wxStandardPaths::Get().GetExecutablePath(); +#ifdef __APPLE__ + boost::process::spawn((const char*)path.c_str()); +#else + wxExecute(wxStandardPaths::Get().GetExecutablePath(), wxEXEC_ASYNC | wxEXEC_HIDE_CONSOLE | wxEXEC_MAKE_GROUP_LEADER); +#endif + }, "upload_queue", nullptr, + [this]() {return true; }, this); } // View menu