No Double-Jeopardy for NoBody

This commit is contained in:
Sebastian Lohff 2013-11-28 20:02:56 +01:00
parent 48a3bd6a93
commit 15e18fb270
1 changed files with 6 additions and 2 deletions

View File

@ -410,14 +410,18 @@ class DoubleJeopardyWindow(QtGui.QDialog):
self.pointsbtn.setFocus()
start = QtGui.QPushButton("Done", self)
start.clicked.connect(self.close)
start.clicked.connect(self.closeIfNotNobody)
self.layout.addWidget(start)
self.setLayout(self.layout)
def closeIfNotNobody(self):
if self.get_player() is not None:
self.close()
def keyPressEvent(self, e):
if e.key() == QtCore.Qt.Key_Escape or e.key() == QtCore.Qt.Key_Enter:
self.close()
self.closeIfNotNobody()
elif e.key() == QtCore.Qt.Key_Left or e.key() == QtCore.Qt.Key_Right:
if self.focusWidget() == self.pbtn:
if e.key() == QtCore.Qt.Key_Right: