chiark / gitweb /
Add popups when copying files to the SD card, to indicate succes or failure. Still...
authordaid303 <daid303@gmail.com>
Tue, 6 Nov 2012 08:11:57 +0000 (09:11 +0100)
committerdaid303 <daid303@gmail.com>
Tue, 6 Nov 2012 08:11:57 +0000 (09:11 +0100)
Cura/gui/preview3d.py
Cura/gui/sliceProgessPanel.py
Cura/util/profile.py

index 54244dd0fb6b092d19a60aea975fe26eeac4fb63..4882df71042e41735e83fdd46bcb6db71ad76a21 100644 (file)
@@ -252,14 +252,6 @@ class previewPanel(wx.Panel):
                        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
@@ -320,6 +312,19 @@ class previewPanel(wx.Panel):
                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
index 1500a59d42e7394f74e32f652dc606064b3a6ab2..5b35fbfc2b8c63f9ad6d0961fd72062e2ab6165d 100644 (file)
@@ -85,8 +85,16 @@ class sliceProgessPanel(wx.Panel):
                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()
index bbc2982b72c5a27d15d61d68b3995c42715da9b7..11c5b65278b606a1ba28fabc0645fa0f245d749c 100644 (file)
@@ -572,6 +572,8 @@ def getPluginList():
                                                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