mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 05:05:56 +08:00
Trying to fix OSX issue
Right clicking on a STL and selecting "Open With PrusaSlicer .app" does not work correctly.
This commit is contained in:
parent
0995cfc658
commit
18ca3b20da
@ -1050,8 +1050,6 @@ bool GUI_App::OnInit()
|
||||
}
|
||||
}
|
||||
|
||||
static bool update_gui_after_init = true;
|
||||
|
||||
bool GUI_App::on_init_inner()
|
||||
{
|
||||
// Set initialization of image handlers before any UI actions - See GH issue #7469
|
||||
@ -1327,18 +1325,18 @@ bool GUI_App::on_init_inner()
|
||||
// An ugly solution to GH #5537 in which GUI_App::init_opengl (normally called from events wxEVT_PAINT
|
||||
// and wxEVT_SET_FOCUS before GUI_App::post_init is called) wasn't called before GUI_App::post_init and OpenGL wasn't initialized.
|
||||
#ifdef __linux__
|
||||
if (update_gui_after_init && m_opengl_initialized) {
|
||||
if (! m_post_initialized && m_opengl_initialized) {
|
||||
#else
|
||||
if (update_gui_after_init) {
|
||||
if (! m_post_initialized) {
|
||||
#endif
|
||||
update_gui_after_init = false;
|
||||
m_post_initialized = true;
|
||||
#ifdef WIN32
|
||||
this->mainframe->register_win32_callbacks();
|
||||
#endif
|
||||
this->post_init();
|
||||
}
|
||||
|
||||
if (! update_gui_after_init && app_config->dirty() && app_config->get("autosave") == "1")
|
||||
if (m_post_initialized && app_config->dirty() && app_config->get("autosave") == "1")
|
||||
app_config->save();
|
||||
});
|
||||
|
||||
@ -2726,17 +2724,25 @@ void GUI_App::MacOpenFiles(const wxArrayString &fileNames)
|
||||
// Running in G-code viewer.
|
||||
// Load the first G-code into the G-code viewer.
|
||||
// Or if no G-codes, send other files to slicer.
|
||||
if (! gcode_files.empty())
|
||||
if (! gcode_files.empty()) {
|
||||
if (m_post_initialized)
|
||||
this->plater()->load_gcode(gcode_files.front());
|
||||
else
|
||||
this->init_params->input_files = { into_u8(gcode_files.front()) };
|
||||
}
|
||||
if (!non_gcode_files.empty())
|
||||
start_new_slicer(non_gcode_files, true);
|
||||
} else {
|
||||
if (! files.empty()) {
|
||||
if (m_post_initialized) {
|
||||
wxArrayString input_files;
|
||||
for (size_t i = 0; i < non_gcode_files.size(); ++i) {
|
||||
for (size_t i = 0; i < non_gcode_files.size(); ++i)
|
||||
input_files.push_back(non_gcode_files[i]);
|
||||
}
|
||||
this->plater()->load_files(input_files);
|
||||
} else {
|
||||
for (const auto &f : non_gcode_files)
|
||||
this->init_params->input_files.emplace_back(into_u8(f));
|
||||
}
|
||||
}
|
||||
for (const wxString &filename : gcode_files)
|
||||
start_new_gcodeviewer(&filename);
|
||||
|
@ -116,6 +116,7 @@ public:
|
||||
|
||||
private:
|
||||
bool m_initialized { false };
|
||||
bool m_post_initialized { false };
|
||||
bool m_app_conf_exists{ false };
|
||||
EAppMode m_app_mode{ EAppMode::Editor };
|
||||
bool m_is_recreating_gui{ false };
|
||||
|
Loading…
x
Reference in New Issue
Block a user