mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-07 09:38:19 +08:00
Support preset names with Unicode characters. #2527
This commit is contained in:
parent
9c08dfb50c
commit
aa5bafb8be
@ -217,6 +217,7 @@ sub presets {
|
|||||||
opendir my $dh, Slic3r::encode_path("$Slic3r::GUI::datadir/$section")
|
opendir my $dh, Slic3r::encode_path("$Slic3r::GUI::datadir/$section")
|
||||||
or die "Failed to read directory $Slic3r::GUI::datadir/$section (errno: $!)\n";
|
or die "Failed to read directory $Slic3r::GUI::datadir/$section (errno: $!)\n";
|
||||||
foreach my $file (grep /\.ini$/i, readdir $dh) {
|
foreach my $file (grep /\.ini$/i, readdir $dh) {
|
||||||
|
$file = Slic3r::decode_path($file);
|
||||||
my $name = basename($file);
|
my $name = basename($file);
|
||||||
$name =~ s/\.ini$//;
|
$name =~ s/\.ini$//;
|
||||||
$presets{$name} = "$Slic3r::GUI::datadir/$section/$file";
|
$presets{$name} = "$Slic3r::GUI::datadir/$section/$file";
|
||||||
|
@ -1390,8 +1390,8 @@ sub config {
|
|||||||
return Slic3r::Config->new_from_defaults(@$keys);
|
return Slic3r::Config->new_from_defaults(@$keys);
|
||||||
} else {
|
} else {
|
||||||
if (!-e $self->file) {
|
if (!-e $self->file) {
|
||||||
Slic3r::GUI::show_error($self, "The selected preset does not exist anymore (" . $self->file . ").");
|
Slic3r::GUI::show_error(undef, "The selected preset does not exist anymore (" . $self->file . ").");
|
||||||
return;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
# apply preset values on top of defaults
|
# apply preset values on top of defaults
|
||||||
|
Loading…
x
Reference in New Issue
Block a user