No Double-Jeopardy for NoBody
This commit is contained in:
parent
48a3bd6a93
commit
15e18fb270
|
@ -410,14 +410,18 @@ class DoubleJeopardyWindow(QtGui.QDialog):
|
||||||
self.pointsbtn.setFocus()
|
self.pointsbtn.setFocus()
|
||||||
|
|
||||||
start = QtGui.QPushButton("Done", self)
|
start = QtGui.QPushButton("Done", self)
|
||||||
start.clicked.connect(self.close)
|
start.clicked.connect(self.closeIfNotNobody)
|
||||||
self.layout.addWidget(start)
|
self.layout.addWidget(start)
|
||||||
|
|
||||||
self.setLayout(self.layout)
|
self.setLayout(self.layout)
|
||||||
|
|
||||||
|
def closeIfNotNobody(self):
|
||||||
|
if self.get_player() is not None:
|
||||||
|
self.close()
|
||||||
|
|
||||||
def keyPressEvent(self, e):
|
def keyPressEvent(self, e):
|
||||||
if e.key() == QtCore.Qt.Key_Escape or e.key() == QtCore.Qt.Key_Enter:
|
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:
|
elif e.key() == QtCore.Qt.Key_Left or e.key() == QtCore.Qt.Key_Right:
|
||||||
if self.focusWidget() == self.pbtn:
|
if self.focusWidget() == self.pbtn:
|
||||||
if e.key() == QtCore.Qt.Key_Right:
|
if e.key() == QtCore.Qt.Key_Right:
|
||||||
|
|
Loading…
Reference in New Issue