chiark / gitweb /
Fix filename and directory in the GCode save dialog being flipped. (.gcode was being...
authorAdam Goldsmith <adamgoldsmith1217@gmail.com>
Sun, 29 Sep 2013 12:01:19 +0000 (08:01 -0400)
committerAdam Goldsmith <adamgoldsmith1217@gmail.com>
Sun, 29 Sep 2013 12:01:19 +0000 (08:01 -0400)
Cura/gui/sceneView.py

index d81c6ba6aa4a876f22ca9aa978c90201df5c6d73..a8d17559b5d2224baff67d2fed6746cf0d43520d 100644 (file)
@@ -222,10 +222,8 @@ class SceneView(openglGui.glGuiPanel):
                        self._slicer.submitSliceInfoOnline()
 
        def showSaveGCode(self):
-               defPath = profile.getPreference('lastFile')
-               defPath = defPath[0:defPath.rfind('.')] + '.gcode'
-               dlg=wx.FileDialog(self, _("Save toolpath"), defPath, style=wx.FD_SAVE)
-               dlg.SetFilename(self._scene._objectList[0].getName())
+               dlg=wx.FileDialog(self, _("Save toolpath"), os.path.dirname(profile.getPreference('lastFile')), style=wx.FD_SAVE)
+               dlg.SetFilename(self._scene._objectList[0].getName()+'.gcode')
                dlg.SetWildcard('Toolpath (*.gcode)|*.gcode;*.g')
                if dlg.ShowModal() != wx.ID_OK:
                        dlg.Destroy()