mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-06 22:47:32 -06:00
Bugfix: error during skein freezed the GUI
This commit is contained in:
parent
076087af2e
commit
71a373e437
1 changed files with 4 additions and 1 deletions
|
@ -225,6 +225,7 @@ sub new {
|
||||||
sub do_slice {
|
sub do_slice {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
|
my $process_dialog;
|
||||||
eval {
|
eval {
|
||||||
# validate configuration
|
# validate configuration
|
||||||
Slic3r::Config->validate;
|
Slic3r::Config->validate;
|
||||||
|
@ -236,7 +237,7 @@ sub do_slice {
|
||||||
my $input_file_basename = basename($input_file);
|
my $input_file_basename = basename($input_file);
|
||||||
|
|
||||||
# show processbar dialog
|
# show processbar dialog
|
||||||
my $process_dialog = Wx::ProgressDialog->new('Slicing...', "Processing $input_file_basename...",
|
$process_dialog = Wx::ProgressDialog->new('Slicing...', "Processing $input_file_basename...",
|
||||||
100, $self, wxPD_APP_MODAL);
|
100, $self, wxPD_APP_MODAL);
|
||||||
$process_dialog->Pulse;
|
$process_dialog->Pulse;
|
||||||
my $skein = Slic3r::Skein->new(
|
my $skein = Slic3r::Skein->new(
|
||||||
|
@ -244,12 +245,14 @@ sub do_slice {
|
||||||
);
|
);
|
||||||
$skein->go;
|
$skein->go;
|
||||||
$process_dialog->Destroy;
|
$process_dialog->Destroy;
|
||||||
|
undef $process_dialog;
|
||||||
|
|
||||||
Wx::MessageDialog->new($self, "$input_file_basename was successfully sliced.", 'Done!',
|
Wx::MessageDialog->new($self, "$input_file_basename was successfully sliced.", 'Done!',
|
||||||
wxOK | wxICON_INFORMATION)->ShowModal;
|
wxOK | wxICON_INFORMATION)->ShowModal;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (my $err = $@) {
|
if (my $err = $@) {
|
||||||
|
$process_dialog->Destroy if $process_dialog;
|
||||||
Wx::MessageDialog->new($self, $err, 'Error', wxOK | wxICON_ERROR)->ShowModal;
|
Wx::MessageDialog->new($self, $err, 'Error', wxOK | wxICON_ERROR)->ShowModal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue