mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-13 03:21:49 +08:00
Prevent race conditions when loading files into GUI from command line
This commit is contained in:
parent
5821f040c4
commit
7355d39584
@ -112,12 +112,14 @@ if ((!@ARGV || $opt{gui}) && !$opt{save} && eval "require Slic3r::GUI; 1") {
|
|||||||
}
|
}
|
||||||
$gui = Slic3r::GUI->new;
|
$gui = Slic3r::GUI->new;
|
||||||
setlocale(LC_NUMERIC, 'C');
|
setlocale(LC_NUMERIC, 'C');
|
||||||
|
$gui->CallAfter(sub {
|
||||||
$gui->{mainframe}->load_config_file($_) for @{$opt{load}};
|
$gui->{mainframe}->load_config_file($_) for @{$opt{load}};
|
||||||
$gui->{mainframe}->load_config($cli_config);
|
$gui->{mainframe}->load_config($cli_config);
|
||||||
foreach my $input_file (@ARGV) {
|
foreach my $input_file (@ARGV) {
|
||||||
$input_file = Slic3r::decode_path($input_file);
|
$input_file = Slic3r::decode_path($input_file);
|
||||||
$gui->{mainframe}{plater}->load_file($input_file) unless $opt{no_plater};
|
$gui->{mainframe}{plater}->load_file($input_file) unless $opt{no_plater};
|
||||||
}
|
}
|
||||||
|
});
|
||||||
$gui->MainLoop;
|
$gui->MainLoop;
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user