When background processing fails because of an error, display it in an explicit dialog

This commit is contained in:
Alessandro Ranellucci 2015-11-04 19:27:58 +01:00
parent a25757a66d
commit 198dc7d3bd
2 changed files with 8 additions and 2 deletions

View file

@ -999,7 +999,7 @@ sub start_background_process {
$self->{print}->process;
};
if ($@) {
Slic3r::debugf "Discarding background process error: $@\n";
Slic3r::debugf "Background process error: $@\n";
Wx::PostEvent($self, Wx::PlThreadEvent->new(-1, $PROCESS_COMPLETED_EVENT, $@));
} else {
Wx::PostEvent($self, Wx::PlThreadEvent->new(-1, $PROCESS_COMPLETED_EVENT, undef));
@ -1150,6 +1150,12 @@ sub on_process_completed {
$self->{process_thread}->detach if $self->{process_thread};
$self->{process_thread} = undef;
# if we're supposed to perform an explicit export let's display the error in a dialog
if ($error && $self->{export_gcode_output_file}) {
$self->{export_gcode_output_file} = undef;
Slic3r::GUI::show_error($self, $error);
}
return if $error;
$self->{toolpaths2D}->reload_print if $self->{toolpaths2D};
$self->{preview3D}->reload_print if $self->{preview3D};