Skip to content

Commit

Permalink
Add text widget below dataset list displaying metadata dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
jpgill86 committed Jan 4, 2021
1 parent b037f98 commit f96c050
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion neurotic/gui/standalone.py
Expand Up @@ -724,7 +724,7 @@ def free_resources(self, i):
class _MetadataSelectorQt(MetadataSelector, QT.QWidget):
"""
A QWidget that displays the state of a MetadataSelector, providing a
QListWidget for selecting one dataset.
QListWidget for selecting one dataset and other widgets for ... TODO
"""

def __init__(self, mainwindow):
Expand Down Expand Up @@ -752,6 +752,9 @@ def __init__(self, mainwindow):
self.dataset_list.currentRowChanged.connect(self._on_select)
self.dataset_list.itemDoubleClicked.connect(self.mainwindow.start_launch)

self.my_text_edit = QT.QTextEdit()
self.layout.addWidget(self.my_text_edit)

def _on_select(self, currentRow):
"""
Update the MetadataSelector's selection after changing the
Expand All @@ -760,6 +763,9 @@ def _on_select(self, currentRow):

if currentRow >= 0:
self._selection = list(self.all_metadata)[currentRow]

from pprint import pformat
self.my_text_edit.setText(pformat(self.selected_metadata))
else:
self._selection = None

Expand Down

0 comments on commit f96c050

Please sign in to comment.