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()]
- dlg.Destroy()
+ choices = map(lambda n: n[0], drives)
+ choices += (_("Custom file destination"), )
+ title = _("Multiple removable drives have been found")
else:
- drive = drives[0]
- filename = self._scene._objectList[0].getName() + profile.getGCodeExtension()
-
- #check if the file is part of the root folder. If so, create folders on sd card to get the same folder hierarchy.
- repDir = profile.getPreference("sdcard_rootfolder")
+ 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:
- if os.path.exists(repDir) and os.path.isdir(repDir):
- repDir = os.path.abspath(repDir)
- originFilename = os.path.abspath( self._scene._objectList[0].getOriginFilename() )
- if os.path.dirname(originFilename).startswith(repDir):
- new_filename = os.path.splitext(originFilename[len(repDir):])[0] + profile.getGCodeExtension()
- sdPath = os.path.dirname(os.path.join(drive[1], new_filename))
- if not os.path.exists(sdPath):
- print "Creating replication directory:", sdPath
- os.makedirs(sdPath)
- filename = new_filename
+ drive = drives[dlg.GetSelection()]
except:
- pass
+ drive = None
+ dlg.Destroy()
- threading.Thread(target=self._saveGCode,args=(drive[1] + filename, drive[1])).start()
+ if drive is None:
+ self.showSaveGCode()
+ else:
+ filename = self._scene._objectList[0].getName() + profile.getGCodeExtension()
+
+ #check if the file is part of the root folder.
+ # If so, create folders on sd card to get the same folder hierarchy.
+ repDir = profile.getPreference("sdcard_rootfolder")
- if os.path.exists(repDir) and os.path.isdir(repDir):
- repDir = os.path.abspath(repDir)
- originFilename = os.path.abspath( self._scene._objectList[0].getOriginFilename() )
- if os.path.dirname(originFilename).startswith(repDir):
- filename = os.path.splitext(originFilename[len(repDir):])[0] + profile.getGCodeExtension()
- sdPath = os.path.dirname(os.path.join( drive[1], filename))
- if not os.path.exists(sdPath):
- print "Creating replication directory:", sdPath
- os.makedirs(sdPath)
++ try:
++ if os.path.exists(repDir) and os.path.isdir(repDir):
++ repDir = os.path.abspath(repDir)
++ originFilename = os.path.abspath( self._scene._objectList[0].getOriginFilename() )
++ if os.path.dirname(originFilename).startswith(repDir):
++ new_filename = os.path.splitext(originFilename[len(repDir):])[0] + profile.getGCodeExtension()
++ sdPath = os.path.dirname(os.path.join( drive[1], new_filename))
++ if not os.path.exists(sdPath):
++ print "Creating replication directory:", sdPath
++ os.makedirs(sdPath)
++ filename = new_filename
++ except:
++ pass
++
+ threading.Thread(target=self._saveGCode,args=(drive[1] + filename, drive[1])).start()
elif connectionGroup is not None:
connections = connectionGroup.getAvailableConnections()
if len(connections) < 2:
if n > cnt:
break
if n <= cnt:
- self.notification.message("Could not create more than %d items" % (n - 1))
+ self.notification.message(_("Could not create more than %d items") % (n - 1))
+ self.notification.message(_("Could not create more than %d items") % (n - 1))
self._scene.remove(newObj)
- self._scene.centerAll()
+ if requestedArrangeAll == 2:
+ self._scene.centerAll()
+
self.sceneUpdated()
def OnSplitObject(self, e):
else:
obj._loadAnim = None
self._scene.add(obj)
- if not self._scene.checkPlatform(obj):
- self._scene.centerAll()
- self._selectObject(obj)
- if obj.getScale()[0] < 1.0:
- self.notification.message(_("Warning: Object scaled down."))
+ if pms_transforms is not None and len(pms_transforms) == len(fileList):
+ obj.setPosition(pms_transforms[objIndex][0])
+ obj.applyMatrix(pms_transforms[objIndex][1])
+ obj.setScale(pms_transforms[objIndex][2][0], 0, False)
+ obj.setScale(pms_transforms[objIndex][2][1], 1, False)
+ obj.setScale(pms_transforms[objIndex][2][2], 2, False)
+ else:
+ if not self._scene.checkPlatform(obj):
+ self._scene.centerAll()
+ self._selectObject(obj)
+ if obj.getScale()[0] < 1.0:
- self.notification.message("Warning: Object scaled down.")
++ self.notification.message(_("Warning: Object scaled down."))
self.sceneUpdated()
def _deleteObject(self, obj):
glVertex3f(-w, d, 0)
glEnd()
glDisable(GL_TEXTURE_2D)
+ glDisable(GL_ALPHA_TEST)
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
glPopMatrix()
- else:
- glColor4f(0,0,0,1)
- glLineWidth(3)
- glBegin(GL_LINES)
- glVertex3f(-size[0] / 2, -size[1] / 2, 0)
- glVertex3f(-size[0] / 2, -size[1] / 2, 10)
- glVertex3f(-size[0] / 2, -size[1] / 2, 0)
- glVertex3f(-size[0] / 2+10, -size[1] / 2, 0)
- glVertex3f(-size[0] / 2, -size[1] / 2, 0)
- glVertex3f(-size[0] / 2, -size[1] / 2+10, 0)
- glEnd()
+ else:'''
+ # until glEnd() goes inside the else
+ glColor4f(0,0,0,1)
+ glLineWidth(3)
+ glBegin(GL_LINES)
+ glVertex3f(-size[0] / 2, -size[1] / 2, 0)
+ glVertex3f(-size[0] / 2, -size[1] / 2, 10)
+ glVertex3f(-size[0] / 2, -size[1] / 2, 0)
+ glVertex3f(-size[0] / 2+10, -size[1] / 2, 0)
+ glVertex3f(-size[0] / 2, -size[1] / 2, 0)
+ glVertex3f(-size[0] / 2, -size[1] / 2+10, 0)
+ glEnd()
glDepthMask(False)