diff --git a/deps/deps-linux.cmake b/deps/deps-linux.cmake index 420638d2f0..2da2890976 100644 --- a/deps/deps-linux.cmake +++ b/deps/deps-linux.cmake @@ -13,11 +13,11 @@ include("deps-unix-common.cmake") ExternalProject_Add(dep_boost EXCLUDE_FROM_ALL 1 - URL "https://dl.bintray.com/boostorg/release/1.70.0/source/boost_1_70_0.tar.gz" - URL_HASH SHA256=882b48708d211a5f48e60b0124cf5863c1534cd544ecd0664bb534a4b5d506e9 + URL "https://dl.bintray.com/boostorg/release/1.75.0/source/boost_1_75_0.tar.gz" + URL_HASH SHA256=aeb26f80e80945e82ee93e5939baebdca47b9dee80a07d3144be1e1a6a66dd6a BUILD_IN_SOURCE 1 CONFIGURE_COMMAND ./bootstrap.sh - --with-libraries=system,iostreams,filesystem,thread,log,locale,regex + --with-libraries=system,iostreams,filesystem,thread,log,locale,regex,date_time "--prefix=${DESTDIR}/usr/local" BUILD_COMMAND ./b2 -j ${NPROC} diff --git a/deps/deps-macos.cmake b/deps/deps-macos.cmake index f985cc5610..bf9501ca02 100644 --- a/deps/deps-macos.cmake +++ b/deps/deps-macos.cmake @@ -18,12 +18,12 @@ include("deps-unix-common.cmake") ExternalProject_Add(dep_boost EXCLUDE_FROM_ALL 1 - URL "https://dl.bintray.com/boostorg/release/1.70.0/source/boost_1_70_0.tar.gz" - URL_HASH SHA256=882b48708d211a5f48e60b0124cf5863c1534cd544ecd0664bb534a4b5d506e9 + URL "https://dl.bintray.com/boostorg/release/1.75.0/source/boost_1_75_0.tar.gz" + URL_HASH SHA256=aeb26f80e80945e82ee93e5939baebdca47b9dee80a07d3144be1e1a6a66dd6a BUILD_IN_SOURCE 1 CONFIGURE_COMMAND ./bootstrap.sh --with-toolset=clang - --with-libraries=system,iostreams,filesystem,thread,log,locale,regex + --with-libraries=system,iostreams,filesystem,thread,log,locale,regex,date_time "--prefix=${DESTDIR}/usr/local" BUILD_COMMAND ./b2 -j ${NPROC} diff --git a/deps/deps-mingw.cmake b/deps/deps-mingw.cmake index 89b7e2b437..c97346bb03 100644 --- a/deps/deps-mingw.cmake +++ b/deps/deps-mingw.cmake @@ -9,8 +9,8 @@ include("deps-unix-common.cmake") ExternalProject_Add(dep_boost EXCLUDE_FROM_ALL 1 - URL "https://dl.bintray.com/boostorg/release/1.70.0/source/boost_1_70_0.tar.gz" - URL_HASH SHA256=882b48708d211a5f48e60b0124cf5863c1534cd544ecd0664bb534a4b5d506e9 + URL "https://dl.bintray.com/boostorg/release/1.75.0/source/boost_1_75_0.tar.gz" + URL_HASH SHA256=aeb26f80e80945e82ee93e5939baebdca47b9dee80a07d3144be1e1a6a66dd6a BUILD_IN_SOURCE 1 CONFIGURE_COMMAND bootstrap.bat BUILD_COMMAND b2.exe @@ -21,6 +21,7 @@ ExternalProject_Add(dep_boost --with-log --with-locale --with-regex + --with-date_time "--prefix=${DESTDIR}/usr/local" "address-model=${DEPS_BITS}" "toolset=${DEP_BOOST_TOOLSET}" diff --git a/deps/deps-windows.cmake b/deps/deps-windows.cmake index ac93b49320..81d52b8424 100644 --- a/deps/deps-windows.cmake +++ b/deps/deps-windows.cmake @@ -55,8 +55,8 @@ endmacro() ExternalProject_Add(dep_boost EXCLUDE_FROM_ALL 1 - URL "https://dl.bintray.com/boostorg/release/1.70.0/source/boost_1_70_0.tar.gz" - URL_HASH SHA256=882b48708d211a5f48e60b0124cf5863c1534cd544ecd0664bb534a4b5d506e9 + URL "https://dl.bintray.com/boostorg/release/1.75.0/source/boost_1_75_0.tar.gz" + URL_HASH SHA256=aeb26f80e80945e82ee93e5939baebdca47b9dee80a07d3144be1e1a6a66dd6a BUILD_IN_SOURCE 1 CONFIGURE_COMMAND bootstrap.bat BUILD_COMMAND b2.exe @@ -68,6 +68,7 @@ ExternalProject_Add(dep_boost --with-log --with-locale --with-regex + --with-date_time "--prefix=${DESTDIR}/usr/local" "address-model=${DEPS_BITS}" "toolset=${DEP_BOOST_TOOLSET}" diff --git a/doc/How to build - Windows.md b/doc/How to build - Windows.md index 979ad9b627..3df17b88f9 100644 --- a/doc/How to build - Windows.md +++ b/doc/How to build - Windows.md @@ -1,5 +1,61 @@ +# Step by Step Visual Studio 2019 Instructions -# This how-to is out of date +### Install the tools + +Install Visual Studio Community 2019 from [visualstudio.microsoft.com/vs/](https://visualstudio.microsoft.com/vs/). Older versions are not supported as PrusaSlicer requires support for C++17. +Select all workload options for C++ + +Install git for Windows from [gitforwindows.org](https://gitforwindows.org/) +Download and run the exe accepting all defaults + +### Download sources + +Clone the respository. To place it in C:\src\PrusaSlicer, run: +``` +c:> mkdir src +c:> cd src +c:\src> git clone https://github.com/prusa3d/PrusaSlicer.git +``` + +### Compile the dependencies. +Dependencies are updated seldomly, thus they are compiled out of the PrusaSlicer source tree. +Go to the Windows Start Menu and Click on "Visual Studio 2019" folder, then select the ->"x64 Native Tools Command Prompt" to open a command window and run the following: +``` +cd c:\src\PrusaSlicer\deps +mkdir build +cd build +cmake .. -G "Visual Studio 16 2019" -DDESTDIR="c:\src\PrusaSlicer-deps" + +msbuild /m ALL_BUILD.vcxproj // This took 13.5 minutes on my machine: core I7-7700K @ 4.2Ghz with 32GB main memory and 20min on a average laptop +``` + +### Generate Visual Studio project file for PrusaSlicer, referencing the precompiled dependencies. +Go to the Windows Start Menu and Click on "Visual Studio 2019" folder, then select the ->"x64 Native Tools Command Prompt" to open a command window and run the following: +``` +cd c:\src\PrusaSlicer\ +mkdir build +cd build +cmake .. -G "Visual Studio 16 2019" -DCMAKE_PREFIX_PATH="c:\src\PrusaSlicer-deps\usr\local" +``` + +### Compile PrusaSlicer. + +Double-click c:\src\PrusaSlicer\build\PrusaSlicer.sln to open in Visual Studio 2019. +OR +Open Visual Studio for C++ development (VS asks this the first time you start it). + +Select PrusaSlicer_app_gui as your startup project (right-click->Set as Startup Project). + +Run Build->Rebuild Solution once to populate all required dependency modules. This is NOT done automatically when you build/run. If you run both Debug and Release variants, you will need to do this once for each. + +Debug->Start Debugging or press F5 + +PrusaSlicer should start. You're up and running! + +note: Thanks to @douggorgen for the original guide, as an answer for a issue + + +# The below information is out of date, but still useful for reference purposes We have switched to MS Visual Studio 2019. @@ -119,38 +175,4 @@ option to CMake, this will only produce a _Release_ build. Refer to the CMake scripts inside the `deps` directory to see which dependencies are built in what versions and how this is done. \*) Specifically, the problem arises when building boost. Boost build tool appends all build options into paths of -intermediate files, which are not handled correctly by either `b2.exe` or possibly `ninja` (?). - - -# Noob guide (step by step) - -- Install Visual Studio Community 2019 from [visualstudio.microsoft.com/vs/](https://visualstudio.microsoft.com/vs/) -- Select all workload options for C++ -- Install git for Windows from [gitforwindows.org](https://gitforwindows.org/) - - download and run the exe accepting all defaults -- Download `PrusaSlicer-master.zip` from github - - This example will use the directory c:\PrusaSlicer and unzipped to `c:\PrusaSlicer\PrusaSlicer-master\` so this will be the prefix for all the steps. Substitute your as required prefix. -- Go to the Windows Start Menu and Click on "Visual Studio 2019" folder, then select the ->"x64 Native Tools Command Prompt" to open a command window - - cd c:\PrusaSlicer\PrusaSlicer-master\deps - mkdir build - cd build - cmake .. -G "Visual Studio 16 2019" -DDESTDIR="c:\PrusaSlicer\PrusaSlicer-master" - msbuild /m ALL_BUILD.vcxproj // This took 13.5 minutes on the following machine: core I7-7700K @ 4.2Ghz with 32GB main memory and 20min on an average laptop - cd c:\PrusaSlicer\PrusaSlicer-master\ - mkdir build - cd build - cmake .. -G "Visual Studio 16 2019" -DCMAKE_PREFIX_PATH="c:\PrusaSlicer\PrusaSlicer-master\usr\local" - -- Open Visual Studio for c++ development (VS asks this the first time you start it) - -`Open->Project/Solution` or `File->Open->Project/Solution` (depending on which dialog comes up first) - -- Click on `c:\PrusaSlicer\PrusaSlicer-master\build\PrusaSlicer.sln` - -`Debug->Start Debugging` or `Debug->Start Without debugging` - -- PrusaSlicer should start. -- You're up and running! - -Note: Thanks to @douggorgen for the original guide, as an answer for a issue +intermediate files, which are not handled correctly by either `b2.exe` or possibly `ninja` (?). \ No newline at end of file diff --git a/doc/Localization_guide.md b/doc/Localization_guide.md index 8e34deef55..8dfbc54904 100644 --- a/doc/Localization_guide.md +++ b/doc/Localization_guide.md @@ -16,7 +16,7 @@ Full manual for GNUgettext can be seen here: http://www.gnu.org/software/gettext https://github.com/prusa3d/PrusaSlicer/tree/master/resources/localization 2. Open this file in PoEdit as "Edit a translation" 3. Apply your corrections to the translation -4. Push changed PrusaSlicer.po and PrusaSlicer.mo (will create automatically after saving of PrusaSlicer.po in PoEdit) back to to the enter folder. +4. Push changed PrusaSlicer.po and PrusaSlicer.mo (will create automatically after saving of PrusaSlicer.po in PoEdit) into the original folder. ### Scenario 2. How do I add a new language support 1. Get file PrusaSlicer.pot here : @@ -71,6 +71,33 @@ https://github.com/prusa3d/PrusaSlicer/tree/master/resources/localization/list.t ``` Notice, in this Catalog it will be totally same strings for initial text and translated. -When you have Catalog to translation open POT or PO file in PoEdit and start to translation, -it's very important to keep attention to every gaps and punctuation. Especially with -formatted strings. (using %d, %s, etc.) \ No newline at end of file +When you have Catalog to translation open POT or PO file in PoEdit and start translating. + + +## General guidelines for PrusaSlicer translators + + +- We recommend using *PoEdit* application for translation (as described above). It will help you eliminate most punctuation errors and will show you strings with "random" translations (if the fuzzy parameter was used). + +- To check how the translated text looks on the UI elements, test it :) If you use *PoEdit*, all you need to do is save the file. At this point, a MO file will be created. Rename it PrusaSlicer.mo, and you can run PrusaSlicer (see above). + +- If you see an encoding error (garbage characters instead of Unicode) somewhere in PrusaSlicer, report it. It is likely not a problem of your translation, but a bug in the software. + +- See on which UI elements the translated phrase will be used. Especially if it's a button, it is very important to decide on the translation and not write alternative translations in parentheses, as this will significantly increase the width of the button, which is sometimes highly undesirable: + +![Long text on button](images/long_text_on_button.png) + +- If you decide to use autocorrect or any batch processing tool, the output requires very careful proofreading. It is very easy to make it do changes that break things big time. + +- **Any formatting parts of the phrases must remain unchanged.** For example, you should not change `%1%` to `%1 %`, you should not change `%%` to `%` (for percent sign) and similar. This will lead to application crashes. + +- Please pay attention to spaces, line breaks (\n) and punctuation marks. **Don't add extra line breaks.** This is especially important for parameter names. + +- Description of the parameters should not contain units of measurement. For example, "Enable fan if layer print time is less than ~~n seconds~~" + +- For units of measurement, use the international system of units. Use "s" instead of "sec". + +- If the phrase doesn't have a dot at the end, don't add it. And if it does, then don't forget to :) + +- It is useful to stick to the same terminology in the application (especially with basic terms such as "filament" and similar). Stay consistent. Otherwise it will confuse users. + diff --git a/doc/images/long_text_on_button.png b/doc/images/long_text_on_button.png new file mode 100644 index 0000000000..5f4ca87be2 Binary files /dev/null and b/doc/images/long_text_on_button.png differ diff --git a/src/libslic3r/Config.hpp b/src/libslic3r/Config.hpp index 8cdacd59f3..12c19eaefe 100644 --- a/src/libslic3r/Config.hpp +++ b/src/libslic3r/Config.hpp @@ -1163,8 +1163,8 @@ public: { UNUSED(append); char dummy; - return sscanf(str.data(), " %lf , %lf , %lf %c", &this->value(0), &this->value(1), &this->value(2), &dummy) == 2 || - sscanf(str.data(), " %lf x %lf x %lf %c", &this->value(0), &this->value(1), &this->value(2), &dummy) == 2; + return sscanf(str.data(), " %lf , %lf , %lf %c", &this->value(0), &this->value(1), &this->value(2), &dummy) == 3 || + sscanf(str.data(), " %lf x %lf x %lf %c", &this->value(0), &this->value(1), &this->value(2), &dummy) == 3; } private: diff --git a/src/libslic3r/Fill/FillPlanePath.cpp b/src/libslic3r/Fill/FillPlanePath.cpp index a7a33b13d7..7beaf2f08e 100644 --- a/src/libslic3r/Fill/FillPlanePath.cpp +++ b/src/libslic3r/Fill/FillPlanePath.cpp @@ -101,9 +101,9 @@ Pointfs FillArchimedeanChords::_generate(coord_t min_x, coord_t min_y, coord_t m // static inline Point hilbert_n_to_xy(const size_t n) { - static const int next_state[16] = { 4,0,0,12, 0,4,4,8, 12,8,8,4, 8,12,12,0 }; - static const int digit_to_x[16] = { 0,1,1,0, 0,0,1,1, 1,0,0,1, 1,1,0,0 }; - static const int digit_to_y[16] = { 0,0,1,1, 0,1,1,0, 1,1,0,0, 1,0,0,1 }; + static constexpr const int next_state[16] { 4,0,0,12, 0,4,4,8, 12,8,8,4, 8,12,12,0 }; + static constexpr const int digit_to_x[16] { 0,1,1,0, 0,0,1,1, 1,0,0,1, 1,1,0,0 }; + static constexpr const int digit_to_y[16] { 0,0,1,1, 0,1,1,0, 1,1,0,0, 1,0,0,1 }; // Number of 2 bit digits. size_t ndigits = 0; diff --git a/src/slic3r/GUI/ExtraRenderers.cpp b/src/slic3r/GUI/ExtraRenderers.cpp index 27e2c12245..584896dd59 100644 --- a/src/slic3r/GUI/ExtraRenderers.cpp +++ b/src/slic3r/GUI/ExtraRenderers.cpp @@ -49,8 +49,7 @@ BitmapTextRenderer::~BitmapTextRenderer() { #ifdef SUPPORTS_MARKUP #ifdef wxHAS_GENERIC_DATAVIEWCTRL - if (m_markupText) - delete m_markupText; + delete m_markupText; #endif //wxHAS_GENERIC_DATAVIEWCTRL #endif // SUPPORTS_MARKUP } diff --git a/src/slic3r/GUI/GUI_Preview.cpp b/src/slic3r/GUI/GUI_Preview.cpp index bca27fa21c..36c1960d3f 100644 --- a/src/slic3r/GUI/GUI_Preview.cpp +++ b/src/slic3r/GUI/GUI_Preview.cpp @@ -36,11 +36,8 @@ View3D::View3D(wxWindow* parent, Model* model, DynamicPrintConfig* config, Backg View3D::~View3D() { - if (m_canvas != nullptr) - delete m_canvas; - - if (m_canvas_widget != nullptr) - delete m_canvas_widget; + delete m_canvas; + delete m_canvas_widget; } bool View3D::init(wxWindow* parent, Model* model, DynamicPrintConfig* config, BackgroundSlicingProcess* process) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 80826eab91..4d6b1178f9 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -595,17 +595,10 @@ struct Sidebar::priv Sidebar::priv::~priv() { - if (object_manipulation != nullptr) - delete object_manipulation; - - if (object_settings != nullptr) - delete object_settings; - - if (frequently_changed_parameters != nullptr) - delete frequently_changed_parameters; - - if (object_layers != nullptr) - delete object_layers; + delete object_manipulation; + delete object_settings; + delete frequently_changed_parameters; + delete object_layers; } void Sidebar::priv::show_preset_comboboxes() diff --git a/xs/src/xsinit.h b/xs/src/xsinit.h index 2082dfb883..cbb55077ba 100644 --- a/xs/src/xsinit.h +++ b/xs/src/xsinit.h @@ -75,6 +75,7 @@ #undef times #undef accept #undef wait + #undef abort // Breaks compilation with Eigen matrices embedded into Slic3r::Point. #undef malloc