imports corrected; menu definition changed

This commit is contained in:
Sebastian Wehling-Benatelli 2014-12-04 05:13:32 +01:00
parent e6ac337466
commit 9603f7127c
2 changed files with 20 additions and 13 deletions

View File

@ -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,6 +240,7 @@ 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,
@ -242,6 +248,7 @@ class MainWindow(QMainWindow):
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):

View File

@ -1 +1 @@
fc3e-dirty e6ac-dirty