Accept multiple --load arguments for GUI too
This commit is contained in:
parent
db8bb8c3d8
commit
d02012e4a3
2 changed files with 7 additions and 6 deletions
|
@ -202,9 +202,9 @@ sub get_preset_config {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my ($preset) = @_;
|
my ($preset) = @_;
|
||||||
|
|
||||||
my $config = Slic3r::Config->new_from_defaults(@{$self->{options}});
|
if ($preset->{default}) {
|
||||||
|
return Slic3r::Config->new_from_defaults(@{$self->{options}});
|
||||||
if (!$preset->{default}) {
|
} else {
|
||||||
if (!-e $preset->{file}) {
|
if (!-e $preset->{file}) {
|
||||||
Slic3r::GUI::show_error($self, "The selected preset does not exist anymore ($preset->{file}).");
|
Slic3r::GUI::show_error($self, "The selected preset does not exist anymore ($preset->{file}).");
|
||||||
return;
|
return;
|
||||||
|
@ -212,11 +212,12 @@ sub get_preset_config {
|
||||||
|
|
||||||
# apply preset values on top of defaults
|
# apply preset values on top of defaults
|
||||||
my $external_config = Slic3r::Config->load($preset->{file});
|
my $external_config = Slic3r::Config->load($preset->{file});
|
||||||
|
my $config = Slic3r::Config->new;
|
||||||
$config->set($_, $external_config->get($_))
|
$config->set($_, $external_config->get($_))
|
||||||
for grep $external_config->has($_), @{$self->{options}};
|
for grep $external_config->has($_), @{$self->{options}};
|
||||||
}
|
|
||||||
|
|
||||||
return $config;
|
return $config;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sub add_options_page {
|
sub add_options_page {
|
||||||
|
|
|
@ -71,7 +71,7 @@ if ($opt{save}) {
|
||||||
my $gui;
|
my $gui;
|
||||||
if (!@ARGV && !$opt{save} && eval "require Slic3r::GUI; 1") {
|
if (!@ARGV && !$opt{save} && eval "require Slic3r::GUI; 1") {
|
||||||
$gui = Slic3r::GUI->new;
|
$gui = Slic3r::GUI->new;
|
||||||
$gui->{skeinpanel}->load_config_file($opt{load}[0]) if $opt{load};
|
$gui->{skeinpanel}->load_config_file($_) for @{$opt{load}};
|
||||||
$gui->{skeinpanel}->load_config($cli_config);
|
$gui->{skeinpanel}->load_config($cli_config);
|
||||||
$gui->MainLoop;
|
$gui->MainLoop;
|
||||||
exit;
|
exit;
|
||||||
|
|
Loading…
Reference in a new issue