From af737ef097504de379526df5f5bcd18962c837d9 Mon Sep 17 00:00:00 2001 From: daid Date: Fri, 13 Apr 2012 12:16:56 +0200 Subject: [PATCH] Fixed #52 - Correct error message when trying to print without a model. Fixed #53 - Give an error message when slicing without model loaded. --- Cura/gui/mainWindow.py | 3 ++- Cura/gui/simpleMode.py | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Cura/gui/mainWindow.py b/Cura/gui/mainWindow.py index c6e7535..965a4e0 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 777b186..0141ed6 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