From 86da45eb66d3a46df3434c0b31c54bddbb6a5666 Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Thu, 29 Jul 2021 13:28:07 +0200 Subject: [PATCH] Horizontal slider in preview to show always (and only) gcode lines indices --- src/libslic3r/AppConfig.cpp | 3 --- src/slic3r/GUI/DoubleSlider.cpp | 7 ++----- src/slic3r/GUI/GUI_App.cpp | 2 +- src/slic3r/GUI/Preferences.cpp | 12 ------------ src/slic3r/GUI/Preferences.hpp | 2 -- 5 files changed, 3 insertions(+), 23 deletions(-) diff --git a/src/libslic3r/AppConfig.cpp b/src/libslic3r/AppConfig.cpp index dc720db48..c32dfbbce 100644 --- a/src/libslic3r/AppConfig.cpp +++ b/src/libslic3r/AppConfig.cpp @@ -155,9 +155,6 @@ void AppConfig::set_defaults() if (get("seq_top_layer_only").empty()) set("seq_top_layer_only", "1"); - if (get("seq_top_gcode_indices").empty()) - set("seq_top_gcode_indices", "1"); - if (get("use_perspective_camera").empty()) set("use_perspective_camera", "1"); diff --git a/src/slic3r/GUI/DoubleSlider.cpp b/src/slic3r/GUI/DoubleSlider.cpp index a422a4303..bc4441ce4 100644 --- a/src/slic3r/GUI/DoubleSlider.cpp +++ b/src/slic3r/GUI/DoubleSlider.cpp @@ -739,11 +739,8 @@ wxString Control::get_label(int tick, LabelType label_type/* = ltHeightWithLayer return size_t(it - m_layers_values.begin()); }; - if (m_draw_mode == dmSequentialGCodeView) { - return (Slic3r::GUI::get_app_config()->get("seq_top_gcode_indices") == "1") ? - wxString::Format("%lu", static_cast(m_alternate_values[value])) : - wxString::Format("%lu", static_cast(m_values[value])); - } + if (m_draw_mode == dmSequentialGCodeView) + return wxString::Format("%lu", static_cast(m_alternate_values[value])); else { if (label_type == ltEstimatedTime) { if (m_is_wipe_tower) { diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index a73ca880a..b775e46eb 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -1908,7 +1908,7 @@ void GUI_App::add_config_menu(wxMenuBar *menu) PreferencesDialog dlg(mainframe); dlg.ShowModal(); app_layout_changed = dlg.settings_layout_changed(); - if (dlg.seq_top_layer_only_changed() || dlg.seq_seq_top_gcode_indices_changed()) + if (dlg.seq_top_layer_only_changed()) this->plater_->refresh_print(); if (dlg.recreate_GUI()) { diff --git a/src/slic3r/GUI/Preferences.cpp b/src/slic3r/GUI/Preferences.cpp index fe1f0eeb4..9add788bc 100644 --- a/src/slic3r/GUI/Preferences.cpp +++ b/src/slic3r/GUI/Preferences.cpp @@ -292,14 +292,6 @@ void PreferencesDialog::build() option = Option(def, "seq_top_layer_only"); m_optgroup_gui->append_single_option_line(option); - def.label = L("Sequential slider shows gcode line numbers"); - def.type = coBool; - def.tooltip = L("If enabled, the sequential slider, in preview, shows the gcode lines numbers." - "If disabled, the sequential slider, in preview, shows the move index."); - def.set_default_value(new ConfigOptionBool{ app_config->get("seq_top_gcode_indices") == "1" }); - option = Option(def, "seq_top_gcode_indices"); - m_optgroup_gui->append_single_option_line(option); - if (is_editor) { def.label = L("Show sidebar collapse/expand button"); def.type = coBool; @@ -436,10 +428,6 @@ void PreferencesDialog::accept(wxEvent&) if (auto it = m_values.find("seq_top_layer_only"); it != m_values.end()) m_seq_top_layer_only_changed = app_config->get("seq_top_layer_only") != it->second; - m_seq_top_gcode_indices_changed = false; - if (auto it = m_values.find("seq_top_gcode_indices"); it != m_values.end()) - m_seq_top_gcode_indices_changed = app_config->get("seq_top_gcode_indices") != it->second; - m_settings_layout_changed = false; for (const std::string& key : { "old_settings_layout_mode", "new_settings_layout_mode", diff --git a/src/slic3r/GUI/Preferences.hpp b/src/slic3r/GUI/Preferences.hpp index 5c0f1a6d5..458c6335c 100644 --- a/src/slic3r/GUI/Preferences.hpp +++ b/src/slic3r/GUI/Preferences.hpp @@ -29,7 +29,6 @@ class PreferencesDialog : public DPIDialog bool isOSX {false}; bool m_settings_layout_changed {false}; bool m_seq_top_layer_only_changed{ false }; - bool m_seq_top_gcode_indices_changed{ false }; bool m_recreate_GUI{false}; public: @@ -38,7 +37,6 @@ public: bool settings_layout_changed() const { return m_settings_layout_changed; } bool seq_top_layer_only_changed() const { return m_seq_top_layer_only_changed; } - bool seq_seq_top_gcode_indices_changed() const { return m_seq_top_gcode_indices_changed; } bool recreate_GUI() const { return m_recreate_GUI; } void build(); void accept(wxEvent&);