From 4a6c270afe8e65f611d69ec5004cfca81a224672 Mon Sep 17 00:00:00 2001 From: Robert Jordens Date: Sat, 2 Jul 2016 12:42:59 +0200 Subject: [PATCH] browser: stub copy repo rev --- artiq/browser/files.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/artiq/browser/files.py b/artiq/browser/files.py index e436df0f2..2eb43bc9e 100644 --- a/artiq/browser/files.py +++ b/artiq/browser/files.py @@ -160,6 +160,14 @@ class FilesDock(QtWidgets.QDockWidget): self.rl.activated.connect(self.list_activated) self.splitter.addWidget(self.rl) + self.rl.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu) + rev_copy = QtWidgets.QAction("Copy repo_rev (SHIFT-CTRL-C)", + self.rl) + rev_copy.triggered.connect(self._copy_repo_rev) + rev_copy.setShortcut("SHIFT-CTRL-C") + rev_copy.setShortcutContext(QtCore.Qt.WidgetShortcut) + self.rl.addAction(rev_copy) + self.restore_selected = select is None if select is not None: f = os.path.abspath(select) @@ -168,6 +176,9 @@ class FilesDock(QtWidgets.QDockWidget): else: self.select_file(f) + def _copy_repo_rev(self): + pass + def tree_current_changed(self, current, previous): idx = self.rt.model().mapToSource(current) self.rl.setRootIndex(idx)