From 094213bd21372a89d547233205321705c2b0b0d9 Mon Sep 17 00:00:00 2001 From: Sebastian Wehling-Benatelli Date: Thu, 27 Nov 2014 10:13:17 +0100 Subject: [PATCH 1/2] method createAction implemented in order to create menu entries --- QtPyLoT.py | 42 ++++++++++++++++++++++++++++++++++++++++-- pylot/RELEASE-VERSION | 2 +- 2 files changed, 41 insertions(+), 3 deletions(-) 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/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 From 8ed281ae2d9e45c842d93da99f641842cdfb8bb4 Mon Sep 17 00:00:00 2001 From: Sebastian Wehling-Benatelli Date: Thu, 27 Nov 2014 10:57:33 +0100 Subject: [PATCH 2/2] printer icon added licensed under Creative Commons (Attribution 3.0); source: https://www.iconfinder.com/icons/59191/print_printer_icon#size=32 (27.11.2014) --- icons/printer.png | Bin 0 -> 937 bytes resources.qrc | 1 + 2 files changed, 1 insertion(+) create mode 100644 icons/printer.png diff --git a/icons/printer.png b/icons/printer.png new file mode 100644 index 0000000000000000000000000000000000000000..339ccab167bb0d0a7a1a9988b917754ba1526571 GIT binary patch literal 937 zcmV;a16KTrP)z_n+Tj;P@a|Mbk9UbzM;Jg;c9m*xA`( z)T_enCLlOOqfrP3gPsuB-rk0MJ`c_WMB_`J&j-Ok5W?ZGCj>}8=~QtXEkJ)1^a$Y* zzOV(a6A;Q*6WlWbLV)?Sv;~r|#{?vX_+KnQ-uhtSK6oiZiD738poey7T$|N=T8c5& zLGeGHngASolLw3{=v)`RkdLgfj^k{#QoU>##yacl?2Kc$<@^DE)bIDpaAElDhtL)v zD3r@(D3{9lLZOi4?XmVbWEBmCLNWuQ1zqsK#>=tZIQM)j(}-%SmI0#^s1YvX2QUU>A-Q>=4m&+i^cRvg6U zc8-V60i(kyhD3xq$*s_0PzMXQg#|gg8WFYxC=*ih;GBax$*oY#S1J{$Q^j#4Kx1+c zDoiLs{xGYU&t+xENwnmYXWK`Lnm#EN;{!5#mug% zuBJp3i^X7bbF-O%rO^tOUOsnafr->)lOB}-Ve^>_(?4!pzj?@d3N}r|CwXGTwGZq? zfPND;pUO;K-T1n3`|kWbXgC)XAIQC0a%F+B(Q!u~pniHL1BA`!W`r`k_GRtT^70#4 z{k$sodj8Hl!&L|@ROGl+D!KLn>ap;kxhyl2kvFaGqur253_{o8u4}#VzAKWzv7TP| z@acUV=ccjslal_vfs3JVNTyE$&MrN5Wr5Vlsa*n?35$gyTY2~PR_)UYwnfDJNO~oK zo+EK-ezVE=#C?oJB6R|^5;qng%b5hWwze4g50!eVZ*gnlu~w~IbHKv2<#WEF zv=iV+-u_~u+zliF&j0K_P+RGqS2Nqmn5SR7&UsP`kdHaZF98MsZ%>DZeSWjR00000 LNkvXXu0mjf=a;{C literal 0 HcmV?d00001 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