[new] added a locate button to the toolbar in the GUI (not working yet)

This commit is contained in:
Sebastian Wehling-Benatelli 2015-11-09 08:53:26 +01:00
parent 9c7fbc4725
commit 8ae692db70
4 changed files with 32 additions and 16 deletions

View File

@ -162,6 +162,8 @@ class MainWindow(QMainWindow):
e_icon.addPixmap(QPixmap(':/icons/key_E.png')) e_icon.addPixmap(QPixmap(':/icons/key_E.png'))
auto_icon = QIcon() auto_icon = QIcon()
auto_icon.addPixmap(QPixmap(':/icons/sync.png')) auto_icon.addPixmap(QPixmap(':/icons/sync.png'))
locate_icon = QIcon()
locate_icon.addPixmap(QPixmap(':/icons/locate.png'))
newEventAction = self.createAction(self, "&New event ...", newEventAction = self.createAction(self, "&New event ...",
self.createNewEvent, self.createNewEvent,
@ -286,6 +288,16 @@ class MainWindow(QMainWindow):
# pickToolBar.setObjectName("PickTools") # pickToolBar.setObjectName("PickTools")
# self.addActions(pickToolBar, pickToolActions) # self.addActions(pickToolBar, pickToolActions)
locateEvent = self.createAction(parent=self, text='locateEvent',
slot=self.locateEvent, shortcut='Alt+Ctrl+L',
icon=locate_icon, tip='Locate the event using '
'the picked arrivals.')
locationToolBar = self.addToolBar("LocationTools")
locationToolActions = (locateEvent,)
locationToolBar.setObjectName("LocationTools")
self.addActions(locationToolBar, locationToolActions)
self.eventLabel = QLabel() self.eventLabel = QLabel()
self.eventLabel.setFrameStyle(QFrame.StyledPanel | QFrame.Sunken) self.eventLabel.setFrameStyle(QFrame.StyledPanel | QFrame.Sunken)
status = self.statusBar() status = self.statusBar()
@ -752,18 +764,8 @@ class MainWindow(QMainWindow):
[mpp + spe, mpp + spe], ylims, colors[1]) [mpp + spe, mpp + spe], ylims, colors[1])
self.draw() self.draw()
def updateStatus(self, message, duration=5000): def locateEvent(self):
self.statusBar().showMessage(message, duration) pass
if self.getData() is not None:
if not self.getData().isNew():
self.setWindowTitle(
"PyLoT - processing event %s[*]" % self.getData().getID())
elif self.getData().isNew():
self.setWindowTitle("PyLoT - New event [*]")
else:
self.setWindowTitle(
"PyLoT - seismic processing the python way[*]")
self.setWindowModified(self.dirty)
def check4Loc(self): def check4Loc(self):
return self.picksNum() > 4 return self.picksNum() > 4
@ -782,6 +784,19 @@ class MainWindow(QMainWindow):
def locflag(self, value): def locflag(self, value):
self.loc = value self.loc = value
def updateStatus(self, message, duration=5000):
self.statusBar().showMessage(message, duration)
if self.getData() is not None:
if not self.getData().isNew():
self.setWindowTitle(
"PyLoT - processing event %s[*]" % self.getData().getID())
elif self.getData().isNew():
self.setWindowTitle("PyLoT - New event [*]")
else:
self.setWindowTitle(
"PyLoT - seismic processing the python way[*]")
self.setWindowModified(self.dirty)
def tutorUser(self): def tutorUser(self):
self.updateStatus('select trace to pick on station ...', 10000) self.updateStatus('select trace to pick on station ...', 10000)

View File

@ -2,6 +2,7 @@
<qresource> <qresource>
<file>icons/pylot.ico</file> <file>icons/pylot.ico</file>
<file>icons/pylot.png</file> <file>icons/pylot.png</file>
<file>icons/locate.png</file>
<file>icons/printer.png</file> <file>icons/printer.png</file>
<file>icons/delete.png</file> <file>icons/delete.png</file>
<file>icons/key_E.png</file> <file>icons/key_E.png</file>

BIN
icons/locate.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

File diff suppressed because one or more lines are too long