[new] introduced new attribute loc in order to control localization relevant GUI elements depending on the number of available phase onsets

This commit is contained in:
Sebastian Wehling-Benatelli 2015-11-06 15:40:21 +01:00
parent 21bb39d528
commit 9c7fbc4725

View File

@ -57,6 +57,7 @@ import icons_rc
class MainWindow(QMainWindow): class MainWindow(QMainWindow):
__version__ = _getVersionString() __version__ = _getVersionString()
__slots__ = ['loc']
closing = Signal() closing = Signal()
def __init__(self, parent=None): def __init__(self, parent=None):
@ -89,6 +90,7 @@ class MainWindow(QMainWindow):
self.filteroptions = {} self.filteroptions = {}
self.pickDlgs = {} self.pickDlgs = {}
self.picks = {} self.picks = {}
self.locflag(False)
# UI has to be set up before(!) children widgets are about to show up # UI has to be set up before(!) children widgets are about to show up
self.setupUi() self.setupUi()
@ -635,6 +637,10 @@ class MainWindow(QMainWindow):
self.drawPicks(station) self.drawPicks(station)
else: else:
self.updateStatus('picks discarded ({0})'.format(station)) self.updateStatus('picks discarded ({0})'.format(station))
if not self.locflag() and self.check4Loc():
self.locflag(True)
elif self.locflag() and not self.check4Loc():
self.locflag(False)
def autoPick(self): def autoPick(self):
list = QListWidget() list = QListWidget()
@ -768,6 +774,13 @@ class MainWindow(QMainWindow):
num += len(phases) num += len(phases)
return num return num
@property
def locflag(self):
return self.loc
@locflag.setter
def locflag(self, value):
self.loc = value
def tutorUser(self): def tutorUser(self):
self.updateStatus('select trace to pick on station ...', 10000) self.updateStatus('select trace to pick on station ...', 10000)