diff --git a/lib/Slic3r/GUI/Plater.pm b/lib/Slic3r/GUI/Plater.pm index 280837299..a5a410402 100644 --- a/lib/Slic3r/GUI/Plater.pm +++ b/lib/Slic3r/GUI/Plater.pm @@ -388,6 +388,12 @@ sub new { $self->load_presets; $self->config_changed; + + # Reload the open tab if any + if (my $print_tab = $self->GetFrame->{preset_editor_tabs}{print}) { + $print_tab->load_presets; + $print_tab->reload_preset; + } }); $o->can_add(0); $o->can_delete(1); @@ -782,6 +788,13 @@ sub show_preset_editor { $preset_editor->select_preset_by_name($presets[$i // 0]->name); $preset_editor->on_value_change(sub { + # Re-load the presets in order to toggle the (modified) suffix + $self->load_presets; + + # Update shortcuts + $self->_on_select_preset($group); + + # Use the new config wherever we actually use its contents $self->config_changed; }); $preset_editor->on_select_preset(sub { diff --git a/lib/Slic3r/GUI/PresetEditor.pm b/lib/Slic3r/GUI/PresetEditor.pm index b566671f9..788c98eed 100644 --- a/lib/Slic3r/GUI/PresetEditor.pm +++ b/lib/Slic3r/GUI/PresetEditor.pm @@ -208,9 +208,7 @@ sub _on_select_preset { # prompted and chose to discard changes. $self->load_presets; - $preset->load_config if !$preset->_loaded; - $self->config->clear; - $self->config->apply($preset->dirty_config); + $self->reload_preset; eval { local $SIG{__WARN__} = Slic3r::GUI::warning_catcher($self); @@ -220,7 +218,6 @@ sub _on_select_preset { $self->_update; $self->on_preset_loaded; - $self->reload_config; }; if ($@) { $@ = "I was unable to load the selected config file: $@"; @@ -247,6 +244,15 @@ sub add_options_page { return $page; } +sub reload_preset { + my ($self) = @_; + + $self->current_preset->load_config if !$self->current_preset->_loaded; + $self->config->clear; + $self->config->apply($self->current_preset->dirty_config); + $self->reload_config; +} + sub reload_config { my $self = shift;