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: