From 16f6d00e35adf18c8b0e10b4ddd6db0def0cfeda Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sat, 16 Jan 2016 12:53:53 -0700 Subject: [PATCH] gui: fix shortcut contexts. Closes #225 --- artiq/gui/explorer.py | 3 +++ artiq/gui/schedule.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/artiq/gui/explorer.py b/artiq/gui/explorer.py index e492aea5d..bdb456323 100644 --- a/artiq/gui/explorer.py +++ b/artiq/gui/explorer.py @@ -160,16 +160,19 @@ class ExplorerDock(dockarea.Dock): open_action.triggered.connect( partial(self.expname_action, "open_experiment")) open_action.setShortcut("RETURN") + open_action.setShortcutContext(QtCore.Qt.WidgetShortcut) self.el.addAction(open_action) submit_action = QtGui.QAction("Submit", self.el) submit_action.triggered.connect( partial(self.expname_action, "submit")) submit_action.setShortcut("CTRL+RETURN") + submit_action.setShortcutContext(QtCore.Qt.WidgetShortcut) self.el.addAction(submit_action) reqterm_action = QtGui.QAction("Request termination of instances", self.el) reqterm_action.triggered.connect( partial(self.expname_action, "request_inst_term")) reqterm_action.setShortcut("CTRL+BACKSPACE") + reqterm_action.setShortcutContext(QtCore.Qt.WidgetShortcut) self.el.addAction(reqterm_action) set_shortcut_menu = QtGui.QMenu() diff --git a/artiq/gui/schedule.py b/artiq/gui/schedule.py index c7a0479ae..466b69098 100644 --- a/artiq/gui/schedule.py +++ b/artiq/gui/schedule.py @@ -77,10 +77,12 @@ class ScheduleDock(dockarea.Dock): request_termination_action = QtGui.QAction("Request termination", self.table) request_termination_action.triggered.connect(partial(self.delete_clicked, True)) request_termination_action.setShortcut("DELETE") + request_termination_action.setShortcutContext(QtCore.Qt.WidgetShortcut) self.table.addAction(request_termination_action) delete_action = QtGui.QAction("Delete", self.table) delete_action.triggered.connect(partial(self.delete_clicked, False)) delete_action.setShortcut("SHIFT+DELETE") + delete_action.setShortcutContext(QtCore.Qt.WidgetShortcut) self.table.addAction(delete_action) self.table_model = Model(dict())