From ad94f055bbfc1a8584511e4dc46ac7842abd4ba4 Mon Sep 17 00:00:00 2001 From: daid Date: Wed, 28 Aug 2013 08:10:35 +0200 Subject: [PATCH] Retry publishing after 1 second, hoping that the renderer has ran then. --- Cura/gui/sceneView.py | 2 +- Cura/gui/tools/youmagineGui.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Cura/gui/sceneView.py b/Cura/gui/sceneView.py index cc3bbe4b..5faaba10 100644 --- a/Cura/gui/sceneView.py +++ b/Cura/gui/sceneView.py @@ -103,7 +103,7 @@ class SceneView(openglGui.glGuiPanel): self.viewSelection = openglGui.glComboButton(self, 'View mode', [7,19,11,15,23], ['Normal', 'Overhang', 'Transparent', 'X-Ray', 'Layers'], (-1,0), self.OnViewChange) self.layerSelect = openglGui.glSlider(self, 10000, 0, 1, (-1,-2), lambda : self.QueueRefresh()) - self.youMagineButton = openglGui.glButton(self, 26, 'YouMagine upload', (2,0), lambda button: youmagineGui.youmagineManager(self.GetTopLevelParent(), self._scene)) + self.youMagineButton = openglGui.glButton(self, 26, 'Share on YouMagine', (2,0), lambda button: youmagineGui.youmagineManager(self.GetTopLevelParent(), self._scene)) self.youMagineButton.setDisabled(True) self.notification = openglGui.glNotification(self, (0, 0)) diff --git a/Cura/gui/tools/youmagineGui.py b/Cura/gui/tools/youmagineGui.py index b027540e..d62b25a7 100644 --- a/Cura/gui/tools/youmagineGui.py +++ b/Cura/gui/tools/youmagineGui.py @@ -156,7 +156,10 @@ class youmagineManager(object): if publish: wx.CallAfter(self._indicatorWindow.showBusy, 'Publishing design...') - self._ym.publishDesign(id) + if not self._ym.publishDesign(id): + #If publishing failed try again after 1 second, this might help when you need to wait for the renderer. But does not always work. + time.sleep(1) + self._ym.publishDesign(id) wx.CallAfter(self._indicatorWindow.Hide) webbrowser.open(self._ym.viewUrlForDesign(id)) -- 2.30.2