Browse Source

No Double-Jeopardy for NoBody

Sebastian Lohff 6 years ago
parent
commit
15e18fb270
1 changed files with 6 additions and 2 deletions
  1. 6
    2
      windows.py

+ 6
- 2
windows.py View File

@@ -410,14 +410,18 @@ class DoubleJeopardyWindow(QtGui.QDialog):
410 410
 		self.pointsbtn.setFocus()
411 411
 
412 412
 		start = QtGui.QPushButton("Done", self)
413
-		start.clicked.connect(self.close)
413
+		start.clicked.connect(self.closeIfNotNobody)
414 414
 		self.layout.addWidget(start)
415 415
 
416 416
 		self.setLayout(self.layout)
417 417
 
418
+	def closeIfNotNobody(self):
419
+		if self.get_player() is not None:
420
+			self.close()
421
+
418 422
 	def keyPressEvent(self, e):
419 423
 		if e.key() == QtCore.Qt.Key_Escape or e.key() == QtCore.Qt.Key_Enter:
420
-			self.close()
424
+			self.closeIfNotNobody()
421 425
 		elif e.key() == QtCore.Qt.Key_Left or e.key() == QtCore.Qt.Key_Right:
422 426
 			if self.focusWidget() == self.pbtn:
423 427
 				if e.key() == QtCore.Qt.Key_Right:

Loading…
Cancel
Save