From 0787f0b2ba4a311c6b39be8e0d8b8f886ce6528c Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 22 Mar 2018 14:46:14 +0100 Subject: [PATCH 1/2] Fix autoslice check so it doesn't slice if there is no need CURA-5130 --- plugins/CuraEngineBackend/CuraEngineBackend.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index e55abe59a2..401ed71347 100755 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -119,6 +119,7 @@ class CuraEngineBackend(QObject, Backend): self._postponed_scene_change_sources = [] # scene change is postponed (by a tool) self._slice_start_time = None + self._is_disabled = False Preferences.getInstance().addPreference("general/auto_slice", True) @@ -405,6 +406,7 @@ class CuraEngineBackend(QObject, Backend): # - decorator isBlockSlicing is found (used in g-code reader) def determineAutoSlicing(self): enable_timer = True + self._is_disabled = False if not Preferences.getInstance().getValue("general/auto_slice"): enable_timer = False @@ -412,6 +414,7 @@ class CuraEngineBackend(QObject, Backend): if node.callDecoration("isBlockSlicing"): enable_timer = False self.backendStateChange.emit(BackendState.Disabled) + self._is_disabled = True gcode_list = node.callDecoration("getGCodeList") if gcode_list is not None: self._scene.gcode_dict[node.callDecoration("getBuildPlateNumber")] = gcode_list @@ -524,6 +527,9 @@ class CuraEngineBackend(QObject, Backend): ## Convenient function: mark everything to slice, emit state and clear layer data def needsSlicing(self): + self.determineAutoSlicing() + if self._is_disabled: + return self.stopSlicing() self.markSliceAll() self.processingProgress.emit(0.0) From f332b833644c45212c182477b6dbecf3aaf563b8 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 22 Mar 2018 14:50:12 +0100 Subject: [PATCH 2/2] Fix typo and remove unused imports CURA-5135 --- plugins/PluginBrowser/PluginBrowser.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/PluginBrowser/PluginBrowser.py b/plugins/PluginBrowser/PluginBrowser.py index c8a5e1e545..bb4d5fb395 100644 --- a/plugins/PluginBrowser/PluginBrowser.py +++ b/plugins/PluginBrowser/PluginBrowser.py @@ -1,11 +1,10 @@ # Copyright (c) 2017 Ultimaker B.V. # PluginBrowser is released under the terms of the LGPLv3 or higher. -from PyQt5.QtCore import QUrl, QObject, Qt, pyqtProperty, pyqtSignal, pyqtSlot +from PyQt5.QtCore import QUrl, QObject, pyqtProperty, pyqtSignal, pyqtSlot from PyQt5.QtNetwork import QNetworkAccessManager, QNetworkRequest, QNetworkReply from UM.Application import Application -from UM.Qt.ListModel import ListModel from UM.Logger import Logger from UM.PluginRegistry import PluginRegistry from UM.Qt.Bindings.PluginsModel import PluginsModel @@ -20,7 +19,6 @@ import os import tempfile import platform import zipfile -import shutil from cura.CuraApplication import CuraApplication @@ -44,7 +42,7 @@ class PluginBrowser(QObject, Extension): self._plugins_metadata = [] self._plugins_model = None - # Can be 'installed' or 'availble' + # Can be 'installed' or 'available' self._view = "available" self._restart_required = False