if profile.getProfileSettingFloat('model_scale') != 1.0 or profile.getProfileSettingFloat('model_rotate_base') != 0 or profile.getProfileSetting('flip_x') != 'False' or profile.getProfileSetting('flip_y') != 'False' or profile.getProfileSetting('flip_z') != 'False' or profile.getProfileSetting('swap_xz') != 'False' or profile.getProfileSetting('swap_yz') != 'False':\r
self.ShowWarningPopup('Reset scale, rotation and mirror?', self.OnResetAll)\r
\r
- def ShowWarningPopup(self, text, callback):\r
- self.warningPopup.text.SetLabel(text)\r
- self.warningPopup.callback = callback\r
- self.OnMove()\r
- self.warningPopup.Show(True)\r
- self.warningPopup.timer.Start(5000)\r
-\r
- \r
def loadReModelFiles(self, filelist):\r
#Only load this again if the filename matches the file we have already loaded (for auto loading GCode after slicing)\r
for idx in xrange(0, len(filelist)):\r
profile.putProfileSetting('swap_xz', 'False')\r
profile.putProfileSetting('swap_yz', 'False')\r
self.updateProfileToControls()\r
+\r
+ def ShowWarningPopup(self, text, callback = None):\r
+ self.warningPopup.text.SetLabel(text)\r
+ self.warningPopup.callback = callback\r
+ if callback == None:\r
+ self.warningPopup.yesButton.Show(False)\r
+ self.warningPopup.noButton.SetLabel('ok')\r
+ else:\r
+ self.warningPopup.yesButton.Show(True)\r
+ self.warningPopup.noButton.SetLabel('no')\r
+ self.OnMove()\r
+ self.warningPopup.Show(True)\r
+ self.warningPopup.timer.Start(5000)\r
\r
def OnWarningPopup(self, e):\r
self.warningPopup.Show(False)\r
filename = os.path.basename(exportFilename)
if profile.getPreference('sdshortnames') == 'True':
filename = sliceRun.getShortFilename(filename)
- shutil.copy(exportFilename, os.path.join(profile.getPreference('sdpath'), filename))
+ try:
+ shutil.copy(exportFilename, os.path.join(profile.getPreference('sdpath'), filename))
+ except:
+ self.GetParent().preview3d.ShowWarningPopup("Failed to copy file to SD card.")
+ return
+ self.GetParent().preview3d.ShowWarningPopup("Copy finished, safely remove SD card?", OnSafeRemove)
+ def OnSafeRemove(self):
+ print "Remove!"
+
def OnSliceDone(self, result):
self.progressGauge.Destroy()
self.abortButton.Destroy()
item['info'] = line[1].strip()\r
elif line[0].upper() == 'TYPE':\r
item['type'] = line[1].strip()\r
+ elif line[0].upper() == 'DEPEND':\r
+ pass\r
elif line[0].upper() == 'PARAM':\r
m = re.match('([a-zA-Z]*)\(([a-zA-Z_]*)(?:\:([^\)]*))?\) +(.*)', line[1].strip())\r
if m != None:\r