diff --git a/QtPyLoT.py b/QtPyLoT.py index ec620c25..452b4469 100755 --- a/QtPyLoT.py +++ b/QtPyLoT.py @@ -69,6 +69,21 @@ class MainWindow(QMainWindow): def _getCurrentPlotType(self): return 'TestType' + def createAction(self, text, slot=None, shortcut=None, icon=None, + tip=None, checkable=False): + action = QAction(text, self) + if icon is not None: + action.setIcon(icon) + if shortcut is not None: + action.setShortcut(shortcut) + if tip is not None: + action.setToolTip(tip) + if slot is not None: + action.triggered.connect(slot) + if checkable: + action.setCheckable(True) + return action + def loadData(self): self.data = None @@ -92,9 +107,33 @@ class MainWindow(QMainWindow): xlabel=xlab, ylabel=None, title=plottitle) + + self.setCentralWidget(self.getDataWidget()) + + self.openEventAction = self.createAction("&Open event ...", + self.loadData, + QKeySequence.Open, + QStyle.SP_DirOpenIcon, + "Open an event.") + self.quitAction = self.createAction("&Quit", self.cleanUp, + QKeySequence.Close, + QStyle.SP_MediaStop, + "Close event and quit PyLoT") + self.filterAction = self.createAction("&Filter ...", self.filterData, + "Ctrl+F", ":/filter.png", + """Toggle un-/filtered waveforms + to be displayed, accroding to the + desired seismic phase.""", True) + + self.selectPAction = self.createAction("&P", self.alterPhase, "Ctrl+P", + ":/picon.png", "Toggle P phase.", + True) + self.selectSAction = self.createAction("&S", self.alterPhase, "Ctrl+S", + ":/sicon.png", "Toggle S phase", + True) self.eventLabel = QLabel() - self.eventLabel.setFrameStyle(QFrame.StyledPanel | QFrame.Sunken) + self.eventLabel.setFrameStyle(QFrame.StyledPanel|QFrame.Sunken) status = self.statusBar() status.setSizeGripEnabled(False) status.addPermanentWidget(self.eventLabel) @@ -108,7 +147,6 @@ class MainWindow(QMainWindow): maingrid.addLayout(statLayout, 0, 0) maingrid.addWidget(dataLayout, 1, 0) self.setLayout(maingrid) - #self.setCentralWidget(dataLayout) def plotData(self): pass #self.data.plotData(self.DataPlot) diff --git a/icons/printer.png b/icons/printer.png new file mode 100644 index 00000000..339ccab1 Binary files /dev/null and b/icons/printer.png differ diff --git a/pylot/RELEASE-VERSION b/pylot/RELEASE-VERSION index 749b26f6..c7992fb6 100644 --- a/pylot/RELEASE-VERSION +++ b/pylot/RELEASE-VERSION @@ -1 +1 @@ -8cb6-dirty +0.0.0-g4b7b diff --git a/resources.qrc b/resources.qrc index a4fcaef9..ba83c9c3 100644 --- a/resources.qrc +++ b/resources.qrc @@ -1,6 +1,7 @@ icons/pylot.ico + icons/printer.png help/index.html