From c44e786cc538c40fb7d3bf81677c85e71a3152ae Mon Sep 17 00:00:00 2001 From: Robert Jordens Date: Sun, 8 May 2016 16:12:43 +0200 Subject: [PATCH] browser: open experiments on lmb --- artiq/browser/experiments.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/artiq/browser/experiments.py b/artiq/browser/experiments.py index 2598893f9..7f701d3e2 100644 --- a/artiq/browser/experiments.py +++ b/artiq/browser/experiments.py @@ -303,14 +303,7 @@ class ExperimentsArea(QtWidgets.QMdiArea): self.pixmap = QtGui.QPixmap(os.path.join( artiq_dir, "gui", "logo20.svg")) self.current_dir = root - self.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu) - 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.setToolTip("Click to open experiment") self.open_experiments = [] @@ -321,6 +314,10 @@ class ExperimentsArea(QtWidgets.QMdiArea): "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): QtWidgets.QMdiArea.paintEvent(self, event) painter = QtGui.QPainter(self.viewport())