|
|
|
@ -127,14 +127,24 @@ class QuestionWindow(QtGui.QDialog):
|
|
|
|
|
# restart music if question was not answered
|
|
|
|
|
MusicBox.play_music("%s-%s" % (self.section, self.qnumber))
|
|
|
|
|
|
|
|
|
|
elif e.get_playerno() > len(self.players) and not self._inWindow:
|
|
|
|
|
# unknown player! to not confuse certain devices we send a buttons open event
|
|
|
|
|
self.buzzersOpen.emit(True)
|
|
|
|
|
print("unknown player", e.get_playerno())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return True
|
|
|
|
|
else:
|
|
|
|
|
if not self._windowSetup and e.type() == QtCore.QEvent.Show:
|
|
|
|
|
ret = super(QuestionWindow, self).event(e)
|
|
|
|
|
|
|
|
|
|
# we want to do this after the window has focus for the first time
|
|
|
|
|
if not self._windowSetup and e.type() == QtCore.QEvent.FocusIn:
|
|
|
|
|
if not self.answers.is_answered():
|
|
|
|
|
self.buzzersOpen.emit(True)
|
|
|
|
|
self._windowSetup = True
|
|
|
|
|
|
|
|
|
|
return super(QuestionWindow, self).event(e)
|
|
|
|
|
return ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def keyPressEvent(self, e):
|
|
|
|
|
if e.key() == QtCore.Qt.Key_Escape:
|
|
|
|
|