Fixed #52 - Correct error message when trying to print without a model. Fixed #53 - Give an error message when slicing without model loaded.

master
daid 2012-04-13 12:16:56 +02:00
parent 493dceedc9
commit af737ef097
2 changed files with 10 additions and 2 deletions

View File

@ -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)

View File

@ -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