diff --git a/mseedpeek/mseedpeek.py b/mseedpeek/mseedpeek.py index 52f614e76e51c59ccbf8aab3eeb09fe6400ee070..7e7ddf7ede8a708b1e4135c4b5a6be0bc2ee37ea 100644 --- a/mseedpeek/mseedpeek.py +++ b/mseedpeek/mseedpeek.py @@ -689,7 +689,7 @@ class MainWindow(QWidget): self.slider_box.jump_menu.currentTextChanged.connect( lambda: self.update_slider("menu")) self.unique_box.unique_jump.currentIndexChanged.connect( - lambda: self.update_slider("unique")) + self.update_unique_block) # add everything to trace headers layout self.trace_headers_layout.addWidget(self.datadir_box) @@ -703,6 +703,19 @@ class MainWindow(QWidget): default_dir = os.getcwd() self.dd_text.setText(default_dir) + def update_unique_block(self): + """ + Update selected item in Unique's tree widget + """ + + row_num = int(self.unique_box.unique_jump.currentText()) + items = self.unique_box.unique_info_tree.findItems(str(row_num), Qt.MatchExactly, 0) + self.unique_box.unique_info_tree.clearSelection() + for i in items: + self.unique_box.unique_info_tree.setItemSelected(i, True) + self.unique_box.unique_info_tree.scrollToItem(i) + + def clicked_scan_type(self, index): """ Show data related to selected scan type @@ -992,7 +1005,7 @@ class MainWindow(QWidget): lastkey = key if key not in self.unique_select_list: self.unique_select_list.append(key) - key = str(blk) + ":" + key + key = str(n) + ":" + key self.unique_list.append(key) # build Blockette dictionary keyed to block number