From ce3c31e77e13d9f9aeef9ed9bf052604611e23d8 Mon Sep 17 00:00:00 2001 From: Vojtech Bubnik Date: Wed, 7 Oct 2020 12:54:29 +0200 Subject: [PATCH 1/6] Support symlinks to prusaslicer binary on OSX and Linux. --- src/PrusaSlicer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PrusaSlicer.cpp b/src/PrusaSlicer.cpp index f934470c1..9285fa13a 100644 --- a/src/PrusaSlicer.cpp +++ b/src/PrusaSlicer.cpp @@ -665,7 +665,7 @@ bool CLI::setup(int argc, char **argv) #ifdef __APPLE__ // The application is packed in the .dmg archive as 'Slic3r.app/Contents/MacOS/Slic3r' // The resources are packed to 'Slic3r.app/Contents/Resources' - boost::filesystem::path path_resources = path_to_binary.parent_path() / "../Resources"; + boost::filesystem::path path_resources = std::filesystem::canonical(path_to_binary).parent_path() / "../Resources"; #elif defined _WIN32 // The application is packed in the .zip archive in the root, // The resources are packed to 'resources' @@ -679,7 +679,7 @@ bool CLI::setup(int argc, char **argv) // The application is packed in the .tar.bz archive (or in AppImage) as 'bin/slic3r', // The resources are packed to 'resources' // Path from Slic3r binary to resources: - boost::filesystem::path path_resources = path_to_binary.parent_path() / "../resources"; + boost::filesystem::path path_resources = std::filesystem::canonical(path_to_binary).parent_path() / "../resources"; #endif set_resources_dir(path_resources.string()); From e9d6e6ac8f0296237b51492a5b29554876dfb52c Mon Sep 17 00:00:00 2001 From: Vojtech Bubnik Date: Wed, 7 Oct 2020 13:01:48 +0200 Subject: [PATCH 2/6] Fix of previous commit --- src/PrusaSlicer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PrusaSlicer.cpp b/src/PrusaSlicer.cpp index 9285fa13a..67147ed33 100644 --- a/src/PrusaSlicer.cpp +++ b/src/PrusaSlicer.cpp @@ -665,7 +665,7 @@ bool CLI::setup(int argc, char **argv) #ifdef __APPLE__ // The application is packed in the .dmg archive as 'Slic3r.app/Contents/MacOS/Slic3r' // The resources are packed to 'Slic3r.app/Contents/Resources' - boost::filesystem::path path_resources = std::filesystem::canonical(path_to_binary).parent_path() / "../Resources"; + boost::filesystem::path path_resources = boost::filesystem::canonical(path_to_binary).parent_path() / "../Resources"; #elif defined _WIN32 // The application is packed in the .zip archive in the root, // The resources are packed to 'resources' @@ -679,7 +679,7 @@ bool CLI::setup(int argc, char **argv) // The application is packed in the .tar.bz archive (or in AppImage) as 'bin/slic3r', // The resources are packed to 'resources' // Path from Slic3r binary to resources: - boost::filesystem::path path_resources = std::filesystem::canonical(path_to_binary).parent_path() / "../resources"; + boost::filesystem::path path_resources = boost::filesystem::canonical(path_to_binary).parent_path() / "../resources"; #endif set_resources_dir(path_resources.string()); From 9e0e59728433f16d096ba6b82b39c031b0c1c458 Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Wed, 7 Oct 2020 13:19:44 +0200 Subject: [PATCH 3/6] Skip invisible moves when moving horizontal slider thumb in preview --- src/slic3r/GUI/DoubleSlider.cpp | 46 +++++++++++++---------------- src/slic3r/GUI/GCodeViewer.cpp | 52 ++++++++++++++++++++++++++++++--- src/slic3r/GUI/GCodeViewer.hpp | 8 ++--- 3 files changed, 71 insertions(+), 35 deletions(-) diff --git a/src/slic3r/GUI/DoubleSlider.cpp b/src/slic3r/GUI/DoubleSlider.cpp index 8a9ac34ea..7add05d9d 100644 --- a/src/slic3r/GUI/DoubleSlider.cpp +++ b/src/slic3r/GUI/DoubleSlider.cpp @@ -1021,8 +1021,7 @@ void Control::OnLeftDown(wxMouseEvent& event) m_mouse = maOneLayerIconClick; else if (is_point_in_rect(pos, m_rect_cog_icon)) m_mouse = maCogIconClick; - else if (m_draw_mode == dmRegular) - { + else if (m_draw_mode == dmRegular) { if (is_point_in_rect(pos, m_rect_tick_action)) { auto it = m_ticks.ticks.find(TickCode{ m_selection == ssLower ? m_lower_value : m_higher_value }); m_mouse = it == m_ticks.ticks.end() ? maAddTick : maDeleteTick; @@ -1267,8 +1266,8 @@ void Control::append_change_extruder_menu_item(wxMenu* menu, bool switch_current for (int i = 1; i <= extruders_cnt; i++) { const bool is_active_extruder = i == active_extruders[0] || i == active_extruders[1]; - const wxString item_name = wxString::Format(_(L("Extruder %d")), i) + - (is_active_extruder ? " (" + _(L("active")) + ")" : ""); + const wxString item_name = wxString::Format(_L("Extruder %d"), i) + + (is_active_extruder ? " (" + _L("active") + ")" : ""); if (m_mode == MultiAsSingle) append_menu_item(change_extruder_menu, wxID_ANY, item_name, "", @@ -1280,7 +1279,7 @@ void Control::append_change_extruder_menu_item(wxMenu* menu, bool switch_current (switch_current_code ? _L("Switch code to Change extruder") : _L("Change extruder") ) : _L("Change extruder (N/A)"); - wxMenuItem* change_extruder_menu_item = menu->AppendSubMenu(change_extruder_menu, change_extruder_menu_name, _(L("Use another extruder"))); + wxMenuItem* change_extruder_menu_item = menu->AppendSubMenu(change_extruder_menu, change_extruder_menu_name, _L("Use another extruder")); change_extruder_menu_item->SetBitmap(create_scaled_bitmap(active_extruders[1] > 0 ? "edit_uni" : "change_extruder")); GUI::wxGetApp().plater()->Bind(wxEVT_UPDATE_UI, [this, change_extruder_menu_item](wxUpdateUIEvent& evt) { @@ -1303,8 +1302,8 @@ void Control::append_add_color_change_menu_item(wxMenu* menu, bool switch_curren { const bool is_used_extruder = used_extruders_for_tick.empty() ? true : // #ys_FIXME till used_extruders_for_tick doesn't filled correct for mmMultiExtruder used_extruders_for_tick.find(i) != used_extruders_for_tick.end(); - const wxString item_name = wxString::Format(_(L("Extruder %d")), i) + - (is_used_extruder ? " (" + _(L("used")) + ")" : ""); + const wxString item_name = wxString::Format(_L("Extruder %d"), i) + + (is_used_extruder ? " (" + _L("used") + ")" : ""); append_menu_item(add_color_change_menu, wxID_ANY, item_name, "", [this, i](wxCommandEvent&) { add_code_as_tick(ColorChange, i); }, "", menu, @@ -1466,11 +1465,9 @@ void Control::OnKeyDown(wxKeyEvent &event) else if (event.GetKeyCode() == WXK_SHIFT) UseDefaultColors(false); #endif // ENABLE_GCODE_VIEWER - else if (is_horizontal()) - { + else if (is_horizontal()) { #if ENABLE_GCODE_VIEWER - if (m_is_focused) - { + if (m_is_focused) { #endif // ENABLE_GCODE_VIEWER if (key == WXK_LEFT || key == WXK_RIGHT) move_current_thumb(key == WXK_LEFT); @@ -1481,11 +1478,10 @@ void Control::OnKeyDown(wxKeyEvent &event) #if ENABLE_GCODE_VIEWER } #endif // ENABLE_GCODE_VIEWER - } + } else { #if ENABLE_GCODE_VIEWER - if (m_is_focused) - { + if (m_is_focused) { #endif // ENABLE_GCODE_VIEWER if (key == WXK_LEFT || key == WXK_RIGHT) { m_selection = key == WXK_LEFT ? ssHigher : ssLower; @@ -1704,18 +1700,18 @@ void Control::show_edit_context_menu() append_add_color_change_menu_item(&menu, true); } else - append_menu_item(&menu, wxID_ANY, it->type == ColorChange ? _(L("Edit color")) : - it->type == PausePrint ? _(L("Edit pause print message")) : - _(L("Edit custom G-code")), "", + append_menu_item(&menu, wxID_ANY, it->type == ColorChange ? _L("Edit color") : + it->type == PausePrint ? _L("Edit pause print message") : + _L("Edit custom G-code"), "", [this](wxCommandEvent&) { edit_tick(); }, "edit_uni", &menu); if (it->type == ColorChange && m_mode == MultiAsSingle) append_change_extruder_menu_item(&menu, true); - append_menu_item(&menu, wxID_ANY, it->type == ColorChange ? _(L("Delete color change")) : - it->type == ToolChange ? _(L("Delete tool change")) : - it->type == PausePrint ? _(L("Delete pause print")) : - _(L("Delete custom G-code")), "", + append_menu_item(&menu, wxID_ANY, it->type == ColorChange ? _L("Delete color change") : + it->type == ToolChange ? _L("Delete tool change") : + it->type == PausePrint ? _L("Delete pause print") : + _L("Delete custom G-code"), "", [this](wxCommandEvent&) { delete_current_tick();}, "colorchange_del_f", &menu); GUI::wxGetApp().plater()->PopupMenu(&menu); @@ -1725,14 +1721,14 @@ void Control::show_cog_icon_context_menu() { wxMenu menu; - append_menu_item(&menu, wxID_ANY, _(L("Jump to height")) + " (Shift+G)", "", + append_menu_item(&menu, wxID_ANY, _L("Jump to height") + " (Shift+G)", "", #if ENABLE_GCODE_VIEWER [this](wxCommandEvent&) { jump_to_value(); }, "", & menu); #else [this](wxCommandEvent&) { jump_to_print_z(); }, "", &menu); #endif // ENABLE_GCODE_VIEWER - append_menu_item(&menu, wxID_ANY, _(L("Set extruder sequence for the entire print")), "", + append_menu_item(&menu, wxID_ANY, _L("Set extruder sequence for the entire print"), "", [this](wxCommandEvent&) { edit_extruder_sequence(); }, "", &menu); GUI::wxGetApp().plater()->PopupMenu(&menu); @@ -1861,8 +1857,8 @@ static double get_print_z_to_jump(double active_print_z, double min_z, double ma wxString msg_header = (mode == dmSequentialGCodeView) ? _L("Jump to move") : _L("Jump to height"); wxString msg_in = GUI::double_to_string(active_value); #else - wxString msg_text = _(L("Enter the height you want to jump to")) + ":"; - wxString msg_header = _(L("Jump to height")); + wxString msg_text = _L("Enter the height you want to jump to") + ":"; + wxString msg_header = _L("Jump to height"); wxString msg_in = GUI::double_to_string(active_print_z); #endif // ENABLE_GCODE_VIEWER diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index aae0f4f07..62056d5d0 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -495,6 +495,50 @@ void GCodeViewer::render() const #endif // ENABLE_GCODE_VIEWER_STATISTICS } +void GCodeViewer::update_sequential_view_current(unsigned int first, unsigned int last) +{ + auto is_visible = [this](unsigned int id) { + for (const TBuffer& buffer : m_buffers) { + if (buffer.visible) { + for (const Path& path : buffer.paths) { + if (path.first.s_id <= id && id <= path.last.s_id) + return true; + } + } + } + return false; + }; + + int first_diff = static_cast(first) - static_cast(m_sequential_view.last_current.first); + int last_diff = static_cast(last) - static_cast(m_sequential_view.last_current.last); + + unsigned int new_first = first; + unsigned int new_last = last; + + while (!is_visible(new_first)) { + if (first_diff > 0) + ++new_first; + else + --new_first; + } + + while (!is_visible(new_last)) { + if (last_diff > 0) + ++new_last; + else + --new_last; + } + + m_sequential_view.current.first = new_first; + m_sequential_view.current.last = new_last; + m_sequential_view.last_current = m_sequential_view.current; + + refresh_render_paths(true, true); + + if (new_first != first || new_last != last) + wxGetApp().plater()->update_preview_moves_slider(); +} + bool GCodeViewer::is_toolpath_move_type_visible(EMoveType type) const { size_t id = static_cast(buffer_id(type)); @@ -2138,10 +2182,10 @@ void GCodeViewer::render_legend() const } break; } - case EViewType::Height: { append_range(m_extrusions.ranges.height, 3); break; } - case EViewType::Width: { append_range(m_extrusions.ranges.width, 3); break; } - case EViewType::Feedrate: { append_range(m_extrusions.ranges.feedrate, 1); break; } - case EViewType::FanSpeed: { append_range(m_extrusions.ranges.fan_speed, 0); break; } + case EViewType::Height: { append_range(m_extrusions.ranges.height, 3); break; } + case EViewType::Width: { append_range(m_extrusions.ranges.width, 3); break; } + case EViewType::Feedrate: { append_range(m_extrusions.ranges.feedrate, 1); break; } + case EViewType::FanSpeed: { append_range(m_extrusions.ranges.fan_speed, 0); break; } case EViewType::VolumetricRate: { append_range(m_extrusions.ranges.volumetric_rate, 3); break; } case EViewType::Tool: { diff --git a/src/slic3r/GUI/GCodeViewer.hpp b/src/slic3r/GUI/GCodeViewer.hpp index 8c5d8b743..c2ebce9b9 100644 --- a/src/slic3r/GUI/GCodeViewer.hpp +++ b/src/slic3r/GUI/GCodeViewer.hpp @@ -367,6 +367,7 @@ public: Endpoints endpoints; Endpoints current; + Endpoints last_current; Vec3f current_position{ Vec3f::Zero() }; Marker marker; }; @@ -430,12 +431,7 @@ public: const std::vector& get_layers_zs() const { return m_layers_zs; }; const SequentialView& get_sequential_view() const { return m_sequential_view; } - void update_sequential_view_current(unsigned int first, unsigned int last) - { - m_sequential_view.current.first = first; - m_sequential_view.current.last = last; - refresh_render_paths(true, true); - } + void update_sequential_view_current(unsigned int first, unsigned int last); EViewType get_view_type() const { return m_view_type; } void set_view_type(EViewType type) { From 2ecd78b0d5d1259d3aafae272bea6f01352c7574 Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Wed, 7 Oct 2020 13:38:21 +0200 Subject: [PATCH 4/6] Fixed crash when moving horizontal slider thumb in preview with no toolpath active --- src/slic3r/GUI/GCodeViewer.cpp | 5 +++++ src/slic3r/GUI/GUI_Preview.cpp | 9 +++++++-- src/slic3r/GUI/GUI_Preview.hpp | 1 + src/slic3r/GUI/Plater.cpp | 15 +++++++++++---- src/slic3r/GUI/Plater.hpp | 1 + 5 files changed, 25 insertions(+), 6 deletions(-) diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index 62056d5d0..40f3d0ba2 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -1689,6 +1689,8 @@ void GCodeViewer::refresh_render_paths(bool keep_sequential_current_first, bool break; } + unsigned int render_paths_count = 0; + // second pass: filter paths by sequential data and collect them by color for (const auto& [buffer, index_buffer_id, path_id] : paths) { const Path& path = buffer->paths[path_id]; @@ -1711,6 +1713,7 @@ void GCodeViewer::refresh_render_paths(bool keep_sequential_current_first, bool it->color = color; it->path_id = path_id; it->index_buffer_id = index_buffer_id; + ++render_paths_count; } unsigned int segments_count = std::min(m_sequential_view.current.last, path.last.s_id) - std::max(m_sequential_view.current.first, path.first.s_id) + 1; @@ -1733,6 +1736,8 @@ void GCodeViewer::refresh_render_paths(bool keep_sequential_current_first, bool it->offsets.push_back(static_cast((path.first.i_id + delta_1st) * sizeof(unsigned int))); } + wxGetApp().plater()->enable_preview_moves_slider(render_paths_count > 0); + #if ENABLE_GCODE_VIEWER_STATISTICS for (const TBuffer& buffer : m_buffers) { m_statistics.render_paths_size += SLIC3R_STDVEC_MEMSIZE(buffer.render_paths, RenderPath); diff --git a/src/slic3r/GUI/GUI_Preview.cpp b/src/slic3r/GUI/GUI_Preview.cpp index b9e0afc65..fd505ef80 100644 --- a/src/slic3r/GUI/GUI_Preview.cpp +++ b/src/slic3r/GUI/GUI_Preview.cpp @@ -1162,8 +1162,7 @@ void Preview::update_moves_slider() std::vector values(view.endpoints.last - view.endpoints.first + 1); unsigned int count = 0; - for (unsigned int i = view.endpoints.first; i <= view.endpoints.last; ++i) - { + for (unsigned int i = view.endpoints.first; i <= view.endpoints.last; ++i) { values[count++] = static_cast(i + 1); } @@ -1171,6 +1170,12 @@ void Preview::update_moves_slider() m_moves_slider->SetMaxValue(view.endpoints.last - view.endpoints.first); m_moves_slider->SetSelectionSpan(view.current.first - view.endpoints.first, view.current.last - view.endpoints.first); } + +void Preview::enable_moves_slider(bool enable) +{ + if (m_moves_slider != nullptr) + m_moves_slider->Enable(enable); +} #else void Preview::update_double_slider_from_canvas(wxKeyEvent & event) { diff --git a/src/slic3r/GUI/GUI_Preview.hpp b/src/slic3r/GUI/GUI_Preview.hpp index c0a457d9c..3628bfd97 100644 --- a/src/slic3r/GUI/GUI_Preview.hpp +++ b/src/slic3r/GUI/GUI_Preview.hpp @@ -194,6 +194,7 @@ Preview(wxWindow* parent, Model* model, DynamicPrintConfig* config, #if ENABLE_GCODE_VIEWER void update_bottom_toolbar(); void update_moves_slider(); + void enable_moves_slider(bool enable); void hide_layers_slider(); #endif // ENABLE_GCODE_VIEWER diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 96287e99b..e14b36c0d 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -1612,9 +1612,8 @@ struct Plater::priv #if ENABLE_GCODE_VIEWER void update_preview_bottom_toolbar(); void update_preview_moves_slider(); -#endif // ENABLE_GCODE_VIEWER + void enable_preview_moves_slider(bool enable); -#if ENABLE_GCODE_VIEWER void reset_gcode_toolpaths(); #endif // ENABLE_GCODE_VIEWER @@ -4105,9 +4104,12 @@ void Plater::priv::update_preview_moves_slider() { preview->update_moves_slider(); } -#endif // ENABLE_GCODE_VIEWER -#if ENABLE_GCODE_VIEWER +void Plater::priv::enable_preview_moves_slider(bool enable) +{ + preview->enable_moves_slider(enable); +} + void Plater::priv::reset_gcode_toolpaths() { preview->get_canvas3d()->reset_gcode_toolpaths(); @@ -5898,6 +5900,11 @@ void Plater::update_preview_moves_slider() p->update_preview_moves_slider(); } +void Plater::enable_preview_moves_slider(bool enable) +{ + p->enable_preview_moves_slider(enable); +} + void Plater::reset_gcode_toolpaths() { p->reset_gcode_toolpaths(); diff --git a/src/slic3r/GUI/Plater.hpp b/src/slic3r/GUI/Plater.hpp index 71cd32415..7abfd3345 100644 --- a/src/slic3r/GUI/Plater.hpp +++ b/src/slic3r/GUI/Plater.hpp @@ -316,6 +316,7 @@ public: #if ENABLE_GCODE_VIEWER void update_preview_bottom_toolbar(); void update_preview_moves_slider(); + void enable_preview_moves_slider(bool enable); void reset_gcode_toolpaths(); void reset_last_loaded_gcode() { m_last_loaded_gcode = ""; } From ce0312acbd6f33331e4451233f4226ff0d12e163 Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Wed, 7 Oct 2020 16:02:01 +0200 Subject: [PATCH 5/6] Fixed gcodeviewer application title on Linux and Mac --- src/libslic3r/libslic3r.h | 3 +++ src/libslic3r/libslic3r_version.h.in | 4 ---- version.inc | 4 ---- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/libslic3r/libslic3r.h b/src/libslic3r/libslic3r.h index 76ff27136..a404d230d 100644 --- a/src/libslic3r/libslic3r.h +++ b/src/libslic3r/libslic3r.h @@ -2,6 +2,9 @@ #define _libslic3r_h_ #include "libslic3r_version.h" +#define GCODEVIEWER_APP_NAME "PrusaSlicer G-code Viewer" +#define GCODEVIEWER_APP_KEY "PrusaSlicerGcodeViewer" +#define GCODEVIEWER_BUILD_ID std::string("PrusaSlicer G-code Viewer-") + std::string(SLIC3R_VERSION) + std::string("-UNKNOWN") // this needs to be included early for MSVC (listing it in Build.PL is not enough) #include diff --git a/src/libslic3r/libslic3r_version.h.in b/src/libslic3r/libslic3r_version.h.in index f65d0637e..26a67362b 100644 --- a/src/libslic3r/libslic3r_version.h.in +++ b/src/libslic3r/libslic3r_version.h.in @@ -6,8 +6,4 @@ #define SLIC3R_VERSION "@SLIC3R_VERSION@" #define SLIC3R_BUILD_ID "@SLIC3R_BUILD_ID@" -#define GCODEVIEWER_APP_NAME "@GCODEVIEWER_APP_NAME@" -#define GCODEVIEWER_APP_KEY "@GCODEVIEWER_APP_KEY@" -#define GCODEVIEWER_BUILD_ID "@GCODEVIEWER_BUILD_ID@" - #endif /* __SLIC3R_VERSION_H */ diff --git a/version.inc b/version.inc index 9f7a105b2..30b373bdf 100644 --- a/version.inc +++ b/version.inc @@ -7,7 +7,3 @@ set(SLIC3R_VERSION "2.3.0-alpha0") set(SLIC3R_BUILD_ID "PrusaSlicer-${SLIC3R_VERSION}+UNKNOWN") set(SLIC3R_RC_VERSION "2,3,0,0") set(SLIC3R_RC_VERSION_DOTS "2.3.0.0") - -set(GCODEVIEWER_APP_NAME "Prusa GCode Viewer") -set(GCODEVIEWER_APP_KEY "PrusaGCodeViewer") -set(GCODEVIEWER_BUILD_ID "Prusa GCode Viewer-${SLIC3R_VERSION}+UNKNOWN") From 6871c2ccd8d77bb69c0197b0b4de1482180d783f Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Wed, 7 Oct 2020 16:15:07 +0200 Subject: [PATCH 6/6] Fixed updating of pages on startup, reverted changes from b17c829 The second commit should be no longer needed, the CallAfter cause crashes on Linux when switching technologies --- src/slic3r/GUI/Tab.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 3a28b2766..9a037d9d7 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -303,7 +303,6 @@ void Tab::create_preset_tab() // so that the cursor jumps to the last item. m_treectrl->Bind(wxEVT_TREE_SEL_CHANGED, [this](wxTreeEvent&) { if (!m_disable_tree_sel_changed_event && !m_pages.empty()) { -#ifdef WIN32 if (m_page_switch_running) m_page_switch_planned = true; else { @@ -314,10 +313,6 @@ void Tab::create_preset_tab() } while (this->tree_sel_change_delayed()); m_page_switch_running = false; } -#else - // Crashes on Linux on start-up without CallAfter. - this->CallAfter([this]() { this->tree_sel_change_delayed(); }); -#endif } }); @@ -357,6 +352,13 @@ void Tab::create_preset_tab() // Initialize the DynamicPrintConfig by default keys/values. build(); + + // ys_FIXME: Following should not be needed, the function will be called later + // (update_mode->update_visibility->rebuild_page_tree). This does not work, during the + // second call of rebuild_page_tree m_treectrl->GetFirstVisibleItem(); returns zero + // for some unknown reason (and the page is not refreshed until user does a selection). + rebuild_page_tree(); + m_completed = true; }