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