From 13c7099e2fc748f2fa50b06eb8296de548657ddf Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 5 Dec 2017 13:29:12 +0100 Subject: [PATCH 1/6] Don't show slice info message if the preference is set to not send it If the preference was set to not send it but the user never clicked on the message, don't show the message. Fixes #2840. --- plugins/SliceInfoPlugin/SliceInfo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/SliceInfoPlugin/SliceInfo.py b/plugins/SliceInfoPlugin/SliceInfo.py index 79963a4740..67f977adce 100755 --- a/plugins/SliceInfoPlugin/SliceInfo.py +++ b/plugins/SliceInfoPlugin/SliceInfo.py @@ -39,7 +39,7 @@ class SliceInfo(Extension): Preferences.getInstance().addPreference("info/send_slice_info", True) Preferences.getInstance().addPreference("info/asked_send_slice_info", False) - if not Preferences.getInstance().getValue("info/asked_send_slice_info"): + if not Preferences.getInstance().getValue("info/asked_send_slice_info") and Preferences.getInstance().getValue("info/send_slice_info"): self.send_slice_info_message = Message(catalog.i18nc("@info", "Cura collects anonymised slicing statistics. You can disable this in the preferences."), lifetime = 0, dismissable = False, From aa727df525f1f73e3030852189323fe7fdb36560 Mon Sep 17 00:00:00 2001 From: Ruben D Date: Wed, 6 Dec 2017 00:53:43 +0100 Subject: [PATCH 2/6] Correct description of SOLIDWORKS macro The original description was factually incorrect. Fixes #2839. --- plugins/ChangeLogPlugin/ChangeLog.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ChangeLogPlugin/ChangeLog.txt b/plugins/ChangeLogPlugin/ChangeLog.txt index 673f2ad7c6..de895b3e41 100755 --- a/plugins/ChangeLogPlugin/ChangeLog.txt +++ b/plugins/ChangeLogPlugin/ChangeLog.txt @@ -109,7 +109,7 @@ The build plate now shows graduations of 10 mm and 1 mm for easy model positioni Extruder tabs have become buttons and icons have been updated. *Add an "Export to Cura" button in SOLIDWORKS -SOLIDWORKS plugin can now be installed using an automatic installer. +A macro can be added to your SOLIDWORKS installation that loads your model into Ultimaker Cura. *Siemens NX macro When a user updates models in Siemens NX and clicks the button, the updated models replace the models opened in Ultimaker Cura. From c0a502f99c637898a59721907e2c824356d48ead Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 6 Dec 2017 11:47:31 +0100 Subject: [PATCH 3/6] Check if there is an active machine before doing anything else CURA-4680 --- cura/Settings/MachineManager.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index f1bb8b6648..253c5f793c 100755 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -498,6 +498,11 @@ class MachineManager(QObject): @pyqtProperty("QVariantList", notify=activeVariantChanged) def activeVariantNames(self) -> List[str]: result = [] + + # it can happen when there is no active machine + if self._global_container_stack is None: + return result + active_stacks = ExtruderManager.getInstance().getActiveGlobalAndExtruderStacks() if active_stacks is not None: for stack in active_stacks: @@ -510,6 +515,11 @@ class MachineManager(QObject): @pyqtProperty("QVariantList", notify = activeMaterialChanged) def activeMaterialNames(self) -> List[str]: result = [] + + # it can happen when there is no active machine + if self._global_container_stack is None: + return result + active_stacks = ExtruderManager.getInstance().getActiveGlobalAndExtruderStacks() if active_stacks is not None: for stack in active_stacks: @@ -530,6 +540,11 @@ class MachineManager(QObject): @pyqtProperty("QVariantMap", notify = activeVariantChanged) def allActiveVariantIds(self) -> Dict[str, str]: result = {} + + # it can happen when there is no active machine + if self._global_container_stack is None: + return result + active_stacks = ExtruderManager.getInstance().getActiveExtruderStacks() if active_stacks is not None: #If we have a global stack. for stack in active_stacks: @@ -548,6 +563,11 @@ class MachineManager(QObject): @pyqtProperty("QVariantMap", notify = activeMaterialChanged) def allActiveMaterialIds(self) -> Dict[str, str]: result = {} + + # it can happen when there is no active machine + if self._global_container_stack is None: + return result + active_stacks = ExtruderManager.getInstance().getActiveExtruderStacks() result[self._global_container_stack.getId()] = self._global_container_stack.material.getId() From 9561827bdad91604fc70e0c448c9b8c657c83a83 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Wed, 6 Dec 2017 14:12:51 +0100 Subject: [PATCH 4/6] CURA-4680 Checking if there is global stack in the ExtruderManager. Intead of checking for it in all the methods in MachineManager, now the check is done in ExtruderManager when there is no printer in the list. --- cura/Settings/ExtruderManager.py | 8 +++++--- cura/Settings/MachineManager.py | 19 ------------------- 2 files changed, 5 insertions(+), 22 deletions(-) diff --git a/cura/Settings/ExtruderManager.py b/cura/Settings/ExtruderManager.py index 34b283107d..32e3867300 100755 --- a/cura/Settings/ExtruderManager.py +++ b/cura/Settings/ExtruderManager.py @@ -356,14 +356,16 @@ class ExtruderManager(QObject): # \return \type{List[ContainerStack]} a list of def getActiveExtruderStacks(self) -> List["ExtruderStack"]: global_stack = Application.getInstance().getGlobalContainerStack() + if not global_stack: + return None result = [] - machine_extruder_count = global_stack.getProperty("machine_extruder_count", "value") - - if global_stack and global_stack.getId() in self._extruder_trains: + if global_stack.getId() in self._extruder_trains: for extruder in sorted(self._extruder_trains[global_stack.getId()]): result.append(self._extruder_trains[global_stack.getId()][extruder]) + machine_extruder_count = global_stack.getProperty("machine_extruder_count", "value") + return result[:machine_extruder_count] def __globalContainerStackChanged(self) -> None: diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index 253c5f793c..afd038b45d 100755 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -499,10 +499,6 @@ class MachineManager(QObject): def activeVariantNames(self) -> List[str]: result = [] - # it can happen when there is no active machine - if self._global_container_stack is None: - return result - active_stacks = ExtruderManager.getInstance().getActiveGlobalAndExtruderStacks() if active_stacks is not None: for stack in active_stacks: @@ -516,10 +512,6 @@ class MachineManager(QObject): def activeMaterialNames(self) -> List[str]: result = [] - # it can happen when there is no active machine - if self._global_container_stack is None: - return result - active_stacks = ExtruderManager.getInstance().getActiveGlobalAndExtruderStacks() if active_stacks is not None: for stack in active_stacks: @@ -541,10 +533,6 @@ class MachineManager(QObject): def allActiveVariantIds(self) -> Dict[str, str]: result = {} - # it can happen when there is no active machine - if self._global_container_stack is None: - return result - active_stacks = ExtruderManager.getInstance().getActiveExtruderStacks() if active_stacks is not None: #If we have a global stack. for stack in active_stacks: @@ -564,14 +552,7 @@ class MachineManager(QObject): def allActiveMaterialIds(self) -> Dict[str, str]: result = {} - # it can happen when there is no active machine - if self._global_container_stack is None: - return result - active_stacks = ExtruderManager.getInstance().getActiveExtruderStacks() - - result[self._global_container_stack.getId()] = self._global_container_stack.material.getId() - if active_stacks is not None: # If we have extruder stacks for stack in active_stacks: material_container = stack.material From 569e040955f9f924040d18b52f3e30f54fe1a196 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 6 Dec 2017 14:45:47 +0100 Subject: [PATCH 5/6] Add more complete version info in project files CURA-4683 --- plugins/3MFWriter/ThreeMFWorkspaceWriter.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/3MFWriter/ThreeMFWorkspaceWriter.py b/plugins/3MFWriter/ThreeMFWorkspaceWriter.py index 9c143f0057..3953bea229 100644 --- a/plugins/3MFWriter/ThreeMFWorkspaceWriter.py +++ b/plugins/3MFWriter/ThreeMFWorkspaceWriter.py @@ -59,7 +59,9 @@ class ThreeMFWorkspaceWriter(WorkspaceWriter): version_file = zipfile.ZipInfo("Cura/version.ini") version_config_parser = configparser.ConfigParser() version_config_parser.add_section("versions") - version_config_parser.set("versions", "cura_version", Application.getStaticVersion()) + version_config_parser.set("versions", "cura_version", Application.getInstance().getVersion()) + version_config_parser.set("versions", "build_type", Application.getInstance().getBuildType()) + version_config_parser.set("versions", "is_debug_mode", Application.getInstance().getIsDebugMode()) version_file_string = StringIO() version_config_parser.write(version_file_string) From 298a659c094bb31e7ad86b4688a40a9a12161dfc Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 6 Dec 2017 14:48:58 +0100 Subject: [PATCH 6/6] Save is_debug_mode as string CURA-4683 --- plugins/3MFWriter/ThreeMFWorkspaceWriter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/3MFWriter/ThreeMFWorkspaceWriter.py b/plugins/3MFWriter/ThreeMFWorkspaceWriter.py index 3953bea229..4f1ff9494f 100644 --- a/plugins/3MFWriter/ThreeMFWorkspaceWriter.py +++ b/plugins/3MFWriter/ThreeMFWorkspaceWriter.py @@ -61,7 +61,7 @@ class ThreeMFWorkspaceWriter(WorkspaceWriter): version_config_parser.add_section("versions") version_config_parser.set("versions", "cura_version", Application.getInstance().getVersion()) version_config_parser.set("versions", "build_type", Application.getInstance().getBuildType()) - version_config_parser.set("versions", "is_debug_mode", Application.getInstance().getIsDebugMode()) + version_config_parser.set("versions", "is_debug_mode", str(Application.getInstance().getIsDebugMode())) version_file_string = StringIO() version_config_parser.write(version_file_string)