diff options
author | bubnikv <bubnikv@gmail.com> | 2017-11-30 12:22:39 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2017-11-30 12:22:39 +0300 |
commit | 6aff27f3abf6ea895cc458845a31bc436ffa38a8 (patch) | |
tree | 06851c8190ab007d00268f1a1f2207e9256ec580 /lib | |
parent | 2f54bf5bca2e151bb2d7c08268c8ceb4de688466 (diff) |
Moved initialization of Slic3r XS datadir variable to GUI.pm
Solves https://github.com/prusa3d/Slic3r/issues/594
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Slic3r/GUI.pm | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Slic3r/GUI.pm b/lib/Slic3r/GUI.pm index c65793d4b..2dc560cad 100644 --- a/lib/Slic3r/GUI.pm +++ b/lib/Slic3r/GUI.pm @@ -52,6 +52,8 @@ use constant FILE_WILDCARDS => { }; use constant MODEL_WILDCARD => join '|', @{&FILE_WILDCARDS}{qw(known stl obj amf prusa)}; +# Datadir provided on the command line. +our $datadir; # If set, the "Controller" tab for the control of the printer over serial line and the serial port settings are hidden. our $no_plater; our @cb; @@ -71,6 +73,12 @@ sub OnInit { $self->SetAppName('Slic3r'); $self->SetAppDisplayName('Slic3r Prusa Edition'); Slic3r::debugf "wxWidgets version %s, Wx version %s\n", &Wx::wxVERSION_STRING, $Wx::VERSION; + + # Set the Slic3r data directory at the Slic3r XS module. + # Unix: ~/.Slic3r + # Windows: "C:\Users\username\AppData\Roaming\Slic3r" or "C:\Documents and Settings\username\Application Data\Slic3r" + # Mac: "~/Library/Application Support/Slic3r" + Slic3r::set_data_dir($datadir || Wx::StandardPaths::Get->GetUserDataDir); $self->{notifier} = Slic3r::GUI::Notifier->new; $self->{app_config} = Slic3r::GUI::AppConfig->new; |