Merge tag 'version_2.2.0-alpha2'

version_2.2.0-alpha2
This commit is contained in:
supermerill 2020-01-10 17:36:24 +01:00
commit 71ba7a0367
14 changed files with 58 additions and 21 deletions

View File

@ -398,13 +398,27 @@ target_include_directories(cereal INTERFACE include)
# l10n # l10n
set(L10N_DIR "${SLIC3R_RESOURCES_DIR}/localization") set(L10N_DIR "${SLIC3R_RESOURCES_DIR}/localization")
add_custom_target(pot add_custom_target(gettext_make_pot
COMMAND xgettext --keyword=L --keyword=L_CONTEXT:1,2c --keyword=_L_PLURAL:1,2 --add-comments=TRN --from-code=UTF-8 --debug COMMAND xgettext --keyword=L --keyword=L_CONTEXT:1,2c --keyword=_L_PLURAL:1,2 --add-comments=TRN --from-code=UTF-8 --debug
-f "${L10N_DIR}/list.txt" -f "${L10N_DIR}/list.txt"
-o "${L10N_DIR}/Slic3r++.pot" -o "${L10N_DIR}/Slic3r++.pot"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMENT "Generate pot file from strings in the source tree" COMMENT "Generate pot file from strings in the source tree"
) )
add_custom_target(gettext_po_to_mo
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMENT "Generate localization po files (binary) from mo files (texts)"
)
file(GLOB L10N_PO_FILES "${L10N_DIR}/*/PrusaSlicer*.po")
foreach(po_file ${L10N_PO_FILES})
GET_FILENAME_COMPONENT(po_dir "${po_file}" DIRECTORY)
SET(mo_file "${po_dir}/PrusaSlicer.mo")
add_custom_command(
TARGET gettext_po_to_mo PRE_BUILD
COMMAND msgfmt ARGS -o ${mo_file} ${po_file}
DEPENDS ${po_file}
)
endforeach()
find_package(NLopt 1.4 REQUIRED) find_package(NLopt 1.4 REQUIRED)

View File

@ -6865,7 +6865,7 @@ msgstr "Textura"
#: src/slic3r/GUI/ConfigManipulation.cpp:200 #: src/slic3r/GUI/ConfigManipulation.cpp:200
msgid "The %1% infill pattern is not supposed to work at 100%% density." msgid "The %1% infill pattern is not supposed to work at 100%% density."
msgstr "Se supone que el patrón de relleno %1% no funciona a una densidad del 100%." msgstr "Se supone que el patrón de relleno %1% no funciona a una densidad del 100%%."
#: src/slic3r/GUI/FirmwareDialog.cpp:530 #: src/slic3r/GUI/FirmwareDialog.cpp:530
#, possible-c-format #, possible-c-format

View File

@ -7013,7 +7013,7 @@ msgstr "Texture"
#: src/slic3r/GUI/ConfigManipulation.cpp:200 #: src/slic3r/GUI/ConfigManipulation.cpp:200
msgid "The %1% infill pattern is not supposed to work at 100%% density." msgid "The %1% infill pattern is not supposed to work at 100%% density."
msgstr "Le modèle de remplissage %1% n'est pas censé fonctionner avec une densité de 100%." msgstr "Le modèle de remplissage %1% n'est pas censé fonctionner avec une densité de 100%%."
#: src/slic3r/GUI/FirmwareDialog.cpp:530 #: src/slic3r/GUI/FirmwareDialog.cpp:530
#, c-format #, c-format

View File

@ -6865,7 +6865,7 @@ msgstr "Texture"
#: src/slic3r/GUI/ConfigManipulation.cpp:200 #: src/slic3r/GUI/ConfigManipulation.cpp:200
msgid "The %1% infill pattern is not supposed to work at 100%% density." msgid "The %1% infill pattern is not supposed to work at 100%% density."
msgstr "La trama di riempimento %1% non è fatta per lavorare con densità al 100%." msgstr "La trama di riempimento %1% non è fatta per lavorare con densità al 100%%."
#: src/slic3r/GUI/FirmwareDialog.cpp:530 #: src/slic3r/GUI/FirmwareDialog.cpp:530
#, possible-c-format #, possible-c-format

View File

@ -3292,7 +3292,7 @@ msgstr "這個 "
#: src/slic3r/GUI/Tab.cpp:1309 #: src/slic3r/GUI/Tab.cpp:1309
#, no-c-format #, no-c-format
msgid "" msgid ""
" infill pattern is not supposed to work at 100% density.\n" " infill pattern is not supposed to work at 100%% density.\n"
"\n" "\n"
"Shall I switch to rectilinear fill pattern?" "Shall I switch to rectilinear fill pattern?"
msgstr "" msgstr ""

View File

@ -1,4 +1,5 @@
min_slic3r_version = 2.2.0-alpha0 min_slic3r_version = 2.2.0-alpha0
1.1.1-alpha2 Bumped up config version, so our in house customer will get updated profiles.
1.1.0 Filament aliases, Creality profiles and other goodies for PrusaSlicer 2.2.0-alpha0 1.1.0 Filament aliases, Creality profiles and other goodies for PrusaSlicer 2.2.0-alpha0
min_slic3r_version = 2.1.1-beta0 min_slic3r_version = 2.1.1-beta0
1.0.6 Added Prusa MINI profiles 1.0.6 Added Prusa MINI profiles

View File

@ -8,7 +8,7 @@ technologies = FFF; SLA
# Configuration version of this file. Config file will only be installed, if the config_version differs. # Configuration version of this file. Config file will only be installed, if the config_version differs.
# This means, the server may force the PrusaSlicer configuration to be downgraded. # This means, the server may force the PrusaSlicer configuration to be downgraded.
config_version = 1.1.0 config_version = 1.1.1-alpha2
# Where to get the updates from? # Where to get the updates from?
config_update_url = config_update_url =
changelog_url = http://files.prusa3d.com/?latest=slicer-profiles&lng=%1% changelog_url = http://files.prusa3d.com/?latest=slicer-profiles&lng=%1%

View File

@ -66,9 +66,12 @@ extern std::error_code rename_file(const std::string &from, const std::string &t
// Copy a file, adjust the access attributes, so that the target is writable. // Copy a file, adjust the access attributes, so that the target is writable.
int copy_file_inner(const std::string &from, const std::string &to); int copy_file_inner(const std::string &from, const std::string &to);
// Copy file to a temp file first, then rename it to the final file name.
// If with_check is true, then the content of the copied file is compared to the content
// of the source file before renaming.
extern int copy_file(const std::string &from, const std::string &to, const bool with_check = false); extern int copy_file(const std::string &from, const std::string &to, const bool with_check = false);
// Compares two files, returns 0 if identical. // Compares two files, returns 0 if identical, -1 if different.
extern int check_copy(const std::string& origin, const std::string& copy); extern int check_copy(const std::string& origin, const std::string& copy);
// Ignore system and hidden files, which may be created by the DropBox synchronisation process. // Ignore system and hidden files, which may be created by the DropBox synchronisation process.

View File

@ -448,31 +448,45 @@ int copy_file(const std::string &from, const std::string &to, const bool with_ch
if (with_check) if (with_check)
ret_val = check_copy(from, to_temp); ret_val = check_copy(from, to_temp);
if (ret_val == 0) if (ret_val == 0 && rename_file(to_temp, to))
rename_file(to_temp, to); ret_val = -1;
} }
return ret_val; return ret_val;
} }
int check_copy(const std::string &origin, const std::string &copy) int check_copy(const std::string &origin, const std::string &copy)
{ {
std::ifstream f1(origin, std::ifstream::binary | std::ifstream::ate); std::ifstream f1(origin, std::ifstream::in | std::ifstream::binary | std::ifstream::ate);
std::ifstream f2(copy, std::ifstream::binary | std::ifstream::ate); std::ifstream f2(copy, std::ifstream::in | std::ifstream::binary | std::ifstream::ate);
if (f1.fail() || f2.fail()) { if (f1.fail() || f2.fail())
return -1; return -1;
}
if (f1.tellg() != f2.tellg()) { std::streampos fsize = f1.tellg();
return -1; if (fsize != f2.tellg())
} return -1;
f1.seekg(0, std::ifstream::beg); f1.seekg(0, std::ifstream::beg);
f2.seekg(0, std::ifstream::beg); f2.seekg(0, std::ifstream::beg);
bool ident = std::equal(std::istreambuf_iterator<char>(f1.rdbuf()),
std::istreambuf_iterator<char>(), // Compare by reading 8 MiB buffers one at a time.
std::istreambuf_iterator<char>(f2.rdbuf())); size_t buffer_size = 8 * 1024 * 1024;
return(ident ? 0 : -1); std::vector<char> buffer_origin(buffer_size, 0);
std::vector<char> buffer_copy(buffer_size, 0);
do {
f1.read(buffer_origin.data(), buffer_size);
f2.read(buffer_copy.data(), buffer_size);
std::streampos origin_cnt = f1.gcount();
std::streampos copy_cnt = f2.gcount();
if (origin_cnt != copy_cnt ||
(origin_cnt > 0 && std::memcmp(buffer_origin.data(), buffer_copy.data(), origin_cnt) != 0))
// Files are different.
return -1;
fsize -= origin_cnt;
} while (f1.good() && f2.good());
// All data has been read and compared equal.
return (f1.eof() && f2.eof() && fsize == 0) ? 0 : -1;
} }
// Ignore system and hidden files, which may be created by the DropBox synchronisation process. // Ignore system and hidden files, which may be created by the DropBox synchronisation process.

View File

@ -8,6 +8,11 @@ add_library(Catch2 INTERFACE)
list (APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules/Catch2) list (APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules/Catch2)
target_include_directories(Catch2 INTERFACE ${CMAKE_CURRENT_LIST_DIR}) target_include_directories(Catch2 INTERFACE ${CMAKE_CURRENT_LIST_DIR})
add_library(Catch2::Catch2 ALIAS Catch2) add_library(Catch2::Catch2 ALIAS Catch2)
if (APPLE)
# OSX builds targeting OSX 10.9 do not support new std::uncought_exception()
# see https://github.com/catchorg/Catch2/issues/1218
target_compile_definitions(Catch2 INTERFACE -DCATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS)
endif()
include(Catch) include(Catch)
set(CATCH_EXTRA_ARGS "" CACHE STRING "Extra arguments for catch2 test suites.") set(CATCH_EXTRA_ARGS "" CACHE STRING "Extra arguments for catch2 test suites.")