mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 01:07:57 -06:00
More refactoring to clean up the Print object API
This commit is contained in:
parent
d3171b1eea
commit
02df73c94b
5 changed files with 47 additions and 57 deletions
|
@ -179,31 +179,26 @@ sub quick_slice {
|
|||
local $SIG{__WARN__} = sub { push @warnings, $_[0] };
|
||||
my %export_params = (
|
||||
output_file => $output_file,
|
||||
status_cb => sub {
|
||||
my ($percent, $message) = @_;
|
||||
if (&Wx::wxVERSION_STRING =~ / 2\.(8\.|9\.[2-9])/) {
|
||||
$process_dialog->Update($percent, "$message…");
|
||||
}
|
||||
},
|
||||
);
|
||||
$print->status_cb(sub {
|
||||
my ($percent, $message) = @_;
|
||||
if (&Wx::wxVERSION_STRING =~ / 2\.(8\.|9\.[2-9])/) {
|
||||
$process_dialog->Update($percent, "$message…");
|
||||
}
|
||||
});
|
||||
if ($params{export_svg}) {
|
||||
$print->export_svg(%export_params);
|
||||
} else {
|
||||
$print->process;
|
||||
$print->export_gcode(%export_params);
|
||||
}
|
||||
$print->status_cb(undef);
|
||||
Slic3r::GUI::warning_catcher($self)->($_) for @warnings;
|
||||
}
|
||||
$process_dialog->Destroy;
|
||||
undef $process_dialog;
|
||||
|
||||
my $message = "$input_file_basename was successfully sliced";
|
||||
if ($print->processing_time) {
|
||||
$message .= ' in';
|
||||
my $minutes = int($print->processing_time/60);
|
||||
$message .= sprintf " %d minutes and", $minutes if $minutes;
|
||||
$message .= sprintf " %.1f seconds", $print->processing_time - $minutes*60;
|
||||
}
|
||||
$message .= ".";
|
||||
my $message = "$input_file_basename was successfully sliced.";
|
||||
&Wx::wxTheApp->notify($message);
|
||||
Wx::MessageDialog->new($self, $message, 'Slicing Done!',
|
||||
wxOK | wxICON_INFORMATION)->ShowModal;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue