mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-24 07:03:59 -06:00
Fix of
"Unicode char like for example "ł" crush app when used in profile name" https://github.com/prusa3d/Slic3r/issues/388 The Prusa3D binary builds are missing the UTF8 libraries. To avoid having to bundle them, the case sensitive regexes testing file suffixes were replaced with explicit enumeration of lower / upper case letters. While crude, it avoids triggering the UTF8 library.
This commit is contained in:
parent
32213ce679
commit
6f28818f87
13 changed files with 26 additions and 22 deletions
|
@ -417,7 +417,7 @@ sub quick_slice {
|
|||
$output_file = $qs_last_output_file if defined $qs_last_output_file;
|
||||
} elsif ($params{save_as}) {
|
||||
$output_file = $sprint->output_filepath;
|
||||
$output_file =~ s/\.gcode$/.svg/i if $params{export_svg};
|
||||
$output_file =~ s/\.[gG][cC][oO][dD][eE]$/.svg/ if $params{export_svg};
|
||||
my $dlg = Wx::FileDialog->new($self, 'Save ' . ($params{export_svg} ? 'SVG' : 'G-code') . ' file as:',
|
||||
wxTheApp->output_path(dirname($output_file)),
|
||||
basename($output_file), $params{export_svg} ? &Slic3r::GUI::FILE_WILDCARDS->{svg} : &Slic3r::GUI::FILE_WILDCARDS->{gcode}, wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
|
||||
|
@ -485,7 +485,7 @@ sub repair_stl {
|
|||
|
||||
my $output_file = $input_file;
|
||||
{
|
||||
$output_file =~ s/\.stl$/_fixed.obj/i;
|
||||
$output_file =~ s/\.[sS][tT][lL]$/_fixed.obj/;
|
||||
my $dlg = Wx::FileDialog->new($self, "Save OBJ file (less prone to coordinate errors than STL) as:", dirname($output_file),
|
||||
basename($output_file), &Slic3r::GUI::FILE_WILDCARDS->{obj}, wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
|
||||
if ($dlg->ShowModal != wxID_OK) {
|
||||
|
|
|
@ -703,7 +703,7 @@ sub load_files {
|
|||
# One of the files is potentionally a bundle of files. Don't bundle them, but load them one by one.
|
||||
# Only bundle .stls or .objs if the printer has multiple extruders.
|
||||
my $one_by_one = (@$nozzle_dmrs <= 1) || (@$input_files == 1) ||
|
||||
defined(first { $_ =~ /.amf$/i || $_ =~ /.3mf$/i || $_ =~ /.prusa$/i } @$input_files);
|
||||
defined(first { $_ =~ /.[aA][mM][fF]$/ || $_ =~ /.3[mM][fF]$/ || $_ =~ /.[pP][rR][uI][sS][aA]$/ } @$input_files);
|
||||
|
||||
my $process_dialog = Wx::ProgressDialog->new('Loading…', "Processing input file\n" . basename($input_files->[0]), 100, $self, 0);
|
||||
$process_dialog->Pulse;
|
||||
|
@ -1660,7 +1660,7 @@ sub _get_export_file {
|
|||
my $output_file = $main::opt{output};
|
||||
{
|
||||
$output_file = $self->{print}->output_filepath($output_file);
|
||||
$output_file =~ s/\.gcode$/$suffix/i;
|
||||
$output_file =~ s/\.[gG][cC][oO][dD][eE]$/$suffix/;
|
||||
my $dlg = Wx::FileDialog->new($self, "Save $format file as:", dirname($output_file),
|
||||
basename($output_file), &Slic3r::GUI::MODEL_WILDCARD, wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
|
||||
if ($dlg->ShowModal != wxID_OK) {
|
||||
|
@ -2194,7 +2194,7 @@ sub OnDropFiles {
|
|||
@_ = ();
|
||||
|
||||
# only accept STL, OBJ and AMF files
|
||||
return 0 if grep !/\.(?:stl|obj|amf(?:\.xml)?|prusa)$/i, @$filenames;
|
||||
return 0 if grep !/\.(?:[sS][tT][lL]|[oO][bB][jJ]|[aA][mM][fF](?:\.[xX][mM][lL])?|[pP][rR][uU][sS][aA])$/, @$filenames;
|
||||
|
||||
$self->{window}->load_files($filenames);
|
||||
}
|
||||
|
|
|
@ -178,7 +178,7 @@ sub save_preset {
|
|||
if (!defined $name) {
|
||||
my $preset = $self->get_current_preset;
|
||||
my $default_name = $preset->default ? 'Untitled' : $preset->name;
|
||||
$default_name =~ s/\.ini$//i;
|
||||
$default_name =~ s/\.[iI][nN][iI]$//;
|
||||
|
||||
my $dlg = Slic3r::GUI::SavePresetWindow->new($self,
|
||||
title => lc($self->title),
|
||||
|
@ -1830,7 +1830,7 @@ sub accept {
|
|||
my ($self, $event) = @_;
|
||||
|
||||
if (($self->{chosen_name} = $self->{combo}->GetValue)) {
|
||||
if ($self->{chosen_name} !~ /^[^<>:\/\\|?*\"]+$/i) {
|
||||
if ($self->{chosen_name} !~ /^[^<>:\/\\|?*\"]+$/) {
|
||||
Slic3r::GUI::show_error($self, "The supplied name is not valid; the following characters are not allowed: <>:/\|?*\"");
|
||||
} elsif ($self->{chosen_name} eq '- default -') {
|
||||
Slic3r::GUI::show_error($self, "The supplied name is not available.");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue