else:\r
self.warningPopup.yesButton.Show(True)\r
self.warningPopup.noButton.SetLabel('no')\r
+ self.warningPopup.Fit()\r
+ self.warningPopup.Layout()\r
self.OnMove()\r
self.warningPopup.Show(True)\r
self.warningPopup.timer.Start(5000)\r
except:
self.GetParent().preview3d.ShowWarningPopup("Failed to copy file to SD card.")
return
- self.GetParent().preview3d.ShowWarningPopup("Copy finished, safely remove SD card?", OnSafeRemove)
+ self.GetParent().preview3d.ShowWarningPopup("Copy finished, safely remove SD card?", self.OnSafeRemove)
def OnSafeRemove(self):
- print "Remove!"
+ if platform.system() == "Windows":
+ cmd = "%s %s>NUL" % (os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'EjectMedia.exe')), profile.getPreference('sdpath'))
+ else:
+ cmd = "umount %s > /dev/null 2>&1" % (profile.getPreference('sdpath'))
+ if os.system(cmd):
+ self.GetParent().preview3d.ShowWarningPopup("Safe remove failed.")
+ else:
+ self.GetParent().preview3d.ShowWarningPopup("You can now eject the card.")
def OnSliceDone(self, result):
self.progressGauge.Destroy()
downloadURL http://videocapture.sourceforge.net/VideoCapture-0.9-5.zip
downloadURL http://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-20120927-git-13f0cd6-win32-static.7z
downloadURL http://sourceforge.net/projects/comtypes/files/comtypes/0.6.2/comtypes-0.6.2.win32.exe
+ downloadURL http://www.uwe-sieber.de/files/ejectmedia.zip
#Get pypy
downloadURL https://bitbucket.org/pypy/pypy/downloads/pypy-${PYPY_VERSION}-win32.zip
elif [ $BUILD_TARGET = "osx64" ]; then
extract ffmpeg-20120927-git-13f0cd6-win32-static.7z ffmpeg-20120927-git-13f0cd6-win32-static/bin/ffmpeg.exe
extract ffmpeg-20120927-git-13f0cd6-win32-static.7z ffmpeg-20120927-git-13f0cd6-win32-static/licenses
extract comtypes-0.6.2.win32.exe
+ extract ejectmedia.zip Win32
mkdir -p ${TARGET_DIR}/python
mkdir -p ${TARGET_DIR}/Cura/
mv VideoCapture-0.9-5/Python27/DLLs/vidcap.pyd ${TARGET_DIR}/python/DLLs
mv ffmpeg-20120927-git-13f0cd6-win32-static/bin/ffmpeg.exe ${TARGET_DIR}/Cura/
mv ffmpeg-20120927-git-13f0cd6-win32-static/licenses ${TARGET_DIR}/Cura/ffmpeg-licenses/
+ mv Win32/EjectMedia.exe ${TARGET_DIR}/Cura/
rm -rf \$_OUTDIR
rm -rf PURELIB
rm -rf PLATLIB