6700
|
1 |
#include <QMessageBox>
|
|
2 |
#include <QDir>
|
|
3 |
|
|
4 |
#include "qpushbuttonwithsound.h"
|
|
5 |
#include "HWDataManager.h"
|
|
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 |
|
|
22 |
HWDataManager & dataMgr = HWDataManager::instance();
|
|
23 |
|
|
24 |
if (this->isEnabled())
|
|
25 |
SDLInteraction::instance().playSoundFile(dataMgr.findFileForRead("Sounds/roperelease.ogg"));
|
|
26 |
}
|