Load files into the GUI when supplying them as command line arguments along with the --gui switch. #2644

This commit is contained in:
Alessandro Ranellucci 2015-02-14 12:54:06 +01:00
parent 6eb1fa36ed
commit 43f4806142
2 changed files with 8 additions and 1 deletions

View File

@ -109,6 +109,8 @@ The author of the Silk icon set is Mark James.
-j, --threads <num> Number of threads to use (1+, default: 2) -j, --threads <num> Number of threads to use (1+, default: 2)
GUI options: GUI options:
--gui Forces the GUI launch instead of command line slicing (if you
supply a model file, it will be loaded into the plater)
--no-plater Disable the plater tab --no-plater Disable the plater tab
--gui-mode Overrides the configured mode (simple/expert) --gui-mode Overrides the configured mode (simple/expert)
--autosave <file> Automatically export current configuration to the specified file --autosave <file> Automatically export current configuration to the specified file

View File

@ -90,7 +90,7 @@ $config->apply($cli_config);
# launch GUI # launch GUI
my $gui; my $gui;
if (!@ARGV && !$opt{save} && eval "require Slic3r::GUI; 1") { if ((!@ARGV || $opt{gui}) && !$opt{save} && eval "require Slic3r::GUI; 1") {
{ {
no warnings 'once'; no warnings 'once';
$Slic3r::GUI::datadir = Slic3r::decode_path($opt{datadir}); $Slic3r::GUI::datadir = Slic3r::decode_path($opt{datadir});
@ -102,6 +102,9 @@ if (!@ARGV && !$opt{save} && eval "require Slic3r::GUI; 1") {
setlocale(LC_NUMERIC, 'C'); setlocale(LC_NUMERIC, 'C');
$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) {
$gui->{mainframe}{plater}->load_file($input_file) unless $opt{no_plater};
}
$gui->MainLoop; $gui->MainLoop;
exit; exit;
} }
@ -261,6 +264,8 @@ Usage: slic3r.pl [ OPTIONS ] [ file.stl ] [ file2.stl ] ...
$j $j
GUI options: GUI options:
--gui Forces the GUI launch instead of command line slicing (if you
supply a model file, it will be loaded into the plater)
--no-plater Disable the plater tab --no-plater Disable the plater tab
--gui-mode Overrides the configured mode (simple/expert) --gui-mode Overrides the configured mode (simple/expert)
--autosave <file> Automatically export current configuration to the specified file --autosave <file> Automatically export current configuration to the specified file