6700
|
1 |
#include <QMessageBox>
|
|
2 |
#include <QDir>
|
|
3 |
|
|
4 |
#include "qpushbuttonwithsound.h"
|
6930
|
5 |
#include "DataManager.h"
|
6700
|
6 |
#include "SDLInteraction.h"
|
|
7 |
#include "hwform.h"
|
|
8 |
#include "gameuiconfig.h"
|
|
9 |
|
|
10 |
QPushButtonWithSound::QPushButtonWithSound(QWidget *parent) :
|
|
11 |
QPushButton(parent),
|
|
12 |
isSoundEnabled(true)
|
|
13 |
{
|
|
14 |
connect(this, SIGNAL(clicked()), this, SLOT(buttonClicked()));
|
|
15 |
}
|
|
16 |
|
|
17 |
void QPushButtonWithSound::buttonClicked()
|
|
18 |
{
|
|
19 |
if ( !isSoundEnabled || !HWForm::config->isFrontendSoundEnabled())
|
|
20 |
return;
|
|
21 |
|
6930
|
22 |
DataManager & dataMgr = DataManager::instance();
|
6700
|
23 |
|
|
24 |
if (this->isEnabled())
|
|
25 |
SDLInteraction::instance().playSoundFile(dataMgr.findFileForRead("Sounds/roperelease.ogg"));
|
|
26 |
}
|