bugfix: in order to be able to check for checkable these should be available in the namespace, thus these actions have been set as attributes of the MainWindow object

This commit is contained in:
Sebastian Wehling-Benatelli 2015-02-20 08:30:17 +01:00
parent 5496b2deaa
commit 35c184ede7

View File

@ -150,7 +150,7 @@ class MainWindow(QMainWindow):
QCoreApplication.instance().quit, QCoreApplication.instance().quit,
QKeySequence.Close, quitIcon, QKeySequence.Close, quitIcon,
"Close event and quit PyLoT") "Close event and quit PyLoT")
filterAction = self.createAction("&Filter ...", self.filterWaveformData, self.filterAction = self.createAction("&Filter ...", self.filterWaveformData,
"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
@ -159,10 +159,10 @@ class MainWindow(QMainWindow):
self.adjustFilterOptions, self.adjustFilterOptions,
"Alt+F", QIcon(None), "Alt+F", QIcon(None),
"""Adjust filter parameters.""") """Adjust filter 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)
selectSAction = self.createAction("&S", self.alterPhase, "Alt+S", self.selectSAction = self.createAction("&S", self.alterPhase, "Alt+S",
QIcon(":/sicon.png"), QIcon(":/sicon.png"),
"Toggle S phase", True) "Toggle S phase", True)
printAction = self.createAction("&Print event ...", printAction = self.createAction("&Print event ...",
@ -182,8 +182,9 @@ class MainWindow(QMainWindow):
self.updateFileMenu() self.updateFileMenu()
self.editMenu = self.menuBar().addMenu('&Edit') self.editMenu = self.menuBar().addMenu('&Edit')
editActions = (filterAction, filterEditAction, None, selectPAction, editActions = (self.filterAction, filterEditAction, None,
selectSAction, None, printAction) self.selectPAction, self.selectSAction, None,
printAction)
self.addMenuActions(self.editMenu, editActions) self.addMenuActions(self.editMenu, editActions)
self.helpMenu = self.menuBar().addMenu('&Help') self.helpMenu = self.menuBar().addMenu('&Help')