Skip to content

Commit

Permalink
Add launch via double click in standalone app
Browse files Browse the repository at this point in the history
  • Loading branch information
jpgill86 committed Mar 1, 2020
1 parent a1ae762 commit 40ed3cd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions neurotic/gui/standalone.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def __init__(self, file=None, initial_selection=None, lazy=True, theme='light',
self.windows = []

# metadata selector
self.metadata_selector = _MetadataSelectorQt()
self.metadata_selector = _MetadataSelectorQt(self)
self.setCentralWidget(self.metadata_selector)

# create a worker thread for downloading data
Expand Down Expand Up @@ -518,18 +518,19 @@ class _MetadataSelectorQt(MetadataSelector, QT.QListWidget):
A QListWidget that displays the state of a MetadataSelector.
"""

def __init__(self):
def __init__(self, parent):
"""
Initialize a new _MetadataSelectorQt.
"""

MetadataSelector.__init__(self)
QT.QListWidget.__init__(self)
QT.QListWidget.__init__(self, parent=parent)

self.setSelectionMode(QT.QListWidget.SingleSelection)
self.setStyleSheet('font: 9pt Courier;')

self.currentRowChanged.connect(self._on_select)
self.itemDoubleClicked.connect(self.parent().launch)

def _on_select(self, currentRow):
"""
Expand Down

0 comments on commit 40ed3cd

Please sign in to comment.