alow use of space to toggle items
[sface.git] / sface / screens / mainscreen.py
index 52981bf..8cbe3d0 100644 (file)
@@ -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())