imports corrected; menu definition changed
This commit is contained in:
parent
e6ac337466
commit
9603f7127c
31
QtPyLoT.py
31
QtPyLoT.py
@ -23,25 +23,22 @@ https://www.iconfinder.com/iconsets/flavour
|
|||||||
(http://www.gnu.org/copyleft/lesser.html)
|
(http://www.gnu.org/copyleft/lesser.html)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from PySide.QtCore import *
|
from PySide.QtCore import *
|
||||||
from PySide.QtGui import *
|
from PySide.QtGui import *
|
||||||
from obspy.core import (read, UTCDateTime)
|
from obspy.core import (UTCDateTime)
|
||||||
from pylot import *
|
|
||||||
from pylot.core.util import _getVersionString
|
from pylot.core.util import _getVersionString
|
||||||
from pylot.core.read import (Data,
|
from pylot.core.read import (Data,
|
||||||
FilterOptions)
|
FilterOptions)
|
||||||
from pylot.core.util import FILTERDEFAULTS
|
from pylot.core.util import FILTERDEFAULTS
|
||||||
from pylot.core.util import fnConstructor
|
from pylot.core.util import fnConstructor
|
||||||
from pylot.core.util import checkurl
|
from pylot.core.util import checkurl
|
||||||
from pylot.core.util import (PickDlg,
|
from pylot.core.util import (FilterOptionsDialog,
|
||||||
FilterOptionsDialog,
|
|
||||||
PropertiesDlg,
|
|
||||||
MPLWidget,
|
MPLWidget,
|
||||||
HelpForm)
|
HelpForm)
|
||||||
from pylot.core.util import layoutStationButtons
|
|
||||||
import qrc_resources
|
|
||||||
|
|
||||||
# Version information
|
# Version information
|
||||||
__version__ = _getVersionString()
|
__version__ = _getVersionString()
|
||||||
@ -86,6 +83,9 @@ class MainWindow(QMainWindow):
|
|||||||
|
|
||||||
def createAction(self, text, slot=None, shortcut=None, icon=None,
|
def createAction(self, text, slot=None, shortcut=None, icon=None,
|
||||||
tip=None, checkable=False):
|
tip=None, checkable=False):
|
||||||
|
"""
|
||||||
|
:rtype : ~PySide.QtGui.QAction
|
||||||
|
"""
|
||||||
action = QAction(text, self)
|
action = QAction(text, self)
|
||||||
if icon is not None:
|
if icon is not None:
|
||||||
action.setIcon(icon)
|
action.setIcon(icon)
|
||||||
@ -203,9 +203,14 @@ class MainWindow(QMainWindow):
|
|||||||
self.fileMenuActions = (openEventAction, saveEventAction, None,
|
self.fileMenuActions = (openEventAction, saveEventAction, None,
|
||||||
quitAction)
|
quitAction)
|
||||||
self.fileMenu.aboutToShow.connect(self.updateFileMenu)
|
self.fileMenu.aboutToShow.connect(self.updateFileMenu)
|
||||||
self.createMenu('&Edit', (filterAction, filterEditAction, None,
|
|
||||||
selectPAction, selectSAction, None,
|
self.editMenu = self.menuBar().addMenu('&Edit')
|
||||||
printAction))
|
for action in (filterAction, filterEditAction, None, selectPAction,
|
||||||
|
selectSAction, None, printAction):
|
||||||
|
if action is None:
|
||||||
|
self.editMenu.addSeparator()
|
||||||
|
else:
|
||||||
|
self.editMenu.addAction(action)
|
||||||
|
|
||||||
self.eventLabel = QLabel()
|
self.eventLabel = QLabel()
|
||||||
self.eventLabel.setFrameStyle(QFrame.StyledPanel|QFrame.Sunken)
|
self.eventLabel.setFrameStyle(QFrame.StyledPanel|QFrame.Sunken)
|
||||||
@ -235,13 +240,15 @@ class MainWindow(QMainWindow):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def adjustFilterOptions(self):
|
def adjustFilterOptions(self):
|
||||||
|
filterOptions = None
|
||||||
fstring = "Filter Options ({0})".format(self.getSeismicPhase())
|
fstring = "Filter Options ({0})".format(self.getSeismicPhase())
|
||||||
filterDlg = FilterOptionsDialog(titleString=fstring,
|
filterDlg = FilterOptionsDialog(titleString=fstring,
|
||||||
parent=self,
|
parent=self,
|
||||||
filterOptions=self.getFilterOptions())
|
filterOptions=self.getFilterOptions())
|
||||||
if filterDlg.exec_():
|
if filterDlg.exec_():
|
||||||
filterOptions = filterDlg.getFilterOptions()
|
filterOptions = filterDlg.getFilterOptions()
|
||||||
|
|
||||||
|
assert isinstance(filterOptions, FilterOptions)
|
||||||
self.setFilterOptions(filterOptions)
|
self.setFilterOptions(filterOptions)
|
||||||
|
|
||||||
def getFilterOptions(self):
|
def getFilterOptions(self):
|
||||||
|
@ -1 +1 @@
|
|||||||
fc3e-dirty
|
e6ac-dirty
|
||||||
|
Loading…
Reference in New Issue
Block a user