diff --git a/mseedpeek/mseedpeek.py b/mseedpeek/mseedpeek.py index e035ef807b2fcd0061f1dbefe61be98be5a6edb8..b8470ea3e228496f0de843a6f1473e0becb4db64 100644 --- a/mseedpeek/mseedpeek.py +++ b/mseedpeek/mseedpeek.py @@ -504,6 +504,10 @@ class MainWindow(QWidget): # widgets blk_label = QLabel("Blockette:") blk_menu = QComboBox() + blk_menu.currentIndexChanged.connect( + lambda: self.fill_blockettes_tab( + 0, + blk_menu.currentText())) blk_menu.setObjectName("type_menu") self.blkinfo_btn = QPushButton("Blockette Info") @@ -1086,6 +1090,7 @@ class MainWindow(QWidget): for blk in self.blockettes_dict[key]: self.blockettes_list.append(blk[0]) self.blockettes_list.sort() + print(self.blockettes_list) # fill blockette info for first blockette found self.fill_blockettes_tab(key, self.blockettes_list[0]) @@ -1094,17 +1099,24 @@ class MainWindow(QWidget): """ clears/initializes entry fields in Blockettes tab """ + for block in self.blockettes_dict[key]: - if block[0] == blktype: + if int(block[0]) == int(blktype): blocktuple = block for key, values in BlkVars.items(): - if blktype == key: + print(key) + if int(blktype) == int(key): + print("matchnig?") boxes = self.blockettes_tab.findChildren(QGroupBox) for box in boxes: if box.objectName() == "Box1": menu = box.findChild(QComboBox, "type_menu") + menu.blockSignals(True) menu.clear() - menu.insertItem(0, str(blktype)) + for blk in self.blockettes_list: + menu.addItem(str(blk)) + menu.setCurrentText(str(blktype)) + menu.blockSignals(False) elif box.objectName() == "Box2": layout = box.layout() # delete previous labels if they exist @@ -1344,7 +1356,7 @@ class MainWindow(QWidget): """ self.infobar.setText(text) self.infobar.setStyleSheet("background-color:" + color) - if color != "yellow" and color != "green": + if color != "yellow": QApplication.beep() def update_slider(self, widget):