From e1966a7ea59933f72e1a8fdf35ae06398c626f4b Mon Sep 17 00:00:00 2001 From: Thomas-Karl Pietrowski Date: Thu, 14 Jan 2016 18:31:23 +0100 Subject: [PATCH 1/2] Scanning i18n directory for languages: Instead of having a list of languages hardcoded, we scan the i18n directory for available languages. It was a TODO, which was left after fixing po-file installation. After finding the macro I decided to fix it here. The reference to the added macro is there as an URL. --- CMakeLists.txt | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f3edadff74..9384c58ff4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,20 @@ set(URANIUM_SCRIPTS_DIR "${CMAKE_SOURCE_DIR}/../uranium/scripts" CACHE DIRECTORY set(CURA_VERSION "master" CACHE STRING "Version name of Cura") configure_file(cura/CuraVersion.py.in CuraVersion.py @ONLY) +# Macro needed to list all sub-directory of a directory. +# There is no function in cmake as far as I know. +# Found at: http://stackoverflow.com/a/7788165 +MACRO(SUBDIRLIST result curdir) + FILE(GLOB children RELATIVE ${curdir} ${curdir}/*) + SET(dirlist "") + FOREACH(child ${children}) + IF(IS_DIRECTORY ${curdir}/${child}) + LIST(APPEND dirlist ${child}) + ENDIF() + ENDFOREACH() + SET(${result} ${dirlist}) +ENDMACRO() + if(NOT ${URANIUM_SCRIPTS_DIR} STREQUAL "") # Extract Strings add_custom_target(extract-messages ${URANIUM_SCRIPTS_DIR}/extract-messages ${CMAKE_SOURCE_DIR} cura) @@ -25,20 +39,7 @@ if(NOT ${URANIUM_SCRIPTS_DIR} STREQUAL "") # during development, normally you want to simply use the install target to install # the files along side the rest of the application. - #TODO: Find a way to get a rid of this list of languages. - set(languages - en - x-test - ru - fr - de - it - es - fi - pl - cs - bg - ) + SUBDIRLIST(languages ${CMAKE_SOURCE_DIR}/resources/i18n/) foreach(lang ${languages}) file(GLOB po_files ${CMAKE_SOURCE_DIR}/resources/i18n/${lang}/*.po) foreach(po_file ${po_files}) From 44ab89724eda9a012ca342db5d1f048132346401 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 15 Jan 2016 15:18:16 +0100 Subject: [PATCH 2/2] ConvexHullDecorator is now correctly duplicated The deepcopy of convex hull decorator now returns an empty (new) ConvexHulldecorator object This ensures that the init is correctly called. CURA-665 --- cura/ConvexHullDecorator.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cura/ConvexHullDecorator.py b/cura/ConvexHullDecorator.py index 1f1bc5db34..f16c2a295e 100644 --- a/cura/ConvexHullDecorator.py +++ b/cura/ConvexHullDecorator.py @@ -18,7 +18,12 @@ class ConvexHullDecorator(SceneNodeDecorator): self._profile = None Application.getInstance().getMachineManager().activeProfileChanged.connect(self._onActiveProfileChanged) self._onActiveProfileChanged() - + + ## Force that a new (empty) object is created upon copy. + def __deepcopy__(self, memo): + copy = ConvexHullDecorator() + return copy + def getConvexHull(self): return self._convex_hull