feat: added sound effects support to themes
Signed-off-by: Boris Yumankulov <boria138@altlinux.org>
This commit is contained in:
@ -220,6 +220,13 @@ class MainWindow(QMainWindow):
|
||||
self.resize(width, height)
|
||||
else:
|
||||
self.showNormal()
|
||||
|
||||
self._startup_sound = self.theme_manager.get_sound(default_styles.SOUNDS["app_start"])
|
||||
self._exit_sound = self.theme_manager.get_sound(default_styles.SOUNDS["app_exit"])
|
||||
|
||||
if self._startup_sound:
|
||||
self._startup_sound.play()
|
||||
|
||||
@Slot(list)
|
||||
def on_games_loaded(self, games: list[tuple]):
|
||||
self.games = games
|
||||
@ -2253,5 +2260,11 @@ class MainWindow(QMainWindow):
|
||||
self.checkProcessTimer.deleteLater()
|
||||
self.checkProcessTimer = None
|
||||
|
||||
QApplication.quit()
|
||||
event.accept()
|
||||
# Воспроизводим звук закрытия
|
||||
if self._exit_sound:
|
||||
self._exit_sound.play()
|
||||
# Небольшая задержка перед закрытием, чтобы звук успел проиграться
|
||||
QTimer.singleShot(100, lambda: event.accept())
|
||||
event.ignore()
|
||||
else:
|
||||
event.accept()
|
||||
|
Reference in New Issue
Block a user