From 3a195e9678513c8b8b09f341da6746e746b8f9a3 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 24 Apr 2019 11:04:31 +0200 Subject: [PATCH 1/5] Fix crash when moving the support eraser CURA-6480 --- cura/PlatformPhysics.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cura/PlatformPhysics.py b/cura/PlatformPhysics.py index 8fffac4501..2710aad91e 100755 --- a/cura/PlatformPhysics.py +++ b/cura/PlatformPhysics.py @@ -173,11 +173,15 @@ class PlatformPhysics: if tool.getPluginId() == "TranslateTool": for node in Selection.getAllSelectedObjects(): - if node.getBoundingBox().bottom < 0: + bounding_box = node.getBoundingBox() + if bounding_box is None: + continue + + if bounding_box.bottom < 0: if not node.getDecorator(ZOffsetDecorator.ZOffsetDecorator): node.addDecorator(ZOffsetDecorator.ZOffsetDecorator()) - node.callDecoration("setZOffset", node.getBoundingBox().bottom) + node.callDecoration("setZOffset", bounding_box.bottom) else: if node.getDecorator(ZOffsetDecorator.ZOffsetDecorator): node.removeDecorator(ZOffsetDecorator.ZOffsetDecorator) From 3c43864daca64152c371b3a4f9fae08a67a02ebf Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 24 Apr 2019 11:28:50 +0200 Subject: [PATCH 2/5] Revert "Fix crash when moving the support eraser" This reverts commit 3a195e9678513c8b8b09f341da6746e746b8f9a3. CURA-6480 --- cura/PlatformPhysics.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/cura/PlatformPhysics.py b/cura/PlatformPhysics.py index 2710aad91e..8fffac4501 100755 --- a/cura/PlatformPhysics.py +++ b/cura/PlatformPhysics.py @@ -173,15 +173,11 @@ class PlatformPhysics: if tool.getPluginId() == "TranslateTool": for node in Selection.getAllSelectedObjects(): - bounding_box = node.getBoundingBox() - if bounding_box is None: - continue - - if bounding_box.bottom < 0: + if node.getBoundingBox().bottom < 0: if not node.getDecorator(ZOffsetDecorator.ZOffsetDecorator): node.addDecorator(ZOffsetDecorator.ZOffsetDecorator()) - node.callDecoration("setZOffset", bounding_box.bottom) + node.callDecoration("setZOffset", node.getBoundingBox().bottom) else: if node.getDecorator(ZOffsetDecorator.ZOffsetDecorator): node.removeDecorator(ZOffsetDecorator.ZOffsetDecorator) From 24f28fe03e27cdbd72302d2476a5b9b981f2e02d Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 24 Apr 2019 13:05:59 +0200 Subject: [PATCH 3/5] Calculate AABB for non printing meshes CURA-6480 --- cura/Settings/GlobalStack.py | 1 + cura/Settings/SettingOverrideDecorator.py | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/Settings/GlobalStack.py b/cura/Settings/GlobalStack.py index 3ec73972dd..fed049126e 100755 --- a/cura/Settings/GlobalStack.py +++ b/cura/Settings/GlobalStack.py @@ -45,6 +45,7 @@ class GlobalStack(CuraContainerStack): # Since the metadatachanged is defined in container stack, we can't use it here as a notifier for pyqt # properties. So we need to tie them together like this. self.metaDataChanged.connect(self.configuredConnectionTypesChanged) + self.metaDataChanged.connect(self.networkGroupNameChanged) extrudersChanged = pyqtSignal() configuredConnectionTypesChanged = pyqtSignal() diff --git a/cura/Settings/SettingOverrideDecorator.py b/cura/Settings/SettingOverrideDecorator.py index d230953f9c..d1f85d0b30 100644 --- a/cura/Settings/SettingOverrideDecorator.py +++ b/cura/Settings/SettingOverrideDecorator.py @@ -120,7 +120,6 @@ class SettingOverrideDecorator(SceneNodeDecorator): changed = False if self._is_non_printing_mesh != new_is_non_printing_mesh: self._is_non_printing_mesh = new_is_non_printing_mesh - self._node.setCalculateBoundingBox(not self._is_non_printing_mesh) changed = True if self._is_non_thumbnail_visible_mesh != new_is_non_thumbnail_visible_mesh: changed = True From 5fc91e797eecc51deaceaa82fa3f975f0e99d6b1 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 24 Apr 2019 13:22:49 +0200 Subject: [PATCH 4/5] Remove mistake code --- cura/Settings/GlobalStack.py | 1 - 1 file changed, 1 deletion(-) diff --git a/cura/Settings/GlobalStack.py b/cura/Settings/GlobalStack.py index fed049126e..3ec73972dd 100755 --- a/cura/Settings/GlobalStack.py +++ b/cura/Settings/GlobalStack.py @@ -45,7 +45,6 @@ class GlobalStack(CuraContainerStack): # Since the metadatachanged is defined in container stack, we can't use it here as a notifier for pyqt # properties. So we need to tie them together like this. self.metaDataChanged.connect(self.configuredConnectionTypesChanged) - self.metaDataChanged.connect(self.networkGroupNameChanged) extrudersChanged = pyqtSignal() configuredConnectionTypesChanged = pyqtSignal() From d69eb89f1781f6cb40eee25c125cc9a8f2c4b527 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 24 Apr 2019 16:03:12 +0200 Subject: [PATCH 5/5] Fix refresh token not being stored in the bootup refresh case --- cura/OAuth2/AuthorizationService.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cura/OAuth2/AuthorizationService.py b/cura/OAuth2/AuthorizationService.py index d721945b79..39ec9846e7 100644 --- a/cura/OAuth2/AuthorizationService.py +++ b/cura/OAuth2/AuthorizationService.py @@ -99,7 +99,9 @@ class AuthorizationService: Logger.log("w", "Unable to use the refresh token to get a new access token.") # The token could not be refreshed using the refresh token. We should login again. return None - + # Ensure it gets stored as otherwise we only have it in memory. The stored refresh token has been deleted + # from the server already. + self._storeAuthData(self._auth_data) return self._auth_helpers.parseJWT(self._auth_data.access_token) ## Get the access token as provided by the repsonse data. @@ -198,6 +200,7 @@ class AuthorizationService: ## Store authentication data in preferences. def _storeAuthData(self, auth_data: Optional[AuthenticationResponse] = None) -> None: + Logger.log("d", "Attempting to store the auth data") if self._preferences is None: Logger.log("e", "Unable to save authentication data, since no preference has been set!") return