From: Youness Alaoui Date: Thu, 8 Jan 2015 19:01:49 +0000 (-0500) Subject: Always give the choice for a custom file destination in the save gcode to SD X-Git-Tag: lulzbot-15.02.1-1.01~75^2~4^2~8 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=179fdaff6129d28421a237d1404c4fadf279b617;p=cura.git Always give the choice for a custom file destination in the save gcode to SD Fixes issue #23 --- diff --git a/Cura/gui/sceneView.py b/Cura/gui/sceneView.py index 48c975d3..f72fd6c6 100644 --- a/Cura/gui/sceneView.py +++ b/Cura/gui/sceneView.py @@ -259,16 +259,28 @@ class SceneView(openglGui.glGuiPanel): if len(removableStorage.getPossibleSDcardDrives()) > 0 and (connectionGroup is None or connectionGroup.getPriority() < 0): drives = removableStorage.getPossibleSDcardDrives() if len(drives) > 1: - dlg = wx.SingleChoiceDialog(self, "Select SD drive", "Multiple removable drives have been found,\nplease select your SD card drive", map(lambda n: n[0], drives)) - if dlg.ShowModal() != wx.ID_OK: - dlg.Destroy() - return - drive = drives[dlg.GetSelection()] + choices = map(lambda n: n[0], drives) + choices += ("Custom file destination", ) + title = "Multiple removable drives have been found" + else: + choices = [drives[0][0], "Custom file destination"] + title = "A removable drive has been found" + + dlg = wx.SingleChoiceDialog(self, "Select destination SD card drive\nYou can also select a custom file to save to", title, choices) + if dlg.ShowModal() != wx.ID_OK: dlg.Destroy() + return + try: + drive = drives[dlg.GetSelection()] + except: + drive = None + dlg.Destroy() + + if drive is None: + self.showSaveGCode() else: - drive = drives[0] - filename = self._scene._objectList[0].getName() + profile.getGCodeExtension() - threading.Thread(target=self._saveGCode,args=(drive[1] + filename, drive[1])).start() + filename = self._scene._objectList[0].getName() + profile.getGCodeExtension() + threading.Thread(target=self._saveGCode,args=(drive[1] + filename, drive[1])).start() elif connectionGroup is not None: connections = connectionGroup.getAvailableConnections() if len(connections) < 2: