From 6877d98e1dd6e3728b0b1adbe8c7e889e68e4b25 Mon Sep 17 00:00:00 2001 From: Lucas Thode Date: Tue, 26 Oct 2010 10:56:59 -0500 Subject: [PATCH] Exporting fits now uses the File->Save box. This allows gui/importExport.py to die completely. HOWEVER, this does drop support for simultaneous EFT and XML export of a fit. --- gui/mainFrame.py | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/gui/mainFrame.py b/gui/mainFrame.py index 293d3a91e..e68199c74 100644 --- a/gui/mainFrame.py +++ b/gui/mainFrame.py @@ -153,7 +153,7 @@ class MainFrame(wx.Frame): sFit = service.Fit.getInstance() dlg=wx.FileDialog( self, - "Pick one or more fitting files to import", + "Choose one or more fitting files to import", wildcard = "EFT text fitting files (*.cfg)|*.cfg|EvE XML fitting files (*.xml)|*.xml|All Files (*)|*", style = wx.FD_OPEN | wx.FD_FILE_MUST_EXIST | wx.FD_MULTIPLE) if (dlg.ShowModal() == wx.ID_OK): @@ -172,8 +172,29 @@ class MainFrame(wx.Frame): wx.PostEvent(self, FitSelected(fitID=fitIDs[0])) def showExportDialog(self, event): - dlg=ExportDialog(self) - dlg.ShowModal() + dlg=wx.FileDialog( + self, + "Choose a file to export the current fitting to", + wildcard = "EFT text fitting files (*.cfg)|*.cfg|EvE XML fitting files (*.xml)|*.xml", + style = wx.FD_SAVE) + if (dlg.ShowModal() == wx.ID_OK): + sFit = service.Fit.getInstance() + format = dlg.GetFilterIndex() + output = "" + path = dlg.GetPath() + if (format == 0): + output = sFit.exportFit(self.getActiveFit()) + path += ".cfg" + elif (format == 1): + output = sFit.exportXml(self.getActiveFit()) + path += ".xml" + else: + print "oops, invalid fit format %d" % format + dlg.Destroy() + return + file = open(path, "w") + file.write(output) + file.close() dlg.Destroy() def showPreferenceDialog(self, event):