chiark / gitweb /
Fixed #52 - Correct error message when trying to print without a model. Fixed #53...
authordaid <daid303@gmail.com>
Fri, 13 Apr 2012 10:16:56 +0000 (12:16 +0200)
committerdaid <daid303@gmail.com>
Fri, 13 Apr 2012 10:16:56 +0000 (12:16 +0200)
Cura/gui/mainWindow.py
Cura/gui/simpleMode.py

index c6e7535d51fbf10a442838313ebc69dca6605a0e..965a4e0c340dbd0a21828d93aac9f2ffde0c1423 100644 (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)
index 777b18623d64f69741cc226b8bd736d1f6d6e1a0..0141ed6a4f8d20f806c4e79ad5d3849dcb6ae51d 100644 (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