do not "save" actions as Attributes of the MainWindow

This commit is contained in:
Sebastian Wehling-Benatelli 2014-12-01 12:39:56 +01:00
parent 4acf634f8d
commit dc43a3520d

View File

@ -169,42 +169,43 @@ class MainWindow(QMainWindow):
openIcon = self.style().standardIcon(QStyle.SP_DirOpenIcon) openIcon = self.style().standardIcon(QStyle.SP_DirOpenIcon)
quitIcon = self.style().standardIcon(QStyle.SP_MediaStop) quitIcon = self.style().standardIcon(QStyle.SP_MediaStop)
saveIcon = self.style().standardIcon(QStyle.SP_DriveHDIcon) saveIcon = self.style().standardIcon(QStyle.SP_DriveHDIcon)
self.openEventAction = self.createAction("&Open event ...", openEventAction = self.createAction("&Open event ...", self.loadData,
self.loadData, QKeySequence.Open, openIcon,
QKeySequence.Open,
openIcon,
"Open an event.") "Open an event.")
self.saveEventAction = self.createAction("&Save event ...", openEventAction.setData(None)
self.saveData, saveEventAction = self.createAction("&Save event ...", self.saveData,
QKeySequence.Save, saveIcon, QKeySequence.Save, saveIcon,
"Save actual event data.") "Save actual event data.")
self.quitAction = self.createAction("&Quit", quitAction = self.createAction("&Quit",
QCoreApplication.instance().quit, QCoreApplication.instance().quit,
QKeySequence.Close, QKeySequence.Close, quitIcon,
quitIcon,
"Close event and quit PyLoT") "Close event and quit PyLoT")
self.filterAction = self.createAction("&Filter ...", self.filterData, filterAction = self.createAction("&Filter ...", self.filterData,
"Ctrl+F", QIcon(":/filter.png"), "Ctrl+F", QIcon(":/filter.png"),
"""Toggle un-/filtered waveforms """Toggle un-/filtered waveforms
to be displayed, according to the to be displayed, according to the
desired seismic phase.""", True) desired seismic phase.""", True)
self.filterEditAction = self.createAction("&Filter parameter ...", filterEditAction = self.createAction("&Filter parameter ...",
self.adjustFilterOptions, self.adjustFilterOptions,
"Alt+F", QIcon(None), "Alt+F", QIcon(None),
"""Adjust filter """Adjust filter parameters.""")
parameters.""") selectPAction = self.createAction("&P", self.alterPhase, "Alt+P",
self.selectPAction = self.createAction("&P", self.alterPhase, "Alt+P",
QIcon(":/picon.png"), QIcon(":/picon.png"),
"Toggle P phase.", True) "Toggle P phase.", True)
self.selectSAction = self.createAction("&S", self.alterPhase, "Alt+S", selectSAction = self.createAction("&S", self.alterPhase, "Alt+S",
QIcon(":/sicon.png"), QIcon(":/sicon.png"),
"Toggle S phase", True) "Toggle S phase", True)
self.printAction = self.createAction("&Print event ...", printAction = self.createAction("&Print event ...",
self.printEvent, self.printEvent, QKeySequence.Print,
QKeySequence.Print,
QIcon(":/printer.png"), QIcon(":/printer.png"),
"Print waveform overview.") "Print waveform overview.")
self.createMenus() self.fileMenu = self.menuBar().addMenu('&File')
self.fileMenuActions = (openEventAction, saveEventAction, None,
quitAction)
self.fileMenu.aboutToShow.connect(self.updateFileMenu)
self.createMenu('&Edit', (filterAction, filterEditAction, None,
selectPAction, selectSAction, None,
printAction))
self.eventLabel = QLabel() self.eventLabel = QLabel()
self.eventLabel.setFrameStyle(QFrame.StyledPanel|QFrame.Sunken) self.eventLabel.setFrameStyle(QFrame.StyledPanel|QFrame.Sunken)