Play start and closing song

master
Sebastian Lohff 10 年前
父節點 a30906e887
當前提交 4ce06a2adb

@ -338,8 +338,8 @@ class PlayerStartWindow(QtGui.QDialog):
#print(self.disconnect(self, QtCore.SIGNAL("accepted()"), self, QtCore.SLOT("accept()")))
self._setupGui()
self.show()
MusicBox.play_music("startSong")
# center window
g = QtGui.QApplication.desktop().screenGeometry()
@ -358,6 +358,10 @@ class PlayerStartWindow(QtGui.QDialog):
else:
return super(PlayerStartWindow, self).event(e)
def closeEvent(self, event):
MusicBox.stop_music()
event.accept()
def keyPressEvent(self, e):
# needed to circumvent dialogclosing when enter is pressed
if e.key() == QtCore.Qt.Key_Escape:
@ -402,6 +406,7 @@ class VictoryWindow(QtGui.QDialog):
self._parent = parent
self._setupGui()
MusicBox.play_music("closingSong")
def _setupGui(self):
self.layout = QtGui.QVBoxLayout()
@ -422,6 +427,13 @@ class VictoryWindow(QtGui.QDialog):
self.setLayout(self.layout)
def keyPressEvent(self, e):
if e.key() == QtCore.Qt.Key_Escape:
self.close()
def closeEvent(self, event):
MusicBox.stop_music()
event.accept()
class DoubleJeopardyWindow(QtGui.QDialog):
def __init__(self, player, points, current_player=None, current_points=None, parent=None):

載入中…
取消
儲存