From d0b0bee9955625687375b6ce41482aea7b194be3 Mon Sep 17 00:00:00 2001 From: remi durand Date: Sun, 18 Apr 2021 16:13:08 +0200 Subject: [PATCH] #1083 Make deselectable the automatic switch from tabs during background processing --- src/libslic3r/AppConfig.cpp | 10 ++++++++++ src/slic3r/GUI/Plater.cpp | 8 +++++--- src/slic3r/GUI/Preferences.cpp | 9 +++++++++ version.inc | 6 +++--- 4 files changed, 27 insertions(+), 6 deletions(-) diff --git a/src/libslic3r/AppConfig.cpp b/src/libslic3r/AppConfig.cpp index 79f90d11a..8b1310e03 100644 --- a/src/libslic3r/AppConfig.cpp +++ b/src/libslic3r/AppConfig.cpp @@ -57,6 +57,7 @@ void AppConfig::set_defaults() if (get("show_drop_project_dialog").empty()) set("show_drop_project_dialog", "1"); + if (get("drop_project_action").empty()) set("drop_project_action", "1"); @@ -151,12 +152,21 @@ void AppConfig::set_defaults() if (get("use_custom_toolbar_size").empty()) set("use_custom_toolbar_size", "0"); + if (get("show_collapse_button").empty()) + set("show_collapse_button", "1"); + + if (get("suppress_hyperlinks").empty()) + set("suppress_hyperlinks", "1"); + if (get("custom_toolbar_size").empty()) set("custom_toolbar_size", "100"); if (get("auto_toolbar_size").empty()) set("auto_toolbar_size", "100"); + if (get("auto_switch_preview").empty()) + set("auto_switch_preview", "1"); + #if ENABLE_ENVIRONMENT_MAP if (get("use_environment_map").empty()) set("use_environment_map", "0"); diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 8de7209a7..0788fb4ed 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -3095,7 +3095,7 @@ unsigned int Plater::priv::update_background_process(bool force_validation, bool } //update tab if needed - if (invalidated != Print::ApplyStatus::APPLY_STATUS_UNCHANGED) + if (invalidated != Print::ApplyStatus::APPLY_STATUS_UNCHANGED && wxGetApp().app_config->get("auto_switch_preview") == "1") { if (this->preview->can_display_gcode()) main_frame->select_tab(MainFrame::ETabType::PlaterGcode, true); @@ -3708,7 +3708,8 @@ void Plater::priv::on_slicing_update(SlicingStatusEvent &evt) void Plater::priv::on_slicing_completed(wxCommandEvent & evt) { notification_manager->push_slicing_complete_notification(evt.GetInt(), is_sidebar_collapsed()); - main_frame->select_tab(MainFrame::ETabType::PlaterPreview); + if(wxGetApp().app_config->get("auto_switch_preview") == "1") + main_frame->select_tab(MainFrame::ETabType::PlaterPreview); switch (this->printer_technology) { case ptFFF: this->update_fff_scene(); @@ -3788,7 +3789,8 @@ void Plater::priv::on_process_completed(SlicingProcessCompletedEvent &evt) this->background_process.stop(); this->statusbar()->reset_cancel_callback(); this->statusbar()->stop_busy(); - main_frame->select_tab(MainFrame::ETabType::PlaterGcode); + if (wxGetApp().app_config->get("auto_switch_preview") == "1") + main_frame->select_tab(MainFrame::ETabType::PlaterGcode); // Reset the "export G-code path" name, so that the automatic background processing will be enabled again. this->background_process.reset_export(); diff --git a/src/slic3r/GUI/Preferences.cpp b/src/slic3r/GUI/Preferences.cpp index bae29f5b3..b66b66995 100644 --- a/src/slic3r/GUI/Preferences.cpp +++ b/src/slic3r/GUI/Preferences.cpp @@ -419,6 +419,15 @@ void PreferencesDialog::build() option.opt.width = 6; m_optgroup_gui->append_single_option_line(option); + if (is_editor) { + def.label = L("Switch from 3D view to Preview when sliced"); + def.type = coBool; + def.tooltip = std::string(L("When an object is sliced, it will switch your view from the 3D view to the previewx (and then gcode-preview) automatically.")); + def.set_default_value(new ConfigOptionBool{ app_config->get("auto_switch_preview") == "1" }); + option = Option(def, "auto_switch_preview"); + m_optgroup_gui->append_single_option_line(option); + } + activate_options_tab(m_optgroup_gui); if (is_editor) { diff --git a/version.inc b/version.inc index 41667c68f..81d4bd988 100644 --- a/version.inc +++ b/version.inc @@ -8,10 +8,10 @@ set(SLIC3R_APP_KEY "Slic3r") # exe name of the slicer, should be lowercase and valid in all os set(SLIC3R_APP_CMD "Slic3r") # versions -set(SLIC3R_VERSION "2.0") -set(SLIC3R_VERSION_FULL "2.0.00.0") +set(SLIC3R_VERSION "2.4") +set(SLIC3R_VERSION_FULL "2.4.00.0") set(SLIC3R_BUILD_ID "Slic3r_${SLIC3R_VERSION_FULL}") -set(SLIC3R_RC_VERSION "2,0,00,0") +set(SLIC3R_RC_VERSION "2,4,00,0") set(SLIC3R_RC_VERSION_DOTS "${SLIC3R_VERSION_FULL}") # Same as the slicer name but for gcodeviewer