From: daid303 Date: Tue, 6 Nov 2012 08:11:57 +0000 (+0100) Subject: Add popups when copying files to the SD card, to indicate succes or failure. Still... X-Git-Tag: 13.03~208 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=6eb39c97f455035c7d00ba02f88529895131f142;p=cura.git Add popups when copying files to the SD card, to indicate succes or failure. Still need to add safely remove code. --- diff --git a/Cura/gui/preview3d.py b/Cura/gui/preview3d.py index 54244dd0..4882df71 100644 --- a/Cura/gui/preview3d.py +++ b/Cura/gui/preview3d.py @@ -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': self.ShowWarningPopup('Reset scale, rotation and mirror?', self.OnResetAll) - def ShowWarningPopup(self, text, callback): - self.warningPopup.text.SetLabel(text) - self.warningPopup.callback = callback - self.OnMove() - self.warningPopup.Show(True) - self.warningPopup.timer.Start(5000) - - def loadReModelFiles(self, filelist): #Only load this again if the filename matches the file we have already loaded (for auto loading GCode after slicing) for idx in xrange(0, len(filelist)): @@ -320,6 +312,19 @@ class previewPanel(wx.Panel): profile.putProfileSetting('swap_xz', 'False') profile.putProfileSetting('swap_yz', 'False') self.updateProfileToControls() + + def ShowWarningPopup(self, text, callback = None): + self.warningPopup.text.SetLabel(text) + self.warningPopup.callback = callback + if callback == None: + self.warningPopup.yesButton.Show(False) + self.warningPopup.noButton.SetLabel('ok') + else: + self.warningPopup.yesButton.Show(True) + self.warningPopup.noButton.SetLabel('no') + self.OnMove() + self.warningPopup.Show(True) + self.warningPopup.timer.Start(5000) def OnWarningPopup(self, e): self.warningPopup.Show(False) diff --git a/Cura/gui/sliceProgessPanel.py b/Cura/gui/sliceProgessPanel.py index 1500a59d..5b35fbfc 100644 --- a/Cura/gui/sliceProgessPanel.py +++ b/Cura/gui/sliceProgessPanel.py @@ -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() diff --git a/Cura/util/profile.py b/Cura/util/profile.py index bbc2982b..11c5b652 100644 --- a/Cura/util/profile.py +++ b/Cura/util/profile.py @@ -572,6 +572,8 @@ def getPluginList(): item['info'] = line[1].strip() elif line[0].upper() == 'TYPE': item['type'] = line[1].strip() + elif line[0].upper() == 'DEPEND': + pass elif line[0].upper() == 'PARAM': m = re.match('([a-zA-Z]*)\(([a-zA-Z_]*)(?:\:([^\)]*))?\) +(.*)', line[1].strip()) if m != None: