From b257632b14f963199db518d6220caf8c9280ea58 Mon Sep 17 00:00:00 2001 From: Jack Ha Date: Tue, 21 Feb 2017 14:53:28 +0100 Subject: [PATCH 1/3] Better file name for saving file (project) without suggested name. CURA-3226 --- cura/PrintInformation.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cura/PrintInformation.py b/cura/PrintInformation.py index b88613b0ac..1f9354c949 100644 --- a/cura/PrintInformation.py +++ b/cura/PrintInformation.py @@ -205,7 +205,10 @@ class PrintInformation(QObject): if self._pre_sliced: return catalog.i18nc("@label", "Pre-sliced file {0}", base_name) elif Preferences.getInstance().getValue("cura/jobname_prefix"): - return self._abbr_machine + "_" + base_name + if base_name == "": + return self._abbr_machine + else: + return self._abbr_machine + "_" + base_name else: return base_name From 580010b6730f0bbd93461e960d771aea6bfca964 Mon Sep 17 00:00:00 2001 From: Jack Ha Date: Tue, 21 Feb 2017 15:15:50 +0100 Subject: [PATCH 2/3] Undo only abbreviation as job name. CURA-3226 --- cura/PrintInformation.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cura/PrintInformation.py b/cura/PrintInformation.py index 9450dba3f8..5d540628af 100644 --- a/cura/PrintInformation.py +++ b/cura/PrintInformation.py @@ -210,11 +210,7 @@ class PrintInformation(QObject): # Don't add abbreviation if it already has the exact same abbreviation. if base_name.startswith(self._abbr_machine + "_"): return base_name - # Only return abbreviation if no base name is given. - if base_name == "": - return self._abbr_machine - else: - return self._abbr_machine + "_" + base_name + return self._abbr_machine + "_" + base_name else: return base_name From bb955ca5abd2dc85fa6b4f95abe0607fe87b2d01 Mon Sep 17 00:00:00 2001 From: Jack Ha Date: Tue, 21 Feb 2017 16:12:25 +0100 Subject: [PATCH 3/3] Tickle the backend if per object settings are changed. CURA-3273 --- cura/Settings/SettingOverrideDecorator.py | 12 ++++++++---- plugins/CuraEngineBackend/CuraEngineBackend.py | 5 +++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/cura/Settings/SettingOverrideDecorator.py b/cura/Settings/SettingOverrideDecorator.py index d5f4ef7b14..1b0294bd9f 100644 --- a/cura/Settings/SettingOverrideDecorator.py +++ b/cura/Settings/SettingOverrideDecorator.py @@ -77,8 +77,10 @@ class SettingOverrideDecorator(SceneNodeDecorator): return container_stack.getMetaDataEntry("position", default=None) def _onSettingChanged(self, instance, property_name): # Reminder: 'property' is a built-in function - if property_name == "value": # Only reslice if the value has changed. - Application.getInstance().getBackend().forceSlice() + # Trigger slice/need slicing if the value has changed. + if property_name == "value": + Application.getInstance().getBackend().needsSlicing() + Application.getInstance().getBackend().tickle() ## Makes sure that the stack upon which the container stack is placed is # kept up to date. @@ -92,8 +94,10 @@ class SettingOverrideDecorator(SceneNodeDecorator): old_extruder_stack_id = "" self._stack.setNextStack(extruder_stack[0]) - if self._stack.getNextStack().getId() != old_extruder_stack_id: #Only reslice if the extruder changed. - Application.getInstance().getBackend().forceSlice() + # Trigger slice/need slicing if the extruder changed. + if self._stack.getNextStack().getId() != old_extruder_stack_id: + Application.getInstance().getBackend().needsSlicing() + Application.getInstance().getBackend().tickle() else: UM.Logger.log("e", "Extruder stack %s below per-object settings does not exist.", self._extruder_stack) else: diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index 2b241723a6..f2023e270a 100644 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -587,3 +587,8 @@ class CuraEngineBackend(QObject, Backend): auto_slice = self.determineAutoSlicing() if auto_slice: self._change_timer.start() + + ## Tickle the backend so in case of auto slicing, it starts the timer. + def tickle(self): + if self._use_timer: + self._change_timer.start()