Removed submenu for copy, will replace with dialog
This commit is contained in:
@@ -230,19 +230,17 @@ class MainFrame(wx.Frame):
|
||||
self.Bind(wx.EVT_MENU, self.showPreferenceDialog, id=wx.ID_PREFERENCES)
|
||||
|
||||
#Clipboard exports
|
||||
self.Bind(wx.EVT_MENU, self.clipboardEft, id=menuBar.idExportEft)
|
||||
self.Bind(wx.EVT_MENU, self.clipboardDna, id=menuBar.idExportDna)
|
||||
self.Bind(wx.EVT_MENU, self.clipboardXml, id=menuBar.idExportXml)
|
||||
self.Bind(wx.EVT_MENU, self.exportToClipboard, id=wx.ID_COPY)
|
||||
|
||||
def clipboardEft(self, event):
|
||||
def clipboardEft(self):
|
||||
sFit = service.Fit.getInstance()
|
||||
self.toClipboard(sFit.exportFit(self.getActiveFit()))
|
||||
|
||||
def clipboardDna(self, event):
|
||||
def clipboardDna(self):
|
||||
sFit = service.Fit.getInstance()
|
||||
self.toClipboard(sFit.exportDna(self.getActiveFit()))
|
||||
|
||||
def clipboardXml(self, event):
|
||||
def clipboardXml(self):
|
||||
sFit = service.Fit.getInstance()
|
||||
self.toClipboard(sFit.exportXml(self.getActiveFit()))
|
||||
|
||||
@@ -254,6 +252,9 @@ class MainFrame(wx.Frame):
|
||||
self._openAfterImport(len(fits), IDs)
|
||||
except:
|
||||
pass
|
||||
|
||||
def exportToClipboard(self, event):
|
||||
sFit = service.Fit.getInstance()
|
||||
|
||||
def toClipboard(self, text):
|
||||
clip = wx.TheClipboard
|
||||
|
||||
@@ -54,15 +54,9 @@ class MainMenuBar(wx.MenuBar):
|
||||
fitMenu.Append(wx.ID_OPEN, "&Import", "Import a fit into pyfa.")
|
||||
fitMenu.Append(wx.ID_SAVEAS, "&Export\tCTRL+S", "Export the fit to another format.")
|
||||
|
||||
clipboardMenu = wx.Menu()
|
||||
self.idExportDna, self.idExportEft, self.idExportXml = wx.NewId(), wx.NewId(), wx.NewId()
|
||||
clipboardMenu.Append(self.idExportEft, "&EFT", "Copy the EFT export of this fit to the clipboard")
|
||||
clipboardMenu.Append(self.idExportXml, "&XML", "Copy the XML export of this fit to the clipboard")
|
||||
clipboardMenu.Append(self.idExportDna, "&DNA", "Copy the DNA export of this fit to the clipboard")
|
||||
|
||||
copyText = "&To Clipboard" + ("\tCTRL+C" if 'wxMSW' in wx.PlatformInfo else "")
|
||||
pasteText = "&From Clipboard" + ("\tCTRL+V" if 'wxMSW' in wx.PlatformInfo else "")
|
||||
fitMenu.AppendMenu(wx.ID_COPY, copyText, clipboardMenu, "Export a fit to the clipboard")
|
||||
fitMenu.Append(wx.ID_COPY, copyText, "Export a fit to the clipboard")
|
||||
fitMenu.Append(wx.ID_PASTE, pasteText, "Import a fit from the clipboard")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user