mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 01:07:57 -06:00
Import config bundle automatically if found in application directory
This commit is contained in:
parent
7e1fac8f76
commit
32a333f16a
6 changed files with 50 additions and 9 deletions
|
@ -5,6 +5,7 @@ use utf8;
|
|||
|
||||
use File::Basename qw(basename);
|
||||
use FindBin;
|
||||
use List::Util qw(first);
|
||||
use Slic3r::GUI::2DBed;
|
||||
use Slic3r::GUI::AboutDialog;
|
||||
use Slic3r::GUI::BedShapeDialog;
|
||||
|
@ -126,6 +127,22 @@ sub OnInit {
|
|||
);
|
||||
$self->SetTopWindow($frame);
|
||||
|
||||
# load init bundle
|
||||
{
|
||||
my @dirs = ($FindBin::Bin);
|
||||
if (&Wx::wxMAC) {
|
||||
push @dirs, qw();
|
||||
} elsif (&Wx::wxMSW) {
|
||||
push @dirs, qw();
|
||||
}
|
||||
my $init_bundle = first { -e $_ } map "$_/.init_bundle.ini", @dirs;
|
||||
if ($init_bundle) {
|
||||
Slic3r::debugf "Loading config bundle from %s\n", $init_bundle;
|
||||
$self->{mainframe}->load_configbundle($init_bundle, 1);
|
||||
$run_wizard = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$run_wizard && (!defined $last_version || $last_version ne $Slic3r::VERSION)) {
|
||||
# user was running another Slic3r version on this computer
|
||||
if (!defined $last_version || $last_version =~ /^0\./) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue