From: daid Date: Fri, 13 Apr 2012 10:16:56 +0000 (+0200) Subject: Fixed #52 - Correct error message when trying to print without a model. Fixed #53... X-Git-Tag: RC3~78 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=af737ef097504de379526df5f5bcd18962c837d9;p=cura.git Fixed #52 - Correct error message when trying to print without a model. Fixed #53 - Give an error message when slicing without model loaded. --- diff --git a/Cura/gui/mainWindow.py b/Cura/gui/mainWindow.py index c6e7535d..965a4e0c 100644 --- a/Cura/gui/mainWindow.py +++ b/Cura/gui/mainWindow.py @@ -274,6 +274,7 @@ class mainWindow(configBase.configWindowBase): def OnSlice(self, e): if self.filename == None: + wx.MessageBox('You need to load a file before you can slice it.', 'Print error', wx.OK | wx.ICON_INFORMATION) return #Create a progress panel and add it to the window. The progress panel will start the Skein operation. spp = sliceProgessPanel.sliceProgessPanel(self, self, self.filename) @@ -286,7 +287,7 @@ class mainWindow(configBase.configWindowBase): def OnPrint(self, e): if self.filename == None: - wx.MessageBox('You need to load a file before you can print it.', 'Print error', wx.OK | wx.ICON_INFORMATION) + wx.MessageBox('You need to load a file and slice it before you can print it.', 'Print error', wx.OK | wx.ICON_INFORMATION) return if not os.path.exists(self.filename[: self.filename.rfind('.')] + "_export.gcode"): wx.MessageBox('You need to slice the file to GCode before you can print it.', 'Print error', wx.OK | wx.ICON_INFORMATION) diff --git a/Cura/gui/simpleMode.py b/Cura/gui/simpleMode.py index 777b1862..0141ed6a 100644 --- a/Cura/gui/simpleMode.py +++ b/Cura/gui/simpleMode.py @@ -164,6 +164,7 @@ class simpleModeWindow(configBase.configWindowBase): def OnSlice(self, e): if self.filename == None: + wx.MessageBox('You need to load a file before you can slice it.', 'Print error', wx.OK | wx.ICON_INFORMATION) return #save the current profile so we can put it back latter oldProfile = profile.getGlobalProfileString() @@ -273,7 +274,13 @@ class simpleModeWindow(configBase.configWindowBase): profile.loadGlobalProfileFromString(oldProfile) def OnPrint(self, e): - printWindow.printWindow() + if self.filename == None: + wx.MessageBox('You need to load a file and slice it before you can print it.', 'Print error', wx.OK | wx.ICON_INFORMATION) + return + if not os.path.exists(self.filename[: self.filename.rfind('.')] + "_export.gcode"): + wx.MessageBox('You need to slice the file to GCode before you can print it.', 'Print error', wx.OK | wx.ICON_INFORMATION) + return + printWindow.printFile(self.filename[: self.filename.rfind('.')] + "_export.gcode") def OnNormalSwitch(self, e): from gui import mainWindow