mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-19 07:57:37 +08:00
Fix multi-extruder options in GUI
This commit is contained in:
parent
87934a972c
commit
92754d7cd4
@ -209,6 +209,8 @@ Slic3r::GUI::ConfigOptionsGroup - pre-filled Wx::StaticBoxSizer wrapper containi
|
|||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
use List::Util qw(first);
|
||||||
|
|
||||||
has 'config' => (is => 'ro', required => 1);
|
has 'config' => (is => 'ro', required => 1);
|
||||||
|
|
||||||
sub _trigger_options {
|
sub _trigger_options {
|
||||||
@ -232,6 +234,13 @@ sub _trigger_options {
|
|||||||
} @{$self->options};
|
} @{$self->options};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub _option {
|
||||||
|
my $self = shift;
|
||||||
|
my ($opt_key) = @_;
|
||||||
|
|
||||||
|
return first { $_->{opt_key} =~ /^\Q$opt_key\E(#.+)?$/ } @{$self->options};
|
||||||
|
}
|
||||||
|
|
||||||
sub set_value {
|
sub set_value {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my ($opt_key, $value) = @_;
|
my ($opt_key, $value) = @_;
|
||||||
|
@ -194,7 +194,7 @@ sub on_select_preset {
|
|||||||
$self->reload_values;
|
$self->reload_values;
|
||||||
$self->set_dirty(0);
|
$self->set_dirty(0);
|
||||||
$Slic3r::GUI::Settings->{presets}{$self->name} = $preset->{file} ? basename($preset->{file}) : '';
|
$Slic3r::GUI::Settings->{presets}{$self->name} = $preset->{file} ? basename($preset->{file}) : '';
|
||||||
Slic3r::GUI->save_settings("$Slic3r::GUI::datadir/slic3r.ini");
|
Slic3r::GUI->save_settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub add_options_page {
|
sub add_options_page {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user