From: smbaker Date: Tue, 13 Sep 2011 23:09:06 +0000 (-0700) Subject: alow use of space to toggle items X-Git-Tag: sface-0.1-19~4 X-Git-Url: http://git.onelab.eu/?p=sface.git;a=commitdiff_plain;h=81846e9abd00f64f6c34e7f9206f327b658622b2;hp=3fe02187d0b5dbb20742b280d391d05ff8c687e7 alow use of space to toggle items --- 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())