#1083 Make deselectable the automatic switch from tabs during background processing

This commit is contained in:
remi durand 2021-04-18 16:13:08 +02:00
parent e9f4a0205b
commit d0b0bee995
4 changed files with 27 additions and 6 deletions

View File

@ -57,6 +57,7 @@ void AppConfig::set_defaults()
if (get("show_drop_project_dialog").empty()) if (get("show_drop_project_dialog").empty())
set("show_drop_project_dialog", "1"); set("show_drop_project_dialog", "1");
if (get("drop_project_action").empty()) if (get("drop_project_action").empty())
set("drop_project_action", "1"); set("drop_project_action", "1");
@ -151,12 +152,21 @@ void AppConfig::set_defaults()
if (get("use_custom_toolbar_size").empty()) if (get("use_custom_toolbar_size").empty())
set("use_custom_toolbar_size", "0"); 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()) if (get("custom_toolbar_size").empty())
set("custom_toolbar_size", "100"); set("custom_toolbar_size", "100");
if (get("auto_toolbar_size").empty()) if (get("auto_toolbar_size").empty())
set("auto_toolbar_size", "100"); set("auto_toolbar_size", "100");
if (get("auto_switch_preview").empty())
set("auto_switch_preview", "1");
#if ENABLE_ENVIRONMENT_MAP #if ENABLE_ENVIRONMENT_MAP
if (get("use_environment_map").empty()) if (get("use_environment_map").empty())
set("use_environment_map", "0"); set("use_environment_map", "0");

View File

@ -3095,7 +3095,7 @@ unsigned int Plater::priv::update_background_process(bool force_validation, bool
} }
//update tab if needed //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()) if (this->preview->can_display_gcode())
main_frame->select_tab(MainFrame::ETabType::PlaterGcode, true); 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) void Plater::priv::on_slicing_completed(wxCommandEvent & evt)
{ {
notification_manager->push_slicing_complete_notification(evt.GetInt(), is_sidebar_collapsed()); 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) { switch (this->printer_technology) {
case ptFFF: case ptFFF:
this->update_fff_scene(); this->update_fff_scene();
@ -3788,7 +3789,8 @@ void Plater::priv::on_process_completed(SlicingProcessCompletedEvent &evt)
this->background_process.stop(); this->background_process.stop();
this->statusbar()->reset_cancel_callback(); this->statusbar()->reset_cancel_callback();
this->statusbar()->stop_busy(); 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. // Reset the "export G-code path" name, so that the automatic background processing will be enabled again.
this->background_process.reset_export(); this->background_process.reset_export();

View File

@ -419,6 +419,15 @@ void PreferencesDialog::build()
option.opt.width = 6; option.opt.width = 6;
m_optgroup_gui->append_single_option_line(option); 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); activate_options_tab(m_optgroup_gui);
if (is_editor) { if (is_editor) {

View File

@ -8,10 +8,10 @@ set(SLIC3R_APP_KEY "Slic3r")
# exe name of the slicer, should be lowercase and valid in all os # exe name of the slicer, should be lowercase and valid in all os
set(SLIC3R_APP_CMD "Slic3r") set(SLIC3R_APP_CMD "Slic3r")
# versions # versions
set(SLIC3R_VERSION "2.0") set(SLIC3R_VERSION "2.4")
set(SLIC3R_VERSION_FULL "2.0.00.0") set(SLIC3R_VERSION_FULL "2.4.00.0")
set(SLIC3R_BUILD_ID "Slic3r_${SLIC3R_VERSION_FULL}") 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}") set(SLIC3R_RC_VERSION_DOTS "${SLIC3R_VERSION_FULL}")
# Same as the slicer name but for gcodeviewer # Same as the slicer name but for gcodeviewer