From 03680bb01442855ed93bcbdde8305e99eb420ed1 Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Mon, 3 Feb 2020 15:47:09 +0100 Subject: [PATCH] Follow-up of 3a99b23ec762cd1ad9b4c5cbb4373d386bfe4b66 -> F5 accelerator added also to objects list --- src/slic3r/GUI/GUI_ObjectList.cpp | 2 ++ src/slic3r/GUI/Plater.cpp | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index 33ddd475c..d630f152f 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -978,6 +978,8 @@ void ObjectList::key_event(wxKeyEvent& event) ) { remove(); } + else if (event.GetKeyCode() == WXK_F5) + wxGetApp().plater()->reload_all_from_disk(); else if (wxGetKeyState(wxKeyCode('A')) && wxGetKeyState(WXK_CONTROL/*WXK_SHIFT*/)) select_item_all_children(); else if (wxGetKeyState(wxKeyCode('C')) && wxGetKeyState(WXK_CONTROL)) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 8afd98d11..f0ca1aa39 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -2076,7 +2076,7 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame) view3D_canvas->Bind(EVT_GLCANVAS_RESET_LAYER_HEIGHT_PROFILE, [this](SimpleEvent&) { this->view3D->get_canvas3d()->reset_layer_height_profile(); }); view3D_canvas->Bind(EVT_GLCANVAS_ADAPTIVE_LAYER_HEIGHT_PROFILE, [this](Event& evt) { this->view3D->get_canvas3d()->adaptive_layer_height_profile(evt.data); }); view3D_canvas->Bind(EVT_GLCANVAS_SMOOTH_LAYER_HEIGHT_PROFILE, [this](HeightProfileSmoothEvent& evt) { this->view3D->get_canvas3d()->smooth_layer_height_profile(evt.data); }); - view3D_canvas->Bind(EVT_GLCANVAS_RELOAD_FROM_DISK, [this](SimpleEvent&) { if (!this->model.objects.empty()) this->reload_all_from_disk(); }); + view3D_canvas->Bind(EVT_GLCANVAS_RELOAD_FROM_DISK, [this](SimpleEvent&) { this->reload_all_from_disk(); }); // 3DScene/Toolbar: view3D_canvas->Bind(EVT_GLTOOLBAR_ADD, &priv::on_action_add, this); @@ -3451,6 +3451,9 @@ void Plater::priv::reload_from_disk() void Plater::priv::reload_all_from_disk() { + if (model.objects.empty()) + return; + Plater::TakeSnapshot snapshot(q, _(L("Reload all from disk"))); Plater::SuppressSnapshots suppress(q);