[add] color for tune/test events on MultiEventWidget

This commit is contained in:
Marcel Paffrath 2017-09-12 12:09:59 +02:00
parent 1d253b5ee5
commit cc0281f9dc
2 changed files with 14 additions and 11 deletions

View File

@ -1342,10 +1342,11 @@ class MainWindow(QMainWindow):
if len(eventdict) < 1: if len(eventdict) < 1:
return return
# init event selection options for autopick # init event selection options for autopick
self.compareoptions =[('tune events', self.get_ref_events), self.compareoptions =[('tune events', self.get_ref_events, self._style['ref']['rgba']),
('test events', self.get_test_events), ('test events', self.get_test_events, self._style['test']['rgba']),
('all (picked) events', self.get_manu_picked_events)] ('all (picked) events', self.get_manu_picked_events, None)]
self.cmpw = CompareEventsWidget(self, self.compareoptions, eventdict, comparisons) self.cmpw = CompareEventsWidget(self, self.compareoptions, eventdict, comparisons)
self.cmpw.start.connect(self.compareMulti) self.cmpw.start.connect(self.compareMulti)
@ -1353,7 +1354,7 @@ class MainWindow(QMainWindow):
self.cmpw.show() self.cmpw.show()
def compareMulti(self): def compareMulti(self):
for key, func in self.compareoptions: for key, func, color in self.compareoptions:
if self.cmpw.rb_dict[key].isChecked(): if self.cmpw.rb_dict[key].isChecked():
# if radio button is checked break for loop and use func # if radio button is checked break for loop and use func
break break
@ -2081,11 +2082,11 @@ class MainWindow(QMainWindow):
return return
# init event selection options for autopick # init event selection options for autopick
self.pickoptions =[('current event', self.get_current_event), self.pickoptions =[('current event', self.get_current_event, None),
('tune events', self.get_ref_events), ('tune events', self.get_ref_events, self._style['ref']['rgba']),
('test events', self.get_test_events), ('test events', self.get_test_events, self._style['test']['rgba']),
('all (picked) events', self.get_manu_picked_events), ('all (picked) events', self.get_manu_picked_events, None),
('all events', self.get_all_events)] ('all events', self.get_all_events, None)]
self.listWidget = QListWidget() self.listWidget = QListWidget()
self.setDirty(True) self.setDirty(True)

View File

@ -2232,9 +2232,11 @@ class MultiEventWidget(QWidget):
self.start_button = QtGui.QPushButton('Start') self.start_button = QtGui.QPushButton('Start')
for index, (key, func) in enumerate(self.options): for index, (key, func, color) in enumerate(self.options):
rb = QtGui.QRadioButton(key) rb = QtGui.QRadioButton(key)
rb.toggled.connect(self.check_rb_selection) rb.toggled.connect(self.check_rb_selection)
if color:
rb.setStyleSheet('QRadioButton{color: rgba%s}'%str(color))
if index == 0: if index == 0:
rb.setChecked(True) rb.setChecked(True)
self.rb_dict[key] = rb self.rb_dict[key] = rb
@ -2249,7 +2251,7 @@ class MultiEventWidget(QWidget):
self.main_layout.insertLayout(0, self.rb_layout) self.main_layout.insertLayout(0, self.rb_layout)
def refresh_tooltips(self): def refresh_tooltips(self):
for key, func in self.options: for key, func, color in self.options:
eventlist = func() eventlist = func()
if not type(eventlist) == list: if not type(eventlist) == list:
eventlist = [eventlist] eventlist = [eventlist]