From 82a3deec30b5a903d4863e6f85da558ffa6db42b Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Tue, 14 Oct 2014 21:13:16 +0200 Subject: [PATCH] Add a button in the sounds settings to play a test sound --- cockatrice/src/dlg_settings.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cockatrice/src/dlg_settings.cpp b/cockatrice/src/dlg_settings.cpp index 414550a9..0a9fe61a 100644 --- a/cockatrice/src/dlg_settings.cpp +++ b/cockatrice/src/dlg_settings.cpp @@ -25,6 +25,7 @@ #include "main.h" #include "settingscache.h" #include "priceupdater.h" +#include "soundengine.h" GeneralSettingsPage::GeneralSettingsPage() { @@ -503,6 +504,8 @@ UserInterfaceSettingsPage::UserInterfaceSettingsPage() connect(soundPathClearButton, SIGNAL(clicked()), this, SLOT(soundPathClearButtonClicked())); QPushButton *soundPathButton = new QPushButton("..."); connect(soundPathButton, SIGNAL(clicked()), this, SLOT(soundPathButtonClicked())); + QPushButton *soundTestButton = new QPushButton(QString("Play test sound")); + connect(soundTestButton, SIGNAL(clicked()), soundEngine, SLOT(cuckoo())); QGridLayout *soundGrid = new QGridLayout; soundGrid->addWidget(soundEnabledCheckBox, 0, 0, 1, 4); @@ -510,6 +513,7 @@ UserInterfaceSettingsPage::UserInterfaceSettingsPage() soundGrid->addWidget(soundPathEdit, 1, 1); soundGrid->addWidget(soundPathClearButton, 1, 2); soundGrid->addWidget(soundPathButton, 1, 3); + soundGrid->addWidget(soundTestButton, 1, 4); soundGroupBox = new QGroupBox; soundGroupBox->setLayout(soundGrid);