Bugfix: Repeat Last Quick Slice was affected by the plater exports. #2016

This commit is contained in:
Alessandro Ranellucci 2015-06-02 22:27:11 +02:00
parent 1dc5f5531e
commit c5f72a633a
2 changed files with 11 additions and 11 deletions

View File

@ -11,8 +11,8 @@ use Wx qw(:frame :bitmap :id :misc :notebook :panel :sizer :menu :dialog :filedi
use Wx::Event qw(EVT_CLOSE EVT_MENU);
use base 'Wx::Frame';
our $last_input_file;
our $last_output_file;
our $qs_last_input_file;
our $qs_last_output_file;
our $last_config;
sub new {
@ -314,19 +314,19 @@ sub quick_slice {
}
$input_file = Slic3r::decode_path($dialog->GetPaths);
$dialog->Destroy;
$last_input_file = $input_file unless $params{export_svg};
$qs_last_input_file = $input_file unless $params{export_svg};
} else {
if (!defined $last_input_file) {
if (!defined $qs_last_input_file) {
Wx::MessageDialog->new($self, "No previously sliced file.",
'Error', wxICON_ERROR | wxOK)->ShowModal();
return;
}
if (! -e $last_input_file) {
Wx::MessageDialog->new($self, "Previously sliced file ($last_input_file) not found.",
if (! -e $qs_last_input_file) {
Wx::MessageDialog->new($self, "Previously sliced file ($qs_last_input_file) not found.",
'File Not Found', wxICON_ERROR | wxOK)->ShowModal();
return;
}
$input_file = $last_input_file;
$input_file = $qs_last_input_file;
}
my $input_file_basename = basename($input_file);
$Slic3r::GUI::Settings->{recent}{skein_directory} = dirname($input_file);
@ -361,7 +361,7 @@ sub quick_slice {
# select output file
my $output_file;
if ($params{reslice}) {
$output_file = $last_output_file if defined $last_output_file;
$output_file = $qs_last_output_file if defined $qs_last_output_file;
} elsif ($params{save_as}) {
$output_file = $sprint->expanded_output_filepath;
$output_file =~ s/\.gcode$/.svg/i if $params{export_svg};
@ -373,7 +373,7 @@ sub quick_slice {
return;
}
$output_file = Slic3r::decode_path($dlg->GetPath);
$last_output_file = $output_file unless $params{export_svg};
$qs_last_output_file = $output_file unless $params{export_svg};
$Slic3r::GUI::Settings->{_}{last_output_path} = dirname($output_file);
wxTheApp->save_settings;
$dlg->Destroy;

View File

@ -1105,7 +1105,7 @@ sub export_gcode {
my $path = Slic3r::decode_path($dlg->GetPath);
$Slic3r::GUI::Settings->{_}{last_output_path} = dirname($path);
wxTheApp->save_settings;
$self->{export_gcode_output_file} = $Slic3r::GUI::MainFrame::last_output_file = $path;
$self->{export_gcode_output_file} = $path;
$dlg->Destroy;
}
@ -1308,7 +1308,7 @@ sub _get_export_file {
$dlg->Destroy;
return undef;
}
$output_file = $Slic3r::GUI::MainFrame::last_output_file = Slic3r::decode_path($dlg->GetPath);
$output_file = Slic3r::decode_path($dlg->GetPath);
$dlg->Destroy;
}
return $output_file;