browser: open experiments on lmb

This commit is contained in:
Robert Jördens 2016-05-08 16:12:43 +02:00
parent 88740f687d
commit c44e786cc5
1 changed files with 5 additions and 8 deletions

View File

@ -303,14 +303,7 @@ class ExperimentsArea(QtWidgets.QMdiArea):
self.pixmap = QtGui.QPixmap(os.path.join( self.pixmap = QtGui.QPixmap(os.path.join(
artiq_dir, "gui", "logo20.svg")) artiq_dir, "gui", "logo20.svg"))
self.current_dir = root self.current_dir = root
self.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu) self.setToolTip("Click to open experiment")
self.setFocusPolicy(QtCore.Qt.StrongFocus)
action = QtWidgets.QAction("&Open experiment", self)
action.setShortcut(QtGui.QKeySequence("CTRL+o"))
action.setShortcutContext(QtCore.Qt.WidgetShortcut)
action.triggered.connect(self._select_experiment)
self.addAction(action)
self.open_experiments = [] self.open_experiments = []
@ -321,6 +314,10 @@ class ExperimentsArea(QtWidgets.QMdiArea):
"update_dataset": lambda k, v: None, "update_dataset": lambda k, v: None,
} }
def mousePressEvent(self, ev):
if ev.button() == QtCore.Qt.LeftButton:
asyncio.ensure_future(self._select_experiment_task())
def paintEvent(self, event): def paintEvent(self, event):
QtWidgets.QMdiArea.paintEvent(self, event) QtWidgets.QMdiArea.paintEvent(self, event)
painter = QtGui.QPainter(self.viewport()) painter = QtGui.QPainter(self.viewport())