mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-14 15:35:56 +08:00
Fixed regression in dirty settings
This commit is contained in:
parent
846478520f
commit
a1b0246710
@ -388,6 +388,12 @@ sub new {
|
|||||||
|
|
||||||
$self->load_presets;
|
$self->load_presets;
|
||||||
$self->config_changed;
|
$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_add(0);
|
||||||
$o->can_delete(1);
|
$o->can_delete(1);
|
||||||
@ -782,6 +788,13 @@ sub show_preset_editor {
|
|||||||
|
|
||||||
$preset_editor->select_preset_by_name($presets[$i // 0]->name);
|
$preset_editor->select_preset_by_name($presets[$i // 0]->name);
|
||||||
$preset_editor->on_value_change(sub {
|
$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;
|
$self->config_changed;
|
||||||
});
|
});
|
||||||
$preset_editor->on_select_preset(sub {
|
$preset_editor->on_select_preset(sub {
|
||||||
|
@ -208,9 +208,7 @@ sub _on_select_preset {
|
|||||||
# prompted and chose to discard changes.
|
# prompted and chose to discard changes.
|
||||||
$self->load_presets;
|
$self->load_presets;
|
||||||
|
|
||||||
$preset->load_config if !$preset->_loaded;
|
$self->reload_preset;
|
||||||
$self->config->clear;
|
|
||||||
$self->config->apply($preset->dirty_config);
|
|
||||||
|
|
||||||
eval {
|
eval {
|
||||||
local $SIG{__WARN__} = Slic3r::GUI::warning_catcher($self);
|
local $SIG{__WARN__} = Slic3r::GUI::warning_catcher($self);
|
||||||
@ -220,7 +218,6 @@ sub _on_select_preset {
|
|||||||
|
|
||||||
$self->_update;
|
$self->_update;
|
||||||
$self->on_preset_loaded;
|
$self->on_preset_loaded;
|
||||||
$self->reload_config;
|
|
||||||
};
|
};
|
||||||
if ($@) {
|
if ($@) {
|
||||||
$@ = "I was unable to load the selected config file: $@";
|
$@ = "I was unable to load the selected config file: $@";
|
||||||
@ -247,6 +244,15 @@ sub add_options_page {
|
|||||||
return $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 {
|
sub reload_config {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user