From 81846e9abd00f64f6c34e7f9206f327b658622b2 Mon Sep 17 00:00:00 2001 From: smbaker Date: Tue, 13 Sep 2011 16:09:06 -0700 Subject: [PATCH 1/1] alow use of space to toggle items --- sface/screens/mainscreen.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sface/screens/mainscreen.py b/sface/screens/mainscreen.py index 52981bf..8cbe3d0 100644 --- a/sface/screens/mainscreen.py +++ b/sface/screens/mainscreen.py @@ -54,7 +54,14 @@ class NodeView(QTreeView): self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) self.setToolTip("Double click on a row to change its status. Right click on a host to add a tag.") + def keyPressEvent(self, event): + if (event.key() == Qt.Key_Space): + self.toggleSelection() + def mouseDoubleClickEvent(self, event): + self.toggleSelection() + + def toggleSelection(self): index = self.currentIndex() model = index.model() status_index = model.index(index.row(), MEMBERSHIP_STATUS_COLUMN, index.parent()) -- 2.43.0