Launch even if config is corrupted. #1067

This commit is contained in:
Alessandro Ranellucci 2013-03-30 00:30:21 +01:00
parent f5e48a306d
commit 7b7c9f6330

View file

@ -197,16 +197,21 @@ sub on_select_preset {
$self->{config}->set($opt_key, $preset_config->get($opt_key))
if $preset_config->has($opt_key);
}
($preset->{default} || $preset->{external})
? $self->{btn_delete_preset}->Disable
: $self->{btn_delete_preset}->Enable;
$self->on_preset_loaded;
$self->reload_values;
$self->set_dirty(0);
$Slic3r::GUI::Settings->{presets}{$self->name} = $preset->{file} ? basename($preset->{file}) : '';
};
Slic3r::GUI::catch_error($self);
($preset->{default} || $preset->{external})
? $self->{btn_delete_preset}->Disable
: $self->{btn_delete_preset}->Enable;
if ($@) {
$@ = "I was unable to load the selected config file: $@";
Slic3r::GUI::catch_error($self);
$self->select_default_preset;
}
$self->on_preset_loaded;
$self->reload_values;
$self->set_dirty(0);
$Slic3r::GUI::Settings->{presets}{$self->name} = $preset->{file} ? basename($preset->{file}) : '';
Slic3r::GUI->save_settings;
}