diff options
author | bubnikv <bubnikv@gmail.com> | 2017-12-14 15:47:22 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2017-12-14 15:47:22 +0300 |
commit | 4bbe328117687ca34889cff4c72e237b25417379 (patch) | |
tree | 7de1599a0ef21b0bf02a9d55532a94fbda079fae | |
parent | d65835f89b2d7138e5225bc1ddb4931f09ad4f73 (diff) |
Config wizard will prompt user to copy the profiles from Slic3r to Slic3rPE
if the datadir is left to the default value (which is Slic3r),
and Slic3rPE directory exists.
-rw-r--r-- | lib/Slic3r/GUI/ConfigWizard.pm | 19 | ||||
-rw-r--r-- | xs/src/libslic3r/utils.cpp | 2 |
2 files changed, 21 insertions, 0 deletions
diff --git a/lib/Slic3r/GUI/ConfigWizard.pm b/lib/Slic3r/GUI/ConfigWizard.pm index c18741396..be6fb2575 100644 --- a/lib/Slic3r/GUI/ConfigWizard.pm +++ b/lib/Slic3r/GUI/ConfigWizard.pm @@ -274,8 +274,27 @@ sub new { my $self = $class->SUPER::new($parent, "Welcome to the Slic3r Configuration $wizard", 'Welcome'); $self->{full_wizard_workflow} = 1; + # Test for the existence of the old config path. + my $message_has_legacy; + { + my $datadir = Slic3r::data_dir; + if ($datadir =~ /Slic3rPE/) { + # Check for existence of the legacy Slic3r directory. + my $datadir_legacy = substr $datadir, 0, -2; + my $dir_enc = Slic3r::encode_path($datadir_legacy); + if (-e $dir_enc && -d $dir_enc && + -e ($dir_enc . '/print') && -d ($dir_enc . '/print') && + -e ($dir_enc . '/filament') && -d ($dir_enc . '/filament') && + -e ($dir_enc . '/printer') && -d ($dir_enc . '/printer') && + -e ($dir_enc . '/slic3r.ini')) { + $message_has_legacy = "Starting with Slic3r 1.38.4, the user profile directory has been renamed to $datadir. You may consider closing Slic3r and renaming $datadir_legacy to $datadir."; + } + } + } + $self->append_text('Hello, welcome to Slic3r Prusa Edition! This '.lc($wizard).' helps you with the initial configuration; just a few settings and you will be ready to print.'); $self->append_text('Please select your printer vendor and printer type. If your printer is not listed, you may try your luck and select a similar one. If you select "Other", this ' . lc($wizard) . ' will let you set the basic 3D printer parameters.'); + $self->append_text($message_has_legacy) if defined $message_has_legacy; # To import an existing configuration instead, cancel this '.lc($wizard).' and use the Open Config menu item found in the File menu.'); $self->append_text('If you received a configuration file or a config bundle from your 3D printer vendor, cancel this '.lc($wizard).' and use the "File->Load Config" or "File->Load Config Bundle" menu.'); diff --git a/xs/src/libslic3r/utils.cpp b/xs/src/libslic3r/utils.cpp index ee579161f..ef05dcae7 100644 --- a/xs/src/libslic3r/utils.cpp +++ b/xs/src/libslic3r/utils.cpp @@ -193,6 +193,7 @@ confess_at(const char *file, int line, const char *func, namespace Slic3r { +// Encode an UTF-8 string to the local code page. std::string encode_path(const char *src) { #ifdef WIN32 @@ -210,6 +211,7 @@ std::string encode_path(const char *src) #endif /* WIN32 */ } +// Encode an 8-bit string from a local code page to UTF-8. std::string decode_path(const char *src) { #ifdef WIN32 |